Reviewers: Erik Corry, danno,

Description:
Do not use deprecated ARM instructions in DirectCEntryStub::GenerateCall.

Non-ancient versions of the ARM-ARM explicitly deprecate most uses of the PC
within instructions and older ARM implementations have a non-predictable offset (8 or 12) for some of these deprecated uses. Avoiding the deprecated instruction costs us one additional instruction in DirectCEntryStub::GenerateCall, but this
should not cause any significant performance degradation.

The deoptimizer still uses the PC in a stm instruction, but it is a bit unclear what to do about that, so simply a comment has been added to reconsider this in
the future.

Please review this at http://codereview.chromium.org/7633014/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/arm/code-stubs-arm.cc
  M     src/arm/deoptimizer-arm.cc


Index: src/arm/code-stubs-arm.cc
===================================================================
--- src/arm/code-stubs-arm.cc   (revision 8912)
+++ src/arm/code-stubs-arm.cc   (working copy)
@@ -6319,7 +6319,9 @@
                      RelocInfo::CODE_TARGET));
   __ mov(r2, Operand(function));
   // Push return address (accessible to GC through exit frame pc).
-  __ str(pc, MemOperand(sp, 0));
+  // Note that using pc with str is deprecated.
+  __ add(ip, pc, Operand(4));
+  __ str(ip, MemOperand(sp, 0));
   __ Jump(r2);  // Call the api function.
 }

@@ -6329,7 +6331,9 @@
   __ mov(lr, Operand(reinterpret_cast<intptr_t>(GetCode().location()),
                      RelocInfo::CODE_TARGET));
   // Push return address (accessible to GC through exit frame pc).
-  __ str(pc, MemOperand(sp, 0));
+  // Note that using pc with str is deprecated.
+  __ add(ip, pc, Operand(4));
+  __ str(ip, MemOperand(sp, 0));
   __ Jump(target);  // Call the C++ function.
 }

Index: src/arm/deoptimizer-arm.cc
===================================================================
--- src/arm/deoptimizer-arm.cc  (revision 8912)
+++ src/arm/deoptimizer-arm.cc  (working copy)
@@ -593,6 +593,8 @@
   __ vstm(db_w, sp, first, last);

// Push all 16 registers (needed to populate FrameDescription::registers_). + // Note that using pc with stm is deprecated, so we should perhaps handle this
+  // a bit differently.
   __ stm(db_w, sp, restored_regs  | sp.bit() | lr.bit() | pc.bit());

   const int kSavedRegistersAreaSize =


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

Reply via email to