Chromium Code Reviews| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1166 __ ret(); | 1166 __ ret(); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 | 1169 |
| 1170 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function | 1170 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function |
| 1171 // from the entry code of a dart function after an error in passed argument | 1171 // from the entry code of a dart function after an error in passed argument |
| 1172 // name or number is detected. | 1172 // name or number is detected. |
| 1173 // Input parameters: | 1173 // Input parameters: |
| 1174 // RSP : points to return address. | 1174 // RSP : points to return address. |
| 1175 // RSP + 8 : address of last argument. | 1175 // RSP + 8 : address of last argument. |
| 1176 // RBX : ic-data. | |
| 1177 // R10 : arguments descriptor array. | 1176 // R10 : arguments descriptor array. |
| 1178 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { | 1177 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { |
| 1179 __ EnterStubFrame(); | 1178 __ EnterStubFrame(); |
| 1180 | 1179 |
| 1181 // Load the receiver. | 1180 // Load the receiver. |
| 1182 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset())); | 1181 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset())); |
| 1183 __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize)); | 1182 __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize)); |
| 1184 | 1183 |
| 1185 __ LoadObject(R12, Object::null_object(), PP); | 1184 __ LoadObject(R12, Object::null_object(), PP); |
| 1186 __ pushq(R12); // Setup space on stack for result from noSuchMethod. | 1185 __ pushq(R12); // Setup space on stack for result from noSuchMethod. |
| 1187 __ pushq(RAX); // Receiver. | 1186 __ pushq(RAX); // Receiver. |
| 1188 __ pushq(RBX); // IC data array. | |
| 1189 __ pushq(R10); // Arguments descriptor array. | 1187 __ pushq(R10); // Arguments descriptor array. |
| 1190 | 1188 |
| 1191 __ movq(R10, R13); // Smi-tagged arguments array length. | 1189 __ movq(R10, R13); // Smi-tagged arguments array length. |
| 1192 PushArgumentsArray(assembler); | 1190 PushArgumentsArray(assembler); |
| 1193 | 1191 |
| 1194 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); | 1192 const intptr_t kNumArgs = 3; |
| 1193 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, kNumArgs); | |
| 1195 | 1194 |
|
Vyacheslav Egorov (Google)
2014/09/02 22:28:04
I think all the code after CallRuntime is dead bec
Florian Schneider
2014/09/03 09:05:00
Only Object::noSuchMethod throws, otherwise it can
Florian Schneider
2014/09/03 12:17:28
You're right that in the case of closures, it alwa
| |
| 1196 // Remove arguments. | 1195 // Remove arguments. |
| 1197 __ Drop(4); | 1196 __ Drop(kNumArgs); |
| 1198 __ popq(RAX); // Get result into RAX. | 1197 __ popq(RAX); // Get result into RAX. |
| 1199 | 1198 |
| 1200 // Remove the stub frame as we are about to return. | 1199 // Remove the stub frame as we are about to return. |
| 1201 __ LeaveStubFrame(); | 1200 __ LeaveStubFrame(); |
| 1202 __ ret(); | 1201 __ ret(); |
| 1203 } | 1202 } |
| 1204 | 1203 |
| 1205 | 1204 |
| 1206 // Cannot use function object from ICData as it may be the inlined | 1205 // Cannot use function object from ICData as it may be the inlined |
| 1207 // function and not the top-scope function. | 1206 // function and not the top-scope function. |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2016 | 2015 |
| 2017 __ movq(left, Address(RSP, 2 * kWordSize)); | 2016 __ movq(left, Address(RSP, 2 * kWordSize)); |
| 2018 __ movq(right, Address(RSP, 1 * kWordSize)); | 2017 __ movq(right, Address(RSP, 1 * kWordSize)); |
| 2019 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 2018 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 2020 __ ret(); | 2019 __ ret(); |
| 2021 } | 2020 } |
| 2022 | 2021 |
| 2023 } // namespace dart | 2022 } // namespace dart |
| 2024 | 2023 |
| 2025 #endif // defined TARGET_ARCH_X64 | 2024 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |