Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 437b7312c718f0aa3b936c0176b49d4724049958..61f963fb1a745b1d5fceaa9eee3458033e81062e 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -888,6 +888,16 @@ void MacroAssembler::VmovLow(DwVfpRegister dst, Register src) { |
} |
+void MacroAssembler::LoadConstantPoolPointerRegister() { |
+ if (FLAG_enable_ool_constant_pool) { |
+ int constant_pool_offset = Code::kConstantPoolOffset - Code::kHeaderSize - |
+ pc_offset() - Instruction::kPCReadOffset; |
+ ASSERT(ImmediateFitsAddrMode2Instruction(constant_pool_offset)); |
+ ldr(pp, MemOperand(pc, constant_pool_offset)); |
+ } |
+} |
+ |
+ |
void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { |
if (frame_mode == BUILD_STUB_FRAME) { |
PushFixedFrame(); |
@@ -912,22 +922,20 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) { |
add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
} |
} |
-} |
- |
- |
-void MacroAssembler::LoadConstantPoolPointerRegister() { |
if (FLAG_enable_ool_constant_pool) { |
- int constant_pool_offset = |
- Code::kConstantPoolOffset - Code::kHeaderSize - pc_offset() - 8; |
- ASSERT(ImmediateFitsAddrMode2Instruction(constant_pool_offset)); |
- ldr(pp, MemOperand(pc, constant_pool_offset)); |
+ LoadConstantPoolPointerRegister(); |
+ set_constant_pool_available(true); |
} |
} |
-void MacroAssembler::EnterFrame(StackFrame::Type type) { |
+void MacroAssembler::EnterFrame(StackFrame::Type type, |
+ bool load_constant_pool) { |
// r0-r3: preserved |
PushFixedFrame(); |
+ if (FLAG_enable_ool_constant_pool && load_constant_pool) { |
+ LoadConstantPoolPointerRegister(); |
+ } |
mov(ip, Operand(Smi::FromInt(type))); |
push(ip); |
mov(ip, Operand(CodeObject())); |
@@ -975,6 +983,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) { |
} |
if (FLAG_enable_ool_constant_pool) { |
str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); |
+ LoadConstantPoolPointerRegister(); |
} |
mov(ip, Operand(CodeObject())); |
str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); |