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/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 __ Pop(V1); // Restore stacktrace. | 540 __ Pop(V1); // Restore stacktrace. |
541 __ Pop(V0); // Restore exception. | 541 __ Pop(V0); // Restore exception. |
542 } | 542 } |
543 __ LeaveStubFrame(); | 543 __ LeaveStubFrame(); |
544 // Remove materialization arguments. | 544 // Remove materialization arguments. |
545 __ SmiUntag(T1); | 545 __ SmiUntag(T1); |
546 __ addu(SP, SP, T1); | 546 __ addu(SP, SP, T1); |
547 __ Ret(); | 547 __ Ret(); |
548 } | 548 } |
549 | 549 |
550 // RA: return address + call-instruction-size | |
551 // V0: result, must be preserved | 550 // V0: result, must be preserved |
552 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 551 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { |
553 // Correct return address to point just after the call that is being | |
554 // deoptimized. | |
555 __ AddImmediate(RA, -CallPattern::kDeoptCallLengthInBytes); | |
556 // Push zap value instead of CODE_REG for lazy deopt. | 552 // Push zap value instead of CODE_REG for lazy deopt. |
557 __ LoadImmediate(TMP, 0xf1f1f1f1); | 553 __ LoadImmediate(TMP, 0xf1f1f1f1); |
558 __ Push(TMP); | 554 __ Push(TMP); |
| 555 // Return address for "call" to deopt stub. |
| 556 __ LoadImmediate(RA, 0xe1e1e1e1); |
| 557 __ lw(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset())); |
559 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); | 558 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
560 } | 559 } |
561 | 560 |
562 | 561 |
563 // RA: return address + call-instruction-size | |
564 // V0: exception, must be preserved | 562 // V0: exception, must be preserved |
565 // V1: stacktrace, must be preserved | 563 // V1: stacktrace, must be preserved |
566 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { | 564 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { |
567 // Correct return address to point just after the call that is being | |
568 // deoptimized. | |
569 __ AddImmediate(RA, -CallPattern::kDeoptCallLengthInBytes); | |
570 // Push zap value instead of CODE_REG for lazy deopt. | 565 // Push zap value instead of CODE_REG for lazy deopt. |
571 __ LoadImmediate(TMP, 0xf1f1f1f1); | 566 __ LoadImmediate(TMP, 0xf1f1f1f1); |
572 __ Push(TMP); | 567 __ Push(TMP); |
| 568 // Return address for "call" to deopt stub. |
| 569 __ LoadImmediate(RA, 0xe1e1e1e1); |
| 570 __ lw(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset())); |
573 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); | 571 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
574 } | 572 } |
575 | 573 |
576 | 574 |
577 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 575 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
578 GenerateDeoptimizationSequence(assembler, kEagerDeopt); | 576 GenerateDeoptimizationSequence(assembler, kEagerDeopt); |
579 } | 577 } |
580 | 578 |
581 | 579 |
582 static void GenerateDispatcherCode(Assembler* assembler, | 580 static void GenerateDispatcherCode(Assembler* assembler, |
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2391 } | 2389 } |
2392 | 2390 |
2393 | 2391 |
2394 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2392 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2395 __ break_(0); | 2393 __ break_(0); |
2396 } | 2394 } |
2397 | 2395 |
2398 } // namespace dart | 2396 } // namespace dart |
2399 | 2397 |
2400 #endif // defined TARGET_ARCH_MIPS | 2398 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |