From f7c7c124a8e316e2b74503a690c36476cffe9132 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 13 Oct 2009 15:14:46 -0700 Subject: [PATCH] Eagerly release frame marks during recursion (bug 521476, r=brendan). --- js/src/jsbuiltins.cpp | 3 +-- js/src/jstracer.cpp | 5 ----- js/src/jstracer.h | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/js/src/jsbuiltins.cpp b/js/src/jsbuiltins.cpp index 359a3fafca9..f0533ed461e 100644 --- a/js/src/jsbuiltins.cpp +++ b/js/src/jsbuiltins.cpp @@ -458,8 +458,7 @@ js_PopInterpFrame(JSContext* cx, InterpState* state) JS_ASSERT(cx->fp->regs == &ifp->callerRegs); cx->fp->regs = ifp->frame.regs; - /* Don't release |ifp->mark| yet, since ExecuteTree uses |cx->stackPool|. */ - state->stackMark = ifp->mark; + JS_ARENA_RELEASE(&cx->stackPool, ifp->mark); /* Update the inline call count. */ *state->inlineCallCountp = *state->inlineCallCountp - 1; diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 341bfa20b9f..6125dcbe5ab 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -6375,8 +6375,6 @@ ExecuteTree(JSContext* cx, Fragment* f, uintN& inlineCallCount, state->eor = callstack_buffer + MAX_CALL_STACK_ENTRIES; state->sor = state->rp; - state->stackMark = NULL; - #ifdef DEBUG memset(stack_buffer, 0xCD, sizeof(stack_buffer)); memset(global, 0xCD, (globalFrameSize+1)*sizeof(double)); @@ -6603,9 +6601,6 @@ LeaveTree(InterpState& state, VMSideExit* lr) JS_ASSERT_IF(innermost->exitType == RECURSIVE_SLURP_FAIL_EXIT, innermost->calldepth == 0 && callstack == rp); - if (state.stackMark) - JS_ARENA_RELEASE(&cx->stackPool, state.stackMark); - while (callstack < rp) { FrameInfo* fi = *callstack; /* Peek at the callee native slot in the not-yet-synthesized down frame. */ diff --git a/js/src/jstracer.h b/js/src/jstracer.h index 41d648aea50..cacacbc5155 100755 --- a/js/src/jstracer.h +++ b/js/src/jstracer.h @@ -717,7 +717,6 @@ struct InterpState FrameInfo** callstackBase; // call stack base uintN* inlineCallCountp; // inline call count counter VMSideExit** innermostNestedGuardp; - void* stackMark; VMSideExit* innermost; #ifdef EXECUTE_TREE_TIMER uint64 startTime;