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
Родитель 1cce65663c
Коммит f31f58b0a8
3 изменённых файлов: 31 добавлений и 5 удалений

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

@ -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;

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

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

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

@ -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);