Sync undefined properly, avoid unnecessary syncs at function entry, bug 586544. r=dvander

This commit is contained in:
Brian Hackett 2010-08-23 16:43:04 -07:00
parent 383caddd9a
commit 93e944674e
5 changed files with 4 additions and 11 deletions

View File

@ -197,7 +197,7 @@ mjit::Compiler::generatePrologue()
saveReturnAddress();
/* Set locals to undefined. */
for (uint32 i = 0; i < script->nslots; i++) {
for (uint32 i = 0; i < script->nfixed; i++) {
Address local(JSFrameReg, sizeof(JSStackFrame) + i * sizeof(Value));
masm.storeValue(UndefinedValue(), local);
}
@ -295,7 +295,6 @@ mjit::Compiler::finishThisUp()
script->mics[i].stubEntry = stubCode.locationOf(mics[i].stubEntry);
script->mics[i].u.name.typeConst = mics[i].u.name.typeConst;
script->mics[i].u.name.dataConst = mics[i].u.name.dataConst;
script->mics[i].u.name.dataWrite = mics[i].u.name.dataWrite;
#if defined JS_PUNBOX64
script->mics[i].patchValueOffset = mics[i].patchValueOffset;
#endif
@ -3567,7 +3566,6 @@ mjit::Compiler::jsop_setgname(uint32 index)
mic.u.name.typeConst = fe->isTypeKnown();
mic.u.name.dataConst = fe->isConstant();
mic.u.name.dataWrite = !mic.u.name.dataConst || !fe->getValue().isUndefined();
if (!mic.u.name.dataConst) {
dataReg = frame.ownRegForData(fe);

View File

@ -101,7 +101,6 @@ class Compiler
struct {
bool typeConst;
bool dataConst;
bool dataWrite;
} name;
struct {
uint32 pcOffs;

View File

@ -179,8 +179,7 @@ ic::SetGlobalName(VMFrame &f, uint32 index)
dataOffset = MICInfo::SET_DATA_CONST_TYPE_OFFSET;
else
dataOffset = MICInfo::SET_DATA_TYPE_OFFSET;
if (mic.u.name.dataWrite)
stores.repatch(mic.load.dataLabel32AtOffset(dataOffset), slot);
stores.repatch(mic.load.dataLabel32AtOffset(dataOffset), slot);
#elif defined JS_CPU_ARM
// mic.load actually points to the LDR instruction which fetches the offset, but 'repatch'
// knows how to dereference it to find the integer value.

View File

@ -108,7 +108,6 @@ struct MICInfo {
bool touched : 1;
bool typeConst : 1;
bool dataConst : 1;
bool dataWrite : 1;
} name;
/* Used by CALL. */
bool generated;

View File

@ -159,8 +159,7 @@ class Assembler : public BaseAssembler
jv.asBits = JSVAL_BITS(Jsvalify(v));
store32(ImmTag(jv.s.tag), tagOf(address));
if (!v.isUndefined())
store32(Imm32(jv.s.payload.u32), payloadOf(address));
store32(Imm32(jv.s.payload.u32), payloadOf(address));
}
void storeValue(const Value &v, BaseIndex address) {
@ -168,8 +167,7 @@ class Assembler : public BaseAssembler
jv.asBits = JSVAL_BITS(Jsvalify(v));
store32(ImmTag(jv.s.tag), tagOf(address));
if (!v.isUndefined())
store32(Imm32(jv.s.payload.u32), payloadOf(address));
store32(Imm32(jv.s.payload.u32), payloadOf(address));
}
/*