| 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" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return locs; | 76 return locs; |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 // Attempt optimized compilation at return instruction instead of at the entry. | 80 // Attempt optimized compilation at return instruction instead of at the entry. |
| 81 // The entry needs to be patchable, no inlined objects are allowed in the area | 81 // The entry needs to be patchable, no inlined objects are allowed in the area |
| 82 // that will be overwritten by the patch instruction: a jump). | 82 // that will be overwritten by the patch instruction: a jump). |
| 83 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 83 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 84 Register result = locs()->in(0).reg(); | 84 Register result = locs()->in(0).reg(); |
| 85 ASSERT(result == RAX); | 85 ASSERT(result == RAX); |
| 86 |
| 87 if (is_intrinsic_) { |
| 88 // Intrinsics don't have a frame. |
| 89 __ ret(); |
| 90 return; |
| 91 } |
| 92 |
| 86 #if defined(DEBUG) | 93 #if defined(DEBUG) |
| 87 __ Comment("Stack Check"); | 94 __ Comment("Stack Check"); |
| 88 Label done; | 95 Label done; |
| 89 const intptr_t fp_sp_dist = | 96 const intptr_t fp_sp_dist = |
| 90 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 97 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; |
| 91 ASSERT(fp_sp_dist <= 0); | 98 ASSERT(fp_sp_dist <= 0); |
| 92 __ movq(RDI, RSP); | 99 __ movq(RDI, RSP); |
| 93 __ subq(RDI, RBP); | 100 __ subq(RDI, RBP); |
| 94 __ CompareImmediate(RDI, Immediate(fp_sp_dist), PP); | 101 __ CompareImmediate(RDI, Immediate(fp_sp_dist), PP); |
| 95 __ j(EQUAL, &done, Assembler::kNearJump); | 102 __ j(EQUAL, &done, Assembler::kNearJump); |
| (...skipping 5743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5839 __ movq(R10, Immediate(kInvalidObjectPointer)); | 5846 __ movq(R10, Immediate(kInvalidObjectPointer)); |
| 5840 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 5847 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
| 5841 #endif | 5848 #endif |
| 5842 } | 5849 } |
| 5843 | 5850 |
| 5844 } // namespace dart | 5851 } // namespace dart |
| 5845 | 5852 |
| 5846 #undef __ | 5853 #undef __ |
| 5847 | 5854 |
| 5848 #endif // defined TARGET_ARCH_X64 | 5855 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |