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

Side by Side Diff: runtime/vm/assembler_arm.cc

Issue 1249933003: Rename assembler field/getter/setter allow_constant_pool to constant_pool_allowed (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // NOLINT 5 #include "vm/globals.h" // NOLINT
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 if (stack_elements > 0) { 1522 if (stack_elements > 0) {
1523 AddImmediate(SP, SP, stack_elements * kWordSize); 1523 AddImmediate(SP, SP, stack_elements * kWordSize);
1524 } 1524 }
1525 } 1525 }
1526 1526
1527 1527
1528 // Uses a code sequence that can easily be decoded. 1528 // Uses a code sequence that can easily be decoded.
1529 void Assembler::LoadWordFromPoolOffset(Register rd, 1529 void Assembler::LoadWordFromPoolOffset(Register rd,
1530 int32_t offset, 1530 int32_t offset,
1531 Condition cond) { 1531 Condition cond) {
1532 ASSERT(allow_constant_pool()); 1532 ASSERT(constant_pool_allowed());
1533 ASSERT(rd != PP); 1533 ASSERT(rd != PP);
1534 int32_t offset_mask = 0; 1534 int32_t offset_mask = 0;
1535 if (Address::CanHoldLoadOffset(kWord, offset, &offset_mask)) { 1535 if (Address::CanHoldLoadOffset(kWord, offset, &offset_mask)) {
1536 ldr(rd, Address(PP, offset), cond); 1536 ldr(rd, Address(PP, offset), cond);
1537 } else { 1537 } else {
1538 int32_t offset_hi = offset & ~offset_mask; // signed 1538 int32_t offset_hi = offset & ~offset_mask; // signed
1539 uint32_t offset_lo = offset & offset_mask; // unsigned 1539 uint32_t offset_lo = offset & offset_mask; // unsigned
1540 // Inline a simplified version of AddImmediate(rd, PP, offset_hi). 1540 // Inline a simplified version of AddImmediate(rd, PP, offset_hi).
1541 Operand o; 1541 Operand o;
1542 if (Operand::CanHold(offset_hi, &o)) { 1542 if (Operand::CanHold(offset_hi, &o)) {
(...skipping 26 matching lines...) Expand all
1569 bool is_unique) { 1569 bool is_unique) {
1570 // Load common VM constants from the thread. This works also in places where 1570 // Load common VM constants from the thread. This works also in places where
1571 // no constant pool is set up (e.g. intrinsic code). 1571 // no constant pool is set up (e.g. intrinsic code).
1572 if (Thread::CanLoadFromThread(object)) { 1572 if (Thread::CanLoadFromThread(object)) {
1573 ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond); 1573 ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond);
1574 return; 1574 return;
1575 } 1575 }
1576 // Smis and VM heap objects are never relocated; do not use object pool. 1576 // Smis and VM heap objects are never relocated; do not use object pool.
1577 if (object.IsSmi()) { 1577 if (object.IsSmi()) {
1578 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond); 1578 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond);
1579 } else if (object.InVMHeap() || !allow_constant_pool()) { 1579 } else if (object.InVMHeap() || !constant_pool_allowed()) {
1580 // Make sure that class CallPattern is able to decode this load immediate. 1580 // Make sure that class CallPattern is able to decode this load immediate.
1581 const int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); 1581 const int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
1582 LoadImmediate(rd, object_raw, cond); 1582 LoadImmediate(rd, object_raw, cond);
1583 } else { 1583 } else {
1584 // Make sure that class CallPattern is able to decode this load from the 1584 // Make sure that class CallPattern is able to decode this load from the
1585 // object pool. 1585 // object pool.
1586 const int32_t offset = ObjectPool::element_offset( 1586 const int32_t offset = ObjectPool::element_offset(
1587 is_unique ? object_pool_wrapper_.AddObject(object) 1587 is_unique ? object_pool_wrapper_.AddObject(object)
1588 : object_pool_wrapper_.FindObject(object)); 1588 : object_pool_wrapper_.FindObject(object));
1589 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, cond); 1589 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, cond);
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
3633 3633
3634 3634
3635 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3635 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3636 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3636 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3637 return fpu_reg_names[reg]; 3637 return fpu_reg_names[reg];
3638 } 3638 }
3639 3639
3640 } // namespace dart 3640 } // namespace dart
3641 3641
3642 #endif // defined TARGET_ARCH_ARM 3642 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698