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 |
550 // V0: result, must be preserved | 551 // V0: result, must be preserved |
551 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 552 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); |
552 // Push zap value instead of CODE_REG for lazy deopt. | 556 // Push zap value instead of CODE_REG for lazy deopt. |
553 __ LoadImmediate(TMP, 0xf1f1f1f1); | 557 __ LoadImmediate(TMP, 0xf1f1f1f1); |
554 __ Push(TMP); | 558 __ 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())); | |
558 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); | 559 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
559 } | 560 } |
560 | 561 |
561 | 562 |
| 563 // RA: return address + call-instruction-size |
562 // V0: exception, must be preserved | 564 // V0: exception, must be preserved |
563 // V1: stacktrace, must be preserved | 565 // V1: stacktrace, must be preserved |
564 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { | 566 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); |
565 // Push zap value instead of CODE_REG for lazy deopt. | 570 // Push zap value instead of CODE_REG for lazy deopt. |
566 __ LoadImmediate(TMP, 0xf1f1f1f1); | 571 __ LoadImmediate(TMP, 0xf1f1f1f1); |
567 __ Push(TMP); | 572 __ 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())); | |
571 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); | 573 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
572 } | 574 } |
573 | 575 |
574 | 576 |
575 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 577 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
576 GenerateDeoptimizationSequence(assembler, kEagerDeopt); | 578 GenerateDeoptimizationSequence(assembler, kEagerDeopt); |
577 } | 579 } |
578 | 580 |
579 | 581 |
580 static void GenerateDispatcherCode(Assembler* assembler, | 582 static void GenerateDispatcherCode(Assembler* assembler, |
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2389 } | 2391 } |
2390 | 2392 |
2391 | 2393 |
2392 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2394 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2393 __ break_(0); | 2395 __ break_(0); |
2394 } | 2396 } |
2395 | 2397 |
2396 } // namespace dart | 2398 } // namespace dart |
2397 | 2399 |
2398 #endif // defined TARGET_ARCH_MIPS | 2400 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |