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

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

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: address review comments and sync Created 3 years, 7 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/stub_code_mips.cc ('k') | runtime/vm/unit_test.h » ('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" 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 __ j(NOT_EQUAL, call_target_function); 557 __ j(NOT_EQUAL, call_target_function);
558 __ EnterStubFrame(); 558 __ EnterStubFrame();
559 // Load the receiver. 559 // Load the receiver.
560 __ movq(RDI, FieldAddress(R10, ArgumentsDescriptor::count_offset())); 560 __ movq(RDI, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
561 __ movq(RAX, Address(RBP, RDI, TIMES_HALF_WORD_SIZE, 561 __ movq(RAX, Address(RBP, RDI, TIMES_HALF_WORD_SIZE,
562 kParamEndSlotFromFp * kWordSize)); 562 kParamEndSlotFromFp * kWordSize));
563 __ pushq(Immediate(0)); // Setup space on stack for result. 563 __ pushq(Immediate(0)); // Setup space on stack for result.
564 __ pushq(RAX); // Receiver. 564 __ pushq(RAX); // Receiver.
565 __ pushq(RBX); // ICData/MegamorphicCache. 565 __ pushq(RBX); // ICData/MegamorphicCache.
566 __ pushq(R10); // Arguments descriptor array. 566 __ pushq(R10); // Arguments descriptor array.
567
568 // Adjust arguments count.
569 __ cmpq(FieldAddress(R10, ArgumentsDescriptor::type_args_len_offset()),
570 Immediate(0));
567 __ movq(R10, RDI); 571 __ movq(R10, RDI);
568 // EDX: Smi-tagged arguments array length. 572 Label args_count_ok;
573 __ j(EQUAL, &args_count_ok, Assembler::kNearJump);
574 __ addq(R10, Immediate(Smi::RawValue(1))); // Include the type arguments.
575 __ Bind(&args_count_ok);
576
577 // R10: Smi-tagged arguments array length.
569 PushArgumentsArray(assembler); 578 PushArgumentsArray(assembler);
570 const intptr_t kNumArgs = 4; 579 const intptr_t kNumArgs = 4;
571 __ CallRuntime(kInvokeNoSuchMethodDispatcherRuntimeEntry, kNumArgs); 580 __ CallRuntime(kInvokeNoSuchMethodDispatcherRuntimeEntry, kNumArgs);
572 __ Drop(4); 581 __ Drop(4);
573 __ popq(RAX); // Return value. 582 __ popq(RAX); // Return value.
574 __ LeaveStubFrame(); 583 __ LeaveStubFrame();
575 __ ret(); 584 __ ret();
576 } 585 }
577 586
578 587
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 __ EnterStubFrame(); 1216 __ EnterStubFrame();
1208 1217
1209 // Load the receiver. 1218 // Load the receiver.
1210 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset())); 1219 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
1211 __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize)); 1220 __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize));
1212 1221
1213 __ pushq(Immediate(0)); // Result slot. 1222 __ pushq(Immediate(0)); // Result slot.
1214 __ pushq(RAX); // Receiver. 1223 __ pushq(RAX); // Receiver.
1215 __ pushq(R10); // Arguments descriptor array. 1224 __ pushq(R10); // Arguments descriptor array.
1216 1225
1217 __ movq(R10, R13); // Smi-tagged arguments array length. 1226 // Adjust arguments count.
1227 __ cmpq(FieldAddress(R10, ArgumentsDescriptor::type_args_len_offset()),
1228 Immediate(0));
1229 __ movq(R10, R13);
1230 Label args_count_ok;
1231 __ j(EQUAL, &args_count_ok, Assembler::kNearJump);
1232 __ addq(R10, Immediate(Smi::RawValue(1))); // Include the type arguments.
1233 __ Bind(&args_count_ok);
1234
1235 // R10: Smi-tagged arguments array length.
1218 PushArgumentsArray(assembler); 1236 PushArgumentsArray(assembler);
1219 1237
1220 const intptr_t kNumArgs = 3; 1238 const intptr_t kNumArgs = 3;
1221 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs); 1239 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs);
1222 // noSuchMethod on closures always throws an error, so it will never return. 1240 // noSuchMethod on closures always throws an error, so it will never return.
1223 __ int3(); 1241 __ int3();
1224 } 1242 }
1225 1243
1226 1244
1227 // Cannot use function object from ICData as it may be the inlined 1245 // Cannot use function object from ICData as it may be the inlined
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 } 2316 }
2299 2317
2300 2318
2301 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { 2319 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
2302 __ int3(); 2320 __ int3();
2303 } 2321 }
2304 2322
2305 } // namespace dart 2323 } // namespace dart
2306 2324
2307 #endif // defined TARGET_ARCH_X64 2325 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698