| 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_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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 object_pool_wrapper_.FindObject(target, equivalence)); | 541 object_pool_wrapper_.FindObject(target, equivalence)); |
| 542 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); | 542 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); |
| 543 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); | 543 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); |
| 544 jalr(T9); | 544 jalr(T9); |
| 545 delay_slot_available_ = false; // CodePatcher expects a nop. | 545 delay_slot_available_ = false; // CodePatcher expects a nop. |
| 546 } | 546 } |
| 547 | 547 |
| 548 | 548 |
| 549 bool Assembler::CanLoadFromObjectPool(const Object& object) const { | 549 bool Assembler::CanLoadFromObjectPool(const Object& object) const { |
| 550 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 550 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 551 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
| 551 ASSERT(!Thread::CanLoadFromThread(object)); | 552 ASSERT(!Thread::CanLoadFromThread(object)); |
| 552 if (!constant_pool_allowed()) { | 553 if (!constant_pool_allowed()) { |
| 553 return false; | 554 return false; |
| 554 } | 555 } |
| 555 | 556 |
| 556 ASSERT(object.IsNotTemporaryScopedHandle()); | 557 ASSERT(object.IsNotTemporaryScopedHandle()); |
| 557 ASSERT(object.IsOld()); | 558 ASSERT(object.IsOld()); |
| 558 return true; | 559 return true; |
| 559 } | 560 } |
| 560 | 561 |
| 561 | 562 |
| 562 void Assembler::LoadObjectHelper(Register rd, | 563 void Assembler::LoadObjectHelper(Register rd, |
| 563 const Object& object, | 564 const Object& object, |
| 564 bool is_unique) { | 565 bool is_unique) { |
| 565 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 566 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 567 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
| 566 ASSERT(!in_delay_slot_); | 568 ASSERT(!in_delay_slot_); |
| 567 if (Thread::CanLoadFromThread(object)) { | 569 if (Thread::CanLoadFromThread(object)) { |
| 568 // Load common VM constants from the thread. This works also in places where | 570 // Load common VM constants from the thread. This works also in places where |
| 569 // no constant pool is set up (e.g. intrinsic code). | 571 // no constant pool is set up (e.g. intrinsic code). |
| 570 lw(rd, Address(THR, Thread::OffsetFromThread(object))); | 572 lw(rd, Address(THR, Thread::OffsetFromThread(object))); |
| 571 } else if (object.IsSmi()) { | 573 } else if (object.IsSmi()) { |
| 572 // Relocation doesn't apply to Smis. | 574 // Relocation doesn't apply to Smis. |
| 573 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); | 575 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); |
| 574 } else if (CanLoadFromObjectPool(object)) { | 576 } else if (CanLoadFromObjectPool(object)) { |
| 575 // Make sure that class CallPattern is able to decode this load from the | 577 // Make sure that class CallPattern is able to decode this load from the |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 const ExternalLabel* label, | 616 const ExternalLabel* label, |
| 615 Patchability patchable) { | 617 Patchability patchable) { |
| 616 const int32_t offset = ObjectPool::element_offset( | 618 const int32_t offset = ObjectPool::element_offset( |
| 617 object_pool_wrapper_.FindNativeEntry(label, patchable)); | 619 object_pool_wrapper_.FindNativeEntry(label, patchable)); |
| 618 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); | 620 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); |
| 619 } | 621 } |
| 620 | 622 |
| 621 | 623 |
| 622 void Assembler::PushObject(const Object& object) { | 624 void Assembler::PushObject(const Object& object) { |
| 623 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); | 625 ASSERT(!object.IsICData() || ICData::Cast(object).IsOriginal()); |
| 626 ASSERT(!object.IsField() || Field::Cast(object).IsOriginal()); |
| 624 ASSERT(!in_delay_slot_); | 627 ASSERT(!in_delay_slot_); |
| 625 LoadObject(TMP, object); | 628 LoadObject(TMP, object); |
| 626 Push(TMP); | 629 Push(TMP); |
| 627 } | 630 } |
| 628 | 631 |
| 629 | 632 |
| 630 // Preserves object and value registers. | 633 // Preserves object and value registers. |
| 631 void Assembler::StoreIntoObjectFilterNoSmi(Register object, | 634 void Assembler::StoreIntoObjectFilterNoSmi(Register object, |
| 632 Register value, | 635 Register value, |
| 633 Label* no_update) { | 636 Label* no_update) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 AddImmediate(TMP, object, offset - kHeapObjectTag); | 744 AddImmediate(TMP, object, offset - kHeapObjectTag); |
| 742 StoreIntoObjectNoBarrier(object, Address(TMP), value); | 745 StoreIntoObjectNoBarrier(object, Address(TMP), value); |
| 743 } | 746 } |
| 744 } | 747 } |
| 745 | 748 |
| 746 | 749 |
| 747 void Assembler::StoreIntoObjectNoBarrier(Register object, | 750 void Assembler::StoreIntoObjectNoBarrier(Register object, |
| 748 const Address& dest, | 751 const Address& dest, |
| 749 const Object& value) { | 752 const Object& value) { |
| 750 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal()); | 753 ASSERT(!value.IsICData() || ICData::Cast(value).IsOriginal()); |
| 754 ASSERT(!value.IsField() || Field::Cast(value).IsOriginal()); |
| 751 ASSERT(!in_delay_slot_); | 755 ASSERT(!in_delay_slot_); |
| 752 ASSERT(value.IsSmi() || value.InVMHeap() || | 756 ASSERT(value.IsSmi() || value.InVMHeap() || |
| 753 (value.IsOld() && value.IsNotTemporaryScopedHandle())); | 757 (value.IsOld() && value.IsNotTemporaryScopedHandle())); |
| 754 // No store buffer update. | 758 // No store buffer update. |
| 755 LoadObject(TMP, value); | 759 LoadObject(TMP, value); |
| 756 sw(TMP, dest); | 760 sw(TMP, dest); |
| 757 } | 761 } |
| 758 | 762 |
| 759 | 763 |
| 760 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, | 764 void Assembler::StoreIntoObjectNoBarrierOffset(Register object, |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1351 Label stop; | 1355 Label stop; |
| 1352 b(&stop); | 1356 b(&stop); |
| 1353 Emit(reinterpret_cast<int32_t>(message)); | 1357 Emit(reinterpret_cast<int32_t>(message)); |
| 1354 Bind(&stop); | 1358 Bind(&stop); |
| 1355 break_(Instr::kStopMessageCode); | 1359 break_(Instr::kStopMessageCode); |
| 1356 } | 1360 } |
| 1357 | 1361 |
| 1358 } // namespace dart | 1362 } // namespace dart |
| 1359 | 1363 |
| 1360 #endif // defined TARGET_ARCH_MIPS | 1364 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |