OLD | NEW |
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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 Label l; | 1535 Label l; |
1536 b(&l); | 1536 b(&l); |
1537 EmitBranch(AL, label, false); | 1537 EmitBranch(AL, label, false); |
1538 Bind(&l); | 1538 Bind(&l); |
1539 } | 1539 } |
1540 | 1540 |
1541 | 1541 |
1542 void Assembler::Drop(intptr_t stack_elements) { | 1542 void Assembler::Drop(intptr_t stack_elements) { |
1543 ASSERT(stack_elements >= 0); | 1543 ASSERT(stack_elements >= 0); |
1544 if (stack_elements > 0) { | 1544 if (stack_elements > 0) { |
1545 AddImmediate(SP, SP, stack_elements * kWordSize); | 1545 AddImmediate(SP, stack_elements * kWordSize); |
1546 } | 1546 } |
1547 } | 1547 } |
1548 | 1548 |
1549 | 1549 |
1550 intptr_t Assembler::FindImmediate(int32_t imm) { | 1550 intptr_t Assembler::FindImmediate(int32_t imm) { |
1551 return object_pool_wrapper_.FindImmediate(imm); | 1551 return object_pool_wrapper_.FindImmediate(imm); |
1552 } | 1552 } |
1553 | 1553 |
1554 | 1554 |
1555 // Uses a code sequence that can easily be decoded. | 1555 // Uses a code sequence that can easily be decoded. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 Push(R0); | 1587 Push(R0); |
1588 Push(IP); | 1588 Push(IP); |
1589 CompareClassId(CODE_REG, kCodeCid, R0); | 1589 CompareClassId(CODE_REG, kCodeCid, R0); |
1590 b(&cid_ok, EQ); | 1590 b(&cid_ok, EQ); |
1591 bkpt(0); | 1591 bkpt(0); |
1592 Bind(&cid_ok); | 1592 Bind(&cid_ok); |
1593 | 1593 |
1594 const intptr_t offset = CodeSize() + Instr::kPCReadOffset + | 1594 const intptr_t offset = CodeSize() + Instr::kPCReadOffset + |
1595 Instructions::HeaderSize() - kHeapObjectTag; | 1595 Instructions::HeaderSize() - kHeapObjectTag; |
1596 mov(R0, Operand(PC)); | 1596 mov(R0, Operand(PC)); |
1597 AddImmediate(R0, R0, -offset); | 1597 AddImmediate(R0, -offset); |
1598 ldr(IP, FieldAddress(CODE_REG, Code::saved_instructions_offset())); | 1598 ldr(IP, FieldAddress(CODE_REG, Code::saved_instructions_offset())); |
1599 cmp(R0, Operand(IP)); | 1599 cmp(R0, Operand(IP)); |
1600 b(&instructions_ok, EQ); | 1600 b(&instructions_ok, EQ); |
1601 bkpt(1); | 1601 bkpt(1); |
1602 Bind(&instructions_ok); | 1602 Bind(&instructions_ok); |
1603 Pop(IP); | 1603 Pop(IP); |
1604 Pop(R0); | 1604 Pop(R0); |
1605 #endif | 1605 #endif |
1606 } | 1606 } |
1607 | 1607 |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3009 kWord, tmp2, src, | 3009 kWord, tmp2, src, |
3010 (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag); | 3010 (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag); |
3011 StoreToOffset(kWord, tmp1, dst, | 3011 StoreToOffset(kWord, tmp1, dst, |
3012 (Float64x2::value_offset() + 2 * kWordSize) - kHeapObjectTag); | 3012 (Float64x2::value_offset() + 2 * kWordSize) - kHeapObjectTag); |
3013 StoreToOffset(kWord, tmp2, dst, | 3013 StoreToOffset(kWord, tmp2, dst, |
3014 (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag); | 3014 (Float64x2::value_offset() + 3 * kWordSize) - kHeapObjectTag); |
3015 } | 3015 } |
3016 } | 3016 } |
3017 | 3017 |
3018 | 3018 |
3019 void Assembler::AddImmediate(Register rd, int32_t value, Condition cond) { | |
3020 AddImmediate(rd, rd, value, cond); | |
3021 } | |
3022 | |
3023 | |
3024 void Assembler::AddImmediate(Register rd, | 3019 void Assembler::AddImmediate(Register rd, |
3025 Register rn, | 3020 Register rn, |
3026 int32_t value, | 3021 int32_t value, |
3027 Condition cond) { | 3022 Condition cond) { |
3028 if (value == 0) { | 3023 if (value == 0) { |
3029 if (rd != rn) { | 3024 if (rd != rn) { |
3030 mov(rd, Operand(rn), cond); | 3025 mov(rd, Operand(rn), cond); |
3031 } | 3026 } |
3032 return; | 3027 return; |
3033 } | 3028 } |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3733 | 3728 |
3734 | 3729 |
3735 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3730 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
3736 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); | 3731 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); |
3737 return fpu_reg_names[reg]; | 3732 return fpu_reg_names[reg]; |
3738 } | 3733 } |
3739 | 3734 |
3740 } // namespace dart | 3735 } // namespace dart |
3741 | 3736 |
3742 #endif // defined TARGET_ARCH_ARM | 3737 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |