Revision: 15733
Author:   [email protected]
Date:     Wed Jul 17 16:57:32 2013
Log:      MIPS: Improve code aging sequence.

Port r15697 (61d56196)

Original commit message:
The code aging sequence contains a load which is unecessary for optimised
function. This has been replaced by a nop.

BUG=

Review URL: https://codereview.chromium.org/19683005
http://code.google.com/p/v8/source/detail?r=15733

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

=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Tue Apr 16 04:33:02 2013 +++ /branches/bleeding_edge/src/mips/assembler-mips.h Wed Jul 17 16:57:32 2013
@@ -583,7 +583,8 @@
     LAST_CODE_MARKER,
     FIRST_IC_MARKER = PROPERTY_ACCESS_INLINED,
     // Code aging
-    CODE_AGE_MARKER_NOP = 6
+    CODE_AGE_MARKER_NOP = 6,
+    CODE_AGE_SEQUENCE_NOP
   };

   // Type == 0 is the default non-marking nop. For mips this is a
=======================================
--- /branches/bleeding_edge/src/mips/codegen-mips.cc Fri Jul 5 02:52:11 2013 +++ /branches/bleeding_edge/src/mips/codegen-mips.cc Wed Jul 17 16:57:32 2013
@@ -603,7 +603,7 @@
   if (!initialized) {
     CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength);
     patcher.masm()->Push(ra, fp, cp, a1);
-    patcher.masm()->LoadRoot(at, Heap::kUndefinedValueRootIndex);
+    patcher.masm()->nop(Assembler::CODE_AGE_SEQUENCE_NOP);
     patcher.masm()->Addu(fp, sp, Operand(2 * kPointerSize));
     initialized = true;
   }
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Jul 17 08:58:59 2013 +++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Jul 17 16:57:32 2013
@@ -174,9 +174,7 @@
// The following three instructions must remain together and unmodified for
   // code aging to work properly.
   __ Push(ra, fp, cp, a1);
-  // Load undefined value here, so the value is ready for the loop
-  // below.
-  __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
+  __ nop(Assembler::CODE_AGE_SEQUENCE_NOP);
   // Adjust fp to point to caller's fp.
   __ Addu(fp, sp, Operand(2 * kPointerSize));
   info->AddNoFrameRange(0, masm_->pc_offset());
@@ -185,8 +183,11 @@
     int locals_count = info->scope()->num_stack_slots();
     // Generators allocate locals, if any, in context slots.
     ASSERT(!info->function()->is_generator() || locals_count == 0);
-    for (int i = 0; i < locals_count; i++) {
-      __ push(at);
+    if (locals_count > 0) {
+      __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
+      for (int i = 0; i < locals_count; i++) {
+        __ push(at);
+      }
     }
   }

=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jul 17 11:39:34 2013 +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jul 17 16:57:32 2013
@@ -159,9 +159,9 @@
// The following three instructions must remain together and unmodified
       // for code aging to work properly.
       __ Push(ra, fp, cp, a1);
-      // Add unused load of ip to ensure prologue sequence is identical for
+      // Add unused nop to ensure prologue sequence is identical for
       // full-codegen and lithium-codegen.
-      __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
+      __ nop(Assembler::CODE_AGE_SEQUENCE_NOP);
       // Adj. FP to point to saved FP.
       __ Addu(fp, sp, Operand(2 * kPointerSize));
     }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to