Chromium Code Reviews| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 = Array::Handle(ArgumentsDescriptor::New( |
| 243 instance_call()->ArgumentCount(), instance_call()->argument_names())); | 243 instance_call()->type_args_len(), instance_call()->ArgumentCount(), |
|
zra
2017/05/03 15:03:24
Does this one need to be adjusted?
regis
2017/05/09 18:31:23
Good catch! I missed this one. One more reason to
| |
| 244 instance_call()->argument_names())); | |
| 244 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 245 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
| 245 const CallTargets& ic_data = targets(); | 246 const CallTargets& ic_data = targets(); |
| 246 | 247 |
| 247 // Push the target onto the stack. | 248 // Push the target onto the stack. |
| 248 if (with_checks()) { | 249 if (with_checks()) { |
| 249 const intptr_t length = ic_data.length(); | 250 const intptr_t length = ic_data.length(); |
| 250 if (!Utils::IsUint(8, length)) { | 251 if (!Utils::IsUint(8, length)) { |
| 251 Unsupported(compiler); | 252 Unsupported(compiler); |
| 252 UNREACHABLE(); | 253 UNREACHABLE(); |
| 253 } | 254 } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 | 445 |
| 445 | 446 |
| 446 EMIT_NATIVE_CODE(ClosureCall, | 447 EMIT_NATIVE_CODE(ClosureCall, |
| 447 1, | 448 1, |
| 448 Location::RegisterLocation(0), | 449 Location::RegisterLocation(0), |
| 449 LocationSummary::kCall) { | 450 LocationSummary::kCall) { |
| 450 if (compiler->is_optimizing()) { | 451 if (compiler->is_optimizing()) { |
| 451 __ Push(locs()->in(0).reg()); | 452 __ Push(locs()->in(0).reg()); |
| 452 } | 453 } |
| 453 | 454 |
| 454 intptr_t argument_count = ArgumentCount(); | 455 const intptr_t ta_len = type_args_len(); |
| 455 const Array& arguments_descriptor = Array::ZoneHandle( | 456 const intptr_t argument_count = ArgumentCount(); // Includes type args. |
| 456 ArgumentsDescriptor::New(argument_count, argument_names())); | 457 const Array& arguments_descriptor = |
| 458 Array::ZoneHandle(ArgumentsDescriptor::New( | |
| 459 ta_len, argument_count - (ta_len > 0 ? 1 : 0), argument_names())); | |
| 457 const intptr_t argdesc_kidx = | 460 const intptr_t argdesc_kidx = |
| 458 compiler->assembler()->AddConstant(arguments_descriptor); | 461 compiler->assembler()->AddConstant(arguments_descriptor); |
| 459 __ StaticCall(argument_count, argdesc_kidx); | 462 __ StaticCall(argument_count, argdesc_kidx); |
| 460 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); | 463 compiler->RecordAfterCall(this, FlowGraphCompiler::kHasResult); |
| 461 if (compiler->is_optimizing()) { | 464 if (compiler->is_optimizing()) { |
| 462 __ PopLocal(locs()->out(0).reg()); | 465 __ PopLocal(locs()->out(0).reg()); |
| 463 } | 466 } |
| 464 } | 467 } |
| 465 | 468 |
| 466 | 469 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 912 } | 915 } |
| 913 | 916 |
| 914 | 917 |
| 915 EMIT_NATIVE_CODE(StringInterpolate, | 918 EMIT_NATIVE_CODE(StringInterpolate, |
| 916 1, | 919 1, |
| 917 Location::RegisterLocation(0), | 920 Location::RegisterLocation(0), |
| 918 LocationSummary::kCall) { | 921 LocationSummary::kCall) { |
| 919 if (compiler->is_optimizing()) { | 922 if (compiler->is_optimizing()) { |
| 920 __ Push(locs()->in(0).reg()); | 923 __ Push(locs()->in(0).reg()); |
| 921 } | 924 } |
| 925 const intptr_t kTypeArgsLen = 0; | |
| 922 const intptr_t kArgumentCount = 1; | 926 const intptr_t kArgumentCount = 1; |
| 923 const Array& arguments_descriptor = Array::Handle( | 927 const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( |
| 924 ArgumentsDescriptor::New(kArgumentCount, Object::null_array())); | 928 kTypeArgsLen, kArgumentCount, Object::null_array())); |
| 925 __ PushConstant(CallFunction()); | 929 __ PushConstant(CallFunction()); |
| 926 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 930 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
| 927 __ StaticCall(kArgumentCount, argdesc_kidx); | 931 __ StaticCall(kArgumentCount, argdesc_kidx); |
| 928 // Note: can't use RecordAfterCall here because | 932 // Note: can't use RecordAfterCall here because |
| 929 // StringInterpolateInstr::ArgumentCount() is 0. However | 933 // StringInterpolateInstr::ArgumentCount() is 0. However |
| 930 // internally it does a call with 1 argument which needs to | 934 // internally it does a call with 1 argument which needs to |
| 931 // be reflected in the lazy deoptimization environment. | 935 // be reflected in the lazy deoptimization environment. |
| 932 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, | 936 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, |
| 933 FlowGraphCompiler::kHasResult, locs()); | 937 FlowGraphCompiler::kHasResult, locs()); |
| 934 if (compiler->is_optimizing()) { | 938 if (compiler->is_optimizing()) { |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2083 } | 2087 } |
| 2084 __ IfULe(length, index); | 2088 __ IfULe(length, index); |
| 2085 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, | 2089 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, |
| 2086 (generalized_ ? ICData::kGeneralized : 0) | | 2090 (generalized_ ? ICData::kGeneralized : 0) | |
| 2087 (licm_hoisted_ ? ICData::kHoisted : 0)); | 2091 (licm_hoisted_ ? ICData::kHoisted : 0)); |
| 2088 } | 2092 } |
| 2089 | 2093 |
| 2090 } // namespace dart | 2094 } // namespace dart |
| 2091 | 2095 |
| 2092 #endif // defined TARGET_ARCH_DBC | 2096 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |