| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 | 147 |
| 148 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 148 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 149 // The arguments to the stub include the closure, as does the arguments | 149 // The arguments to the stub include the closure, as does the arguments |
| 150 // descriptor. | 150 // descriptor. |
| 151 Register temp_reg = locs()->temp(0).reg(); | 151 Register temp_reg = locs()->temp(0).reg(); |
| 152 int argument_count = ArgumentCount(); | 152 int argument_count = ArgumentCount(); |
| 153 const Array& arguments_descriptor = | 153 const Array& arguments_descriptor = |
| 154 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, | 154 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, |
| 155 argument_names())); | 155 argument_names())); |
| 156 ASSERT(temp_reg == S4); |
| 156 __ LoadObject(temp_reg, arguments_descriptor); | 157 __ LoadObject(temp_reg, arguments_descriptor); |
| 157 compiler->GenerateDartCall(deopt_id(), | 158 compiler->GenerateDartCall(deopt_id(), |
| 158 token_pos(), | 159 token_pos(), |
| 159 &StubCode::CallClosureFunctionLabel(), | 160 &StubCode::CallClosureFunctionLabel(), |
| 160 PcDescriptors::kClosureCall, | 161 PcDescriptors::kClosureCall, |
| 161 locs()); | 162 locs()); |
| 162 __ Drop(argument_count); | 163 __ Drop(argument_count); |
| 163 } | 164 } |
| 164 | 165 |
| 165 | 166 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { | 400 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { |
| 400 ASSERT(!original_ic_data.IsNull()); | 401 ASSERT(!original_ic_data.IsNull()); |
| 401 if (original_ic_data.NumberOfChecks() == 0) { | 402 if (original_ic_data.NumberOfChecks() == 0) { |
| 402 // IC call for reoptimization populates original ICData. | 403 // IC call for reoptimization populates original ICData. |
| 403 equality_ic_data = original_ic_data.raw(); | 404 equality_ic_data = original_ic_data.raw(); |
| 404 } else { | 405 } else { |
| 405 // Megamorphic call. | 406 // Megamorphic call. |
| 406 equality_ic_data = original_ic_data.AsUnaryClassChecks(); | 407 equality_ic_data = original_ic_data.AsUnaryClassChecks(); |
| 407 } | 408 } |
| 408 } else { | 409 } else { |
| 410 const Array& arguments_descriptor = |
| 411 Array::ZoneHandle(ArgumentsDescriptor::New(kNumberOfArguments, |
| 412 kNoArgumentNames)); |
| 409 equality_ic_data = ICData::New(compiler->parsed_function().function(), | 413 equality_ic_data = ICData::New(compiler->parsed_function().function(), |
| 410 Symbols::EqualOperator(), | 414 Symbols::EqualOperator(), |
| 415 arguments_descriptor, |
| 411 deopt_id, | 416 deopt_id, |
| 412 kNumArgumentsChecked); | 417 kNumArgumentsChecked); |
| 413 } | 418 } |
| 414 compiler->GenerateInstanceCall(deopt_id, | 419 compiler->GenerateInstanceCall(deopt_id, |
| 415 token_pos, | 420 token_pos, |
| 416 kNumberOfArguments, | 421 kNumberOfArguments, |
| 417 kNoArgumentNames, | 422 kNoArgumentNames, |
| 418 locs, | 423 locs, |
| 419 equality_ic_data); | 424 equality_ic_data); |
| 420 Label check_ne; | 425 Label check_ne; |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { | 1010 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { |
| 1006 ASSERT(!ic_data()->IsNull()); | 1011 ASSERT(!ic_data()->IsNull()); |
| 1007 if (ic_data()->NumberOfChecks() == 0) { | 1012 if (ic_data()->NumberOfChecks() == 0) { |
| 1008 // IC call for reoptimization populates original ICData. | 1013 // IC call for reoptimization populates original ICData. |
| 1009 relational_ic_data = ic_data()->raw(); | 1014 relational_ic_data = ic_data()->raw(); |
| 1010 } else { | 1015 } else { |
| 1011 // Megamorphic call. | 1016 // Megamorphic call. |
| 1012 relational_ic_data = ic_data()->AsUnaryClassChecks(); | 1017 relational_ic_data = ic_data()->AsUnaryClassChecks(); |
| 1013 } | 1018 } |
| 1014 } else { | 1019 } else { |
| 1020 const Array& arguments_descriptor = |
| 1021 Array::ZoneHandle(ArgumentsDescriptor::New(kNumArguments, |
| 1022 Array::ZoneHandle())); |
| 1015 relational_ic_data = ICData::New(compiler->parsed_function().function(), | 1023 relational_ic_data = ICData::New(compiler->parsed_function().function(), |
| 1016 function_name, | 1024 function_name, |
| 1025 arguments_descriptor, |
| 1017 deopt_id(), | 1026 deopt_id(), |
| 1018 kNumArgsChecked); | 1027 kNumArgsChecked); |
| 1019 } | 1028 } |
| 1020 compiler->GenerateInstanceCall(deopt_id(), | 1029 compiler->GenerateInstanceCall(deopt_id(), |
| 1021 token_pos(), | 1030 token_pos(), |
| 1022 kNumArguments, | 1031 kNumArguments, |
| 1023 Array::ZoneHandle(), // No optional arguments. | 1032 Array::ZoneHandle(), // No optional arguments. |
| 1024 locs(), | 1033 locs(), |
| 1025 relational_ic_data); | 1034 relational_ic_data); |
| 1026 } | 1035 } |
| (...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3668 compiler->GenerateCall(token_pos(), | 3677 compiler->GenerateCall(token_pos(), |
| 3669 &label, | 3678 &label, |
| 3670 PcDescriptors::kOther, | 3679 PcDescriptors::kOther, |
| 3671 locs()); | 3680 locs()); |
| 3672 __ Drop(2); // Discard type arguments and receiver. | 3681 __ Drop(2); // Discard type arguments and receiver. |
| 3673 } | 3682 } |
| 3674 | 3683 |
| 3675 } // namespace dart | 3684 } // namespace dart |
| 3676 | 3685 |
| 3677 #endif // defined TARGET_ARCH_MIPS | 3686 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |