Chromium Code Reviews| 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 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1721 | 1721 |
| 1722 void Assembler::LoadClassId(Register result, Register object, Condition cond) { | 1722 void Assembler::LoadClassId(Register result, Register object, Condition cond) { |
| 1723 ASSERT(RawObject::kClassIdTagPos == 16); | 1723 ASSERT(RawObject::kClassIdTagPos == 16); |
| 1724 ASSERT(RawObject::kClassIdTagSize == 16); | 1724 ASSERT(RawObject::kClassIdTagSize == 16); |
| 1725 const intptr_t class_id_offset = Object::tags_offset() + | 1725 const intptr_t class_id_offset = Object::tags_offset() + |
| 1726 RawObject::kClassIdTagPos / kBitsPerByte; | 1726 RawObject::kClassIdTagPos / kBitsPerByte; |
| 1727 ldrh(result, FieldAddress(object, class_id_offset), cond); | 1727 ldrh(result, FieldAddress(object, class_id_offset), cond); |
| 1728 } | 1728 } |
| 1729 | 1729 |
| 1730 | 1730 |
| 1731 void Assembler::LoadClassById(Register result, Register class_id) { | 1731 void Assembler::LoadClassById(Register result, |
| 1732 Register class_id, | |
| 1733 Isolate* isolate) { | |
|
Vyacheslav Egorov (Google)
2014/09/26 13:09:43
Can we make isolate member of the assembler?
Florian Schneider
2014/09/26 14:05:02
Yes, this would be a bigger change (since we shoul
| |
| 1732 ASSERT(result != class_id); | 1734 ASSERT(result != class_id); |
| 1733 ldr(result, FieldAddress(CTX, Context::isolate_offset())); | 1735 LoadImmediate(result, isolate->ClassTableAddress()); |
| 1734 const intptr_t table_offset_in_isolate = | 1736 LoadFromOffset(kWord, result, result, 0); |
| 1735 Isolate::class_table_offset() + ClassTable::table_offset(); | |
| 1736 LoadFromOffset(kWord, result, result, table_offset_in_isolate); | |
| 1737 ldr(result, Address(result, class_id, LSL, 2)); | 1737 ldr(result, Address(result, class_id, LSL, 2)); |
| 1738 } | 1738 } |
| 1739 | 1739 |
| 1740 | 1740 |
| 1741 void Assembler::LoadClass(Register result, Register object, Register scratch) { | 1741 void Assembler::LoadClass(Register result, |
| 1742 Register object, | |
| 1743 Register scratch, | |
| 1744 Isolate* isolate) { | |
| 1742 ASSERT(scratch != result); | 1745 ASSERT(scratch != result); |
| 1743 LoadClassId(scratch, object); | 1746 LoadClassId(scratch, object); |
| 1744 | 1747 LoadClassById(result, scratch, isolate); |
| 1745 ldr(result, FieldAddress(CTX, Context::isolate_offset())); | |
| 1746 const intptr_t table_offset_in_isolate = | |
| 1747 Isolate::class_table_offset() + ClassTable::table_offset(); | |
| 1748 LoadFromOffset(kWord, result, result, table_offset_in_isolate); | |
| 1749 ldr(result, Address(result, scratch, LSL, 2)); | |
| 1750 } | 1748 } |
| 1751 | 1749 |
| 1752 | 1750 |
| 1753 void Assembler::CompareClassId(Register object, | 1751 void Assembler::CompareClassId(Register object, |
| 1754 intptr_t class_id, | 1752 intptr_t class_id, |
| 1755 Register scratch) { | 1753 Register scratch) { |
| 1756 LoadClassId(scratch, object); | 1754 LoadClassId(scratch, object); |
| 1757 CompareImmediate(scratch, class_id); | 1755 CompareImmediate(scratch, class_id); |
| 1758 } | 1756 } |
| 1759 | 1757 |
| (...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3421 | 3419 |
| 3422 | 3420 |
| 3423 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3421 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3424 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); | 3422 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); |
| 3425 return fpu_reg_names[reg]; | 3423 return fpu_reg_names[reg]; |
| 3426 } | 3424 } |
| 3427 | 3425 |
| 3428 } // namespace dart | 3426 } // namespace dart |
| 3429 | 3427 |
| 3430 #endif // defined TARGET_ARCH_ARM | 3428 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |