Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 12826) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -422,6 +422,16 @@ |
void MacroAssembler::LoadRoot(Register destination, |
Heap::RootListIndex index, |
Condition cond) { |
+ if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && |
+ !Heap::RootCanBeWrittenAfterInitialization(index)) { |
+ Handle<Object> root(isolate()->heap()->roots_array_start()[index]); |
+ if (!isolate()->heap()->InNewSpace(*root)) { |
+ // The CPU supports fast immediate values, and this root will never |
+ // change. We will load it as a relocatable immediate value. |
+ mov(destination, Operand(root), LeaveCC, cond); |
+ return; |
+ } |
+ } |
ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
} |