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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 53f153e2c25d4d1d337309569f7377f94a1654c1..733a7bc34d51ae471da51b2ccf409aa19ac72c9d 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -564,8 +564,17 @@ static void GenerateDispatcherCode(Assembler* assembler,
__ pushq(RAX); // Receiver.
__ pushq(RBX); // ICData/MegamorphicCache.
__ pushq(R10); // Arguments descriptor array.
+
+ // Adjust arguments count.
+ __ cmpq(FieldAddress(R10, ArgumentsDescriptor::type_args_len_offset()),
+ Immediate(0));
__ movq(R10, RDI);
- // EDX: Smi-tagged arguments array length.
+ Label args_count_ok;
+ __ j(EQUAL, &args_count_ok, Assembler::kNearJump);
+ __ addq(R10, Immediate(Smi::RawValue(1))); // Include the type arguments.
+ __ Bind(&args_count_ok);
+
+ // R10: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
const intptr_t kNumArgs = 4;
__ CallRuntime(kInvokeNoSuchMethodDispatcherRuntimeEntry, kNumArgs);
@@ -1214,7 +1223,16 @@ void StubCode::GenerateCallClosureNoSuchMethodStub(Assembler* assembler) {
__ pushq(RAX); // Receiver.
__ pushq(R10); // Arguments descriptor array.
- __ movq(R10, R13); // Smi-tagged arguments array length.
+ // Adjust arguments count.
+ __ cmpq(FieldAddress(R10, ArgumentsDescriptor::type_args_len_offset()),
+ Immediate(0));
+ __ movq(R10, R13);
+ Label args_count_ok;
+ __ j(EQUAL, &args_count_ok, Assembler::kNearJump);
+ __ addq(R10, Immediate(Smi::RawValue(1))); // Include the type arguments.
+ __ Bind(&args_count_ok);
+
+ // R10: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
const intptr_t kNumArgs = 3;
« 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