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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } | 499 } |
500 | 500 |
501 | 501 |
502 void Assembler::BranchLink(const ExternalLabel* label) { | 502 void Assembler::BranchLink(const ExternalLabel* label) { |
503 ASSERT(!in_delay_slot_); | 503 ASSERT(!in_delay_slot_); |
504 LoadImmediate(T9, label->address()); | 504 LoadImmediate(T9, label->address()); |
505 jalr(T9); | 505 jalr(T9); |
506 } | 506 } |
507 | 507 |
508 | 508 |
509 void Assembler::BranchLink(const ExternalLabel* label, Patchability patchable) { | |
510 ASSERT(!in_delay_slot_); | |
511 const int32_t offset = ObjectPool::element_offset( | |
512 object_pool_wrapper_.FindExternalLabel(label, patchable)); | |
513 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); | |
514 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); | |
515 jalr(T9); | |
516 if (patchable == kPatchable) { | |
517 delay_slot_available_ = false; // CodePatcher expects a nop. | |
518 } | |
519 } | |
520 | |
521 | |
522 void Assembler::BranchLink(const Code& target, Patchability patchable) { | 509 void Assembler::BranchLink(const Code& target, Patchability patchable) { |
523 ASSERT(!in_delay_slot_); | 510 ASSERT(!in_delay_slot_); |
524 const int32_t offset = ObjectPool::element_offset( | 511 const int32_t offset = ObjectPool::element_offset( |
525 object_pool_wrapper_.FindObject(target, patchable)); | 512 object_pool_wrapper_.FindObject(target, patchable)); |
526 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); | 513 LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag); |
527 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); | 514 lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset())); |
528 jalr(T9); | 515 jalr(T9); |
529 if (patchable == kPatchable) { | 516 if (patchable == kPatchable) { |
530 delay_slot_available_ = false; // CodePatcher expects a nop. | 517 delay_slot_available_ = false; // CodePatcher expects a nop. |
531 } | 518 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 void Assembler::LoadObject(Register rd, const Object& object) { | 576 void Assembler::LoadObject(Register rd, const Object& object) { |
590 LoadObjectHelper(rd, object, false); | 577 LoadObjectHelper(rd, object, false); |
591 } | 578 } |
592 | 579 |
593 | 580 |
594 void Assembler::LoadUniqueObject(Register rd, const Object& object) { | 581 void Assembler::LoadUniqueObject(Register rd, const Object& object) { |
595 LoadObjectHelper(rd, object, true); | 582 LoadObjectHelper(rd, object, true); |
596 } | 583 } |
597 | 584 |
598 | 585 |
599 void Assembler::LoadExternalLabel(Register rd, | |
600 const ExternalLabel* label, | |
601 Patchability patchable) { | |
602 const int32_t offset = ObjectPool::element_offset( | |
603 object_pool_wrapper_.FindExternalLabel(label, patchable)); | |
604 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); | |
605 } | |
606 | |
607 | |
608 void Assembler::LoadFunctionFromCalleePool(Register dst, | 586 void Assembler::LoadFunctionFromCalleePool(Register dst, |
609 const Function& function, | 587 const Function& function, |
610 Register new_pp) { | 588 Register new_pp) { |
611 const int32_t offset = | 589 const int32_t offset = |
612 ObjectPool::element_offset(object_pool_wrapper_.FindObject(function)); | 590 ObjectPool::element_offset(object_pool_wrapper_.FindObject(function)); |
613 LoadWordFromPoolOffset(dst, offset - kHeapObjectTag, new_pp); | 591 LoadWordFromPoolOffset(dst, offset - kHeapObjectTag, new_pp); |
614 } | 592 } |
615 | 593 |
616 | 594 |
617 void Assembler::LoadNativeEntry(Register rd, | 595 void Assembler::LoadNativeEntry(Register rd, |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 Label stop; | 1331 Label stop; |
1354 b(&stop); | 1332 b(&stop); |
1355 Emit(reinterpret_cast<int32_t>(message)); | 1333 Emit(reinterpret_cast<int32_t>(message)); |
1356 Bind(&stop); | 1334 Bind(&stop); |
1357 break_(Instr::kStopMessageCode); | 1335 break_(Instr::kStopMessageCode); |
1358 } | 1336 } |
1359 | 1337 |
1360 } // namespace dart | 1338 } // namespace dart |
1361 | 1339 |
1362 #endif // defined TARGET_ARCH_MIPS | 1340 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |