Bug 609244: use entry script's compartment for VM frame stack management, r=dvander, a=beta8+

This commit is contained in:
David Mandelin 2010-11-10 16:49:31 -08:00
Родитель f86f705149
Коммит 9218a4591e
4 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- mOde: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* ***** BEGIN LICENSE BLOCK *****
@ -181,7 +181,7 @@ InlineReturn(VMFrame &f)
JSContext *cx = f.cx;
JSStackFrame *fp = f.regs.fp;
JS_ASSERT(f.fp() != f.entryFp);
JS_ASSERT(f.fp() != f.entryfp);
JS_ASSERT(!js_IsActiveWithOrBlock(cx, &fp->scopeChain(), 0));
@ -231,7 +231,7 @@ stubs::HitStackQuota(VMFrame &f)
/* Include space to push another frame. */
uintN nvals = f.fp()->script()->nslots + VALUES_PER_STACK_FRAME;
JS_ASSERT(f.regs.sp == f.fp()->base());
if (f.cx->stack().bumpCommitAndLimit(f.entryFp, f.regs.sp, nvals, &f.stackLimit))
if (f.cx->stack().bumpCommitAndLimit(f.entryfp, f.regs.sp, nvals, &f.stackLimit))
return;
/* Remove the current partially-constructed frame before throwing. */
@ -269,7 +269,7 @@ stubs::FixupArity(VMFrame &f, uint32 nactual)
/* Reserve enough space for a callee frame. */
JSStackFrame *newfp = cx->stack().getInlineFrameWithinLimit(cx, (Value*) oldfp, nactual,
fun, fun->script(), &flags,
f.entryFp, &f.stackLimit);
f.entryfp, &f.stackLimit);
if (!newfp)
THROWV(NULL);
@ -364,7 +364,7 @@ UncachedInlineCall(VMFrame &f, uint32 flags, void **pret, uint32 argc)
StackSpace &stack = cx->stack();
JSStackFrame *newfp = stack.getInlineFrameWithinLimit(cx, f.regs.sp, argc,
newfun, newscript, &flags,
f.entryFp, &f.stackLimit);
f.entryfp, &f.stackLimit);
if (JS_UNLIKELY(!newfp))
return false;
JS_ASSERT_IF(!vp[1].isPrimitive() && !(flags & JSFRAME_CONSTRUCTING),
@ -560,7 +560,7 @@ js_InternalThrow(VMFrame &f)
// called into through js_Interpret). In this case, we still unwind,
// but we shouldn't return from a JS function, because we're not in a
// JS function.
bool lastFrame = (f.entryFp == f.fp());
bool lastFrame = (f.entryfp == f.fp());
js_UnwindScope(cx, 0, cx->throwing);
// For consistency with Interpret(), always run the script epilogue.

Просмотреть файл

@ -116,14 +116,14 @@ extern "C" void JaegerTrampolineReturn();
extern "C" void JS_FASTCALL
PushActiveVMFrame(VMFrame &f)
{
f.cx->jaegerCompartment()->pushActiveFrame(&f);
f.entryfp->script()->compartment->jaegerCompartment->pushActiveFrame(&f);
f.regs.fp->setNativeReturnAddress(JS_FUNC_TO_DATA_PTR(void*, JaegerTrampolineReturn));
}
extern "C" void JS_FASTCALL
PopActiveVMFrame(VMFrame &f)
{
f.cx->jaegerCompartment()->popActiveFrame();
f.entryfp->script()->compartment->jaegerCompartment->popActiveFrame();
}
extern "C" void JS_FASTCALL
@ -206,7 +206,7 @@ SYMBOL_STRING(JaegerTrampoline) ":" "\n"
* rcx = inlineCallCount
* fp must go into rbx
*/
"pushq %rsi" "\n" /* entryFp */
"pushq %rsi" "\n" /* entryfp */
"pushq %rcx" "\n" /* inlineCallCount */
"pushq %rdi" "\n" /* cx */
"pushq %rsi" "\n" /* fp */
@ -317,7 +317,7 @@ SYMBOL_STRING(JaegerTrampoline) ":" "\n"
/* Build the JIT frame. Push fields in order,
* then align the stack to form esp == VMFrame. */
"movl 12(%ebp), %ebx" "\n" /* load fp */
"pushl %ebx" "\n" /* entryFp */
"pushl %ebx" "\n" /* entryfp */
"pushl 20(%ebp)" "\n" /* stackLimit */
"pushl 8(%ebp)" "\n" /* cx */
"pushl %ebx" "\n" /* fp */
@ -396,7 +396,7 @@ SYMBOL_STRING(InjectJaegerReturn) ":" "\n"
JS_STATIC_ASSERT(sizeof(VMFrame) == 80);
JS_STATIC_ASSERT(offsetof(VMFrame, savedLR) == (4*19));
JS_STATIC_ASSERT(offsetof(VMFrame, entryFp) == (4*10));
JS_STATIC_ASSERT(offsetof(VMFrame, entryfp) == (4*10));
JS_STATIC_ASSERT(offsetof(VMFrame, stackLimit) == (4*9));
JS_STATIC_ASSERT(offsetof(VMFrame, cx) == (4*8));
JS_STATIC_ASSERT(offsetof(VMFrame, regs.fp) == (4*7));
@ -451,7 +451,7 @@ SYMBOL_STRING(JaegerTrampoline) ":" "\n"
* [ r6 ] | considering that we might not use them anyway.
* [ r5 ] |
* [ r4 ] /
* [ entryFp ]
* [ entryfp ]
* [ stkLimit ]
* [ cx ]
* [ regs.fp ]
@ -467,7 +467,7 @@ SYMBOL_STRING(JaegerTrampoline) ":" "\n"
/* Push callee-saved registers. */
" push {r4-r11,lr}" "\n"
/* Push interesting VMFrame content. */
" push {r1}" "\n" /* entryFp */
" push {r1}" "\n" /* entryfp */
" push {r3}" "\n" /* stackLimit */
" push {r0}" "\n" /* cx */
" push {r1}" "\n" /* regs.fp */

Просмотреть файл

@ -70,7 +70,7 @@ struct VMFrame
JSFrameRegs regs;
JSContext *cx;
Value *stackLimit;
JSStackFrame *entryFp;
JSStackFrame *entryfp;
#if defined(JS_CPU_X86)
void *savedEBX;

Просмотреть файл

@ -132,7 +132,7 @@ Recompiler::recompile()
f = f->previous) {
// Scan all frames owned by this VMFrame.
JSStackFrame *end = f->entryFp->prev();
JSStackFrame *end = f->entryfp->prev();
for (JSStackFrame *fp = f->fp(); fp != end; fp = fp->prev()) {
// Remember the latest frame for each type of JIT'd code, so the
// compiler will have a frame to re-JIT from.