Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: runtime/vm/assembler_ia32.cc

Issue 605533003: Make subtype test stubs isolate-specific. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 2729
2730 void Assembler::LoadClassId(Register result, Register object) { 2730 void Assembler::LoadClassId(Register result, Register object) {
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,
2740 Register class_id,
2741 Isolate* isolate) {
2740 ASSERT(result != class_id); 2742 ASSERT(result != class_id);
2741 movl(result, FieldAddress(CTX, Context::isolate_offset())); 2743 movl(result, Address::Absolute(isolate->ClassTableAddress()));
2742 const intptr_t table_offset_in_isolate =
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)); 2744 movl(result, Address(result, class_id, TIMES_4, 0));
2746 } 2745 }
2747 2746
2748 2747
2749 void Assembler::LoadClass(Register result, 2748 void Assembler::LoadClass(Register result,
2750 Register object, 2749 Register object,
2751 Register scratch) { 2750 Register scratch,
2751 Isolate* isolate) {
2752 ASSERT(scratch != result); 2752 ASSERT(scratch != result);
2753 LoadClassId(scratch, object); 2753 LoadClassId(scratch, object);
2754 2754 LoadClassById(result, scratch, isolate);
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 } 2755 }
2761 2756
2762 2757
2763 void Assembler::CompareClassId(Register object, 2758 void Assembler::CompareClassId(Register object,
2764 intptr_t class_id, 2759 intptr_t class_id,
2765 Register scratch) { 2760 Register scratch) {
2766 LoadClassId(scratch, object); 2761 LoadClassId(scratch, object);
2767 cmpl(scratch, Immediate(class_id)); 2762 cmpl(scratch, Immediate(class_id));
2768 } 2763 }
2769 2764
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 2871
2877 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2872 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2878 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 2873 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
2879 return xmm_reg_names[reg]; 2874 return xmm_reg_names[reg];
2880 } 2875 }
2881 2876
2882 2877
2883 } // namespace dart 2878 } // namespace dart
2884 2879
2885 #endif // defined TARGET_ARCH_IA32 2880 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698