| 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_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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, Register class_id) { |
| 673 ASSERT(!in_delay_slot_); | 673 ASSERT(!in_delay_slot_); |
| 674 ASSERT(result != class_id); | 674 ASSERT(result != class_id); |
| 675 lw(result, FieldAddress(CTX, Context::isolate_offset())); | 675 LoadImmediate(result, Isolate::Current()->class_table()->TableAddress()); |
| 676 const intptr_t table_offset_in_isolate = | 676 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); | 677 sll(TMP, class_id, 2); |
| 680 addu(result, result, TMP); | 678 addu(result, result, TMP); |
| 681 lw(result, Address(result)); | 679 lw(result, Address(result)); |
| 682 } | 680 } |
| 683 | 681 |
| 684 | 682 |
| 685 void Assembler::LoadClass(Register result, Register object) { | 683 void Assembler::LoadClass(Register result, Register object) { |
| 686 ASSERT(!in_delay_slot_); | 684 ASSERT(!in_delay_slot_); |
| 687 ASSERT(TMP != result); | 685 ASSERT(TMP != result); |
| 688 LoadClassId(TMP, object); | 686 LoadClassId(TMP, object); |
| 689 | 687 LoadClassById(result, TMP); |
| 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 } | 688 } |
| 698 | 689 |
| 699 | 690 |
| 700 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { | 691 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
| 701 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos; | 692 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos; |
| 702 | 693 |
| 703 LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1); | 694 LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1); |
| 704 andi(CMPRES1, object, Immediate(kSmiTagMask)); | 695 andi(CMPRES1, object, Immediate(kSmiTagMask)); |
| 705 if (result != object) { | 696 if (result != object) { |
| 706 mov(result, object); | 697 mov(result, object); |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 Emit(reinterpret_cast<int32_t>(message)); | 1228 Emit(reinterpret_cast<int32_t>(message)); |
| 1238 Bind(&msg); | 1229 Bind(&msg); |
| 1239 break_(Instr::kMsgMessageCode); | 1230 break_(Instr::kMsgMessageCode); |
| 1240 } | 1231 } |
| 1241 #endif | 1232 #endif |
| 1242 } | 1233 } |
| 1243 | 1234 |
| 1244 } // namespace dart | 1235 } // namespace dart |
| 1245 | 1236 |
| 1246 #endif // defined TARGET_ARCH_MIPS | 1237 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |