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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8916 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6fb9140b
......@@ -6319,7 +6319,9 @@ void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
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 @@ void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
__ 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.
}
......
......@@ -593,6 +593,8 @@ void Deoptimizer::EntryGenerator::Generate() {
__ 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 =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment