| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 | 419 |
| 420 void MacroAssembler::LoadRoot(Register destination, | 420 void MacroAssembler::LoadRoot(Register destination, |
| 421 Heap::RootListIndex index, | 421 Heap::RootListIndex index, |
| 422 Condition cond) { | 422 Condition cond) { |
| 423 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && | 423 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && |
| 424 isolate()->heap()->RootCanBeTreatedAsConstant(index) && | 424 isolate()->heap()->RootCanBeTreatedAsConstant(index) && |
| 425 !predictable_code_size()) { | 425 !predictable_code_size()) { |
| 426 // The CPU supports fast immediate values, and this root will never | 426 // The CPU supports fast immediate values, and this root will never |
| 427 // change. We will load it as a relocatable immediate value. | 427 // change. We will load it as a relocatable immediate value. |
| 428 Handle<Object> root(&isolate()->heap()->roots_array_start()[index]); | 428 Handle<Object> root = isolate()->heap()->root_handle(index); |
| 429 mov(destination, Operand(root), LeaveCC, cond); | 429 mov(destination, Operand(root), LeaveCC, cond); |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); | 432 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 void MacroAssembler::StoreRoot(Register source, | 436 void MacroAssembler::StoreRoot(Register source, |
| 437 Heap::RootListIndex index, | 437 Heap::RootListIndex index, |
| 438 Condition cond) { | 438 Condition cond) { |
| (...skipping 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3807 } | 3807 } |
| 3808 } | 3808 } |
| 3809 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3809 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3810 add(result, result, Operand(dividend, LSR, 31)); | 3810 add(result, result, Operand(dividend, LSR, 31)); |
| 3811 } | 3811 } |
| 3812 | 3812 |
| 3813 } // namespace internal | 3813 } // namespace internal |
| 3814 } // namespace v8 | 3814 } // namespace v8 |
| 3815 | 3815 |
| 3816 #endif // V8_TARGET_ARCH_ARM | 3816 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |