Sync FrameState entries based on tracker, bug 698100. r=dvander

This commit is contained in:
Brian Hackett 2011-10-29 18:16:35 -07:00
parent 27eed80a06
commit 236e81968d
3 changed files with 17 additions and 21 deletions

View File

@ -1265,13 +1265,13 @@ FrameState::assertValidRegisterState() const
#if defined JS_NUNBOX32
void
FrameState::syncFancy(Assembler &masm, Registers avail, FrameEntry *resumeAt,
FrameEntry *bottom) const
FrameState::syncFancy(Assembler &masm, Registers avail, int trackerIndex) const
{
reifier.reset(&masm, avail, resumeAt, bottom);
reifier.reset(&masm, avail, a->sp, entries);
for (FrameEntry *fe = resumeAt; fe >= bottom; fe--) {
if (!fe->isTracked())
for (; trackerIndex >= 0; trackerIndex--) {
FrameEntry *fe = tracker[trackerIndex];
if (fe >= a->sp)
continue;
reifier.sync(fe);
@ -1325,8 +1325,11 @@ FrameState::sync(Assembler &masm, Uses uses) const
Registers avail(freeRegs.freeMask & Registers::AvailRegs);
Registers temp(Registers::TempAnyRegs);
for (FrameEntry *fe = a->sp - 1; fe >= entries; fe--) {
if (!fe->isTracked())
unsigned nentries = tracker.nentries;
for (int trackerIndex = nentries - 1; trackerIndex >= 0; trackerIndex--) {
JS_ASSERT(tracker.nentries == nentries);
FrameEntry *fe = tracker[trackerIndex];
if (fe >= a->sp)
continue;
if (fe->isType(JSVAL_TYPE_DOUBLE)) {
@ -1375,7 +1378,7 @@ FrameState::sync(Assembler &masm, Uses uses) const
/* Fall back to a slower sync algorithm if load required. */
if ((!fe->type.synced() && backing->type.inMemory()) ||
(!fe->data.synced() && backing->data.inMemory())) {
syncFancy(masm, avail, fe, entries);
syncFancy(masm, avail, trackerIndex);
return;
}
#endif
@ -1454,15 +1457,13 @@ FrameState::syncAndKill(Registers kill, Uses uses, Uses ignore)
#endif
}
uint32 maxvisits = tracker.nentries;
for (FrameEntry *fe = a->sp - 1; fe >= entries && maxvisits; fe--) {
if (!fe->isTracked())
continue;
unsigned nentries = tracker.nentries;
for (int trackerIndex = nentries - 1; trackerIndex >= 0; trackerIndex--) {
JS_ASSERT(tracker.nentries == nentries);
FrameEntry *fe = tracker[trackerIndex];
maxvisits--;
if (deadEntry(fe, ignore.nuses))
if (fe >= a->sp || deadEntry(fe, ignore.nuses))
continue;
syncFe(fe);

View File

@ -990,8 +990,7 @@ class FrameState
inline void forgetAllRegs(FrameEntry *fe);
inline void swapInTracker(FrameEntry *lhs, FrameEntry *rhs);
#if defined JS_NUNBOX32
void syncFancy(Assembler &masm, Registers avail, FrameEntry *resumeAt,
FrameEntry *bottom) const;
void syncFancy(Assembler &masm, Registers avail, int trackerIndex) const;
#endif
inline bool tryFastDoubleLoad(FrameEntry *fe, FPRegisterID fpReg, Assembler &masm) const;
void resetInternalState();

View File

@ -156,10 +156,6 @@ ImmutableSync::entryFor(FrameEntry *fe)
void
ImmutableSync::sync(FrameEntry *fe)
{
#ifdef DEBUG
top = fe;
#endif
if (fe->isCopy())
syncCopy(fe);
else