Commit a060bf0e authored by danno@chromium.org's avatar danno@chromium.org

MIPS: Elide unnecessary context reload in generated stubs.

Port r13290 (6970ca83)

BUG=
TEST=

Review URL: https://codereview.chromium.org/11773013
Patch from Akos Palfi <palfia@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b510dc58
......@@ -2468,9 +2468,6 @@ void LCodeGen::DoReturn(LReturn* instr) {
__ Pop(ra, fp);
__ Addu(sp, sp, Operand(sp_delta));
}
if (info()->IsStub()) {
__ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
}
__ Jump(ra);
}
......
......@@ -1002,7 +1002,14 @@ LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) {
LInstruction* LChunkBuilder::DoContext(HContext* instr) {
return instr->HasNoUses() ? NULL : DefineAsRegister(new(zone()) LContext);
// If there is a non-return use, the context must be allocated in a register.
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->IsReturn()) {
return DefineAsRegister(new(zone()) LContext);
}
}
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment