Bug 853394 - Enable ParallelArray tests, fix test failures. r=djvj

This commit is contained in:
Jan de Mooij 2013-03-22 11:23:10 +01:00
parent 39b2173b9d
commit 970ae9ee4f
3 changed files with 31 additions and 5 deletions

View File

@ -5351,6 +5351,9 @@ TryAttachCallStub(JSContext *cx, ICCall_Fallback *stub, HandleScript script, JSO
if (!calleeScript->hasBaselineScript() && !calleeScript->hasIonScript()) if (!calleeScript->hasBaselineScript() && !calleeScript->hasIonScript())
return true; return true;
if (calleeScript->shouldCloneAtCallsite)
return true;
// Check if this stub chain has already generalized scripted calls. // Check if this stub chain has already generalized scripted calls.
if (stub->scriptedStubsAreGeneralized()) { if (stub->scriptedStubsAreGeneralized()) {
IonSpew(IonSpew_BaselineIC, " Chain already has generalized scripted call stub!"); IonSpew(IonSpew_BaselineIC, " Chain already has generalized scripted call stub!");
@ -5415,6 +5418,28 @@ TryAttachCallStub(JSContext *cx, ICCall_Fallback *stub, HandleScript script, JSO
return true; return true;
} }
static bool
MaybeCloneFunctionAtCallsite(JSContext *cx, MutableHandleValue callee, HandleScript script,
jsbytecode *pc)
{
RootedFunction fun(cx);
if (!IsFunctionObject(callee, fun.address()))
return true;
if (!fun->hasScript() || !fun->nonLazyScript()->shouldCloneAtCallsite)
return true;
if (!cx->typeInferenceEnabled())
return true;
fun = CloneFunctionAtCallsite(cx, fun, script, pc);
if (!fun)
return false;
callee.setObject(*fun);
return true;
}
static bool static bool
DoCallFallback(JSContext *cx, BaselineFrame *frame, ICCall_Fallback *stub, uint32_t argc, DoCallFallback(JSContext *cx, BaselineFrame *frame, ICCall_Fallback *stub, uint32_t argc,
Value *vp, MutableHandleValue res) Value *vp, MutableHandleValue res)
@ -5450,6 +5475,9 @@ DoCallFallback(JSContext *cx, BaselineFrame *frame, ICCall_Fallback *stub, uint3
if (!TryAttachCallStub(cx, stub, script, op, argc, vp, constructing, newType)) if (!TryAttachCallStub(cx, stub, script, op, argc, vp, constructing, newType))
return false; return false;
if (!MaybeCloneFunctionAtCallsite(cx, &callee, script, pc))
return false;
if (op == JSOP_NEW) { if (op == JSOP_NEW) {
if (!InvokeConstructor(cx, callee, argc, args, res.address())) if (!InvokeConstructor(cx, callee, argc, args, res.address()))
return false; return false;

View File

@ -25,6 +25,7 @@
#include "jsworkers.h" #include "jsworkers.h"
#ifdef JS_ION #ifdef JS_ION
#include "ion/BaselineJIT.h"
#include "ion/Ion.h" #include "ion/Ion.h"
#include "ion/IonCompartment.h" #include "ion/IonCompartment.h"
#endif #endif
@ -2910,7 +2911,8 @@ TypeCompartment::addPendingRecompile(JSContext *cx, RawScript script, jsbytecode
CancelOffThreadIonCompile(cx->compartment, script); CancelOffThreadIonCompile(cx->compartment, script);
// Let the script warm up again before attempting another compile. // Let the script warm up again before attempting another compile.
script->resetUseCount(); if (ion::IsBaselineEnabled(cx))
script->resetUseCount();
if (script->hasIonScript()) if (script->hasIonScript())
addPendingRecompile(cx, script->ionScript()->recompileInfo()); addPendingRecompile(cx, script->ionScript()->recompileInfo());

View File

@ -402,11 +402,7 @@ js::intrinsic_UnsafeSetElement(JSContext *cx, unsigned argc, Value *vp)
static JSBool static JSBool
intrinsic_ParallelTestsShouldPass(JSContext *cx, unsigned argc, Value *vp) intrinsic_ParallelTestsShouldPass(JSContext *cx, unsigned argc, Value *vp)
{ {
//XXX: FIXME: disable parallel array tests for now on the BC branch.
CallArgs args = CallArgsFromVp(argc, vp); CallArgs args = CallArgsFromVp(argc, vp);
args.rval().setBoolean(false);
return true;
#if defined(JS_THREADSAFE) && defined(JS_ION) #if defined(JS_THREADSAFE) && defined(JS_ION)
args.rval().setBoolean(ion::IsEnabled(cx) && args.rval().setBoolean(ion::IsEnabled(cx) &&
!ion::js_IonOptions.eagerCompilation); !ion::js_IonOptions.eagerCompilation);