OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 if (compiler->is_optimizing()) { | 232 if (compiler->is_optimizing()) { |
233 __ Drop1(); | 233 __ Drop1(); |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 | 237 |
238 EMIT_NATIVE_CODE(PolymorphicInstanceCall, | 238 EMIT_NATIVE_CODE(PolymorphicInstanceCall, |
239 0, | 239 0, |
240 Location::RegisterLocation(0), | 240 Location::RegisterLocation(0), |
241 LocationSummary::kCall) { | 241 LocationSummary::kCall) { |
242 const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( | 242 const Array& arguments_descriptor = |
243 instance_call()->ArgumentCount(), instance_call()->argument_names())); | 243 Array::Handle(instance_call()->GetArgumentsDescriptor()); |
244 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 244 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
245 | 245 |
246 // Push the target onto the stack. | 246 // Push the target onto the stack. |
247 if (with_checks()) { | 247 if (with_checks()) { |
248 const intptr_t length = targets_.length(); | 248 const intptr_t length = targets_.length(); |
249 if (!Utils::IsUint(8, length)) { | 249 if (!Utils::IsUint(8, length)) { |
250 Unsupported(compiler); | 250 Unsupported(compiler); |
251 UNREACHABLE(); | 251 UNREACHABLE(); |
252 } | 252 } |
253 bool using_ranges = false; | 253 bool using_ranges = false; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 | 444 |
445 EMIT_NATIVE_CODE(ClosureCall, | 445 EMIT_NATIVE_CODE(ClosureCall, |
446 1, | 446 1, |
447 Location::RegisterLocation(0), | 447 Location::RegisterLocation(0), |
448 LocationSummary::kCall) { | 448 LocationSummary::kCall) { |
449 if (compiler->is_optimizing()) { | 449 if (compiler->is_optimizing()) { |
450 __ Push(locs()->in(0).reg()); | 450 __ Push(locs()->in(0).reg()); |
451 } | 451 } |
452 | 452 |
453 intptr_t argument_count = ArgumentCount(); | 453 const Array& arguments_descriptor = |
454 const Array& arguments_descriptor = Array::ZoneHandle( | 454 Array::ZoneHandle(GetArgumentsDescriptor()); |
455 ArgumentsDescriptor::New(argument_count, argument_names())); | |
456 const intptr_t argdesc_kidx = | 455 const intptr_t argdesc_kidx = |
457 compiler->assembler()->AddConstant(arguments_descriptor); | 456 compiler->assembler()->AddConstant(arguments_descriptor); |
458 __ StaticCall(argument_count, argdesc_kidx); | 457 __ StaticCall(ArgumentCount(), argdesc_kidx); |
459 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); | 458 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); |
460 if (compiler->is_optimizing()) { | 459 if (compiler->is_optimizing()) { |
461 __ PopLocal(locs()->out(0).reg()); | 460 __ PopLocal(locs()->out(0).reg()); |
462 } | 461 } |
463 } | 462 } |
464 | 463 |
465 | 464 |
466 static void EmitBranchOnCondition(FlowGraphCompiler* compiler, | 465 static void EmitBranchOnCondition(FlowGraphCompiler* compiler, |
467 Condition true_condition, | 466 Condition true_condition, |
468 BranchLabels labels) { | 467 BranchLabels labels) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 } | 910 } |
912 | 911 |
913 | 912 |
914 EMIT_NATIVE_CODE(StringInterpolate, | 913 EMIT_NATIVE_CODE(StringInterpolate, |
915 1, | 914 1, |
916 Location::RegisterLocation(0), | 915 Location::RegisterLocation(0), |
917 LocationSummary::kCall) { | 916 LocationSummary::kCall) { |
918 if (compiler->is_optimizing()) { | 917 if (compiler->is_optimizing()) { |
919 __ Push(locs()->in(0).reg()); | 918 __ Push(locs()->in(0).reg()); |
920 } | 919 } |
| 920 const intptr_t kTypeArgsLen = 0; |
921 const intptr_t kArgumentCount = 1; | 921 const intptr_t kArgumentCount = 1; |
922 const Array& arguments_descriptor = Array::Handle( | 922 const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( |
923 ArgumentsDescriptor::New(kArgumentCount, Object::null_array())); | 923 kTypeArgsLen, kArgumentCount, Object::null_array())); |
924 __ PushConstant(CallFunction()); | 924 __ PushConstant(CallFunction()); |
925 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 925 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
926 __ StaticCall(kArgumentCount, argdesc_kidx); | 926 __ StaticCall(kArgumentCount, argdesc_kidx); |
927 // Note: can't use RecordAfterCall here because | 927 // Note: can't use RecordAfterCall here because |
928 // StringInterpolateInstr::ArgumentCount() is 0. However | 928 // StringInterpolateInstr::ArgumentCount() is 0. However |
929 // internally it does a call with 1 argument which needs to | 929 // internally it does a call with 1 argument which needs to |
930 // be reflected in the lazy deoptimization environment. | 930 // be reflected in the lazy deoptimization environment. |
931 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, | 931 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, |
932 FlowGraphCompiler::kHasResult, locs()); | 932 FlowGraphCompiler::kHasResult, locs()); |
933 if (compiler->is_optimizing()) { | 933 if (compiler->is_optimizing()) { |
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 } | 2083 } |
2084 __ IfULe(length, index); | 2084 __ IfULe(length, index); |
2085 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, | 2085 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, |
2086 (generalized_ ? ICData::kGeneralized : 0) | | 2086 (generalized_ ? ICData::kGeneralized : 0) | |
2087 (licm_hoisted_ ? ICData::kHoisted : 0)); | 2087 (licm_hoisted_ ? ICData::kHoisted : 0)); |
2088 } | 2088 } |
2089 | 2089 |
2090 } // namespace dart | 2090 } // namespace dart |
2091 | 2091 |
2092 #endif // defined TARGET_ARCH_DBC | 2092 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |