| 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" // 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 | 1039 |
| 1040 void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, | 1040 void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, |
| 1041 const RuntimeEntry& entry, | 1041 const RuntimeEntry& entry, |
| 1042 LocationSummary* locs) { | 1042 LocationSummary* locs) { |
| 1043 __ CallRuntime(entry); | 1043 __ CallRuntime(entry); |
| 1044 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); | 1044 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); |
| 1045 RecordSafepoint(locs); | 1045 RecordSafepoint(locs); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 | 1048 |
| 1049 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
| 1050 ExternalLabel* target_label, |
| 1051 const ICData& ic_data, |
| 1052 const Array& arguments_descriptor, |
| 1053 intptr_t argument_count, |
| 1054 intptr_t deopt_id, |
| 1055 intptr_t token_pos, |
| 1056 LocationSummary* locs) { |
| 1057 // Each ICData propagated from unoptimized to optimized code contains the |
| 1058 // function that corresponds to the Dart function of that IC call. Due |
| 1059 // to inlining in optimized code, that function may not correspond to the |
| 1060 // top-level function (parsed_function().function()) which could be |
| 1061 // reoptimized and which counter needs to be incremented. |
| 1062 // Pass the function explicitly. |
| 1063 __ LoadObject(RDI, parsed_function().function()); |
| 1064 __ LoadObject(RBX, ic_data); |
| 1065 __ LoadObject(R10, arguments_descriptor); |
| 1066 GenerateDartCall(deopt_id, |
| 1067 token_pos, |
| 1068 target_label, |
| 1069 PcDescriptors::kIcCall, |
| 1070 locs); |
| 1071 __ Drop(argument_count); |
| 1072 } |
| 1073 |
| 1074 |
| 1049 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1075 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
| 1050 const ICData& ic_data, | 1076 const ICData& ic_data, |
| 1051 const Array& arguments_descriptor, | 1077 const Array& arguments_descriptor, |
| 1052 intptr_t argument_count, | 1078 intptr_t argument_count, |
| 1053 intptr_t deopt_id, | 1079 intptr_t deopt_id, |
| 1054 intptr_t token_pos, | 1080 intptr_t token_pos, |
| 1055 LocationSummary* locs) { | 1081 LocationSummary* locs) { |
| 1056 __ LoadObject(RBX, ic_data); | 1082 __ LoadObject(RBX, ic_data); |
| 1057 __ LoadObject(R10, arguments_descriptor); | 1083 __ LoadObject(R10, arguments_descriptor); |
| 1058 GenerateDartCall(deopt_id, | 1084 GenerateDartCall(deopt_id, |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { | 1363 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { |
| 1338 __ Exchange(mem1, mem2); | 1364 __ Exchange(mem1, mem2); |
| 1339 } | 1365 } |
| 1340 | 1366 |
| 1341 | 1367 |
| 1342 #undef __ | 1368 #undef __ |
| 1343 | 1369 |
| 1344 } // namespace dart | 1370 } // namespace dart |
| 1345 | 1371 |
| 1346 #endif // defined TARGET_ARCH_X64 | 1372 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |