Backed out changeset af1cebf017fc (bug 994957) for hazards on a CLOSED TREE

This commit is contained in:
Wes Kocher 2014-05-01 15:19:37 -07:00
parent 7e0717cc2b
commit d606afd2cf
6 changed files with 144 additions and 221 deletions

View File

@ -6753,7 +6753,6 @@ CodeGenerator::visitCallsiteCloneCache(LCallsiteCloneCache *ins)
Register output = ToRegister(ins->output());
CallsiteCloneIC cache(callee, mir->block()->info().script(), mir->callPc(), output);
cache.setProfilerLeavePC(mir->profilerLeavePc());
return addCache(ins, allocateCache(cache));
}
@ -6787,7 +6786,6 @@ CodeGenerator::visitGetNameCache(LGetNameCache *ins)
bool isTypeOf = ins->mir()->accessKind() != MGetNameCache::NAME;
NameIC cache(liveRegs, isTypeOf, scopeChain, ins->mir()->name(), output);
cache.setProfilerLeavePC(ins->mir()->profilerLeavePc());
return addCache(ins, allocateCache(cache));
}
@ -6814,17 +6812,15 @@ CodeGenerator::visitNameIC(OutOfLineUpdateCache *ool, DataPtr<NameIC> &ic)
bool
CodeGenerator::addGetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
PropertyName *name, TypedOrValueRegister output,
bool monitoredResult, jsbytecode *profilerLeavePc)
bool monitoredResult)
{
switch (gen->info().executionMode()) {
case SequentialExecution: {
GetPropertyIC cache(liveRegs, objReg, name, output, monitoredResult);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
case ParallelExecution: {
GetPropertyParIC cache(objReg, name, output);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
default:
@ -6835,17 +6831,15 @@ CodeGenerator::addGetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Regi
bool
CodeGenerator::addSetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
PropertyName *name, ConstantOrRegister value, bool strict,
bool needsTypeBarrier, jsbytecode *profilerLeavePc)
bool needsTypeBarrier)
{
switch (gen->info().executionMode()) {
case SequentialExecution: {
SetPropertyIC cache(liveRegs, objReg, name, value, strict, needsTypeBarrier);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
case ParallelExecution: {
SetPropertyParIC cache(objReg, name, value, strict, needsTypeBarrier);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
default:
@ -6856,20 +6850,17 @@ CodeGenerator::addSetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Regi
bool
CodeGenerator::addSetElementCache(LInstruction *ins, Register obj, Register unboxIndex,
Register temp, FloatRegister tempFloat, ValueOperand index,
ConstantOrRegister value, bool strict, bool guardHoles,
jsbytecode *profilerLeavePc)
ConstantOrRegister value, bool strict, bool guardHoles)
{
switch (gen->info().executionMode()) {
case SequentialExecution: {
SetElementIC cache(obj, unboxIndex, temp, tempFloat, index, value, strict,
guardHoles);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
case ParallelExecution: {
SetElementParIC cache(obj, unboxIndex, temp, tempFloat, index, value, strict,
guardHoles);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
default:
@ -6886,8 +6877,7 @@ CodeGenerator::visitGetPropertyCacheV(LGetPropertyCacheV *ins)
bool monitoredResult = ins->mir()->monitoredResult();
TypedOrValueRegister output = TypedOrValueRegister(GetValueOutput(ins));
return addGetPropertyCache(ins, liveRegs, objReg, name, output, monitoredResult,
ins->mir()->profilerLeavePc());
return addGetPropertyCache(ins, liveRegs, objReg, name, output, monitoredResult);
}
bool
@ -6899,8 +6889,7 @@ CodeGenerator::visitGetPropertyCacheT(LGetPropertyCacheT *ins)
bool monitoredResult = ins->mir()->monitoredResult();
TypedOrValueRegister output(ins->mir()->type(), ToAnyRegister(ins->getDef(0)));
return addGetPropertyCache(ins, liveRegs, objReg, name, output, monitoredResult,
ins->mir()->profilerLeavePc());
return addGetPropertyCache(ins, liveRegs, objReg, name, output, monitoredResult);
}
typedef bool (*GetPropertyICFn)(JSContext *, size_t, HandleObject, MutableHandleValue);
@ -6956,18 +6945,16 @@ CodeGenerator::visitGetPropertyParIC(OutOfLineUpdateCache *ool, DataPtr<GetPrope
bool
CodeGenerator::addGetElementCache(LInstruction *ins, Register obj, ConstantOrRegister index,
TypedOrValueRegister output, bool monitoredResult,
bool allowDoubleResult, jsbytecode *profilerLeavePc)
bool allowDoubleResult)
{
switch (gen->info().executionMode()) {
case SequentialExecution: {
RegisterSet liveRegs = ins->safepoint()->liveRegs();
GetElementIC cache(liveRegs, obj, index, output, monitoredResult, allowDoubleResult);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
case ParallelExecution: {
GetElementParIC cache(obj, index, output, monitoredResult, allowDoubleResult);
cache.setProfilerLeavePC(profilerLeavePc);
return addCache(ins, allocateCache(cache));
}
default:
@ -6983,8 +6970,7 @@ CodeGenerator::visitGetElementCacheV(LGetElementCacheV *ins)
TypedOrValueRegister output = TypedOrValueRegister(GetValueOutput(ins));
const MGetElementCache *mir = ins->mir();
return addGetElementCache(ins, obj, index, output, mir->monitoredResult(),
mir->allowDoubleResult(), mir->profilerLeavePc());
return addGetElementCache(ins, obj, index, output, mir->monitoredResult(), mir->allowDoubleResult());
}
bool
@ -6995,8 +6981,7 @@ CodeGenerator::visitGetElementCacheT(LGetElementCacheT *ins)
TypedOrValueRegister output(ins->mir()->type(), ToAnyRegister(ins->output()));
const MGetElementCache *mir = ins->mir();
return addGetElementCache(ins, obj, index, output, mir->monitoredResult(),
mir->allowDoubleResult(), mir->profilerLeavePc());
return addGetElementCache(ins, obj, index, output, mir->monitoredResult(), mir->allowDoubleResult());
}
typedef bool (*GetElementICFn)(JSContext *, size_t, HandleObject, HandleValue, MutableHandleValue);
@ -7032,8 +7017,7 @@ CodeGenerator::visitSetElementCacheV(LSetElementCacheV *ins)
ConstantOrRegister value = TypedOrValueRegister(ToValue(ins, LSetElementCacheV::Value));
return addSetElementCache(ins, obj, unboxIndex, temp, tempFloat, index, value,
ins->mir()->strict(), ins->mir()->guardHoles(),
ins->mir()->profilerLeavePc());
ins->mir()->strict(), ins->mir()->guardHoles());
}
bool
@ -7052,8 +7036,7 @@ CodeGenerator::visitSetElementCacheT(LSetElementCacheT *ins)
value = TypedOrValueRegister(ins->mir()->value()->type(), ToAnyRegister(tmp));
return addSetElementCache(ins, obj, unboxIndex, temp, tempFloat, index, value,
ins->mir()->strict(), ins->mir()->guardHoles(),
ins->mir()->profilerLeavePc());
ins->mir()->strict(), ins->mir()->guardHoles());
}
typedef bool (*SetElementICFn)(JSContext *, size_t, HandleObject, HandleValue, HandleValue);
@ -7129,7 +7112,6 @@ CodeGenerator::visitBindNameCache(LBindNameCache *ins)
Register scopeChain = ToRegister(ins->scopeChain());
Register output = ToRegister(ins->output());
BindNameIC cache(scopeChain, ins->mir()->name(), output);
cache.setProfilerLeavePC(ins->mir()->profilerLeavePc());
return addCache(ins, allocateCache(cache));
}
@ -7224,8 +7206,7 @@ CodeGenerator::visitSetPropertyCacheV(LSetPropertyCacheV *ins)
ConstantOrRegister value = TypedOrValueRegister(ToValue(ins, LSetPropertyCacheV::Value));
return addSetPropertyCache(ins, liveRegs, objReg, ins->mir()->name(), value,
ins->mir()->strict(), ins->mir()->needsTypeBarrier(),
ins->mir()->profilerLeavePc());
ins->mir()->strict(), ins->mir()->needsTypeBarrier());
}
bool
@ -7241,8 +7222,7 @@ CodeGenerator::visitSetPropertyCacheT(LSetPropertyCacheT *ins)
value = TypedOrValueRegister(ins->valueType(), ToAnyRegister(ins->getOperand(1)));
return addSetPropertyCache(ins, liveRegs, objReg, ins->mir()->name(), value,
ins->mir()->strict(), ins->mir()->needsTypeBarrier(),
ins->mir()->profilerLeavePc());
ins->mir()->strict(), ins->mir()->needsTypeBarrier());
}
typedef bool (*SetPropertyICFn)(JSContext *, size_t, HandleObject, HandleValue);

View File

@ -353,16 +353,16 @@ class CodeGenerator : public CodeGeneratorSpecific
private:
bool addGetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
PropertyName *name, TypedOrValueRegister output,
bool monitoredResult, jsbytecode *profilerLeavePc);
bool monitoredResult);
bool addGetElementCache(LInstruction *ins, Register obj, ConstantOrRegister index,
TypedOrValueRegister output, bool monitoredResult,
bool allowDoubleResult, jsbytecode *profilerLeavePc);
bool allowDoubleResult);
bool addSetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
PropertyName *name, ConstantOrRegister value, bool strict,
bool needsTypeBarrier, jsbytecode *profilerLeavePc);
bool needsTypeBarrier);
bool addSetElementCache(LInstruction *ins, Register obj, Register unboxIndex, Register temp,
FloatRegister tempFloat, ValueOperand index, ConstantOrRegister value,
bool strict, bool guardHoles, jsbytecode *profilerLeavePc);
bool strict, bool guardHoles);
bool checkForAbortPar(LInstruction *lir);
bool generateBranchV(const ValueOperand &value, Label *ifTrue, Label *ifFalse, FloatRegister fr);

View File

@ -80,15 +80,6 @@ class InlineScriptTree {
return caller_;
}
bool isOutermostCaller() const {
return caller_ == nullptr;
}
InlineScriptTree *outermostCaller() {
if (isOutermostCaller())
return this;
return caller_->outermostCaller();
}
jsbytecode *callerPc() const {
return callerPc_;
}

View File

@ -1195,12 +1195,11 @@ GetPropertyIC::allowArrayLength(Context cx, HandleObject obj) const
}
bool
GetPropertyIC::tryAttachNative(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
GetPropertyIC::tryAttachNative(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr, bool *emitted)
{
JS_ASSERT(canAttachStub());
JS_ASSERT(!*emitted);
JS_ASSERT(topScript->ionScript() == ion);
RootedShape shape(cx);
RootedObject holder(cx);
@ -1212,7 +1211,7 @@ GetPropertyIC::tryAttachNative(JSContext *cx, JSScript *topScript, IonScript *io
*emitted = true;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
const char *attachKind;
@ -1245,8 +1244,8 @@ GetPropertyIC::tryAttachNative(JSContext *cx, JSScript *topScript, IonScript *io
}
bool
GetPropertyIC::tryAttachTypedArrayLength(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name, bool *emitted)
GetPropertyIC::tryAttachTypedArrayLength(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, bool *emitted)
{
JS_ASSERT(canAttachStub());
JS_ASSERT(!*emitted);
@ -1271,7 +1270,7 @@ GetPropertyIC::tryAttachTypedArrayLength(JSContext *cx, JSScript *topScript, Ion
*emitted = true;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
GenerateTypedArrayLength(cx, masm, attacher, obj, object(), output());
@ -1354,7 +1353,7 @@ EmitCallProxyGet(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &at
}
bool
GetPropertyIC::tryAttachDOMProxyShadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
GetPropertyIC::tryAttachDOMProxyShadowed(JSContext *cx, IonScript *ion,
HandleObject obj, void *returnAddr,
bool *emitted)
{
@ -1370,7 +1369,7 @@ GetPropertyIC::tryAttachDOMProxyShadowed(JSContext *cx, JSScript *topScript, Ion
*emitted = true;
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
// Guard on the shape of the object.
@ -1400,9 +1399,9 @@ GetPropertyIC::tryAttachDOMProxyShadowed(JSContext *cx, JSScript *topScript, Ion
}
bool
GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name,
bool resetNeeded, void *returnAddr, bool *emitted)
GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, bool resetNeeded,
void *returnAddr, bool *emitted)
{
JS_ASSERT(canAttachStub());
JS_ASSERT(!*emitted);
@ -1439,7 +1438,7 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, I
}
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
// Guard on the shape of the object.
@ -1500,7 +1499,7 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, I
}
bool
GetPropertyIC::tryAttachProxy(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
GetPropertyIC::tryAttachProxy(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr,
bool *emitted)
{
@ -1522,13 +1521,13 @@ GetPropertyIC::tryAttachProxy(JSContext *cx, JSScript *topScript, IonScript *ion
if (shadows == ShadowCheckFailed)
return false;
if (shadows == Shadows)
return tryAttachDOMProxyShadowed(cx, topScript, ion, obj, returnAddr, emitted);
return tryAttachDOMProxyShadowed(cx, ion, obj, returnAddr, emitted);
return tryAttachDOMProxyUnshadowed(cx, topScript, ion, obj, name,
shadows == DoesntShadowUnique, returnAddr, emitted);
return tryAttachDOMProxyUnshadowed(cx, ion, obj, name, shadows == DoesntShadowUnique,
returnAddr, emitted);
}
return tryAttachGenericProxy(cx, topScript, ion, obj, name, returnAddr, emitted);
return tryAttachGenericProxy(cx, ion, obj, name, returnAddr, emitted);
}
static void
@ -1542,8 +1541,8 @@ GenerateProxyClassGuards(MacroAssembler &masm, Register object, Register scratch
}
bool
GetPropertyIC::tryAttachGenericProxy(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name, void *returnAddr,
GetPropertyIC::tryAttachGenericProxy(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr,
bool *emitted)
{
JS_ASSERT(canAttachStub());
@ -1561,7 +1560,7 @@ GetPropertyIC::tryAttachGenericProxy(JSContext *cx, JSScript *topScript, IonScri
*emitted = true;
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
Register scratchReg = output().valueReg().scratchReg();
@ -1591,8 +1590,8 @@ GetPropertyIC::tryAttachGenericProxy(JSContext *cx, JSScript *topScript, IonScri
}
bool
GetPropertyIC::tryAttachArgumentsLength(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name, bool *emitted)
GetPropertyIC::tryAttachArgumentsLength(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, bool *emitted)
{
JS_ASSERT(canAttachStub());
JS_ASSERT(!*emitted);
@ -1614,7 +1613,7 @@ GetPropertyIC::tryAttachArgumentsLength(JSContext *cx, JSScript *topScript, IonS
JS_ASSERT(!idempotent());
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
Register tmpReg;
@ -1661,7 +1660,7 @@ GetPropertyIC::tryAttachArgumentsLength(JSContext *cx, JSScript *topScript, IonS
}
bool
GetPropertyIC::tryAttachStub(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
GetPropertyIC::tryAttachStub(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr, bool *emitted)
{
JS_ASSERT(!*emitted);
@ -1669,16 +1668,16 @@ GetPropertyIC::tryAttachStub(JSContext *cx, JSScript *topScript, IonScript *ion,
if (!canAttachStub())
return true;
if (!*emitted && !tryAttachArgumentsLength(cx, topScript, ion, obj, name, emitted))
if (!*emitted && !tryAttachArgumentsLength(cx, ion, obj, name, emitted))
return false;
if (!*emitted && !tryAttachProxy(cx, topScript, ion, obj, name, returnAddr, emitted))
if (!*emitted && !tryAttachProxy(cx, ion, obj, name, returnAddr, emitted))
return false;
if (!*emitted && !tryAttachNative(cx, topScript, ion, obj, name, returnAddr, emitted))
if (!*emitted && !tryAttachNative(cx, ion, obj, name, returnAddr, emitted))
return false;
if (!*emitted && !tryAttachTypedArrayLength(cx, topScript, ion, obj, name, emitted))
if (!*emitted && !tryAttachTypedArrayLength(cx, ion, obj, name, emitted))
return false;
return true;
@ -1708,7 +1707,7 @@ GetPropertyIC::update(JSContext *cx, size_t cacheIndex,
// limit. Once we can make calls from within generated stubs, a new call
// stub will be generated instead and the previous stubs unlinked.
bool emitted = false;
if (!cache.tryAttachStub(cx, topScript, ion, obj, name, returnAddr, &emitted))
if (!cache.tryAttachStub(cx, ion, obj, name, returnAddr, &emitted))
return false;
if (cache.idempotent() && !emitted) {
@ -2006,10 +2005,10 @@ GenerateSetSlot(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &att
}
bool
SetPropertyIC::attachSetSlot(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
SetPropertyIC::attachSetSlot(JSContext *cx, IonScript *ion, HandleObject obj,
HandleShape shape, bool checkTypeset)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
GenerateSetSlot(cx, masm, attacher, obj, shape, object(), value(), needsTypeBarrier(),
checkTypeset);
@ -2125,12 +2124,11 @@ EmitCallProxySet(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &at
}
bool
SetPropertyIC::attachGenericProxy(JSContext *cx, JSScript *topScript, IonScript *ion,
void *returnAddr)
SetPropertyIC::attachGenericProxy(JSContext *cx, IonScript *ion, void *returnAddr)
{
JS_ASSERT(!hasGenericProxyStub());
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
Label failures;
@ -2181,13 +2179,13 @@ SetPropertyIC::attachGenericProxy(JSContext *cx, JSScript *topScript, IonScript
}
bool
SetPropertyIC::attachDOMProxyShadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, void *returnAddr)
SetPropertyIC::attachDOMProxyShadowed(JSContext *cx, IonScript *ion, HandleObject obj,
void *returnAddr)
{
JS_ASSERT(IsCacheableDOMProxy(obj));
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
// Guard on the shape of the object.
@ -2408,13 +2406,13 @@ IsCacheableDOMProxyUnshadowedSetterCall(JSContext *cx, HandleObject obj, HandleP
}
bool
SetPropertyIC::attachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, void *returnAddr)
SetPropertyIC::attachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, HandleObject obj,
void *returnAddr)
{
JS_ASSERT(IsCacheableDOMProxy(obj));
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
// Guard on the shape of the object.
@ -2463,13 +2461,13 @@ SetPropertyIC::attachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, IonS
}
bool
SetPropertyIC::attachCallSetter(JSContext *cx, JSScript *topScript, IonScript *ion,
SetPropertyIC::attachCallSetter(JSContext *cx, IonScript *ion,
HandleObject obj, HandleObject holder, HandleShape shape,
void *returnAddr)
{
JS_ASSERT(obj->isNative());
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
Label failure;
@ -2576,12 +2574,12 @@ GenerateAddSlot(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher &att
}
bool
SetPropertyIC::attachAddSlot(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *obj,
HandleShape oldShape, bool checkTypeset)
SetPropertyIC::attachAddSlot(JSContext *cx, IonScript *ion, JSObject *obj, HandleShape oldShape,
bool checkTypeset)
{
JS_ASSERT_IF(!needsTypeBarrier(), !checkTypeset);
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
GenerateAddSlot(cx, masm, attacher, obj, oldShape, object(), value(), checkTypeset);
return linkAndAttachStub(cx, masm, attacher, ion, "adding");
@ -2772,21 +2770,21 @@ SetPropertyIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
if (shadows == ShadowCheckFailed)
return false;
if (shadows == Shadows) {
if (!cache.attachDOMProxyShadowed(cx, script, ion, obj, returnAddr))
if (!cache.attachDOMProxyShadowed(cx, ion, obj, returnAddr))
return false;
addedSetterStub = true;
} else {
JS_ASSERT(shadows == DoesntShadow || shadows == DoesntShadowUnique);
if (shadows == DoesntShadowUnique)
cache.reset();
if (!cache.attachDOMProxyUnshadowed(cx, script, ion, obj, returnAddr))
if (!cache.attachDOMProxyUnshadowed(cx, ion, obj, returnAddr))
return false;
addedSetterStub = true;
}
}
if (!addedSetterStub && !cache.hasGenericProxyStub()) {
if (!cache.attachGenericProxy(cx, script, ion, returnAddr))
if (!cache.attachGenericProxy(cx, ion, returnAddr))
return false;
addedSetterStub = true;
}
@ -2805,13 +2803,13 @@ SetPropertyIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
&holder, &shape, &checkTypeset);
if (!addedSetterStub && canCache == CanAttachSetSlot) {
if (!cache.attachSetSlot(cx, script, ion, obj, shape, checkTypeset))
if (!cache.attachSetSlot(cx, ion, obj, shape, checkTypeset))
return false;
addedSetterStub = true;
}
if (!addedSetterStub && canCache == CanAttachCallSetter) {
if (!cache.attachCallSetter(cx, script, ion, obj, holder, shape, returnAddr))
if (!cache.attachCallSetter(cx, ion, obj, holder, shape, returnAddr))
return false;
addedSetterStub = true;
}
@ -2830,7 +2828,7 @@ SetPropertyIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
IsPropertyAddInlineable(obj, id, cache.value(), oldSlots, oldShape, cache.needsTypeBarrier(),
&checkTypeset))
{
if (!cache.attachAddSlot(cx, script, ion, obj, oldShape, checkTypeset))
if (!cache.attachAddSlot(cx, ion, obj, oldShape, checkTypeset))
return false;
}
@ -2971,7 +2969,7 @@ EqualStringsHelper(JSString *str1, JSString *str2)
}
bool
GetElementIC::attachGetProp(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
GetElementIC::attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj,
const Value &idval, HandlePropertyName name,
void *returnAddr)
{
@ -2997,7 +2995,7 @@ GetElementIC::attachGetProp(JSContext *cx, JSScript *topScript, IonScript *ion,
JS_ASSERT(idval.toString()->length() == name->length());
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
// Ensure the index is a string.
ValueOperand val = index().reg().valueReg();
@ -3130,10 +3128,9 @@ GenerateDenseElement(JSContext *cx, MacroAssembler &masm, IonCache::StubAttacher
}
bool
GetElementIC::attachDenseElement(JSContext *cx, JSScript *topScript, IonScript *ion,
JSObject *obj, const Value &idval)
GetElementIC::attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
if (!GenerateDenseElement(cx, masm, attacher, obj, idval, object(), index(), output()))
return false;
@ -3285,10 +3282,10 @@ GenerateGetTypedArrayElement(JSContext *cx, MacroAssembler &masm, IonCache::Stub
}
bool
GetElementIC::attachTypedArrayElement(JSContext *cx, JSScript *topScript, IonScript *ion,
TypedArrayObject *tarr, const Value &idval)
GetElementIC::attachTypedArrayElement(JSContext *cx, IonScript *ion, TypedArrayObject *tarr,
const Value &idval)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
GenerateGetTypedArrayElement(cx, masm, attacher, tarr, idval, object(), index(), output(),
allowDoubleResult());
@ -3296,13 +3293,12 @@ GetElementIC::attachTypedArrayElement(JSContext *cx, JSScript *topScript, IonScr
}
bool
GetElementIC::attachArgumentsElement(JSContext *cx, JSScript *topScript, IonScript *ion,
JSObject *obj)
GetElementIC::attachArgumentsElement(JSContext *cx, IonScript *ion, JSObject *obj)
{
JS_ASSERT(obj->is<ArgumentsObject>());
Label failures;
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
Register tmpReg = output().scratchReg().gpr();
@ -3410,8 +3406,7 @@ GetElementIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
HandleValue idval, MutableHandleValue res)
{
void *returnAddr;
RootedScript topScript(cx, GetTopIonJSScript(cx, &returnAddr));
IonScript *ion = topScript->ionScript();
IonScript *ion = GetTopIonJSScript(cx, &returnAddr)->ionScript();
GetElementIC &cache = ion->getCache(cacheIndex).toGetElement();
RootedScript script(cx);
jsbytecode *pc;
@ -3443,24 +3438,24 @@ GetElementIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
cache.index().reg().type() == MIRType_Int32) &&
(cache.output().hasValue() || !cache.output().typedReg().isFloat()))
{
if (!cache.attachArgumentsElement(cx, topScript, ion, obj))
if (!cache.attachArgumentsElement(cx, ion, obj))
return false;
attachedStub = true;
}
if (!attachedStub && cache.monitoredResult() && canAttachGetProp(obj, idval, id)) {
RootedPropertyName name(cx, JSID_TO_ATOM(id)->asPropertyName());
if (!cache.attachGetProp(cx, topScript, ion, obj, idval, name, returnAddr))
if (!cache.attachGetProp(cx, ion, obj, idval, name, returnAddr))
return false;
attachedStub = true;
}
if (!attachedStub && !cache.hasDenseStub() && canAttachDenseElement(obj, idval)) {
if (!cache.attachDenseElement(cx, topScript, ion, obj, idval))
if (!cache.attachDenseElement(cx, ion, obj, idval))
return false;
attachedStub = true;
}
if (!attachedStub && canAttachTypedArrayElement(obj, idval, cache.output())) {
Rooted<TypedArrayObject*> tarr(cx, &obj->as<TypedArrayObject>());
if (!cache.attachTypedArrayElement(cx, topScript, ion, tarr, idval))
if (!cache.attachTypedArrayElement(cx, ion, tarr, idval))
return false;
attachedStub = true;
}
@ -3682,10 +3677,9 @@ GenerateSetDenseElement(JSContext *cx, MacroAssembler &masm, IonCache::StubAttac
}
bool
SetElementIC::attachDenseElement(JSContext *cx, JSScript *topScript, IonScript *ion,
JSObject *obj, const Value &idval)
SetElementIC::attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
if (!GenerateSetDenseElement(cx, masm, attacher, obj, idval,
guardHoles(), object(), index(),
@ -3786,10 +3780,9 @@ GenerateSetTypedArrayElement(JSContext *cx, MacroAssembler &masm, IonCache::Stub
}
bool
SetElementIC::attachTypedArrayElement(JSContext *cx, JSScript *topScript, IonScript *ion,
TypedArrayObject *tarr)
SetElementIC::attachTypedArrayElement(JSContext *cx, IonScript *ion, TypedArrayObject *tarr)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
if (!GenerateSetTypedArrayElement(cx, masm, attacher, tarr,
object(), index(), value(),
@ -3805,20 +3798,19 @@ bool
SetElementIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
HandleValue idval, HandleValue value)
{
RootedScript topScript(cx, GetTopIonJSScript(cx));
IonScript *ion = topScript->ionScript();
IonScript *ion = GetTopIonJSScript(cx)->ionScript();
SetElementIC &cache = ion->getCache(cacheIndex).toSetElement();
bool attachedStub = false;
if (cache.canAttachStub()) {
if (!cache.hasDenseStub() && IsDenseElementSetInlineable(obj, idval)) {
if (!cache.attachDenseElement(cx, topScript, ion, obj, idval))
if (!cache.attachDenseElement(cx, ion, obj, idval))
return false;
attachedStub = true;
}
if (!attachedStub && IsTypedArrayElementSetInlineable(obj, idval, value)) {
TypedArrayObject *tarr = &obj->as<TypedArrayObject>();
if (!cache.attachTypedArrayElement(cx, topScript, ion, tarr))
if (!cache.attachTypedArrayElement(cx, ion, tarr))
return false;
}
}
@ -4023,11 +4015,11 @@ GetElementParIC::update(ForkJoinContext *cx, size_t cacheIndex, HandleObject obj
}
bool
BindNameIC::attachGlobal(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *scopeChain)
BindNameIC::attachGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain)
{
JS_ASSERT(scopeChain->is<GlobalObject>());
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
// Guard on the scope chain.
@ -4098,12 +4090,11 @@ GenerateScopeChainGuards(MacroAssembler &masm, JSObject *scopeChain, JSObject *h
}
bool
BindNameIC::attachNonGlobal(JSContext *cx, JSScript *topScript, IonScript *ion,
JSObject *scopeChain, JSObject *holder)
BindNameIC::attachNonGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain, JSObject *holder)
{
JS_ASSERT(IsCacheableNonGlobalScope(scopeChain));
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
// Guard on the shape of the scope chain.
@ -4162,8 +4153,7 @@ BindNameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain)
{
AutoFlushCache afc ("BindNameCache", cx->runtime()->jitRuntime());
RootedScript topScript(cx, GetTopIonJSScript(cx));
IonScript *ion = topScript->ionScript();
IonScript *ion = GetTopIonJSScript(cx)->ionScript();
BindNameIC &cache = ion->getCache(cacheIndex).toBindName();
HandlePropertyName name = cache.name();
@ -4179,10 +4169,10 @@ BindNameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain)
// GetPropertyCache.
if (cache.canAttachStub()) {
if (scopeChain->is<GlobalObject>()) {
if (!cache.attachGlobal(cx, topScript, ion, scopeChain))
if (!cache.attachGlobal(cx, ion, scopeChain))
return nullptr;
} else if (IsCacheableScopeChain(scopeChain, holder)) {
if (!cache.attachNonGlobal(cx, topScript, ion, scopeChain, holder))
if (!cache.attachNonGlobal(cx, ion, scopeChain, holder))
return nullptr;
} else {
IonSpew(IonSpew_InlineCaches, "BINDNAME uncacheable scope chain");
@ -4193,11 +4183,11 @@ BindNameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain)
}
bool
NameIC::attachReadSlot(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject scopeChain,
NameIC::attachReadSlot(JSContext *cx, IonScript *ion, HandleObject scopeChain,
HandleObject holderBase, HandleObject holder,
HandleShape shape)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
Label failures;
RepatchStubAppender attacher(*this);
@ -4257,10 +4247,10 @@ IsCacheableNameReadSlot(JSContext *cx, HandleObject scopeChain, HandleObject obj
}
bool
NameIC::attachCallGetter(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *obj,
JSObject *holder, HandleShape shape, void *returnAddr)
NameIC::attachCallGetter(JSContext *cx, IonScript *ion, JSObject *obj, JSObject *holder,
HandleShape shape, void *returnAddr)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion, script_, pc_);
RepatchStubAppender attacher(*this);
if (!GenerateCallGetter(cx, ion, masm, attacher, obj, name(), holder, shape, liveRegs_,
@ -4293,8 +4283,7 @@ NameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain,
AutoFlushCache afc ("GetNameCache", cx->runtime()->jitRuntime());
void *returnAddr;
RootedScript topScript(cx, GetTopIonJSScript(cx, &returnAddr));
IonScript *ion = topScript->ionScript();
IonScript *ion = GetTopIonJSScript(cx, &returnAddr)->ionScript();
NameIC &cache = ion->getCache(cacheIndex).toName();
RootedPropertyName name(cx, cache.name());
@ -4311,10 +4300,10 @@ NameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain,
if (cache.canAttachStub()) {
if (IsCacheableNameReadSlot(cx, scopeChain, obj, holder, shape, pc, cache.outputReg())) {
if (!cache.attachReadSlot(cx, topScript, ion, scopeChain, obj, holder, shape))
if (!cache.attachReadSlot(cx, ion, scopeChain, obj, holder, shape))
return false;
} else if (IsCacheableNameCallGetter(scopeChain, obj, holder, shape)) {
if (!cache.attachCallGetter(cx, topScript, ion, obj, holder, shape, returnAddr))
if (!cache.attachCallGetter(cx, ion, obj, holder, shape, returnAddr))
return false;
}
}
@ -4334,10 +4323,10 @@ NameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain,
}
bool
CallsiteCloneIC::attach(JSContext *cx, JSScript *topScript, IonScript *ion, HandleFunction original,
CallsiteCloneIC::attach(JSContext *cx, IonScript *ion, HandleFunction original,
HandleFunction clone)
{
MacroAssembler masm(cx, ion, topScript, profilerLeavePc_);
MacroAssembler masm(cx, ion);
RepatchStubAppender attacher(*this);
// Guard against object identity on the original.
@ -4362,8 +4351,7 @@ CallsiteCloneIC::update(JSContext *cx, size_t cacheIndex, HandleObject callee)
if (!fun->hasScript() || !fun->nonLazyScript()->shouldCloneAtCallsite())
return fun;
RootedScript topScript(cx, GetTopIonJSScript(cx));
IonScript *ion = topScript->ionScript();
IonScript *ion = GetTopIonJSScript(cx)->ionScript();
CallsiteCloneIC &cache = ion->getCache(cacheIndex).toCallsiteClone();
RootedFunction clone(cx, CloneFunctionAtCallsite(cx, fun, cache.callScript(), cache.callPc()));
@ -4371,7 +4359,7 @@ CallsiteCloneIC::update(JSContext *cx, size_t cacheIndex, HandleObject callee)
return nullptr;
if (cache.canAttachStub()) {
if (!cache.attach(cx, topScript, ion, fun, clone))
if (!cache.attach(cx, ion, fun, clone))
return nullptr;
}

View File

@ -168,10 +168,6 @@ class IonCache
JSScript *script_;
jsbytecode *pc_;
// Location to use when updating profiler pseudostack when leaving this
// IC code to enter a callee.
jsbytecode *profilerLeavePc_;
private:
static const size_t MAX_STUBS;
void incrementStubCount() {
@ -189,8 +185,7 @@ class IonCache
stubCount_(0),
fallbackLabel_(),
script_(nullptr),
pc_(nullptr),
profilerLeavePc_(nullptr)
pc_(nullptr)
{
}
@ -206,11 +201,6 @@ class IonCache
fallbackLabel_ = fallbackLabel;
}
void setProfilerLeavePC(jsbytecode *pc) {
JS_ASSERT(pc != nullptr);
profilerLeavePc_ = pc;
}
virtual void emitInitialJump(MacroAssembler &masm, AddCacheState &addState) = 0;
virtual void bindInitialJump(MacroAssembler &masm, AddCacheState &addState) = 0;
virtual void updateBaseAddress(JitCode *code, MacroAssembler &masm);
@ -624,24 +614,24 @@ class GetPropertyIC : public RepatchIonCache
}
// Attach the proper stub, if possible
bool tryAttachStub(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
bool tryAttachStub(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr, bool *emitted);
bool tryAttachProxy(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
bool tryAttachProxy(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr, bool *emitted);
bool tryAttachGenericProxy(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
bool tryAttachGenericProxy(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr, bool *emitted);
bool tryAttachDOMProxyShadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, void *returnAddr, bool *emitted);
bool tryAttachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name, bool resetNeeded,
bool tryAttachDOMProxyShadowed(JSContext *cx, IonScript *ion, HandleObject obj,
void *returnAddr, bool *emitted);
bool tryAttachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, bool resetNeeded,
void *returnAddr, bool *emitted);
bool tryAttachNative(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
bool tryAttachNative(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, void *returnAddr, bool *emitted);
bool tryAttachTypedArrayLength(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name, bool *emitted);
bool tryAttachTypedArrayLength(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, bool *emitted);
bool tryAttachArgumentsLength(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, HandlePropertyName name, bool *emitted);
bool tryAttachArgumentsLength(JSContext *cx, IonScript *ion, HandleObject obj,
HandlePropertyName name, bool *emitted);
static bool update(JSContext *cx, size_t cacheIndex, HandleObject obj, MutableHandleValue vp);
};
@ -704,17 +694,17 @@ class SetPropertyIC : public RepatchIonCache
CanAttachCallSetter
};
bool attachSetSlot(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
HandleShape shape, bool checkTypeset);
bool attachCallSetter(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
bool attachSetSlot(JSContext *cx, IonScript *ion, HandleObject obj, HandleShape shape,
bool checkTypeset);
bool attachCallSetter(JSContext *cx, IonScript *ion, HandleObject obj,
HandleObject holder, HandleShape shape, void *returnAddr);
bool attachAddSlot(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *obj,
HandleShape oldShape, bool checkTypeset);
bool attachGenericProxy(JSContext *cx, JSScript *topScript, IonScript *ion, void *returnAddr);
bool attachDOMProxyShadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, void *returnAddr);
bool attachDOMProxyUnshadowed(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleObject obj, void *returnAddr);
bool attachAddSlot(JSContext *cx, IonScript *ion, JSObject *obj, HandleShape oldShape,
bool checkTypeset);
bool attachGenericProxy(JSContext *cx, IonScript *ion, void *returnAddr);
bool attachDOMProxyShadowed(JSContext *cx, IonScript *ion, HandleObject obj,
void *returnAddr);
bool attachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, HandleObject obj,
void *returnAddr);
static bool
update(JSContext *cx, size_t cacheIndex, HandleObject obj, HandleValue value);
@ -798,13 +788,12 @@ class GetElementIC : public RepatchIonCache
static bool canAttachTypedArrayElement(JSObject *obj, const Value &idval,
TypedOrValueRegister output);
bool attachGetProp(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject obj,
const Value &idval, HandlePropertyName name, void *returnAddr);
bool attachDenseElement(JSContext *cx, JSScript *topScript, IonScript *ion,
JSObject *obj, const Value &idval);
bool attachTypedArrayElement(JSContext *cx, JSScript *topScript, IonScript *ion,
TypedArrayObject *tarr, const Value &idval);
bool attachArgumentsElement(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *obj);
bool attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj, const Value &idval,
HandlePropertyName name, void *returnAddr);
bool attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval);
bool attachTypedArrayElement(JSContext *cx, IonScript *ion, TypedArrayObject *tarr,
const Value &idval);
bool attachArgumentsElement(JSContext *cx, IonScript *ion, JSObject *obj);
static bool
update(JSContext *cx, size_t cacheIndex, HandleObject obj, HandleValue idval,
@ -889,10 +878,8 @@ class SetElementIC : public RepatchIonCache
hasDenseStub_ = true;
}
bool attachDenseElement(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *obj,
const Value &idval);
bool attachTypedArrayElement(JSContext *cx, JSScript *topScript, IonScript *ion,
TypedArrayObject *tarr);
bool attachDenseElement(JSContext *cx, IonScript *ion, JSObject *obj, const Value &idval);
bool attachTypedArrayElement(JSContext *cx, IonScript *ion, TypedArrayObject *tarr);
static bool
update(JSContext *cx, size_t cacheIndex, HandleObject obj, HandleValue idval,
@ -926,9 +913,8 @@ class BindNameIC : public RepatchIonCache
return output_;
}
bool attachGlobal(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *scopeChain);
bool attachNonGlobal(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *scopeChain,
JSObject *holder);
bool attachGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain);
bool attachNonGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain, JSObject *holder);
static JSObject *
update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain);
@ -973,10 +959,10 @@ class NameIC : public RepatchIonCache
return typeOf_;
}
bool attachReadSlot(JSContext *cx, JSScript *topScript, IonScript *ion, HandleObject scopeChain,
bool attachReadSlot(JSContext *cx, IonScript *ion, HandleObject scopeChain,
HandleObject holderBase, HandleObject holder, HandleShape shape);
bool attachCallGetter(JSContext *cx, JSScript *topScript, IonScript *ion, JSObject *obj,
JSObject *holder, HandleShape shape, void *returnAddr);
bool attachCallGetter(JSContext *cx, IonScript *ion, JSObject *obj, JSObject *holder,
HandleShape shape, void *returnAddr);
static bool
update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain, MutableHandleValue vp);
@ -1014,8 +1000,7 @@ class CallsiteCloneIC : public RepatchIonCache
return output_;
}
bool attach(JSContext *cx, JSScript *topScript, IonScript *ion,
HandleFunction original, HandleFunction clone);
bool attach(JSContext *cx, IonScript *ion, HandleFunction original, HandleFunction clone);
static JSObject *update(JSContext *cx, size_t cacheIndex, HandleObject callee);
};

View File

@ -378,34 +378,13 @@ class MDefinition : public MNode
const BytecodeSite &trackedSite() const {
return trackedSite_;
}
jsbytecode *trackedPc() const {
jsbytecode *trackedPc() {
return trackedSite_.pc();
}
InlineScriptTree *trackedTree() const {
InlineScriptTree *trackedTree() {
return trackedSite_.tree();
}
JSScript *profilerLeaveScript() const {
return trackedTree()->outermostCaller()->script();
}
jsbytecode *profilerLeavePc() const {
// If this is in a top-level function, use the pc directly.
if (trackedTree()->isOutermostCaller())
return trackedPc();
// Walk up the InlineScriptTree chain to find the top-most callPC
InlineScriptTree *curTree = trackedTree();
InlineScriptTree *callerTree = curTree->caller();
while (!callerTree->isOutermostCaller()) {
curTree = callerTree;
callerTree = curTree->caller();
}
// Return the callPc of the topmost inlined script.
return curTree->callerPc();
}
// Return the range of this value, *before* any bailout checks. Contrast
// this with the type() method, and the Range constructor which takes an
// MDefinition*, which describe the value *after* any bailout checks.