mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 749039 - Fixup registers when returning from methodjit (r=bhackett)
This commit is contained in:
parent
b87c85ed4e
commit
870e1b5096
11
js/src/jit-test/tests/basic/bug749039.js
Normal file
11
js/src/jit-test/tests/basic/bug749039.js
Normal file
@ -0,0 +1,11 @@
|
||||
// |jit-test| error: ReferenceError;
|
||||
gczeal(4);
|
||||
try { jsTestDriverEnd(); } catch(exc1) {}
|
||||
evaluate("\
|
||||
schedulegc(10);\
|
||||
for(var i=0; i<3; i++) {\
|
||||
var obj = { first: 'first', second: 'second' };\
|
||||
for (var elem in obj) {}\
|
||||
x.push(count);\
|
||||
}\
|
||||
");
|
@ -4249,9 +4249,7 @@ END_CASE(JSOP_ARRAYPUSH)
|
||||
|
||||
forced_return:
|
||||
UnwindScope(cx, 0);
|
||||
regs.sp = regs.fp()->base();
|
||||
regs.pc = script->code + script->length - JSOP_STOP_LENGTH;
|
||||
JS_ASSERT(*regs.pc == JSOP_STOP);
|
||||
regs.setToEndOfScript();
|
||||
|
||||
if (entryFrame != regs.fp())
|
||||
goto inline_return;
|
||||
|
@ -565,7 +565,7 @@ js_InternalThrow(VMFrame &f)
|
||||
// property.
|
||||
JS_ASSERT(!f.fp()->finishedInInterpreter());
|
||||
UnwindScope(cx, 0);
|
||||
f.regs.sp = f.fp()->base();
|
||||
f.regs.setToEndOfScript();
|
||||
|
||||
if (cx->compartment->debugMode()) {
|
||||
// This can turn a throw or error into a healthy return. Note that
|
||||
|
@ -1076,6 +1076,9 @@ mjit::EnterMethodJIT(JSContext *cx, StackFrame *fp, void *code, Value *stackLimi
|
||||
return ok ? Jaeger_Returned : Jaeger_Throwing;
|
||||
}
|
||||
|
||||
cx->regs().refreshFramePointer(fp);
|
||||
cx->regs().setToEndOfScript();
|
||||
|
||||
/* The entry frame should have finished. */
|
||||
JS_ASSERT(fp == cx->fp());
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
#define Stack_h__
|
||||
|
||||
#include "jsfun.h"
|
||||
#include "jsautooplen.h"
|
||||
|
||||
struct JSContext;
|
||||
struct JSCompartment;
|
||||
@ -1288,6 +1289,11 @@ class FrameRegs
|
||||
fp_ = (StackFrame *) newfp;
|
||||
}
|
||||
|
||||
/* For EnterMethodJIT: */
|
||||
void refreshFramePointer(StackFrame *fp) {
|
||||
fp_ = fp;
|
||||
}
|
||||
|
||||
/* For stubs::CompileFunction, ContextStack: */
|
||||
void prepareToRun(StackFrame &fp, JSScript *script) {
|
||||
pc = script->code;
|
||||
@ -1296,6 +1302,13 @@ class FrameRegs
|
||||
inlined_ = NULL;
|
||||
}
|
||||
|
||||
void setToEndOfScript() {
|
||||
JSScript *script = fp()->script();
|
||||
sp = fp()->base();
|
||||
pc = script->code + script->length - JSOP_STOP_LENGTH;
|
||||
JS_ASSERT(*pc == JSOP_STOP);
|
||||
}
|
||||
|
||||
/* For pushDummyFrame: */
|
||||
void initDummyFrame(StackFrame &fp) {
|
||||
pc = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user