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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 __ movq(RAX, FieldAddress(RDI, RCX, TIMES_8, base + kWordSize)); | 1354 __ movq(RAX, FieldAddress(RDI, RCX, TIMES_8, base + kWordSize)); |
1355 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); | 1355 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); |
1356 __ LoadObject(RBX, ic_data, PP); | 1356 __ LoadObject(RBX, ic_data, PP); |
1357 __ LoadObject(R10, arguments_descriptor, PP); | 1357 __ LoadObject(R10, arguments_descriptor, PP); |
1358 __ AddImmediate( | 1358 __ AddImmediate( |
1359 RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag), PP); | 1359 RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag), PP); |
1360 __ call(RCX); | 1360 __ call(RCX); |
1361 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1361 AddCurrentDescriptor(RawPcDescriptors::kOther, |
1362 Isolate::kNoDeoptId, token_pos); | 1362 Isolate::kNoDeoptId, token_pos); |
1363 RecordSafepoint(locs); | 1363 RecordSafepoint(locs); |
1364 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); | 1364 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
| 1365 if (is_optimizing()) { |
| 1366 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 1367 } else { |
| 1368 // Add deoptimization continuation point after the call and before the |
| 1369 // arguments are removed. |
| 1370 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
| 1371 } |
1365 __ Drop(argument_count, RCX); | 1372 __ Drop(argument_count, RCX); |
1366 } | 1373 } |
1367 | 1374 |
1368 | 1375 |
1369 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1376 void FlowGraphCompiler::EmitOptimizedStaticCall( |
1370 const Function& function, | 1377 const Function& function, |
1371 const Array& arguments_descriptor, | 1378 const Array& arguments_descriptor, |
1372 intptr_t argument_count, | 1379 intptr_t argument_count, |
1373 intptr_t deopt_id, | 1380 intptr_t deopt_id, |
1374 intptr_t token_pos, | 1381 intptr_t token_pos, |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 __ movups(reg, Address(RSP, 0)); | 1776 __ movups(reg, Address(RSP, 0)); |
1770 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1777 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
1771 } | 1778 } |
1772 | 1779 |
1773 | 1780 |
1774 #undef __ | 1781 #undef __ |
1775 | 1782 |
1776 } // namespace dart | 1783 } // namespace dart |
1777 | 1784 |
1778 #endif // defined TARGET_ARCH_X64 | 1785 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |