| 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/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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 | 895 |
| 896 __ Bind(&wrong_num_arguments); | 896 __ Bind(&wrong_num_arguments); |
| 897 if (function.IsClosureFunction()) { | 897 if (function.IsClosureFunction()) { |
| 898 // Invoke noSuchMethod function passing "call" as the original name. | 898 // Invoke noSuchMethod function passing "call" as the original name. |
| 899 const int kNumArgsChecked = 1; | 899 const int kNumArgsChecked = 1; |
| 900 const ICData& ic_data = ICData::ZoneHandle( | 900 const ICData& ic_data = ICData::ZoneHandle( |
| 901 ICData::New(function, Symbols::Call(), Object::empty_array(), | 901 ICData::New(function, Symbols::Call(), Object::empty_array(), |
| 902 Isolate::kNoDeoptId, kNumArgsChecked)); | 902 Isolate::kNoDeoptId, kNumArgsChecked)); |
| 903 __ LoadObject(R5, ic_data, PP); | 903 __ LoadObject(R5, ic_data, PP); |
| 904 __ LeaveDartFrame(); // The arguments are still on the stack. | 904 __ LeaveDartFrame(); // The arguments are still on the stack. |
| 905 __ Branch(&StubCode::CallNoSuchMethodFunctionLabel(), PP); | 905 __ BranchFixed(&StubCode::CallNoSuchMethodFunctionLabel()); |
| 906 // The noSuchMethod call may return to the caller, but not here. | 906 // The noSuchMethod call may return to the caller, but not here. |
| 907 __ hlt(0); | 907 __ hlt(0); |
| 908 } else if (check_correct_named_args) { | 908 } else if (check_correct_named_args) { |
| 909 __ Stop("Wrong arguments"); | 909 __ Stop("Wrong arguments"); |
| 910 } | 910 } |
| 911 | 911 |
| 912 __ Bind(&all_arguments_processed); | 912 __ Bind(&all_arguments_processed); |
| 913 // Nullify originally passed arguments only after they have been copied and | 913 // Nullify originally passed arguments only after they have been copied and |
| 914 // checked, otherwise noSuchMethod would not see their original values. | 914 // checked, otherwise noSuchMethod would not see their original values. |
| 915 // This step can be skipped in case we decide that formal parameters are | 915 // This step can be skipped in case we decide that formal parameters are |
| (...skipping 21 matching lines...) Expand all Loading... |
| 937 // SP: receiver. | 937 // SP: receiver. |
| 938 // Sequence node has one return node, its input is load field node. | 938 // Sequence node has one return node, its input is load field node. |
| 939 __ Comment("Inlined Getter"); | 939 __ Comment("Inlined Getter"); |
| 940 __ LoadFromOffset(R0, SP, 0 * kWordSize); | 940 __ LoadFromOffset(R0, SP, 0 * kWordSize); |
| 941 __ LoadFromOffset(R0, R0, offset - kHeapObjectTag); | 941 __ LoadFromOffset(R0, R0, offset - kHeapObjectTag); |
| 942 __ ret(); | 942 __ ret(); |
| 943 } | 943 } |
| 944 | 944 |
| 945 | 945 |
| 946 void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) { | 946 void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) { |
| 947 UNIMPLEMENTED(); | 947 // LR: return address. |
| 948 // SP+1: receiver. |
| 949 // SP+0: value. |
| 950 // Sequence node has one store node and one return NULL node. |
| 951 __ Comment("Inlined Setter"); |
| 952 __ LoadFromOffset(R0, SP, 1 * kWordSize); // Receiver. |
| 953 __ LoadFromOffset(R1, SP, 0 * kWordSize); // Value. |
| 954 __ StoreIntoObject(R0, FieldAddress(R0, offset), R1); |
| 955 __ LoadObject(R0, Object::null_object(), PP); |
| 956 __ ret(); |
| 948 } | 957 } |
| 949 | 958 |
| 950 | 959 |
| 951 void FlowGraphCompiler::EmitFrameEntry() { | 960 void FlowGraphCompiler::EmitFrameEntry() { |
| 952 const Function& function = parsed_function().function(); | 961 const Function& function = parsed_function().function(); |
| 953 Register new_pp = kNoPP; | 962 Register new_pp = kNoPP; |
| 954 if (CanOptimizeFunction() && | 963 if (CanOptimizeFunction() && |
| 955 function.IsOptimizable() && | 964 function.IsOptimizable() && |
| 956 (!is_optimizing() || may_reoptimize())) { | 965 (!is_optimizing() || may_reoptimize())) { |
| 957 const Register function_reg = R6; | 966 const Register function_reg = R6; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 981 ASSERT(function_reg == R6); | 990 ASSERT(function_reg == R6); |
| 982 Label dont_optimize; | 991 Label dont_optimize; |
| 983 __ b(&dont_optimize, LT); | 992 __ b(&dont_optimize, LT); |
| 984 __ Branch(&StubCode::OptimizeFunctionLabel(), new_pp); | 993 __ Branch(&StubCode::OptimizeFunctionLabel(), new_pp); |
| 985 __ Bind(&dont_optimize); | 994 __ Bind(&dont_optimize); |
| 986 } else if (!flow_graph().IsCompiledForOsr()) { | 995 } else if (!flow_graph().IsCompiledForOsr()) { |
| 987 // We have to load the PP here too because a load of an external label | 996 // We have to load the PP here too because a load of an external label |
| 988 // may be patched at the AddCurrentDescriptor below. | 997 // may be patched at the AddCurrentDescriptor below. |
| 989 new_pp = R13; | 998 new_pp = R13; |
| 990 | 999 |
| 1000 // Set up pool pointer in new_pp. |
| 991 __ LoadPoolPointer(new_pp); | 1001 __ LoadPoolPointer(new_pp); |
| 992 | 1002 |
| 993 AddCurrentDescriptor(PcDescriptors::kEntryPatch, | 1003 AddCurrentDescriptor(PcDescriptors::kEntryPatch, |
| 994 Isolate::kNoDeoptId, | 1004 Isolate::kNoDeoptId, |
| 995 0); // No token position. | 1005 0); // No token position. |
| 996 } | 1006 } |
| 997 __ Comment("Enter frame"); | 1007 __ Comment("Enter frame"); |
| 998 if (flow_graph().IsCompiledForOsr()) { | 1008 if (flow_graph().IsCompiledForOsr()) { |
| 999 intptr_t extra_slots = StackSize() | 1009 intptr_t extra_slots = StackSize() |
| 1000 - flow_graph().num_stack_locals() | 1010 - flow_graph().num_stack_locals() |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 const String& name = | 1068 const String& name = |
| 1059 String::Handle(function.IsClosureFunction() | 1069 String::Handle(function.IsClosureFunction() |
| 1060 ? Symbols::Call().raw() | 1070 ? Symbols::Call().raw() |
| 1061 : function.name()); | 1071 : function.name()); |
| 1062 const int kNumArgsChecked = 1; | 1072 const int kNumArgsChecked = 1; |
| 1063 const ICData& ic_data = ICData::ZoneHandle( | 1073 const ICData& ic_data = ICData::ZoneHandle( |
| 1064 ICData::New(function, name, Object::empty_array(), | 1074 ICData::New(function, name, Object::empty_array(), |
| 1065 Isolate::kNoDeoptId, kNumArgsChecked)); | 1075 Isolate::kNoDeoptId, kNumArgsChecked)); |
| 1066 __ LoadObject(R5, ic_data, PP); | 1076 __ LoadObject(R5, ic_data, PP); |
| 1067 __ LeaveDartFrame(); // The arguments are still on the stack. | 1077 __ LeaveDartFrame(); // The arguments are still on the stack. |
| 1068 __ Branch(&StubCode::CallNoSuchMethodFunctionLabel(), PP); | 1078 __ BranchFixed(&StubCode::CallNoSuchMethodFunctionLabel()); |
| 1069 // The noSuchMethod call may return to the caller, but not here. | 1079 // The noSuchMethod call may return to the caller, but not here. |
| 1070 __ hlt(0); | 1080 __ hlt(0); |
| 1071 } else { | 1081 } else { |
| 1072 __ Stop("Wrong number of arguments"); | 1082 __ Stop("Wrong number of arguments"); |
| 1073 } | 1083 } |
| 1074 __ Bind(&correct_num_arguments); | 1084 __ Bind(&correct_num_arguments); |
| 1075 } | 1085 } |
| 1076 } else if (!flow_graph().IsCompiledForOsr()) { | 1086 } else if (!flow_graph().IsCompiledForOsr()) { |
| 1077 CopyParameters(); | 1087 CopyParameters(); |
| 1078 } | 1088 } |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1762 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1772 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1763 UNIMPLEMENTED(); | 1773 UNIMPLEMENTED(); |
| 1764 } | 1774 } |
| 1765 | 1775 |
| 1766 | 1776 |
| 1767 #undef __ | 1777 #undef __ |
| 1768 | 1778 |
| 1769 } // namespace dart | 1779 } // namespace dart |
| 1770 | 1780 |
| 1771 #endif // defined TARGET_ARCH_ARM64 | 1781 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |