| 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" | 5 #include "vm/globals.h" |
| 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 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1678 | 1678 |
| 1679 | 1679 |
| 1680 void Assembler::CompareClassId(Register object, | 1680 void Assembler::CompareClassId(Register object, |
| 1681 intptr_t class_id, | 1681 intptr_t class_id, |
| 1682 Register scratch) { | 1682 Register scratch) { |
| 1683 LoadClassId(scratch, object); | 1683 LoadClassId(scratch, object); |
| 1684 CompareImmediate(scratch, class_id); | 1684 CompareImmediate(scratch, class_id); |
| 1685 } | 1685 } |
| 1686 | 1686 |
| 1687 | 1687 |
| 1688 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
| 1689 tst(object, Operand(kSmiTagMask)); |
| 1690 LoadImmediate(result, Smi::RawValue(kSmiCid), EQ); |
| 1691 LoadClassId(result, object, NE); |
| 1692 SmiTag(result, NE); |
| 1693 } |
| 1694 |
| 1695 |
| 1688 static bool CanEncodeBranchOffset(int32_t offset) { | 1696 static bool CanEncodeBranchOffset(int32_t offset) { |
| 1689 ASSERT(Utils::IsAligned(offset, 4)); | 1697 ASSERT(Utils::IsAligned(offset, 4)); |
| 1690 return Utils::IsInt(Utils::CountOneBits(kBranchOffsetMask), offset); | 1698 return Utils::IsInt(Utils::CountOneBits(kBranchOffsetMask), offset); |
| 1691 } | 1699 } |
| 1692 | 1700 |
| 1693 | 1701 |
| 1694 int32_t Assembler::EncodeBranchOffset(int32_t offset, int32_t inst) { | 1702 int32_t Assembler::EncodeBranchOffset(int32_t offset, int32_t inst) { |
| 1695 // The offset is off by 8 due to the way the ARM CPUs read PC. | 1703 // The offset is off by 8 due to the way the ARM CPUs read PC. |
| 1696 offset -= Instr::kPCReadOffset; | 1704 offset -= Instr::kPCReadOffset; |
| 1697 | 1705 |
| (...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3191 | 3199 |
| 3192 | 3200 |
| 3193 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3201 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3194 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); | 3202 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); |
| 3195 return fpu_reg_names[reg]; | 3203 return fpu_reg_names[reg]; |
| 3196 } | 3204 } |
| 3197 | 3205 |
| 3198 } // namespace dart | 3206 } // namespace dart |
| 3199 | 3207 |
| 3200 #endif // defined TARGET_ARCH_ARM | 3208 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |