| 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. | |
| 548 if (preserve_rax) { | 547 if (preserve_rax) { |
| 549 // Restore result into RBX. | 548 // Restore result into RAX. |
| 550 __ movq(RBX, Address(RBP, -1 * kWordSize)); | 549 __ movq(RAX, Address(RBP, -1 * kWordSize)); |
| 551 } | 550 } |
| 552 // Code above cannot cause GC. | 551 // Code above cannot cause GC. |
| 553 __ LeaveFrame(); | 552 __ LeaveFrame(); |
| 554 __ movq(RBP, RAX); | |
| 555 | 553 |
| 556 // Frame is fully rewritten at this point and it is safe to perform a GC. | 554 // Frame is fully rewritten at this point and it is safe to perform a GC. |
| 557 // Materialize any objects that were deferred by FillFrame because they | 555 // Materialize any objects that were deferred by FillFrame because they |
| 558 // require allocation. | 556 // require allocation. |
| 559 __ EnterFrame(0); | 557 __ EnterFrame(0); |
| 560 if (preserve_rax) { | 558 if (preserve_rax) { |
| 561 __ pushq(RBX); // Preserve result, it will be GC-d here. | 559 __ pushq(RAX); // Preserve result, it will be GC-d here. |
| 562 } | 560 } |
| 563 __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry); | 561 __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry); |
| 564 if (preserve_rax) { | 562 if (preserve_rax) { |
| 565 __ popq(RAX); // Restore result. | 563 __ popq(RAX); // Restore result. |
| 566 } | 564 } |
| 567 __ LeaveFrame(); | 565 __ LeaveFrame(); |
| 568 | 566 |
| 569 __ ret(); | 567 __ ret(); |
| 570 } | 568 } |
| 571 | 569 |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1925 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { | 1923 void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { |
| 1926 __ movq(RAX, RCX); // error object. | 1924 __ movq(RAX, RCX); // error object. |
| 1927 __ movq(RBP, RDX); // target frame_pointer. | 1925 __ movq(RBP, RDX); // target frame_pointer. |
| 1928 __ movq(RSP, RSI); // target stack_pointer. | 1926 __ movq(RSP, RSI); // target stack_pointer. |
| 1929 __ jmp(RDI); // Jump to the exception handler code. | 1927 __ jmp(RDI); // Jump to the exception handler code. |
| 1930 } | 1928 } |
| 1931 | 1929 |
| 1932 } // namespace dart | 1930 } // namespace dart |
| 1933 | 1931 |
| 1934 #endif // defined TARGET_ARCH_X64 | 1932 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |