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_X64) | 6 #if defined(TARGET_ARCH_X64) |
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/heap.h" | 10 #include "vm/heap.h" |
(...skipping 3763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3774 ASSERT(RawObject::kClassIdTagSize == kBitsPerInt32); | 3774 ASSERT(RawObject::kClassIdTagSize == kBitsPerInt32); |
3775 ASSERT(sizeof(classid_t) == sizeof(uint32_t)); | 3775 ASSERT(sizeof(classid_t) == sizeof(uint32_t)); |
3776 const intptr_t class_id_offset = Object::tags_offset() + | 3776 const intptr_t class_id_offset = Object::tags_offset() + |
3777 RawObject::kClassIdTagPos / kBitsPerByte; | 3777 RawObject::kClassIdTagPos / kBitsPerByte; |
3778 movl(result, FieldAddress(object, class_id_offset)); | 3778 movl(result, FieldAddress(object, class_id_offset)); |
3779 } | 3779 } |
3780 | 3780 |
3781 | 3781 |
3782 void Assembler::LoadClassById(Register result, Register class_id, Register pp) { | 3782 void Assembler::LoadClassById(Register result, Register class_id, Register pp) { |
3783 ASSERT(result != class_id); | 3783 ASSERT(result != class_id); |
3784 Isolate* isolate = Isolate::Current(); | 3784 LoadIsolate(result); |
3785 LoadImmediate(result, Immediate(isolate->class_table()->TableAddress()), pp); | 3785 const intptr_t offset = |
3786 movq(result, Address(result, 0)); | 3786 Isolate::class_table_offset() + ClassTable::table_offset(); |
| 3787 movq(result, Address(result, offset)); |
3787 movq(result, Address(result, class_id, TIMES_8, 0)); | 3788 movq(result, Address(result, class_id, TIMES_8, 0)); |
3788 } | 3789 } |
3789 | 3790 |
3790 | 3791 |
3791 void Assembler::LoadClass(Register result, Register object, Register pp) { | 3792 void Assembler::LoadClass(Register result, Register object, Register pp) { |
3792 LoadClassId(TMP, object); | 3793 LoadClassId(TMP, object); |
3793 LoadClassById(result, TMP, pp); | 3794 LoadClassById(result, TMP, pp); |
3794 } | 3795 } |
3795 | 3796 |
3796 | 3797 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3958 | 3959 |
3959 | 3960 |
3960 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3961 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
3961 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3962 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
3962 return xmm_reg_names[reg]; | 3963 return xmm_reg_names[reg]; |
3963 } | 3964 } |
3964 | 3965 |
3965 } // namespace dart | 3966 } // namespace dart |
3966 | 3967 |
3967 #endif // defined TARGET_ARCH_X64 | 3968 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |