OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 146 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
147 // The arguments to the stub include the closure, as does the arguments | 147 // The arguments to the stub include the closure, as does the arguments |
148 // descriptor. | 148 // descriptor. |
149 Register temp_reg = locs()->temp(0).reg(); | 149 Register temp_reg = locs()->temp(0).reg(); |
150 int argument_count = ArgumentCount(); | 150 int argument_count = ArgumentCount(); |
151 const Array& arguments_descriptor = | 151 const Array& arguments_descriptor = |
152 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, | 152 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, |
153 argument_names())); | 153 argument_names())); |
154 __ LoadObject(temp_reg, arguments_descriptor); | 154 __ LoadObject(temp_reg, arguments_descriptor); |
| 155 ASSERT(temp_reg == R4); |
155 compiler->GenerateDartCall(deopt_id(), | 156 compiler->GenerateDartCall(deopt_id(), |
156 token_pos(), | 157 token_pos(), |
157 &StubCode::CallClosureFunctionLabel(), | 158 &StubCode::CallClosureFunctionLabel(), |
158 PcDescriptors::kClosureCall, | 159 PcDescriptors::kClosureCall, |
159 locs()); | 160 locs()); |
160 __ Drop(argument_count); | 161 __ Drop(argument_count); |
161 } | 162 } |
162 | 163 |
163 | 164 |
164 LocationSummary* LoadLocalInstr::MakeLocationSummary() const { | 165 LocationSummary* LoadLocalInstr::MakeLocationSummary() const { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { | 401 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { |
401 ASSERT(!original_ic_data.IsNull()); | 402 ASSERT(!original_ic_data.IsNull()); |
402 if (original_ic_data.NumberOfChecks() == 0) { | 403 if (original_ic_data.NumberOfChecks() == 0) { |
403 // IC call for reoptimization populates original ICData. | 404 // IC call for reoptimization populates original ICData. |
404 equality_ic_data = original_ic_data.raw(); | 405 equality_ic_data = original_ic_data.raw(); |
405 } else { | 406 } else { |
406 // Megamorphic call. | 407 // Megamorphic call. |
407 equality_ic_data = original_ic_data.AsUnaryClassChecks(); | 408 equality_ic_data = original_ic_data.AsUnaryClassChecks(); |
408 } | 409 } |
409 } else { | 410 } else { |
| 411 const Array& arguments_descriptor = |
| 412 Array::Handle(ArgumentsDescriptor::New(kNumberOfArguments, |
| 413 kNoArgumentNames)); |
410 equality_ic_data = ICData::New(compiler->parsed_function().function(), | 414 equality_ic_data = ICData::New(compiler->parsed_function().function(), |
411 Symbols::EqualOperator(), | 415 Symbols::EqualOperator(), |
| 416 arguments_descriptor, |
412 deopt_id, | 417 deopt_id, |
413 kNumArgumentsChecked); | 418 kNumArgumentsChecked); |
414 } | 419 } |
415 compiler->GenerateInstanceCall(deopt_id, | 420 compiler->GenerateInstanceCall(deopt_id, |
416 token_pos, | 421 token_pos, |
417 kNumberOfArguments, | 422 kNumberOfArguments, |
418 kNoArgumentNames, | 423 kNoArgumentNames, |
419 locs, | 424 locs, |
420 equality_ic_data); | 425 equality_ic_data); |
421 Label check_ne; | 426 Label check_ne; |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { | 951 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { |
947 ASSERT(!ic_data()->IsNull()); | 952 ASSERT(!ic_data()->IsNull()); |
948 if (ic_data()->NumberOfChecks() == 0) { | 953 if (ic_data()->NumberOfChecks() == 0) { |
949 // IC call for reoptimization populates original ICData. | 954 // IC call for reoptimization populates original ICData. |
950 relational_ic_data = ic_data()->raw(); | 955 relational_ic_data = ic_data()->raw(); |
951 } else { | 956 } else { |
952 // Megamorphic call. | 957 // Megamorphic call. |
953 relational_ic_data = ic_data()->AsUnaryClassChecks(); | 958 relational_ic_data = ic_data()->AsUnaryClassChecks(); |
954 } | 959 } |
955 } else { | 960 } else { |
| 961 const Array& arguments_descriptor = |
| 962 Array::Handle(ArgumentsDescriptor::New(kNumArguments, |
| 963 Object::null_array())); |
956 relational_ic_data = ICData::New(compiler->parsed_function().function(), | 964 relational_ic_data = ICData::New(compiler->parsed_function().function(), |
957 function_name, | 965 function_name, |
| 966 arguments_descriptor, |
958 deopt_id(), | 967 deopt_id(), |
959 kNumArgsChecked); | 968 kNumArgsChecked); |
960 } | 969 } |
961 compiler->GenerateInstanceCall(deopt_id(), | 970 compiler->GenerateInstanceCall(deopt_id(), |
962 token_pos(), | 971 token_pos(), |
963 kNumArguments, | 972 kNumArguments, |
964 Array::ZoneHandle(), // No optional arguments. | 973 Object::null_array(), // No optional args. |
965 locs(), | 974 locs(), |
966 relational_ic_data); | 975 relational_ic_data); |
967 } | 976 } |
968 | 977 |
969 | 978 |
970 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 979 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
971 BranchInstr* branch) { | 980 BranchInstr* branch) { |
972 if (operands_class_id() == kSmiCid) { | 981 if (operands_class_id() == kSmiCid) { |
973 EmitSmiComparisonOp(compiler, *locs(), kind(), branch); | 982 EmitSmiComparisonOp(compiler, *locs(), kind(), branch); |
974 return; | 983 return; |
(...skipping 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3618 compiler->GenerateCall(token_pos(), | 3627 compiler->GenerateCall(token_pos(), |
3619 &label, | 3628 &label, |
3620 PcDescriptors::kOther, | 3629 PcDescriptors::kOther, |
3621 locs()); | 3630 locs()); |
3622 __ Drop(2); // Discard type arguments and receiver. | 3631 __ Drop(2); // Discard type arguments and receiver. |
3623 } | 3632 } |
3624 | 3633 |
3625 } // namespace dart | 3634 } // namespace dart |
3626 | 3635 |
3627 #endif // defined TARGET_ARCH_ARM | 3636 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |