Closed Bug 487200 Opened 16 years ago Closed 16 years ago

Do not embed stack address constants in generated code

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: edwsmith, Unassigned)

References

Details

Doing so ties the code to a specific thread (well, stack). Instead load the minstack value from AvmCore (which can be const).
Blocks: 487199
The only change I made was to change this: LIns *c = binaryIns(LIR_pult, vars, InsConstPtr((void*)core->minstack)); LIns *b = branchIns(LIR_jf, c); to this: LIns *d = loadIns(LIR_ldp, 0, InsConstPtr(&core->minstack)); LIns *c = binaryIns(LIR_pult, vars, d); LIns *b = branchIns(LIR_jf, c); --tinic
redux changeset: 1777:ff76cf536103
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
this change enables an optimization to stack overflow checks/handling before this change we compare sp with a constant, and call a handler if we have overflowed. Handling a stack overflow involves calling yet more functions that deal with the error, and those functions should not fail. So, core->stackOverflow() is stateful, and ignores additional errors (since we're now in the stack slop/reserve area). With this patch, we compare sp with a loaded value. The value can be changed after an initial error, to avoid needing this statefulness in the overflow handler. furthermore the call to the handler (env->stkover()) must currently be a *call*, because of the statefulness. (sometimes the call returns and the code must continue). we could optimize generated code so that the call instead is a jump that can never return. (or a call known not to return).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.