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 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 } else { | 1200 } else { |
1201 // Add deoptimization continuation point after the call and before the | 1201 // Add deoptimization continuation point after the call and before the |
1202 // arguments are removed. | 1202 // arguments are removed. |
1203 AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); | 1203 AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); |
1204 } | 1204 } |
1205 } | 1205 } |
1206 } | 1206 } |
1207 | 1207 |
1208 | 1208 |
1209 void FlowGraphCompiler::EmitUnoptimizedStaticCall( | 1209 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
1210 const Function& target_function, | |
1211 const Array& arguments_descriptor, | |
1212 intptr_t argument_count, | 1210 intptr_t argument_count, |
1213 intptr_t deopt_id, | 1211 intptr_t deopt_id, |
1214 intptr_t token_pos, | 1212 intptr_t token_pos, |
1215 LocationSummary* locs) { | 1213 LocationSummary* locs, |
1216 // TODO(srdjan): Improve performance of function recognition. | 1214 const ICData& ic_data) { |
1217 MethodRecognizer::Kind recognized_kind = | |
1218 MethodRecognizer::RecognizeKind(target_function); | |
1219 int num_args_checked = 0; | |
1220 if ((recognized_kind == MethodRecognizer::kMathMin) || | |
1221 (recognized_kind == MethodRecognizer::kMathMax)) { | |
1222 num_args_checked = 2; | |
1223 } | |
1224 const ICData& ic_data = ICData::ZoneHandle( | |
1225 ICData::New(parsed_function().function(), // Caller function. | |
1226 String::Handle(target_function.name()), | |
1227 arguments_descriptor, | |
1228 deopt_id, | |
1229 num_args_checked)); // No arguments checked. | |
1230 ic_data.AddTarget(target_function); | |
1231 uword label_address = 0; | 1215 uword label_address = 0; |
1232 if (ic_data.NumArgsTested() == 0) { | 1216 if (ic_data.NumArgsTested() == 0) { |
1233 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); | 1217 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
1234 } else if (ic_data.NumArgsTested() == 2) { | 1218 } else if (ic_data.NumArgsTested() == 2) { |
1235 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); | 1219 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
1236 } else { | 1220 } else { |
1237 UNIMPLEMENTED(); | 1221 UNIMPLEMENTED(); |
1238 } | 1222 } |
1239 ExternalLabel target_label(label_address); | 1223 ExternalLabel target_label(label_address); |
1240 __ LoadObject(RBX, ic_data, PP); | 1224 __ LoadObject(RBX, ic_data, PP); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 __ movups(reg, Address(RSP, 0)); | 1702 __ movups(reg, Address(RSP, 0)); |
1719 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1703 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
1720 } | 1704 } |
1721 | 1705 |
1722 | 1706 |
1723 #undef __ | 1707 #undef __ |
1724 | 1708 |
1725 } // namespace dart | 1709 } // namespace dart |
1726 | 1710 |
1727 #endif // defined TARGET_ARCH_X64 | 1711 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |