mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[INFER] Recompile target script in InvokeSession as necessary, bug 621292.
This commit is contained in:
parent
e5852f8376
commit
eb12efe47d
24
js/src/jit-test/tests/jaeger/recompile/bug621292.js
Normal file
24
js/src/jit-test/tests/jaeger/recompile/bug621292.js
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
/* Don't crash. */
|
||||
|
||||
var count = 0;
|
||||
|
||||
function callbackfn(v) {
|
||||
if (++count == 98)
|
||||
count = 0x7ffffff0;
|
||||
return arr[0] + count;
|
||||
}
|
||||
|
||||
function foo() {
|
||||
arr = [1,2,3,4,5];
|
||||
for (var i = 0; i < 50; i++)
|
||||
arr = arr.map(callbackfn);
|
||||
}
|
||||
foo();
|
||||
|
||||
function f(a,b,c) {
|
||||
a = 1; b = 'str'; c = 2.1;
|
||||
return arguments[0];
|
||||
}
|
||||
for (var i = 0; i < 20; i++)
|
||||
assertEq(f(10,'sss',1), 1);
|
@ -587,14 +587,24 @@ InvokeSessionGuard::invoke(JSContext *cx) const
|
||||
formals_[-2] = savedCallee_;
|
||||
formals_[-1] = savedThis_;
|
||||
|
||||
#ifdef JS_METHODJIT
|
||||
void *code;
|
||||
if (!optimized() || !(code = script_->getJIT(false /* !constructing */)->invokeEntry))
|
||||
#else
|
||||
if (!optimized())
|
||||
#endif
|
||||
return Invoke(cx, args_, 0);
|
||||
|
||||
#ifdef JS_METHODJIT
|
||||
mjit::JITScript *jit = script_->getJIT(false /* !constructing */);
|
||||
if (!jit) {
|
||||
/* Watch in case the code was thrown away due a recompile. */
|
||||
mjit::CompileStatus status = mjit::TryCompile(cx, frame_.fp());
|
||||
if (status == mjit::Compile_Error)
|
||||
return false;
|
||||
JS_ASSERT(status == mjit::Compile_Okay);
|
||||
jit = script_->getJIT(false);
|
||||
}
|
||||
void *code;
|
||||
if (!(code = jit->invokeEntry))
|
||||
return Invoke(cx, args_, 0);
|
||||
#endif
|
||||
|
||||
/* Clear any garbage left from the last Invoke. */
|
||||
JSStackFrame *fp = frame_.fp();
|
||||
fp->clearMissingArgs();
|
||||
|
Loading…
Reference in New Issue
Block a user