Revision: 17485
Author:   [email protected]
Date:     Tue Nov  5 13:19:14 2013 UTC
Log:      Avoid using dd() in Prologue when --optimize-for-size.

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
[email protected]

Review URL: https://codereview.chromium.org/47743007

Patch from Ross McIlroy <[email protected]>.
http://code.google.com/p/v8/source/detail?r=17485

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

=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm.cc Thu Oct 10 08:45:40 2013 UTC +++ /branches/bleeding_edge/src/arm/assembler-arm.cc Tue Nov 5 13:19:14 2013 UTC
@@ -3182,6 +3182,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/arm/assembler-arm.h Thu Oct 10 08:45:40 2013 UTC +++ /branches/bleeding_edge/src/arm/assembler-arm.h Tue Nov 5 13:19:14 2013 UTC
@@ -1393,6 +1393,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_; }

   // Read/patch instructions
=======================================
--- /branches/bleeding_edge/src/arm/codegen-arm.cc Thu Oct 24 10:50:35 2013 UTC +++ /branches/bleeding_edge/src/arm/codegen-arm.cc Tue Nov 5 13:19:14 2013 UTC
@@ -896,7 +896,7 @@
     CodePatcher patcher(sequence, young_length / Assembler::kInstrSize);
     patcher.masm()->add(r0, pc, Operand(-8));
     patcher.masm()->ldr(pc, MemOperand(pc, -4));
- patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
+    patcher.masm()->emit_code_stub_address(stub);
   }
 }

=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Thu Oct 31 11:43:23 2013 UTC +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Tue Nov 5 13:19:14 2013 UTC
@@ -932,7 +932,7 @@
       Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
       add(r0, pc, Operand(-8));
       ldr(pc, MemOperand(pc, -4));
-      dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
+      emit_code_stub_address(stub);
     } else {
       stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
       nop(ip.code());

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