Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 1312763006: [heap] User safer root set accessor when possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-heap-root-set-1
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | src/snapshot/serialize.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | src/snapshot/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698