Revision: 17508
Author:   [email protected]
Date:     Tue Nov  5 20:48:35 2013 UTC
Log:      MIPS: Avoid using dd() in Prologue when --optimize-for-size.

Port: r17485 (0d82025)

Original commit message:
When --optimize-for-size is true, the prologue generation outputs the
pre-aging code stub address directly to the instruction stream. Previously
this was done using dd() which failed if there was any pending constant
pool entries left to be written. This CL introduces an emit_code_stub_address()
for this purpose instead.

BUG=v8:2968

Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=17508

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

=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.cc Thu Oct 10 08:45:40 2013 UTC +++ /branches/bleeding_edge/src/mips/assembler-mips.cc Tue Nov 5 20:48:35 2013 UTC
@@ -2029,6 +2029,14 @@
   *reinterpret_cast<uint32_t*>(pc_) = data;
   pc_ += sizeof(uint32_t);
 }
+
+
+void Assembler::emit_code_stub_address(Code* stub) {
+  CheckBuffer();
+  *reinterpret_cast<uint32_t*>(pc_) =
+      reinterpret_cast<uint32_t>(stub->instruction_start());
+  pc_ += sizeof(uint32_t);
+}


 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Thu Oct 10 08:45:40 2013 UTC +++ /branches/bleeding_edge/src/mips/assembler-mips.h Tue Nov 5 20:48:35 2013 UTC
@@ -896,6 +896,9 @@
   void db(uint8_t data);
   void dd(uint32_t data);

+  // Emits the address of the code stub's first instruction.
+  void emit_code_stub_address(Code* stub);
+
   PositionsRecorder* positions_recorder() { return &positions_recorder_; }

// Postpone the generation of the trampoline pool for the specified number of
=======================================
--- /branches/bleeding_edge/src/mips/codegen-mips.cc Thu Oct 24 10:50:35 2013 UTC +++ /branches/bleeding_edge/src/mips/codegen-mips.cc Tue Nov 5 20:48:35 2013 UTC
@@ -671,7 +671,7 @@
         Operand(reinterpret_cast<uint32_t>(stub->instruction_start())));
     patcher.masm()->Call(t9);
     // Record the stub address in the empty space for GetCodeAgeAndParity()
- patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
+    patcher.masm()->emit_code_stub_address(stub);
   }
 }

=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue Nov 5 01:31:22 2013 UTC +++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue Nov 5 20:48:35 2013 UTC
@@ -4606,14 +4606,14 @@
       Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
       nop(Assembler::CODE_AGE_MARKER_NOP);
       // Save the function's original return address
-      // (it will be clobbered by Call(t9))
+      // (it will be clobbered by Call(t9)).
       mov(at, ra);
-      // Load the stub address to t9 and call it
+      // Load the stub address to t9 and call it.
       li(t9,
          Operand(reinterpret_cast<uint32_t>(stub->instruction_start())));
       Call(t9);
- // Record the stub address in the empty space for GetCodeAgeAndParity()
-      dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
+ // Record the stub address in the empty space for GetCodeAgeAndParity().
+      emit_code_stub_address(stub);
     } else {
       Push(ra, fp, cp, a1);
       nop(Assembler::CODE_AGE_SEQUENCE_NOP);

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