OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 __ movq(Address(RSP, 0), RCX); | 537 __ movq(Address(RSP, 0), RCX); |
538 | 538 |
539 __ EnterFrame(0); | 539 __ EnterFrame(0); |
540 __ movq(RCX, RSP); // Get last FP address. | 540 __ movq(RCX, RSP); // Get last FP address. |
541 if (preserve_rax) { | 541 if (preserve_rax) { |
542 __ pushq(RBX); // Preserve result. | 542 __ pushq(RBX); // Preserve result. |
543 } | 543 } |
544 __ ReserveAlignedFrameSpace(0); | 544 __ ReserveAlignedFrameSpace(0); |
545 __ movq(RDI, RCX); // Set up argument 1 last_fp. | 545 __ movq(RDI, RCX); // Set up argument 1 last_fp. |
546 __ CallRuntime(kDeoptimizeFillFrameRuntimeEntry); | 546 __ CallRuntime(kDeoptimizeFillFrameRuntimeEntry); |
| 547 // Result (RAX) is our FP. |
547 if (preserve_rax) { | 548 if (preserve_rax) { |
548 // Restore result into RAX. | 549 // Restore result into RBX. |
549 __ movq(RAX, Address(RBP, -1 * kWordSize)); | 550 __ movq(RBX, Address(RBP, -1 * kWordSize)); |
550 } | 551 } |
551 // Code above cannot cause GC. | 552 // Code above cannot cause GC. |
552 __ LeaveFrame(); | 553 __ LeaveFrame(); |
| 554 __ movq(RBP, RAX); |
553 | 555 |
554 // Frame is fully rewritten at this point and it is safe to perform a GC. | 556 // Frame is fully rewritten at this point and it is safe to perform a GC. |
555 // Materialize any objects that were deferred by FillFrame because they | 557 // Materialize any objects that were deferred by FillFrame because they |
556 // require allocation. | 558 // require allocation. |
557 __ EnterFrame(0); | 559 __ EnterFrame(0); |
558 if (preserve_rax) { | 560 if (preserve_rax) { |
559 __ pushq(RAX); // Preserve result, it will be GC-d here. | 561 __ pushq(RBX); // Preserve result, it will be GC-d here. |
560 } | 562 } |
561 __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry); | 563 __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry); |
562 if (preserve_rax) { | 564 if (preserve_rax) { |
563 __ popq(RAX); // Restore result. | 565 __ popq(RAX); // Restore result. |
564 } | 566 } |
565 __ LeaveFrame(); | 567 __ LeaveFrame(); |
566 | 568 |
567 __ ret(); | 569 __ ret(); |
568 } | 570 } |
569 | 571 |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { | 1925 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { |
1924 __ movq(RAX, RCX); // error object. | 1926 __ movq(RAX, RCX); // error object. |
1925 __ movq(RBP, RDX); // target frame_pointer. | 1927 __ movq(RBP, RDX); // target frame_pointer. |
1926 __ movq(RSP, RSI); // target stack_pointer. | 1928 __ movq(RSP, RSI); // target stack_pointer. |
1927 __ jmp(RDI); // Jump to the exception handler code. | 1929 __ jmp(RDI); // Jump to the exception handler code. |
1928 } | 1930 } |
1929 | 1931 |
1930 } // namespace dart | 1932 } // namespace dart |
1931 | 1933 |
1932 #endif // defined TARGET_ARCH_X64 | 1934 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |