Revision: 13323
Author:   [email protected]
Date:     Mon Jan  7 02:23:30 2013
Log:      MIPS: Elide unnecessary context reload in generated stubs.

Port r13290 (6970ca83)

BUG=
TEST=

Review URL: https://codereview.chromium.org/11773013
Patch from Akos Palfi <[email protected]>.
http://code.google.com/p/v8/source/detail?r=13323

Modified:
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jan 7 02:18:25 2013 +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jan 7 02:23:30 2013
@@ -2468,9 +2468,6 @@
     __ Pop(ra, fp);
     __ Addu(sp, sp, Operand(sp_delta));
   }
-  if (info()->IsStub()) {
-    __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
-  }
   __ Jump(ra);
 }

=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Jan 7 02:18:25 2013 +++ /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Jan 7 02:23:30 2013
@@ -1002,7 +1002,14 @@


 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;
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to