| 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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 uword label_address = 0; | 1181 uword label_address = 0; |
| 1182 StubCode* stub_code = isolate()->stub_code(); | 1182 StubCode* stub_code = isolate()->stub_code(); |
| 1183 if (ic_data.NumArgsTested() == 0) { | 1183 if (ic_data.NumArgsTested() == 0) { |
| 1184 label_address = stub_code->ZeroArgsUnoptimizedStaticCallEntryPoint(); | 1184 label_address = stub_code->ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 1185 } else if (ic_data.NumArgsTested() == 2) { | 1185 } else if (ic_data.NumArgsTested() == 2) { |
| 1186 label_address = stub_code->TwoArgsUnoptimizedStaticCallEntryPoint(); | 1186 label_address = stub_code->TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 1187 } else { | 1187 } else { |
| 1188 UNIMPLEMENTED(); | 1188 UNIMPLEMENTED(); |
| 1189 } | 1189 } |
| 1190 ExternalLabel target_label(label_address); | 1190 ExternalLabel target_label(label_address); |
| 1191 __ movl(EDX, Immediate(0)); | |
| 1192 __ LoadObject(ECX, ic_data); | 1191 __ LoadObject(ECX, ic_data); |
| 1193 GenerateDartCall(deopt_id, | 1192 GenerateDartCall(deopt_id, |
| 1194 token_pos, | 1193 token_pos, |
| 1195 &target_label, | 1194 &target_label, |
| 1196 RawPcDescriptors::kUnoptStaticCall, | 1195 RawPcDescriptors::kUnoptStaticCall, |
| 1197 locs); | 1196 locs); |
| 1198 __ Drop(argument_count); | 1197 __ Drop(argument_count); |
| 1199 #if defined(DEBUG) | 1198 #if defined(DEBUG) |
| 1200 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 1199 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 1201 #endif | 1200 #endif |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 } | 1241 } |
| 1243 | 1242 |
| 1244 | 1243 |
| 1245 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1244 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
| 1246 const ICData& ic_data, | 1245 const ICData& ic_data, |
| 1247 intptr_t argument_count, | 1246 intptr_t argument_count, |
| 1248 intptr_t deopt_id, | 1247 intptr_t deopt_id, |
| 1249 intptr_t token_pos, | 1248 intptr_t token_pos, |
| 1250 LocationSummary* locs) { | 1249 LocationSummary* locs) { |
| 1251 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); | 1250 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); |
| 1252 __ movl(EDX, Immediate(0)); | |
| 1253 __ LoadObject(ECX, ic_data); | 1251 __ LoadObject(ECX, ic_data); |
| 1254 GenerateDartCall(deopt_id, | 1252 GenerateDartCall(deopt_id, |
| 1255 token_pos, | 1253 token_pos, |
| 1256 target_label, | 1254 target_label, |
| 1257 RawPcDescriptors::kIcCall, | 1255 RawPcDescriptors::kIcCall, |
| 1258 locs); | 1256 locs); |
| 1259 __ Drop(argument_count); | 1257 __ Drop(argument_count); |
| 1260 #if defined(DEBUG) | 1258 #if defined(DEBUG) |
| 1261 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 1259 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 1262 #endif | 1260 #endif |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 Register right, | 1384 Register right, |
| 1387 bool needs_number_check, | 1385 bool needs_number_check, |
| 1388 intptr_t token_pos) { | 1386 intptr_t token_pos) { |
| 1389 if (needs_number_check) { | 1387 if (needs_number_check) { |
| 1390 StubCode* stub_code = isolate()->stub_code(); | 1388 StubCode* stub_code = isolate()->stub_code(); |
| 1391 __ pushl(left); | 1389 __ pushl(left); |
| 1392 __ pushl(right); | 1390 __ pushl(right); |
| 1393 if (is_optimizing()) { | 1391 if (is_optimizing()) { |
| 1394 __ call(&stub_code->OptimizedIdenticalWithNumberCheckLabel()); | 1392 __ call(&stub_code->OptimizedIdenticalWithNumberCheckLabel()); |
| 1395 } else { | 1393 } else { |
| 1396 __ movl(EDX, Immediate(0)); | |
| 1397 __ movl(ECX, Immediate(0)); | |
| 1398 __ call(&stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); | 1394 __ call(&stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1399 } | 1395 } |
| 1400 if (token_pos != Scanner::kNoSourcePos) { | 1396 if (token_pos != Scanner::kNoSourcePos) { |
| 1401 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 1397 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, |
| 1402 Isolate::kNoDeoptId, | 1398 Isolate::kNoDeoptId, |
| 1403 token_pos); | 1399 token_pos); |
| 1404 } | 1400 } |
| 1405 #if defined(DEBUG) | 1401 #if defined(DEBUG) |
| 1406 if (!is_optimizing()) { | 1402 if (!is_optimizing()) { |
| 1407 // Do this *after* adding the pc descriptor! | 1403 // Do this *after* adding the pc descriptor! |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 __ movups(reg, Address(ESP, 0)); | 1764 __ movups(reg, Address(ESP, 0)); |
| 1769 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1765 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1770 } | 1766 } |
| 1771 | 1767 |
| 1772 | 1768 |
| 1773 #undef __ | 1769 #undef __ |
| 1774 | 1770 |
| 1775 } // namespace dart | 1771 } // namespace dart |
| 1776 | 1772 |
| 1777 #endif // defined TARGET_ARCH_IA32 | 1773 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |