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

Side by Side Diff: runtime/vm/assembler_mips.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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 662
663 void Assembler::LoadClassId(Register result, Register object) { 663 void Assembler::LoadClassId(Register result, Register object) {
664 ASSERT(RawObject::kClassIdTagPos == 16); 664 ASSERT(RawObject::kClassIdTagPos == 16);
665 ASSERT(RawObject::kClassIdTagSize == 16); 665 ASSERT(RawObject::kClassIdTagSize == 16);
666 const intptr_t class_id_offset = Object::tags_offset() + 666 const intptr_t class_id_offset = Object::tags_offset() +
667 RawObject::kClassIdTagPos / kBitsPerByte; 667 RawObject::kClassIdTagPos / kBitsPerByte;
668 lhu(result, FieldAddress(object, class_id_offset)); 668 lhu(result, FieldAddress(object, class_id_offset));
669 } 669 }
670 670
671 671
672 void Assembler::LoadClassById(Register result, Register class_id) { 672 void Assembler::LoadClassById(Register result,
673 Register class_id,
674 Isolate* isolate) {
673 ASSERT(!in_delay_slot_); 675 ASSERT(!in_delay_slot_);
674 ASSERT(result != class_id); 676 ASSERT(result != class_id);
675 lw(result, FieldAddress(CTX, Context::isolate_offset())); 677 LoadImmediate(result, isolate->ClassTableAddress());
676 const intptr_t table_offset_in_isolate = 678 lw(result, Address(result, 0));
677 Isolate::class_table_offset() + ClassTable::table_offset();
678 lw(result, Address(result, table_offset_in_isolate));
679 sll(TMP, class_id, 2); 679 sll(TMP, class_id, 2);
680 addu(result, result, TMP); 680 addu(result, result, TMP);
681 lw(result, Address(result)); 681 lw(result, Address(result));
682 } 682 }
683 683
684 684
685 void Assembler::LoadClass(Register result, Register object) { 685 void Assembler::LoadClass(Register result, Register object, Isolate* isolate) {
686 ASSERT(!in_delay_slot_); 686 ASSERT(!in_delay_slot_);
687 ASSERT(TMP != result); 687 ASSERT(TMP != result);
688 LoadClassId(TMP, object); 688 LoadClassId(TMP, object);
689 689 LoadClassById(result, TMP, isolate);
690 lw(result, FieldAddress(CTX, Context::isolate_offset()));
691 const intptr_t table_offset_in_isolate =
692 Isolate::class_table_offset() + ClassTable::table_offset();
693 lw(result, Address(result, table_offset_in_isolate));
694 sll(TMP, TMP, 2);
695 addu(result, result, TMP);
696 lw(result, Address(result));
697 } 690 }
698 691
699 692
700 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { 693 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
701 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos; 694 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos;
702 695
703 LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1); 696 LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1);
704 andi(CMPRES1, object, Immediate(kSmiTagMask)); 697 andi(CMPRES1, object, Immediate(kSmiTagMask));
705 if (result != object) { 698 if (result != object) {
706 mov(result, object); 699 mov(result, object);
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 Emit(reinterpret_cast<int32_t>(message)); 1230 Emit(reinterpret_cast<int32_t>(message));
1238 Bind(&msg); 1231 Bind(&msg);
1239 break_(Instr::kMsgMessageCode); 1232 break_(Instr::kMsgMessageCode);
1240 } 1233 }
1241 #endif 1234 #endif
1242 } 1235 }
1243 1236
1244 } // namespace dart 1237 } // namespace dart
1245 1238
1246 #endif // defined TARGET_ARCH_MIPS 1239 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698