| 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 __ ldr(R5, Address(R6, ArgumentsDescriptor::position_offset())); | 857 __ ldr(R5, Address(R6, ArgumentsDescriptor::position_offset())); |
| 858 // R5 is arg_pos as Smi. | 858 // R5 is arg_pos as Smi. |
| 859 // Point to next named entry. | 859 // Point to next named entry. |
| 860 __ add(R6, R6, Operand(ArgumentsDescriptor::named_entry_size())); | 860 __ add(R6, R6, Operand(ArgumentsDescriptor::named_entry_size())); |
| 861 __ rsb(R5, R5, Operand(0)); | 861 __ rsb(R5, R5, Operand(0)); |
| 862 Address argument_addr(R7, R5, LSL, 1); // R5 is a negative Smi. | 862 Address argument_addr(R7, R5, LSL, 1); // R5 is a negative Smi. |
| 863 __ ldr(R5, argument_addr); | 863 __ ldr(R5, argument_addr); |
| 864 __ b(&assign_optional_parameter); | 864 __ b(&assign_optional_parameter); |
| 865 __ Bind(&load_default_value); | 865 __ Bind(&load_default_value); |
| 866 // Load R5 with default argument. | 866 // Load R5 with default argument. |
| 867 const Object& value = Object::ZoneHandle( | 867 const Instance& value = |
| 868 zone(), parsed_function().default_parameter_values().At( | 868 parsed_function().DefaultParameterAt(param_pos - num_fixed_params); |
| 869 param_pos - num_fixed_params)); | |
| 870 __ LoadObject(R5, value); | 869 __ LoadObject(R5, value); |
| 871 __ Bind(&assign_optional_parameter); | 870 __ Bind(&assign_optional_parameter); |
| 872 // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos]. | 871 // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos]. |
| 873 // We do not use the final allocation index of the variable here, i.e. | 872 // We do not use the final allocation index of the variable here, i.e. |
| 874 // scope->VariableAt(i)->index(), because captured variables still need | 873 // scope->VariableAt(i)->index(), because captured variables still need |
| 875 // to be copied to the context that is not yet allocated. | 874 // to be copied to the context that is not yet allocated. |
| 876 const intptr_t computed_param_pos = kFirstLocalSlotFromFp - param_pos; | 875 const intptr_t computed_param_pos = kFirstLocalSlotFromFp - param_pos; |
| 877 const Address param_addr(FP, computed_param_pos * kWordSize); | 876 const Address param_addr(FP, computed_param_pos * kWordSize); |
| 878 __ str(R5, param_addr); | 877 __ str(R5, param_addr); |
| 879 } | 878 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 893 __ SmiUntag(R9); | 892 __ SmiUntag(R9); |
| 894 for (int i = 0; i < num_opt_pos_params; i++) { | 893 for (int i = 0; i < num_opt_pos_params; i++) { |
| 895 Label next_parameter; | 894 Label next_parameter; |
| 896 // Handle this optional positional parameter only if k or fewer positional | 895 // Handle this optional positional parameter only if k or fewer positional |
| 897 // arguments have been passed, where k is param_pos, the position of this | 896 // arguments have been passed, where k is param_pos, the position of this |
| 898 // optional parameter in the formal parameter list. | 897 // optional parameter in the formal parameter list. |
| 899 const int param_pos = num_fixed_params + i; | 898 const int param_pos = num_fixed_params + i; |
| 900 __ CompareImmediate(R9, param_pos); | 899 __ CompareImmediate(R9, param_pos); |
| 901 __ b(&next_parameter, GT); | 900 __ b(&next_parameter, GT); |
| 902 // Load R5 with default argument. | 901 // Load R5 with default argument. |
| 903 const Object& value = Object::ZoneHandle( | 902 const Object& value = parsed_function().DefaultParameterAt(i); |
| 904 zone(), parsed_function().default_parameter_values().At(i)); | |
| 905 __ LoadObject(R5, value); | 903 __ LoadObject(R5, value); |
| 906 // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos]. | 904 // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos]. |
| 907 // We do not use the final allocation index of the variable here, i.e. | 905 // We do not use the final allocation index of the variable here, i.e. |
| 908 // scope->VariableAt(i)->index(), because captured variables still need | 906 // scope->VariableAt(i)->index(), because captured variables still need |
| 909 // to be copied to the context that is not yet allocated. | 907 // to be copied to the context that is not yet allocated. |
| 910 const intptr_t computed_param_pos = kFirstLocalSlotFromFp - param_pos; | 908 const intptr_t computed_param_pos = kFirstLocalSlotFromFp - param_pos; |
| 911 const Address param_addr(FP, computed_param_pos * kWordSize); | 909 const Address param_addr(FP, computed_param_pos * kWordSize); |
| 912 __ str(R5, param_addr); | 910 __ str(R5, param_addr); |
| 913 __ Bind(&next_parameter); | 911 __ Bind(&next_parameter); |
| 914 } | 912 } |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1904 DRegister dreg = EvenDRegisterOf(reg); | 1902 DRegister dreg = EvenDRegisterOf(reg); |
| 1905 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1903 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1906 } | 1904 } |
| 1907 | 1905 |
| 1908 | 1906 |
| 1909 #undef __ | 1907 #undef __ |
| 1910 | 1908 |
| 1911 } // namespace dart | 1909 } // namespace dart |
| 1912 | 1910 |
| 1913 #endif // defined TARGET_ARCH_ARM | 1911 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |