| 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/runtime_entry.h" | 9 #include "vm/runtime_entry.h" |
| 10 #include "vm/simulator.h" | 10 #include "vm/simulator.h" |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 addiu(FP, SP, Immediate(kWordSize)); | 479 addiu(FP, SP, Immediate(kWordSize)); |
| 480 | 480 |
| 481 // Load the pool pointer. offset has already been subtracted from TMP1. | 481 // Load the pool pointer. offset has already been subtracted from TMP1. |
| 482 lw(PP, Address(TMP1, -object_pool_pc_dist + offset)); | 482 lw(PP, Address(TMP1, -object_pool_pc_dist + offset)); |
| 483 | 483 |
| 484 // Reserve space for locals. | 484 // Reserve space for locals. |
| 485 AddImmediate(SP, -frame_size); | 485 AddImmediate(SP, -frame_size); |
| 486 } | 486 } |
| 487 | 487 |
| 488 | 488 |
| 489 void Assembler::LeaveDartFrame() { |
| 490 addiu(SP, FP, Immediate(-kWordSize)); |
| 491 |
| 492 lw(RA, Address(SP, 2 * kWordSize)); |
| 493 lw(FP, Address(SP, 1 * kWordSize)); |
| 494 lw(PP, Address(SP, 0 * kWordSize)); |
| 495 |
| 496 // Adjust SP for PC, RA, FP, PP pushed in EnterDartFrame. |
| 497 addiu(SP, SP, Immediate(4 * kWordSize)); |
| 498 } |
| 499 |
| 500 |
| 489 void Assembler::LeaveDartFrameAndReturn() { | 501 void Assembler::LeaveDartFrameAndReturn() { |
| 490 addiu(SP, FP, Immediate(-kWordSize)); | 502 addiu(SP, FP, Immediate(-kWordSize)); |
| 491 | 503 |
| 492 lw(RA, Address(SP, 2 * kWordSize)); | 504 lw(RA, Address(SP, 2 * kWordSize)); |
| 493 lw(FP, Address(SP, 1 * kWordSize)); | 505 lw(FP, Address(SP, 1 * kWordSize)); |
| 494 lw(PP, Address(SP, 0 * kWordSize)); | 506 lw(PP, Address(SP, 0 * kWordSize)); |
| 495 | 507 |
| 496 // Adjust SP for PC pushed in EnterDartFrame, and return. | 508 // Adjust SP for PC, RA, FP, PP pushed in EnterDartFrame, and return. |
| 497 Ret(); | 509 Ret(); |
| 498 delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize)); | 510 delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize)); |
| 499 } | 511 } |
| 500 | 512 |
| 501 | 513 |
| 502 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { | 514 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { |
| 503 // Reserve space for arguments and align frame before entering | 515 // Reserve space for arguments and align frame before entering |
| 504 // the C++ world. | 516 // the C++ world. |
| 505 AddImmediate(SP, -frame_space); | 517 AddImmediate(SP, -frame_space); |
| 506 if (OS::ActivationFrameAlignment() > 0) { | 518 if (OS::ActivationFrameAlignment() > 0) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 Bind(&msg); | 663 Bind(&msg); |
| 652 break_(Instr::kMsgMessageCode); | 664 break_(Instr::kMsgMessageCode); |
| 653 } | 665 } |
| 654 #endif | 666 #endif |
| 655 } | 667 } |
| 656 | 668 |
| 657 } // namespace dart | 669 } // namespace dart |
| 658 | 670 |
| 659 #endif // defined TARGET_ARCH_MIPS | 671 #endif // defined TARGET_ARCH_MIPS |
| 660 | 672 |
| OLD | NEW |