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 argument_count = ArgumentCount(); // Includes type args. |
224 const Array& arguments_descriptor = Array::ZoneHandle( | 224 const Array& arguments_descriptor = |
225 ArgumentsDescriptor::New(argument_count, argument_names())); | 225 Array::ZoneHandle(Z, GetArgumentsDescriptor()); |
226 __ LoadObject(R4, arguments_descriptor); | 226 __ LoadObject(R4, arguments_descriptor); |
227 | 227 |
228 // R4: Arguments descriptor. | 228 // R4: Arguments descriptor. |
229 // R0: Function. | 229 // R0: Function. |
230 ASSERT(locs()->in(0).reg() == R0); | 230 ASSERT(locs()->in(0).reg() == R0); |
231 __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset()); | 231 __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset()); |
232 __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset()); | 232 __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset()); |
233 | 233 |
234 // R2: instructions. | 234 // R2: instructions. |
235 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 235 // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 907 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
908 summary->set_in(0, Location::RegisterLocation(R0)); | 908 summary->set_in(0, Location::RegisterLocation(R0)); |
909 summary->set_out(0, Location::RegisterLocation(R0)); | 909 summary->set_out(0, Location::RegisterLocation(R0)); |
910 return summary; | 910 return summary; |
911 } | 911 } |
912 | 912 |
913 | 913 |
914 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 914 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
915 const Register array = locs()->in(0).reg(); | 915 const Register array = locs()->in(0).reg(); |
916 __ Push(array); | 916 __ Push(array); |
| 917 const int kTypeArgsLen = 0; |
917 const int kNumberOfArguments = 1; | 918 const int kNumberOfArguments = 1; |
918 const Array& kNoArgumentNames = Object::null_array(); | 919 const Array& kNoArgumentNames = Object::null_array(); |
| 920 ArgumentsInfo args_info(kTypeArgsLen, kNumberOfArguments, kNoArgumentNames); |
919 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), | 921 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), |
920 kNumberOfArguments, kNoArgumentNames, locs(), | 922 args_info, locs(), ICData::Handle()); |
921 ICData::Handle()); | |
922 ASSERT(locs()->out(0).reg() == R0); | 923 ASSERT(locs()->out(0).reg() == R0); |
923 } | 924 } |
924 | 925 |
925 | 926 |
926 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, | 927 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, |
927 bool opt) const { | 928 bool opt) const { |
928 const intptr_t kNumInputs = 1; | 929 const intptr_t kNumInputs = 1; |
929 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), | 930 return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(), |
930 LocationSummary::kNoCall); | 931 LocationSummary::kNoCall); |
931 } | 932 } |
(...skipping 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5094 __ CompareImmediate(result, 0xC000000000000000); | 5095 __ CompareImmediate(result, 0xC000000000000000); |
5095 __ b(&do_call, MI); | 5096 __ b(&do_call, MI); |
5096 __ SmiTag(result); | 5097 __ SmiTag(result); |
5097 __ b(&done); | 5098 __ b(&done); |
5098 __ Bind(&do_call); | 5099 __ Bind(&do_call); |
5099 __ Push(value_obj); | 5100 __ Push(value_obj); |
5100 ASSERT(instance_call()->HasICData()); | 5101 ASSERT(instance_call()->HasICData()); |
5101 const ICData& ic_data = *instance_call()->ic_data(); | 5102 const ICData& ic_data = *instance_call()->ic_data(); |
5102 ASSERT(ic_data.NumberOfChecksIs(1)); | 5103 ASSERT(ic_data.NumberOfChecksIs(1)); |
5103 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); | 5104 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); |
5104 | 5105 const int kTypeArgsLen = 0; |
5105 const intptr_t kNumberOfArguments = 1; | 5106 const int kNumberOfArguments = 1; |
| 5107 const Array& kNoArgumentNames = Object::null_array(); |
| 5108 ArgumentsInfo args_info(kTypeArgsLen, kNumberOfArguments, kNoArgumentNames); |
5106 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, | 5109 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, |
5107 kNumberOfArguments, | 5110 args_info, locs(), ICData::Handle()); |
5108 Object::null_array(), // No argument names., | |
5109 locs(), ICData::Handle()); | |
5110 __ Bind(&done); | 5111 __ Bind(&done); |
5111 } | 5112 } |
5112 | 5113 |
5113 | 5114 |
5114 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, | 5115 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, |
5115 bool opt) const { | 5116 bool opt) const { |
5116 const intptr_t kNumInputs = 1; | 5117 const intptr_t kNumInputs = 1; |
5117 const intptr_t kNumTemps = 0; | 5118 const intptr_t kNumTemps = 0; |
5118 LocationSummary* result = new (zone) | 5119 LocationSummary* result = new (zone) |
5119 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5120 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6090 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6091 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
6091 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6092 kGrowRegExpStackRuntimeEntry, 1, locs()); |
6092 __ Drop(1); | 6093 __ Drop(1); |
6093 __ Pop(result); | 6094 __ Pop(result); |
6094 } | 6095 } |
6095 | 6096 |
6096 | 6097 |
6097 } // namespace dart | 6098 } // namespace dart |
6098 | 6099 |
6099 #endif // defined TARGET_ARCH_ARM64 | 6100 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |