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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
620 __ EnterStubFrame(); | 620 __ EnterStubFrame(); |
621 | 621 |
622 // Load the receiver. | 622 // Load the receiver. |
623 __ LoadFieldFromOffset(R2, R4, ArgumentsDescriptor::count_offset()); | 623 __ LoadFieldFromOffset(R2, R4, ArgumentsDescriptor::count_offset()); |
624 __ add(TMP, FP, Operand(R2, LSL, 2)); // R2 is Smi. | 624 __ add(TMP, FP, Operand(R2, LSL, 2)); // R2 is Smi. |
625 __ LoadFromOffset(R6, TMP, kParamEndSlotFromFp * kWordSize); | 625 __ LoadFromOffset(R6, TMP, kParamEndSlotFromFp * kWordSize); |
626 __ Push(ZR); // Result slot. | 626 __ Push(ZR); // Result slot. |
627 __ Push(R6); // Receiver. | 627 __ Push(R6); // Receiver. |
628 __ Push(R5); // ICData/MegamorphicCache. | 628 __ Push(R5); // ICData/MegamorphicCache. |
629 __ Push(R4); // Arguments descriptor. | 629 __ Push(R4); // Arguments descriptor. |
630 | |
631 // Adjust arguments count. | |
632 __ LoadFieldFromOffset(R3, R4, ArgumentsDescriptor::type_args_len_offset()); | |
633 __ cmp(R3, Operand(0)); | |
634 Label args_count_ok; | |
635 __ b(&args_count_ok, EQ); | |
636 __ AddImmediate(R2, R2, Smi::RawValue(1)); // Include the type arguments. | |
zra
2017/05/03 15:03:25
Can you use the cinc instruction here instead of a
regis
2017/05/09 18:31:23
Done. Used csinc.
| |
637 __ Bind(&args_count_ok); | |
638 | |
630 // R2: Smi-tagged arguments array length. | 639 // R2: Smi-tagged arguments array length. |
631 PushArgumentsArray(assembler); | 640 PushArgumentsArray(assembler); |
632 const intptr_t kNumArgs = 4; | 641 const intptr_t kNumArgs = 4; |
633 __ CallRuntime(kInvokeNoSuchMethodDispatcherRuntimeEntry, kNumArgs); | 642 __ CallRuntime(kInvokeNoSuchMethodDispatcherRuntimeEntry, kNumArgs); |
634 __ Drop(4); | 643 __ Drop(4); |
635 __ Pop(R0); // Return value. | 644 __ Pop(R0); // Return value. |
636 __ LeaveStubFrame(); | 645 __ LeaveStubFrame(); |
637 __ ret(); | 646 __ ret(); |
638 } | 647 } |
639 | 648 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1278 __ add(TMP, FP, Operand(R2, LSL, 2)); // R2 is Smi. | 1287 __ add(TMP, FP, Operand(R2, LSL, 2)); // R2 is Smi. |
1279 __ LoadFromOffset(R6, TMP, kParamEndSlotFromFp * kWordSize); | 1288 __ LoadFromOffset(R6, TMP, kParamEndSlotFromFp * kWordSize); |
1280 | 1289 |
1281 // Push space for the return value. | 1290 // Push space for the return value. |
1282 // Push the receiver. | 1291 // Push the receiver. |
1283 // Push arguments descriptor array. | 1292 // Push arguments descriptor array. |
1284 __ Push(ZR); | 1293 __ Push(ZR); |
1285 __ Push(R6); | 1294 __ Push(R6); |
1286 __ Push(R4); | 1295 __ Push(R4); |
1287 | 1296 |
1297 // Adjust arguments count. | |
1298 __ LoadFieldFromOffset(R3, R4, ArgumentsDescriptor::type_args_len_offset()); | |
1299 __ cmp(R3, Operand(0)); | |
1300 Label args_count_ok; | |
1301 __ b(&args_count_ok, EQ); | |
1302 __ AddImmediate(R2, R2, Smi::RawValue(1)); // Include the type arguments. | |
zra
2017/05/03 15:03:25
ditto
regis
2017/05/09 18:31:23
Done.
| |
1303 __ Bind(&args_count_ok); | |
1304 | |
1288 // R2: Smi-tagged arguments array length. | 1305 // R2: Smi-tagged arguments array length. |
1289 PushArgumentsArray(assembler); | 1306 PushArgumentsArray(assembler); |
1290 | 1307 |
1291 const intptr_t kNumArgs = 3; | 1308 const intptr_t kNumArgs = 3; |
1292 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs); | 1309 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs); |
1293 // noSuchMethod on closures always throws an error, so it will never return. | 1310 // noSuchMethod on closures always throws an error, so it will never return. |
1294 __ brk(0); | 1311 __ brk(0); |
1295 } | 1312 } |
1296 | 1313 |
1297 | 1314 |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2361 } | 2378 } |
2362 | 2379 |
2363 | 2380 |
2364 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { | 2381 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { |
2365 __ brk(0); | 2382 __ brk(0); |
2366 } | 2383 } |
2367 | 2384 |
2368 } // namespace dart | 2385 } // namespace dart |
2369 | 2386 |
2370 #endif // defined TARGET_ARCH_ARM64 | 2387 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |