Bug 989344 part 2 - Share LRecoverInfo between LSnapshots. r=jandem

This commit is contained in:
Nicolas B. Pierron 2014-03-31 09:39:45 -07:00
parent 00d83d3e90
commit cf5ed52de1
2 changed files with 12 additions and 6 deletions

View File

@ -57,17 +57,21 @@ LIRGeneratorShared::lowerTypedPhiInput(MPhi *phi, uint32_t inputPosition, LBlock
}
LRecoverInfo *
LIRGeneratorShared::buildRecover(MResumePoint *rp)
LIRGeneratorShared::getRecoverInfo(MResumePoint *rp)
{
LRecoverInfo *recover = LRecoverInfo::New(gen, rp);
return recover;
if (cachedRecoverInfo_ && cachedRecoverInfo_->mir() == rp)
return cachedRecoverInfo_;
LRecoverInfo *recoverInfo = LRecoverInfo::New(gen, rp);
cachedRecoverInfo_ = recoverInfo;
return recoverInfo;
}
#ifdef JS_NUNBOX32
LSnapshot *
LIRGeneratorShared::buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKind kind)
{
LRecoverInfo *recover = buildRecover(rp);
LRecoverInfo *recover = getRecoverInfo(rp);
if (!recover)
return nullptr;
@ -125,7 +129,7 @@ LIRGeneratorShared::buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKi
LSnapshot *
LIRGeneratorShared::buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKind kind)
{
LRecoverInfo *recover = buildRecover(rp);
LRecoverInfo *recover = getRecoverInfo(rp);
if (!recover)
return nullptr;

View File

@ -31,6 +31,7 @@ class LIRGeneratorShared : public MInstructionVisitorWithDefaults
LIRGraph &lirGraph_;
LBlock *current;
MResumePoint *lastResumePoint_;
LRecoverInfo *cachedRecoverInfo_;
LOsiPoint *osiPoint_;
public:
@ -39,6 +40,7 @@ class LIRGeneratorShared : public MInstructionVisitorWithDefaults
graph(graph),
lirGraph_(lirGraph),
lastResumePoint_(nullptr),
cachedRecoverInfo_(nullptr),
osiPoint_(nullptr)
{ }
@ -160,7 +162,7 @@ class LIRGeneratorShared : public MInstructionVisitorWithDefaults
return tmp;
}
LRecoverInfo *buildRecover(MResumePoint *rp);
LRecoverInfo *getRecoverInfo(MResumePoint *rp);
LSnapshot *buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKind kind);
bool assignPostSnapshot(MInstruction *mir, LInstruction *ins);