| 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 // Code above cannot cause GC. | 456 // Code above cannot cause GC. |
| 457 // There is a Dart Frame on the stack. We must restore PP and leave frame. | 457 // There is a Dart Frame on the stack. We must restore PP and leave frame. |
| 458 __ LeaveDartFrame(); | 458 __ LeaveDartFrame(); |
| 459 | 459 |
| 460 // Frame is fully rewritten at this point and it is safe to perform a GC. | 460 // Frame is fully rewritten at this point and it is safe to perform a GC. |
| 461 // Materialize any objects that were deferred by FillFrame because they | 461 // Materialize any objects that were deferred by FillFrame because they |
| 462 // require allocation. | 462 // require allocation. |
| 463 // Enter stub frame with loading PP. The caller's PP is not materialized yet. | 463 // Enter stub frame with loading PP. The caller's PP is not materialized yet. |
| 464 __ EnterStubFrame(); | 464 __ EnterStubFrame(); |
| 465 if (preserve_result) { | 465 if (preserve_result) { |
| 466 __ pushq(Immediate(0)); // Workaround for dropped stack slot during GC. | |
| 467 __ pushq(RBX); // Preserve result, it will be GC-d here. | 466 __ pushq(RBX); // Preserve result, it will be GC-d here. |
| 468 } | 467 } |
| 469 __ pushq(Immediate(Smi::RawValue(0))); // Space for the result. | 468 __ pushq(Immediate(Smi::RawValue(0))); // Space for the result. |
| 470 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); | 469 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); |
| 471 // Result tells stub how many bytes to remove from the expression stack | 470 // Result tells stub how many bytes to remove from the expression stack |
| 472 // of the bottom-most frame. They were used as materialization arguments. | 471 // of the bottom-most frame. They were used as materialization arguments. |
| 473 __ popq(RBX); | 472 __ popq(RBX); |
| 474 __ SmiUntag(RBX); | 473 __ SmiUntag(RBX); |
| 475 if (preserve_result) { | 474 if (preserve_result) { |
| 476 __ popq(RAX); // Restore result. | 475 __ popq(RAX); // Restore result. |
| 477 __ Drop(1); // Workaround for dropped stack slot during GC. | |
| 478 } | 476 } |
| 479 __ LeaveStubFrame(); | 477 __ LeaveStubFrame(); |
| 480 | 478 |
| 481 __ popq(RCX); // Pop return address. | 479 __ popq(RCX); // Pop return address. |
| 482 __ addq(RSP, RBX); // Remove materialization arguments. | 480 __ addq(RSP, RBX); // Remove materialization arguments. |
| 483 __ pushq(RCX); // Push return address. | 481 __ pushq(RCX); // Push return address. |
| 484 __ ret(); | 482 __ ret(); |
| 485 } | 483 } |
| 486 | 484 |
| 487 | 485 |
| (...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 // Result: | 2146 // Result: |
| 2149 // RCX: entry point. | 2147 // RCX: entry point. |
| 2150 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2148 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2151 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); | 2149 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); |
| 2152 __ ret(); | 2150 __ ret(); |
| 2153 } | 2151 } |
| 2154 | 2152 |
| 2155 } // namespace dart | 2153 } // namespace dart |
| 2156 | 2154 |
| 2157 #endif // defined TARGET_ARCH_X64 | 2155 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |