Bug 857094. (r=sstangl)

This commit is contained in:
Shu-yu Guo 2013-04-04 08:13:22 -07:00
parent e2b5865f26
commit 905d015a4d
4 changed files with 14 additions and 4 deletions

View File

@ -6058,7 +6058,6 @@ IonBuilder::jsop_setelem_dense()
return false;
}
// Determine whether a write barrier is required.
if (oracle->elementWriteNeedsBarrier(script(), pc))
store->setNeedsBarrier();

View File

@ -1001,6 +1001,9 @@ IonBuilder::inlineUnsafeSetDenseArrayElement(CallInfo &callInfo, uint32_t base)
/* needsHoleCheck = */ false);
store->setRacy();
if (oracle->elementWriteNeedsBarrier(getInlineArgTypeSet(callInfo, arri)))
store->setNeedsBarrier();
current->add(store);
if (!resumeAfter(store))

View File

@ -640,8 +640,13 @@ TypeInferenceOracle::elementWriteNeedsBarrier(RawScript script, jsbytecode *pc)
{
// Return true if SETELEM-like instructions need a write barrier before modifying
// a property. The object is the third value popped by SETELEM.
StackTypeSet *types = script->analysis()->poppedTypes(pc, 2);
return types->propertyNeedsBarrier(cx, JSID_VOID);
return elementWriteNeedsBarrier(script->analysis()->poppedTypes(pc, 2));
}
bool
TypeInferenceOracle::elementWriteNeedsBarrier(StackTypeSet *obj)
{
return obj->propertyNeedsBarrier(cx, JSID_VOID);
}
StackTypeSet *

View File

@ -141,6 +141,9 @@ class TypeOracle
virtual bool elementWriteNeedsBarrier(RawScript script, jsbytecode *pc) {
return true;
}
virtual bool elementWriteNeedsBarrier(types::StackTypeSet *obj) {
return true;
}
virtual MIRType elementWrite(RawScript script, jsbytecode *pc) {
return MIRType_None;
}
@ -288,6 +291,7 @@ class TypeInferenceOracle : public TypeOracle
bool propertyWriteCanSpecialize(RawScript script, jsbytecode *pc);
bool propertyWriteNeedsBarrier(RawScript script, jsbytecode *pc, RawId id);
bool elementWriteNeedsBarrier(RawScript script, jsbytecode *pc);
bool elementWriteNeedsBarrier(types::StackTypeSet *obj);
MIRType elementWrite(RawScript script, jsbytecode *pc);
bool canInlineCall(HandleScript caller, jsbytecode *pc);
types::TypeBarrier *callArgsBarrier(HandleScript caller, jsbytecode *pc);
@ -416,4 +420,3 @@ IsNullOrUndefined(MIRType type)
} /* js */
#endif // js_ion_type_oracle_h__