mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 10:21:21 +00:00
[qfcc] Skip over zero stack adjustment
This is a very tiny optimization, but there's no point in adjust the stack if there's no actual adjustment. I didn't bother with it initially because I thought it wouldn't happen (and I was more interested in getting things working first), but it turns out that simple getters that result in a zero adjustment are quite common (70/535 in qwaq-app.dat).
This commit is contained in:
parent
fbb67419f2
commit
5f2fd3cac0
1 changed files with 6 additions and 1 deletions
|
@ -801,7 +801,12 @@ build_code_function (symbol_t *fsym, expr_t *state_expr, expr_t *statements)
|
|||
|
||||
dstatement_t *st = &pr.code->code[func->code];
|
||||
if (st->op == OP_ADJSTK) {
|
||||
st->b = -func->params_start;
|
||||
if (func->params_start) {
|
||||
st->b = -func->params_start;
|
||||
} else {
|
||||
// skip over adjstk so a zero adjustment doesn't get executed
|
||||
func->code += 1;
|
||||
}
|
||||
}
|
||||
merge_spaces (space, func->parameters->space, STACK_ALIGN);
|
||||
func->parameters->space = space;
|
||||
|
|
Loading…
Reference in a new issue