Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Side by Side Diff: runtime/vm/flow_graph_compiler_arm.cc

Issue 1307943008: Make default_parameter_values a ZoneGrowableArray instead of an array in new space (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = parsed_function().DefaultParameterValueAt(
868 zone(), parsed_function().default_parameter_values().At( 868 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
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().DefaultParameterValueAt(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
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
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698