Revision: 8916
Author:   [email protected]
Date:     Fri Aug 12 01:45:17 2011
Log: 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.
Review URL: http://codereview.chromium.org/7633014
http://code.google.com/p/v8/source/detail?r=8916

Modified:
 /branches/bleeding_edge/src/arm/code-stubs-arm.cc
 /branches/bleeding_edge/src/arm/deoptimizer-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Thu Aug 11 00:22:16 2011 +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Fri Aug 12 01:45:17 2011
@@ -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.
 }

=======================================
--- /branches/bleeding_edge/src/arm/deoptimizer-arm.cc Wed Aug 10 01:03:22 2011 +++ /branches/bleeding_edge/src/arm/deoptimizer-arm.cc Fri Aug 12 01:45:17 2011
@@ -593,6 +593,8 @@
   __ vstm(db_w, sp, first, last);

// Push all 16 registers (needed to populate FrameDescription::registers_). + // TODO(1588) 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