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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 3005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 ASSERT(RawObject::kClassIdTagPos == 16); | 3016 ASSERT(RawObject::kClassIdTagPos == 16); |
3017 ASSERT(RawObject::kClassIdTagSize == 16); | 3017 ASSERT(RawObject::kClassIdTagSize == 16); |
3018 const intptr_t class_id_offset = Object::tags_offset() + | 3018 const intptr_t class_id_offset = Object::tags_offset() + |
3019 RawObject::kClassIdTagPos / kBitsPerByte; | 3019 RawObject::kClassIdTagPos / kBitsPerByte; |
3020 movzxw(result, FieldAddress(object, class_id_offset)); | 3020 movzxw(result, FieldAddress(object, class_id_offset)); |
3021 } | 3021 } |
3022 | 3022 |
3023 | 3023 |
3024 void Assembler::LoadClassById(Register result, Register class_id) { | 3024 void Assembler::LoadClassById(Register result, Register class_id) { |
3025 ASSERT(result != class_id); | 3025 ASSERT(result != class_id); |
3026 movl(result, | 3026 LoadIsolate(result); |
3027 Address::Absolute(Isolate::Current()->class_table()->TableAddress())); | 3027 const intptr_t offset = |
| 3028 Isolate::class_table_offset() + ClassTable::table_offset(); |
| 3029 movl(result, Address(result, offset)); |
3028 movl(result, Address(result, class_id, TIMES_4, 0)); | 3030 movl(result, Address(result, class_id, TIMES_4, 0)); |
3029 } | 3031 } |
3030 | 3032 |
3031 | 3033 |
3032 void Assembler::LoadClass(Register result, Register object, Register scratch) { | 3034 void Assembler::LoadClass(Register result, Register object, Register scratch) { |
3033 ASSERT(scratch != result); | 3035 ASSERT(scratch != result); |
3034 LoadClassId(scratch, object); | 3036 LoadClassId(scratch, object); |
3035 LoadClassById(result, scratch); | 3037 LoadClassById(result, scratch); |
3036 } | 3038 } |
3037 | 3039 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 | 3199 |
3198 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3200 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
3199 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3201 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
3200 return xmm_reg_names[reg]; | 3202 return xmm_reg_names[reg]; |
3201 } | 3203 } |
3202 | 3204 |
3203 | 3205 |
3204 } // namespace dart | 3206 } // namespace dart |
3205 | 3207 |
3206 #endif // defined TARGET_ARCH_IA32 | 3208 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |