Bug 838014 - Rooting in ionmonkey. r=terrence. Relanding.

--HG--
extra : rebase_source : 6df06564ba73b2f3c34274e077025c510f5e9ccc
This commit is contained in:
Steve Fink 2013-02-07 13:32:00 -08:00
parent 389e924d96
commit 23e48dff27
7 changed files with 21 additions and 22 deletions

View File

@ -1508,9 +1508,7 @@ class ValueOperations
JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }
#ifdef DEBUG
JSWhyMagic whyMagic() const { return value()->whyMagic(); }
#endif
};
/*

View File

@ -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());
Value result = Int32Value(numActualArgs);
RootedValue result(cx, 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);
enter(jitcode, maxArgc, maxArgv, fp, calleeToken, result.address());
}
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);
Value result = Int32Value(args.length());
RootedValue result(cx, 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);
enter(jitcode, args.length() + 1, args.array() - 1, fp, calleeToken, result.address());
args.setInactive();
if (clearCallingIntoIon)

View File

@ -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, PropertyName *name)
const Value &idval, HandlePropertyName name)
{
RootedObject holder(cx);
RootedShape shape(cx);
@ -1732,7 +1732,8 @@ 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)) {
if (!cache.attachGetProp(cx, ion, obj, idval, JSID_TO_ATOM(id)->asPropertyName()))
RootedPropertyName name(cx, JSID_TO_ATOM(id)->asPropertyName());
if (!cache.attachGetProp(cx, ion, obj, idval, name))
return false;
attachedStub = true;
}

View File

@ -374,7 +374,7 @@ class IonCacheGetElement : public IonCache
u.getelem.hasDenseStub = true;
}
bool attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, const Value &idval, PropertyName *name);
bool attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, const Value &idval, HandlePropertyName name);
bool attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval);
};

View File

@ -295,7 +295,7 @@ TypeInferenceOracle::elementReadIsDenseNative(RawScript script, jsbytecode *pc)
}
bool
TypeInferenceOracle::elementReadIsTypedArray(HandleScript script, jsbytecode *pc, int *arrayType)
TypeInferenceOracle::elementReadIsTypedArray(RawScript 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(UnrootedScript script, jsbytecode *pc)
TypeInferenceOracle::elementWriteHasExtraIndexedProperty(RawScript script, jsbytecode *pc)
{
StackTypeSet *obj = script->analysis()->poppedTypes(pc, 2);
@ -454,7 +454,7 @@ TypeInferenceOracle::elementWriteHasExtraIndexedProperty(UnrootedScript script,
}
bool
TypeInferenceOracle::elementWriteIsPacked(UnrootedScript script, jsbytecode *pc)
TypeInferenceOracle::elementWriteIsPacked(RawScript 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(HandleScript caller, jsbytecode *pc, JSFunction *target)
TypeInferenceOracle::canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction target)
{
AssertCanGC();
RootedScript targetScript(cx, target->nonLazyScript());

View File

@ -85,7 +85,7 @@ class TypeOracle
virtual bool elementReadIsDenseNative(RawScript script, jsbytecode *pc) {
return false;
}
virtual bool elementReadIsTypedArray(HandleScript script, jsbytecode *pc, int *arrayType) {
virtual bool elementReadIsTypedArray(RawScript 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(UnrootedScript script, jsbytecode *pc) {
virtual bool elementWriteHasExtraIndexedProperty(RawScript script, jsbytecode *pc) {
return false;
}
virtual bool elementWriteIsPacked(UnrootedScript script, jsbytecode *pc) {
virtual bool elementWriteIsPacked(RawScript 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(HandleScript caller, jsbytecode *pc, JSFunction *callee) {
virtual bool canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction 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(HandleScript script, jsbytecode *pc, int *atype);
bool elementReadIsTypedArray(RawScript 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(UnrootedScript script, jsbytecode *pc);
bool elementWriteIsPacked(UnrootedScript script, jsbytecode *pc);
bool elementWriteHasExtraIndexedProperty(RawScript script, jsbytecode *pc);
bool elementWriteIsPacked(RawScript 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(HandleScript caller, jsbytecode *pc, JSFunction *callee);
bool canEnterInlinedFunction(RawScript caller, jsbytecode *pc, RawFunction callee);
types::StackTypeSet *aliasedVarBarrier(UnrootedScript script, jsbytecode *pc, types::StackTypeSet **barrier);
LazyArgumentsType isArgumentObject(types::StackTypeSet *obj);

View File

@ -112,7 +112,7 @@ class JS_PUBLIC_API(AutoGCRooter) {
enum {
JSVAL = -1, /* js::AutoValueRooter */
VALARRAY = -2, /* js::AutoValueArrayRooter */
VALARRAY = -2, /* js::AutoValueArray */
PARSER = -3, /* js::frontend::Parser */
SHAPEVECTOR = -4, /* js::AutoShapeVector */
IDARRAY = -6, /* js::AutoIdArray */