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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 } else { | 1162 } else { |
1163 // Add deoptimization continuation point after the call and before the | 1163 // Add deoptimization continuation point after the call and before the |
1164 // arguments are removed. | 1164 // arguments are removed. |
1165 AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); | 1165 AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); |
1166 } | 1166 } |
1167 } | 1167 } |
1168 } | 1168 } |
1169 | 1169 |
1170 | 1170 |
1171 void FlowGraphCompiler::EmitUnoptimizedStaticCall( | 1171 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
1172 const Function& target_function, | |
1173 const Array& arguments_descriptor, | |
1174 intptr_t argument_count, | 1172 intptr_t argument_count, |
1175 intptr_t deopt_id, | 1173 intptr_t deopt_id, |
1176 intptr_t token_pos, | 1174 intptr_t token_pos, |
1177 LocationSummary* locs) { | 1175 LocationSummary* locs, |
1178 // TODO(srdjan): Improve performance of function recognition. | 1176 const ICData& ic_data) { |
1179 MethodRecognizer::Kind recognized_kind = | |
1180 MethodRecognizer::RecognizeKind(target_function); | |
1181 int num_args_checked = 0; | |
1182 if ((recognized_kind == MethodRecognizer::kMathMin) || | |
1183 (recognized_kind == MethodRecognizer::kMathMax)) { | |
1184 num_args_checked = 2; | |
1185 } | |
1186 const ICData& ic_data = ICData::ZoneHandle( | |
1187 ICData::New(parsed_function().function(), // Caller function. | |
1188 String::Handle(target_function.name()), | |
1189 arguments_descriptor, | |
1190 deopt_id, | |
1191 num_args_checked)); // No arguments checked. | |
1192 ic_data.AddTarget(target_function); | |
1193 uword label_address = 0; | 1177 uword label_address = 0; |
1194 if (ic_data.NumArgsTested() == 0) { | 1178 if (ic_data.NumArgsTested() == 0) { |
1195 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); | 1179 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
1196 } else if (ic_data.NumArgsTested() == 2) { | 1180 } else if (ic_data.NumArgsTested() == 2) { |
1197 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); | 1181 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
1198 } else { | 1182 } else { |
1199 UNIMPLEMENTED(); | 1183 UNIMPLEMENTED(); |
1200 } | 1184 } |
1201 ExternalLabel target_label(label_address); | 1185 ExternalLabel target_label(label_address); |
1202 __ LoadObject(ECX, ic_data); | 1186 __ LoadObject(ECX, ic_data); |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 __ movups(reg, Address(ESP, 0)); | 1740 __ movups(reg, Address(ESP, 0)); |
1757 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1741 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1758 } | 1742 } |
1759 | 1743 |
1760 | 1744 |
1761 #undef __ | 1745 #undef __ |
1762 | 1746 |
1763 } // namespace dart | 1747 } // namespace dart |
1764 | 1748 |
1765 #endif // defined TARGET_ARCH_IA32 | 1749 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |