Bug 971319 - Stop passing redundant barriering information through to GetPropertyIC. (r=jandem)

This commit is contained in:
Eric Faust 2014-02-13 11:04:49 -08:00
parent ccfea40879
commit b41c031b17
5 changed files with 12 additions and 27 deletions

View File

@ -6570,11 +6570,11 @@ CodeGenerator::visitNameIC(OutOfLineUpdateCache *ool, DataPtr<NameIC> &ic)
bool
CodeGenerator::addGetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
PropertyName *name, TypedOrValueRegister output,
bool allowGetters, bool monitoredResult)
bool monitoredResult)
{
switch (gen->info().executionMode()) {
case SequentialExecution: {
GetPropertyIC cache(liveRegs, objReg, name, output, allowGetters, monitoredResult);
GetPropertyIC cache(liveRegs, objReg, name, output, monitoredResult);
return addCache(ins, allocateCache(cache));
}
case ParallelExecution: {
@ -6632,11 +6632,10 @@ CodeGenerator::visitGetPropertyCacheV(LGetPropertyCacheV *ins)
RegisterSet liveRegs = ins->safepoint()->liveRegs();
Register objReg = ToRegister(ins->getOperand(0));
PropertyName *name = ins->mir()->name();
bool allowGetters = ins->mir()->allowGetters();
bool monitoredResult = ins->mir()->monitoredResult();
TypedOrValueRegister output = TypedOrValueRegister(GetValueOutput(ins));
return addGetPropertyCache(ins, liveRegs, objReg, name, output, allowGetters, monitoredResult);
return addGetPropertyCache(ins, liveRegs, objReg, name, output, monitoredResult);
}
bool
@ -6645,11 +6644,10 @@ CodeGenerator::visitGetPropertyCacheT(LGetPropertyCacheT *ins)
RegisterSet liveRegs = ins->safepoint()->liveRegs();
Register objReg = ToRegister(ins->getOperand(0));
PropertyName *name = ins->mir()->name();
bool allowGetters = ins->mir()->allowGetters();
bool monitoredResult = ins->mir()->monitoredResult();
TypedOrValueRegister output(ins->mir()->type(), ToAnyRegister(ins->getDef(0)));
return addGetPropertyCache(ins, liveRegs, objReg, name, output, allowGetters, monitoredResult);
return addGetPropertyCache(ins, liveRegs, objReg, name, output, monitoredResult);
}
typedef bool (*GetPropertyICFn)(JSContext *, size_t, HandleObject, MutableHandleValue);

View File

@ -351,7 +351,7 @@ class CodeGenerator : public CodeGeneratorSpecific
private:
bool addGetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
PropertyName *name, TypedOrValueRegister output,
bool allowGetters, bool monitoredResult);
bool monitoredResult);
bool addGetElementCache(LInstruction *ins, Register obj, ConstantOrRegister index,
TypedOrValueRegister output, bool monitoredResult,
bool allowDoubleResult);

View File

@ -8723,7 +8723,6 @@ IonBuilder::getPropTryCache(bool *emitted, PropertyName *name,
bool barrier, types::TemporaryTypeSet *types)
{
JS_ASSERT(*emitted == false);
bool accessGetter = inspector->hasSeenAccessedGetter(pc);
MDefinition *obj = current->peek(-1);
@ -8735,7 +8734,9 @@ IonBuilder::getPropTryCache(bool *emitted, PropertyName *name,
return true;
}
if (accessGetter)
// Since getters have no guaranteed return values, we must barrier in order to be
// able to attach stubs for them.
if (inspector->hasSeenAccessedGetter(pc))
barrier = true;
if (needsToMonitorMissingProperties(types))
@ -8767,10 +8768,6 @@ IonBuilder::getPropTryCache(bool *emitted, PropertyName *name,
return false;
}
// If the cache is known to access getters, then enable generation of getter stubs.
if (accessGetter)
load->setAllowGetters();
current->add(load);
current->push(load);

View File

@ -530,7 +530,6 @@ class GetPropertyIC : public RepatchIonCache
size_t locationsIndex_;
size_t numLocations_;
bool allowGetters_ : 1;
bool monitoredResult_ : 1;
bool hasTypedArrayLengthStub_ : 1;
bool hasStrictArgumentsLengthStub_ : 1;
@ -541,14 +540,13 @@ class GetPropertyIC : public RepatchIonCache
GetPropertyIC(RegisterSet liveRegs,
Register object, PropertyName *name,
TypedOrValueRegister output,
bool allowGetters, bool monitoredResult)
bool monitoredResult)
: liveRegs_(liveRegs),
object_(object),
name_(name),
output_(output),
locationsIndex_(0),
numLocations_(0),
allowGetters_(allowGetters),
monitoredResult_(monitoredResult),
hasTypedArrayLengthStub_(false),
hasStrictArgumentsLengthStub_(false),
@ -570,9 +568,6 @@ class GetPropertyIC : public RepatchIonCache
TypedOrValueRegister output() const {
return output_;
}
bool allowGetters() const {
return allowGetters_ && !idempotent();
}
bool monitoredResult() const {
return monitoredResult_;
}
@ -609,6 +604,9 @@ class GetPropertyIC : public RepatchIonCache
// Helpers for CanAttachNativeGetProp
typedef JSContext * Context;
bool allowArrayLength(Context cx, HandleObject obj) const;
bool allowGetters() const {
return monitoredResult() && !idempotent();
}
// Attach the proper stub, if possible
bool tryAttachStub(JSContext *cx, IonScript *ion, HandleObject obj,

View File

@ -6687,7 +6687,6 @@ class MGetPropertyCache
{
CompilerRootPropertyName name_;
bool idempotent_;
bool allowGetters_;
bool monitoredResult_;
CacheLocationList location_;
@ -6698,7 +6697,6 @@ class MGetPropertyCache
: MUnaryInstruction(obj),
name_(name),
idempotent_(false),
allowGetters_(false),
monitoredResult_(monitoredResult),
location_(),
inlinePropertyTable_(nullptr)
@ -6746,15 +6744,9 @@ class MGetPropertyCache
idempotent_ = true;
setMovable();
}
bool allowGetters() const {
return allowGetters_;
}
bool monitoredResult() const {
return monitoredResult_;
}
void setAllowGetters() {
allowGetters_ = true;
}
CacheLocationList &location() {
return location_;
}