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 instance_call()->GetArgumentsDescriptor(Thread::Current()->zone()); |
244 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 244 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
245 const CallTargets& ic_data = targets(); | 245 const CallTargets& ic_data = targets(); |
246 | 246 |
247 // Push the target onto the stack. | 247 // Push the target onto the stack. |
248 if (with_checks()) { | 248 if (with_checks()) { |
249 const intptr_t length = ic_data.length(); | 249 const intptr_t length = ic_data.length(); |
250 if (!Utils::IsUint(8, length)) { | 250 if (!Utils::IsUint(8, length)) { |
251 Unsupported(compiler); | 251 Unsupported(compiler); |
252 UNREACHABLE(); | 252 UNREACHABLE(); |
253 } | 253 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 444 |
445 | 445 |
446 EMIT_NATIVE_CODE(ClosureCall, | 446 EMIT_NATIVE_CODE(ClosureCall, |
447 1, | 447 1, |
448 Location::RegisterLocation(0), | 448 Location::RegisterLocation(0), |
449 LocationSummary::kCall) { | 449 LocationSummary::kCall) { |
450 if (compiler->is_optimizing()) { | 450 if (compiler->is_optimizing()) { |
451 __ Push(locs()->in(0).reg()); | 451 __ Push(locs()->in(0).reg()); |
452 } | 452 } |
453 | 453 |
454 intptr_t argument_count = ArgumentCount(); | 454 const Array& arguments_descriptor = |
455 const Array& arguments_descriptor = Array::ZoneHandle( | 455 GetArgumentsDescriptor(Thread::Current()->zone()); |
456 ArgumentsDescriptor::New(argument_count, argument_names())); | |
457 const intptr_t argdesc_kidx = | 456 const intptr_t argdesc_kidx = |
458 compiler->assembler()->AddConstant(arguments_descriptor); | 457 compiler->assembler()->AddConstant(arguments_descriptor); |
459 __ StaticCall(argument_count, argdesc_kidx); | 458 __ StaticCall(ArgumentCount(), argdesc_kidx); |
460 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); | 459 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); |
461 if (compiler->is_optimizing()) { | 460 if (compiler->is_optimizing()) { |
462 __ PopLocal(locs()->out(0).reg()); | 461 __ PopLocal(locs()->out(0).reg()); |
463 } | 462 } |
464 } | 463 } |
465 | 464 |
466 | 465 |
467 static void EmitBranchOnCondition(FlowGraphCompiler* compiler, | 466 static void EmitBranchOnCondition(FlowGraphCompiler* compiler, |
468 Condition true_condition, | 467 Condition true_condition, |
469 BranchLabels labels) { | 468 BranchLabels labels) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 } | 911 } |
913 | 912 |
914 | 913 |
915 EMIT_NATIVE_CODE(StringInterpolate, | 914 EMIT_NATIVE_CODE(StringInterpolate, |
916 1, | 915 1, |
917 Location::RegisterLocation(0), | 916 Location::RegisterLocation(0), |
918 LocationSummary::kCall) { | 917 LocationSummary::kCall) { |
919 if (compiler->is_optimizing()) { | 918 if (compiler->is_optimizing()) { |
920 __ Push(locs()->in(0).reg()); | 919 __ Push(locs()->in(0).reg()); |
921 } | 920 } |
| 921 const intptr_t kTypeArgsLen = 0; |
922 const intptr_t kArgumentCount = 1; | 922 const intptr_t kArgumentCount = 1; |
923 const Array& arguments_descriptor = Array::Handle( | 923 const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( |
924 ArgumentsDescriptor::New(kArgumentCount, Object::null_array())); | 924 kTypeArgsLen, kArgumentCount, Object::null_array())); |
925 __ PushConstant(CallFunction()); | 925 __ PushConstant(CallFunction()); |
926 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 926 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
927 __ StaticCall(kArgumentCount, argdesc_kidx); | 927 __ StaticCall(kArgumentCount, argdesc_kidx); |
928 // Note: can't use RecordAfterCall here because | 928 // Note: can't use RecordAfterCall here because |
929 // StringInterpolateInstr::ArgumentCount() is 0. However | 929 // StringInterpolateInstr::ArgumentCount() is 0. However |
930 // internally it does a call with 1 argument which needs to | 930 // internally it does a call with 1 argument which needs to |
931 // be reflected in the lazy deoptimization environment. | 931 // be reflected in the lazy deoptimization environment. |
932 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, | 932 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, |
933 FlowGraphCompiler::kHasResult, locs()); | 933 FlowGraphCompiler::kHasResult, locs()); |
934 if (compiler->is_optimizing()) { | 934 if (compiler->is_optimizing()) { |
(...skipping 1148 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 |