| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 } | 970 } |
| 971 | 971 |
| 972 __ Bind(&wrong_num_arguments); | 972 __ Bind(&wrong_num_arguments); |
| 973 if (function.IsClosureFunction()) { | 973 if (function.IsClosureFunction()) { |
| 974 // Invoke noSuchMethod function passing "call" as the original name. | 974 // Invoke noSuchMethod function passing "call" as the original name. |
| 975 const int kNumArgsChecked = 1; | 975 const int kNumArgsChecked = 1; |
| 976 const ICData& ic_data = ICData::ZoneHandle( | 976 const ICData& ic_data = ICData::ZoneHandle( |
| 977 ICData::New(function, Symbols::Call(), Object::empty_array(), | 977 ICData::New(function, Symbols::Call(), Object::empty_array(), |
| 978 Isolate::kNoDeoptId, kNumArgsChecked)); | 978 Isolate::kNoDeoptId, kNumArgsChecked)); |
| 979 __ LoadObject(RBX, ic_data, PP); | 979 __ LoadObject(RBX, ic_data, PP); |
| 980 __ LeaveFrameWithPP(); // The arguments are still on the stack. | 980 __ LeaveDartFrame(); // The arguments are still on the stack. |
| 981 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); | 981 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); |
| 982 // The noSuchMethod call may return to the caller, but not here. | 982 // The noSuchMethod call may return to the caller, but not here. |
| 983 __ int3(); | 983 __ int3(); |
| 984 } else if (check_correct_named_args) { | 984 } else if (check_correct_named_args) { |
| 985 __ Stop("Wrong arguments"); | 985 __ Stop("Wrong arguments"); |
| 986 } | 986 } |
| 987 | 987 |
| 988 __ Bind(&all_arguments_processed); | 988 __ Bind(&all_arguments_processed); |
| 989 // Nullify originally passed arguments only after they have been copied and | 989 // Nullify originally passed arguments only after they have been copied and |
| 990 // checked, otherwise noSuchMethod would not see their original values. | 990 // checked, otherwise noSuchMethod would not see their original values. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 // For closure functions, use "call" as the original name. | 1169 // For closure functions, use "call" as the original name. |
| 1170 const String& name = | 1170 const String& name = |
| 1171 String::Handle(function.IsClosureFunction() | 1171 String::Handle(function.IsClosureFunction() |
| 1172 ? Symbols::Call().raw() | 1172 ? Symbols::Call().raw() |
| 1173 : function.name()); | 1173 : function.name()); |
| 1174 const int kNumArgsChecked = 1; | 1174 const int kNumArgsChecked = 1; |
| 1175 const ICData& ic_data = ICData::ZoneHandle( | 1175 const ICData& ic_data = ICData::ZoneHandle( |
| 1176 ICData::New(function, name, Object::empty_array(), | 1176 ICData::New(function, name, Object::empty_array(), |
| 1177 Isolate::kNoDeoptId, kNumArgsChecked)); | 1177 Isolate::kNoDeoptId, kNumArgsChecked)); |
| 1178 __ LoadObject(RBX, ic_data, PP); | 1178 __ LoadObject(RBX, ic_data, PP); |
| 1179 __ LeaveFrameWithPP(); // The arguments are still on the stack. | 1179 __ LeaveDartFrame(); // The arguments are still on the stack. |
| 1180 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); | 1180 __ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); |
| 1181 // The noSuchMethod call may return to the caller, but not here. | 1181 // The noSuchMethod call may return to the caller, but not here. |
| 1182 __ int3(); | 1182 __ int3(); |
| 1183 } else { | 1183 } else { |
| 1184 __ Stop("Wrong number of arguments"); | 1184 __ Stop("Wrong number of arguments"); |
| 1185 } | 1185 } |
| 1186 __ Bind(&correct_num_arguments); | 1186 __ Bind(&correct_num_arguments); |
| 1187 } | 1187 } |
| 1188 } else if (!flow_graph().IsCompiledForOsr()) { | 1188 } else if (!flow_graph().IsCompiledForOsr()) { |
| 1189 CopyParameters(); | 1189 CopyParameters(); |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1898 __ movups(reg, Address(RSP, 0)); | 1898 __ movups(reg, Address(RSP, 0)); |
| 1899 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1899 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1900 } | 1900 } |
| 1901 | 1901 |
| 1902 | 1902 |
| 1903 #undef __ | 1903 #undef __ |
| 1904 | 1904 |
| 1905 } // namespace dart | 1905 } // namespace dart |
| 1906 | 1906 |
| 1907 #endif // defined TARGET_ARCH_X64 | 1907 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |