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())
return true;
if (calleeScript->shouldCloneAtCallsite)
return true;
// Check if this stub chain has already generalized scripted calls.
if (stub->scriptedStubsAreGeneralized()) {
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;
}
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
DoCallFallback(JSContext *cx, BaselineFrame *frame, ICCall_Fallback *stub, uint32_t argc,
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))
return false;
if (!MaybeCloneFunctionAtCallsite(cx, &callee, script, pc))
return false;
if (op == JSOP_NEW) {
if (!InvokeConstructor(cx, callee, argc, args, res.address()))
return false;

View File

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

View File

@ -402,11 +402,7 @@ js::intrinsic_UnsafeSetElement(JSContext *cx, unsigned argc, Value *vp)
static JSBool
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);
args.rval().setBoolean(false);
return true;
#if defined(JS_THREADSAFE) && defined(JS_ION)
args.rval().setBoolean(ion::IsEnabled(cx) &&
!ion::js_IonOptions.eagerCompilation);