Bug 865635 - Use MMonitorTypes instead of MTypeBarrier for type write barriers, r=dvander.

This commit is contained in:
Brian Hackett 2013-04-25 14:44:44 -06:00
parent fe68a570a8
commit b30b9eb3fe
4 changed files with 4 additions and 9 deletions

View File

@ -1730,7 +1730,7 @@ LIRGenerator::visitMonitorTypes(MMonitorTypes *ins)
LMonitorTypes *lir = new LMonitorTypes(temp());
if (!useBox(lir, LMonitorTypes::Input, ins->input()))
return false;
return assignSnapshot(lir, Bailout_Monitor) && add(lir, ins);
return assignSnapshot(lir, Bailout_Normal) && add(lir, ins);
}
bool

View File

@ -2473,9 +2473,8 @@ TryAddTypeBarrierForWrite(JSContext *cx, MBasicBlock *current, types::StackTypeS
if (!types)
return false;
MInstruction *ins = MTypeBarrier::New(*pvalue, types, Bailout_Normal);
MInstruction *ins = MMonitorTypes::New(*pvalue, types);
current->add(ins);
*pvalue = ins;
return true;
}

View File

@ -6878,8 +6878,8 @@ class MTypeBarrier
};
// Like MTypeBarrier, guard that the value is in the given type set. This is
// used after some VM calls (like GetElement) to avoid the slower calls to
// TypeScript::Monitor inside these stubs.
// used before property writes to ensure the value being written is represented
// in the property types for the object.
class MMonitorTypes : public MUnaryInstruction
{
const types::StackTypeSet *typeSet_;
@ -6888,7 +6888,6 @@ class MMonitorTypes : public MUnaryInstruction
: MUnaryInstruction(def),
typeSet_(types)
{
setResultType(MIRType_Value);
setGuard();
JS_ASSERT(!types->unknown());
}

View File

@ -401,9 +401,6 @@ LIRGeneratorShared::add(T *ins, MInstruction *mir)
static inline uint32_t
VirtualRegisterOfPayload(MDefinition *mir)
{
// Type barriers may have box inputs, and pass through their input's vreg.
while (mir->isTypeBarrier())
mir = mir->getOperand(0);
if (mir->isBox()) {
MDefinition *inner = mir->toBox()->getOperand(0);
if (!inner->isConstant() && inner->type() != MIRType_Double)