| 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_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 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 ASSERT(RawObject::kClassIdTagPos == 16); | 2731 ASSERT(RawObject::kClassIdTagPos == 16); |
| 2732 ASSERT(RawObject::kClassIdTagSize == 16); | 2732 ASSERT(RawObject::kClassIdTagSize == 16); |
| 2733 const intptr_t class_id_offset = Object::tags_offset() + | 2733 const intptr_t class_id_offset = Object::tags_offset() + |
| 2734 RawObject::kClassIdTagPos / kBitsPerByte; | 2734 RawObject::kClassIdTagPos / kBitsPerByte; |
| 2735 movzxw(result, FieldAddress(object, class_id_offset)); | 2735 movzxw(result, FieldAddress(object, class_id_offset)); |
| 2736 } | 2736 } |
| 2737 | 2737 |
| 2738 | 2738 |
| 2739 void Assembler::LoadClassById(Register result, Register class_id) { | 2739 void Assembler::LoadClassById(Register result, Register class_id) { |
| 2740 ASSERT(result != class_id); | 2740 ASSERT(result != class_id); |
| 2741 movl(result, FieldAddress(CTX, Context::isolate_offset())); | 2741 movl(result, |
| 2742 const intptr_t table_offset_in_isolate = | 2742 Address::Absolute(Isolate::Current()->class_table()->TableAddress())); |
| 2743 Isolate::class_table_offset() + ClassTable::table_offset(); | |
| 2744 movl(result, Address(result, table_offset_in_isolate)); | |
| 2745 movl(result, Address(result, class_id, TIMES_4, 0)); | 2743 movl(result, Address(result, class_id, TIMES_4, 0)); |
| 2746 } | 2744 } |
| 2747 | 2745 |
| 2748 | 2746 |
| 2749 void Assembler::LoadClass(Register result, | 2747 void Assembler::LoadClass(Register result, Register object, Register scratch) { |
| 2750 Register object, | |
| 2751 Register scratch) { | |
| 2752 ASSERT(scratch != result); | 2748 ASSERT(scratch != result); |
| 2753 LoadClassId(scratch, object); | 2749 LoadClassId(scratch, object); |
| 2754 | 2750 LoadClassById(result, scratch); |
| 2755 movl(result, FieldAddress(CTX, Context::isolate_offset())); | |
| 2756 const intptr_t table_offset_in_isolate = | |
| 2757 Isolate::class_table_offset() + ClassTable::table_offset(); | |
| 2758 movl(result, Address(result, table_offset_in_isolate)); | |
| 2759 movl(result, Address(result, scratch, TIMES_4, 0)); | |
| 2760 } | 2751 } |
| 2761 | 2752 |
| 2762 | 2753 |
| 2763 void Assembler::CompareClassId(Register object, | 2754 void Assembler::CompareClassId(Register object, |
| 2764 intptr_t class_id, | 2755 intptr_t class_id, |
| 2765 Register scratch) { | 2756 Register scratch) { |
| 2766 LoadClassId(scratch, object); | 2757 LoadClassId(scratch, object); |
| 2767 cmpl(scratch, Immediate(class_id)); | 2758 cmpl(scratch, Immediate(class_id)); |
| 2768 } | 2759 } |
| 2769 | 2760 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2876 | 2867 |
| 2877 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 2868 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 2878 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2869 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 2879 return xmm_reg_names[reg]; | 2870 return xmm_reg_names[reg]; |
| 2880 } | 2871 } |
| 2881 | 2872 |
| 2882 | 2873 |
| 2883 } // namespace dart | 2874 } // namespace dart |
| 2884 | 2875 |
| 2885 #endif // defined TARGET_ARCH_IA32 | 2876 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |