| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 LocationSummary* summary = new (zone) | 213 LocationSummary* summary = new (zone) |
| 214 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 214 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 215 summary->set_in(0, Location::RegisterLocation(R0)); // Function. | 215 summary->set_in(0, Location::RegisterLocation(R0)); // Function. |
| 216 summary->set_out(0, Location::RegisterLocation(R0)); | 216 summary->set_out(0, Location::RegisterLocation(R0)); |
| 217 return summary; | 217 return summary; |
| 218 } | 218 } |
| 219 | 219 |
| 220 | 220 |
| 221 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 221 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 222 // Load arguments descriptor in R4. | 222 // Load arguments descriptor in R4. |
| 223 int argument_count = ArgumentCount(); | 223 const intptr_t ta_len = type_args_len(); |
| 224 const Array& arguments_descriptor = Array::ZoneHandle( | 224 const intptr_t argument_count = ArgumentCount(); // Includes type args. |
| 225 ArgumentsDescriptor::New(argument_count, argument_names())); | 225 const Array& arguments_descriptor = |
| 226 Array::ZoneHandle(ArgumentsDescriptor::New( |
| 227 ta_len, argument_count - (ta_len > 0 ? 1 : 0), argument_names())); |
| 226 __ LoadObject(R4, arguments_descriptor); | 228 __ LoadObject(R4, arguments_descriptor); |
| 227 | 229 |
| 228 // R4: Arguments descriptor. | 230 // R4: Arguments descriptor. |
| 229 // R0: Function. | 231 // R0: Function. |
| 230 ASSERT(locs()->in(0).reg() == R0); | 232 ASSERT(locs()->in(0).reg() == R0); |
| 231 __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset()); | 233 __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset()); |
| 232 __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset()); | 234 __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset()); |
| 233 | 235 |
| 234 // R2: instructions. | 236 // R2: instructions. |
| 235 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 237 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 910 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 909 summary->set_in(0, Location::RegisterLocation(R0)); | 911 summary->set_in(0, Location::RegisterLocation(R0)); |
| 910 summary->set_out(0, Location::RegisterLocation(R0)); | 912 summary->set_out(0, Location::RegisterLocation(R0)); |
| 911 return summary; | 913 return summary; |
| 912 } | 914 } |
| 913 | 915 |
| 914 | 916 |
| 915 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 917 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 916 const Register array = locs()->in(0).reg(); | 918 const Register array = locs()->in(0).reg(); |
| 917 __ Push(array); | 919 __ Push(array); |
| 920 const int kTypeArgsLen = 0; |
| 918 const int kNumberOfArguments = 1; | 921 const int kNumberOfArguments = 1; |
| 919 const Array& kNoArgumentNames = Object::null_array(); | 922 const Array& kNoArgumentNames = Object::null_array(); |
| 920 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), | 923 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), |
| 921 kNumberOfArguments, kNoArgumentNames, locs(), | 924 kTypeArgsLen, kNumberOfArguments, |
| 922 ICData::Handle()); | 925 kNoArgumentNames, locs(), ICData::Handle()); |
| 923 ASSERT(locs()->out(0).reg() == R0); | 926 ASSERT(locs()->out(0).reg() == R0); |
| 924 } | 927 } |
| 925 | 928 |
| 926 | 929 |
| 927 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, | 930 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, |
| 928 bool opt) const { | 931 bool opt) const { |
| 929 const intptr_t kNumInputs = 1; | 932 const intptr_t kNumInputs = 1; |
| 930 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), | 933 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), |
| 931 LocationSummary::kNoCall); | 934 LocationSummary::kNoCall); |
| 932 } | 935 } |
| (...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5096 __ b(&do_call, MI); | 5099 __ b(&do_call, MI); |
| 5097 __ SmiTag(result); | 5100 __ SmiTag(result); |
| 5098 __ b(&done); | 5101 __ b(&done); |
| 5099 __ Bind(&do_call); | 5102 __ Bind(&do_call); |
| 5100 __ Push(value_obj); | 5103 __ Push(value_obj); |
| 5101 ASSERT(instance_call()->HasICData()); | 5104 ASSERT(instance_call()->HasICData()); |
| 5102 const ICData& ic_data = *instance_call()->ic_data(); | 5105 const ICData& ic_data = *instance_call()->ic_data(); |
| 5103 ASSERT(ic_data.NumberOfChecksIs(1)); | 5106 ASSERT(ic_data.NumberOfChecksIs(1)); |
| 5104 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); | 5107 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); |
| 5105 | 5108 |
| 5109 const intptr_t kTypeArgsLen = 0; |
| 5106 const intptr_t kNumberOfArguments = 1; | 5110 const intptr_t kNumberOfArguments = 1; |
| 5107 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, | 5111 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, |
| 5108 kNumberOfArguments, | 5112 kTypeArgsLen, kNumberOfArguments, |
| 5109 Object::null_array(), // No argument names., | 5113 Object::null_array(), // No argument names., |
| 5110 locs(), ICData::Handle()); | 5114 locs(), ICData::Handle()); |
| 5111 __ Bind(&done); | 5115 __ Bind(&done); |
| 5112 } | 5116 } |
| 5113 | 5117 |
| 5114 | 5118 |
| 5115 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, | 5119 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, |
| 5116 bool opt) const { | 5120 bool opt) const { |
| 5117 const intptr_t kNumInputs = 1; | 5121 const intptr_t kNumInputs = 1; |
| 5118 const intptr_t kNumTemps = 0; | 5122 const intptr_t kNumTemps = 0; |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6112 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6116 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
| 6113 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6117 kGrowRegExpStackRuntimeEntry, 1, locs()); |
| 6114 __ Drop(1); | 6118 __ Drop(1); |
| 6115 __ Pop(result); | 6119 __ Pop(result); |
| 6116 } | 6120 } |
| 6117 | 6121 |
| 6118 | 6122 |
| 6119 } // namespace dart | 6123 } // namespace dart |
| 6120 | 6124 |
| 6121 #endif // defined TARGET_ARCH_ARM64 | 6125 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |