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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 89 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; |
90 ASSERT(fp_sp_dist <= 0); | 90 ASSERT(fp_sp_dist <= 0); |
91 __ movq(RDI, RSP); | 91 __ movq(RDI, RSP); |
92 __ subq(RDI, RBP); | 92 __ subq(RDI, RBP); |
93 __ cmpq(RDI, Immediate(fp_sp_dist)); | 93 __ cmpq(RDI, Immediate(fp_sp_dist)); |
94 __ j(EQUAL, &done, Assembler::kNearJump); | 94 __ j(EQUAL, &done, Assembler::kNearJump); |
95 __ int3(); | 95 __ int3(); |
96 __ Bind(&done); | 96 __ Bind(&done); |
97 } | 97 } |
98 #endif | 98 #endif |
99 __ LeaveFrame(); | 99 __ LeaveFrame(true); |
100 __ ret(); | 100 __ ret(); |
101 | 101 |
102 // Generate 8 bytes of NOPs so that the debugger can patch the | 102 // Generate 4 bytes of NOPs so that the debugger can patch the |
103 // return pattern with a call to the debug stub. | 103 // return pattern with a call to the debug stub. |
104 // Note that the nop(8) byte pattern is not recognized by the debugger. | 104 // Note that the nop(8) byte pattern is not recognized by the debugger. |
105 __ nop(1); | 105 __ nop(1); |
106 __ nop(1); | 106 __ nop(1); |
107 __ nop(1); | 107 __ nop(1); |
108 __ nop(1); | 108 __ nop(1); |
109 __ nop(1); | |
110 __ nop(1); | |
111 __ nop(1); | |
112 __ nop(1); | |
113 compiler->AddCurrentDescriptor(PcDescriptors::kReturn, | 109 compiler->AddCurrentDescriptor(PcDescriptors::kReturn, |
114 Isolate::kNoDeoptId, | 110 Isolate::kNoDeoptId, |
115 token_pos()); | 111 token_pos()); |
116 } | 112 } |
117 | 113 |
118 | 114 |
119 static Condition NegateCondition(Condition condition) { | 115 static Condition NegateCondition(Condition condition) { |
120 switch (condition) { | 116 switch (condition) { |
121 case EQUAL: return NOT_EQUAL; | 117 case EQUAL: return NOT_EQUAL; |
122 case NOT_EQUAL: return EQUAL; | 118 case NOT_EQUAL: return EQUAL; |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 return NULL; | 2219 return NULL; |
2224 } | 2220 } |
2225 | 2221 |
2226 | 2222 |
2227 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2223 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2228 __ Bind(compiler->GetJumpLabel(this)); | 2224 __ Bind(compiler->GetJumpLabel(this)); |
2229 compiler->AddExceptionHandler(catch_try_index(), | 2225 compiler->AddExceptionHandler(catch_try_index(), |
2230 try_index(), | 2226 try_index(), |
2231 compiler->assembler()->CodeSize(), | 2227 compiler->assembler()->CodeSize(), |
2232 catch_handler_types_); | 2228 catch_handler_types_); |
| 2229 |
| 2230 // Restore the pool pointer. |
| 2231 __ LoadPoolPointer(); |
| 2232 |
2233 if (HasParallelMove()) { | 2233 if (HasParallelMove()) { |
2234 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 2234 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
2235 } | 2235 } |
2236 | 2236 |
2237 // Restore RSP from RBP as we are coming from a throw and the code for | 2237 // Restore RSP from RBP as we are coming from a throw and the code for |
2238 // popping arguments has not been run. | 2238 // popping arguments has not been run. |
2239 const intptr_t fp_sp_dist = | 2239 const intptr_t fp_sp_dist = |
2240 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 2240 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; |
2241 ASSERT(fp_sp_dist <= 0); | 2241 ASSERT(fp_sp_dist <= 0); |
2242 __ leaq(RSP, Address(RBP, fp_sp_dist)); | 2242 __ leaq(RSP, Address(RBP, fp_sp_dist)); |
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4795 PcDescriptors::kOther, | 4795 PcDescriptors::kOther, |
4796 locs()); | 4796 locs()); |
4797 __ Drop(2); // Discard type arguments and receiver. | 4797 __ Drop(2); // Discard type arguments and receiver. |
4798 } | 4798 } |
4799 | 4799 |
4800 } // namespace dart | 4800 } // namespace dart |
4801 | 4801 |
4802 #undef __ | 4802 #undef __ |
4803 | 4803 |
4804 #endif // defined TARGET_ARCH_X64 | 4804 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |