Revision: 8938
Author:   [email protected]
Date:     Tue Aug 16 02:58:34 2011
Log: Refactored DirectCEntryStub::GenerateCall a bit to make it clearer what's going on and added an ASSERT.
Review URL: http://codereview.chromium.org/7640016
http://code.google.com/p/v8/source/detail?r=8938

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

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Fri Aug 12 01:45:17 2011 +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Aug 16 02:58:34 2011
@@ -6315,14 +6315,8 @@

 void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
                                     ExternalReference function) {
-  __ mov(lr, Operand(reinterpret_cast<intptr_t>(GetCode().location()),
-                     RelocInfo::CODE_TARGET));
   __ mov(r2, Operand(function));
-  // Push return address (accessible to GC through exit frame pc).
-  // Note that using pc with str is deprecated.
-  __ add(ip, pc, Operand(4));
-  __ str(ip, MemOperand(sp, 0));
-  __ Jump(r2);  // Call the api function.
+  GenerateCall(masm, r2);
 }


@@ -6332,9 +6326,13 @@
                      RelocInfo::CODE_TARGET));
   // Push return address (accessible to GC through exit frame pc).
   // Note that using pc with str is deprecated.
-  __ add(ip, pc, Operand(4));
+  Label start;
+  __ bind(&start);
+  __ add(ip, pc, Operand(Assembler::kInstrSize));
   __ str(ip, MemOperand(sp, 0));
   __ Jump(target);  // Call the C++ function.
+  ASSERT_EQ(Assembler::kInstrSize + Assembler::kPcLoadDelta,
+            masm->SizeOfCodeGeneratedSince(&start));
 }


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

Reply via email to