From 57bee78e2f219bee2ea1614fbf8bbb9e6fc6a7dd Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 7 Feb 2013 17:06:42 -0800 Subject: [PATCH] Backed out changeset ced35810adb2 (bug 838014). Again. --- js/public/Value.h | 2 ++ js/src/ion/Ion.cpp | 8 ++++---- js/src/ion/IonCaches.cpp | 5 ++--- js/src/ion/IonCaches.h | 2 +- js/src/ion/TypeOracle.cpp | 8 ++++---- js/src/ion/TypeOracle.h | 16 ++++++++-------- js/src/jsapi.h | 2 +- 7 files changed, 22 insertions(+), 21 deletions(-) diff --git a/js/public/Value.h b/js/public/Value.h index f01f8dff7b6..96697e87221 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -1508,7 +1508,9 @@ class ValueOperations JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); } +#ifdef DEBUG JSWhyMagic whyMagic() const { return value()->whyMagic(); } +#endif }; /* diff --git a/js/src/ion/Ion.cpp b/js/src/ion/Ion.cpp index 0d1d83f55de..905c32eff1b 100644 --- a/js/src/ion/Ion.cpp +++ b/js/src/ion/Ion.cpp @@ -1717,7 +1717,7 @@ EnterIon(JSContext *cx, StackFrame *fp, void *jitcode) // Caller must construct |this| before invoking the Ion function. JS_ASSERT_IF(fp->isConstructing(), fp->functionThis().isObject()); - RootedValue result(cx, Int32Value(numActualArgs)); + Value result = Int32Value(numActualArgs); { AssertCompartmentUnchanged pcc(cx); IonContext ictx(cx, cx->compartment, NULL); @@ -1725,7 +1725,7 @@ EnterIon(JSContext *cx, StackFrame *fp, void *jitcode) JSAutoResolveFlags rf(cx, RESOLVE_INFER); AutoFlushInhibitor afi(cx->compartment->ionCompartment()); // Single transition point from Interpreter to Ion. - enter(jitcode, maxArgc, maxArgv, fp, calleeToken, result.address()); + enter(jitcode, maxArgc, maxArgv, fp, calleeToken, &result); } if (result.isMagic() && result.whyMagic() == JS_ION_BAILOUT) { @@ -1853,12 +1853,12 @@ ion::FastInvoke(JSContext *cx, HandleFunction fun, CallArgsList &args) EnterIonCode enter = cx->compartment->ionCompartment()->enterJIT(); void *calleeToken = CalleeToToken(fun); - RootedValue result(cx, Int32Value(args.length())); + Value result = Int32Value(args.length()); JS_ASSERT(args.length() >= fun->nargs); JSAutoResolveFlags rf(cx, RESOLVE_INFER); args.setActive(); - enter(jitcode, args.length() + 1, args.array() - 1, fp, calleeToken, result.address()); + enter(jitcode, args.length() + 1, args.array() - 1, fp, calleeToken, &result); args.setInactive(); if (clearCallingIntoIon) diff --git a/js/src/ion/IonCaches.cpp b/js/src/ion/IonCaches.cpp index 681de28378b..59bc3305273 100644 --- a/js/src/ion/IonCaches.cpp +++ b/js/src/ion/IonCaches.cpp @@ -1566,7 +1566,7 @@ js::ion::SetPropertyCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Ha bool IonCacheGetElement::attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, - const Value &idval, HandlePropertyName name) + const Value &idval, PropertyName *name) { RootedObject holder(cx); RootedShape shape(cx); @@ -1732,8 +1732,7 @@ js::ion::GetElementCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Han uint32_t dummy; if (idval.isString() && JSID_IS_ATOM(id) && !JSID_TO_ATOM(id)->isIndex(&dummy)) { - RootedPropertyName name(cx, JSID_TO_ATOM(id)->asPropertyName()); - if (!cache.attachGetProp(cx, ion, obj, idval, name)) + if (!cache.attachGetProp(cx, ion, obj, idval, JSID_TO_ATOM(id)->asPropertyName())) return false; attachedStub = true; } diff --git a/js/src/ion/IonCaches.h b/js/src/ion/IonCaches.h index 64f6973c56d..0c7c04e8d96 100644 --- a/js/src/ion/IonCaches.h +++ b/js/src/ion/IonCaches.h @@ -374,7 +374,7 @@ class IonCacheGetElement : public IonCache u.getelem.hasDenseStub = true; } - bool attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, const Value &idval, HandlePropertyName name); + bool attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, const Value &idval, PropertyName *name); bool attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval); }; diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index b32ee57a3e1..f44b45084e5 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -295,7 +295,7 @@ TypeInferenceOracle::elementReadIsDenseNative(RawScript script, jsbytecode *pc) } bool -TypeInferenceOracle::elementReadIsTypedArray(RawScript script, jsbytecode *pc, int *arrayType) +TypeInferenceOracle::elementReadIsTypedArray(HandleScript script, jsbytecode *pc, int *arrayType) { if (!elementAccessIsTypedArray(script->analysis()->poppedTypes(pc, 1), script->analysis()->poppedTypes(pc, 0), @@ -443,7 +443,7 @@ TypeInferenceOracle::elementWriteNeedsDoubleConversion(UnrootedScript script, js } bool -TypeInferenceOracle::elementWriteHasExtraIndexedProperty(RawScript script, jsbytecode *pc) +TypeInferenceOracle::elementWriteHasExtraIndexedProperty(UnrootedScript script, jsbytecode *pc) { StackTypeSet *obj = script->analysis()->poppedTypes(pc, 2); @@ -454,7 +454,7 @@ TypeInferenceOracle::elementWriteHasExtraIndexedProperty(RawScript script, jsbyt } bool -TypeInferenceOracle::elementWriteIsPacked(RawScript script, jsbytecode *pc) +TypeInferenceOracle::elementWriteIsPacked(UnrootedScript script, jsbytecode *pc) { StackTypeSet *types = script->analysis()->poppedTypes(pc, 2); return !types->hasObjectFlags(cx, types::OBJECT_FLAG_NON_PACKED); @@ -581,7 +581,7 @@ TypeInferenceOracle::canInlineCall(HandleScript caller, jsbytecode *pc) } bool -TypeInferenceOracle::canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction target) +TypeInferenceOracle::canEnterInlinedFunction(HandleScript caller, jsbytecode *pc, JSFunction *target) { AssertCanGC(); RootedScript targetScript(cx, target->nonLazyScript()); diff --git a/js/src/ion/TypeOracle.h b/js/src/ion/TypeOracle.h index 36d72e45e15..31c57c020c6 100644 --- a/js/src/ion/TypeOracle.h +++ b/js/src/ion/TypeOracle.h @@ -85,7 +85,7 @@ class TypeOracle virtual bool elementReadIsDenseNative(RawScript script, jsbytecode *pc) { return false; } - virtual bool elementReadIsTypedArray(RawScript script, jsbytecode *pc, int *arrayType) { + virtual bool elementReadIsTypedArray(HandleScript script, jsbytecode *pc, int *arrayType) { return false; } virtual bool elementReadIsString(UnrootedScript script, jsbytecode *pc) { @@ -116,10 +116,10 @@ class TypeOracle virtual bool elementWriteNeedsDoubleConversion(UnrootedScript script, jsbytecode *pc) { return false; } - virtual bool elementWriteHasExtraIndexedProperty(RawScript script, jsbytecode *pc) { + virtual bool elementWriteHasExtraIndexedProperty(UnrootedScript script, jsbytecode *pc) { return false; } - virtual bool elementWriteIsPacked(RawScript script, jsbytecode *pc) { + virtual bool elementWriteIsPacked(UnrootedScript script, jsbytecode *pc) { return false; } virtual bool elementAccessIsDenseNative(types::StackTypeSet *obj, types::StackTypeSet *id) { @@ -162,7 +162,7 @@ class TypeOracle virtual bool canInlineCall(HandleScript caller, jsbytecode *pc) { return false; } - virtual bool canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction callee) { + virtual bool canEnterInlinedFunction(HandleScript caller, jsbytecode *pc, JSFunction *callee) { return false; } @@ -251,7 +251,7 @@ class TypeInferenceOracle : public TypeOracle bool inObjectIsDenseNativeWithoutExtraIndexedProperties(HandleScript script, jsbytecode *pc); bool inArrayIsPacked(UnrootedScript script, jsbytecode *pc); bool elementReadIsDenseNative(RawScript script, jsbytecode *pc); - bool elementReadIsTypedArray(RawScript script, jsbytecode *pc, int *atype); + bool elementReadIsTypedArray(HandleScript script, jsbytecode *pc, int *atype); bool elementReadIsString(UnrootedScript script, jsbytecode *pc); bool elementReadShouldAlwaysLoadDoubles(UnrootedScript script, jsbytecode *pc); bool elementReadHasExtraIndexedProperty(UnrootedScript, jsbytecode *pc); @@ -262,8 +262,8 @@ class TypeInferenceOracle : public TypeOracle bool elementWriteIsTypedArray(RawScript script, jsbytecode *pc, int *arrayType); bool elementAccessIsTypedArray(types::StackTypeSet *obj, types::StackTypeSet *id, int *arrayType); bool elementWriteNeedsDoubleConversion(UnrootedScript script, jsbytecode *pc); - bool elementWriteHasExtraIndexedProperty(RawScript script, jsbytecode *pc); - bool elementWriteIsPacked(RawScript script, jsbytecode *pc); + bool elementWriteHasExtraIndexedProperty(UnrootedScript script, jsbytecode *pc); + bool elementWriteIsPacked(UnrootedScript script, jsbytecode *pc); bool arrayResultShouldHaveDoubleConversion(UnrootedScript script, jsbytecode *pc); bool setElementHasWrittenHoles(UnrootedScript script, jsbytecode *pc); bool propertyWriteCanSpecialize(UnrootedScript script, jsbytecode *pc); @@ -272,7 +272,7 @@ class TypeInferenceOracle : public TypeOracle MIRType elementWrite(UnrootedScript script, jsbytecode *pc); bool canInlineCalls(); bool canInlineCall(HandleScript caller, jsbytecode *pc); - bool canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction callee); + bool canEnterInlinedFunction(HandleScript caller, jsbytecode *pc, JSFunction *callee); types::StackTypeSet *aliasedVarBarrier(UnrootedScript script, jsbytecode *pc, types::StackTypeSet **barrier); LazyArgumentsType isArgumentObject(types::StackTypeSet *obj); diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 481d8aaf6aa..cff0344f021 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -112,7 +112,7 @@ class JS_PUBLIC_API(AutoGCRooter) { enum { JSVAL = -1, /* js::AutoValueRooter */ - VALARRAY = -2, /* js::AutoValueArray */ + VALARRAY = -2, /* js::AutoValueArrayRooter */ PARSER = -3, /* js::frontend::Parser */ SHAPEVECTOR = -4, /* js::AutoShapeVector */ IDARRAY = -6, /* js::AutoIdArray */