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

Unified Diff: runtime/vm/stub_code_arm64.cc

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: Created 3 years, 8 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
Index: runtime/vm/stub_code_arm64.cc
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index 30d38de94c5a9eb3eef432ea1b4b84b89d4b3b67..d00a714ae1b06a7b02715c5dace6ac299a80c790 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -627,6 +627,15 @@ static void GenerateDispatcherCode(Assembler* assembler,
__ Push(R6); // Receiver.
__ Push(R5); // ICData/MegamorphicCache.
__ Push(R4); // Arguments descriptor.
+
+ // Adjust arguments count.
+ __ LoadFieldFromOffset(R3, R4, ArgumentsDescriptor::type_args_len_offset());
+ __ cmp(R3, Operand(0));
+ Label args_count_ok;
+ __ b(&args_count_ok, EQ);
+ __ 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.
+ __ Bind(&args_count_ok);
+
// R2: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
const intptr_t kNumArgs = 4;
@@ -1285,6 +1294,14 @@ void StubCode::GenerateCallClosureNoSuchMethodStub(Assembler* assembler) {
__ Push(R6);
__ Push(R4);
+ // Adjust arguments count.
+ __ LoadFieldFromOffset(R3, R4, ArgumentsDescriptor::type_args_len_offset());
+ __ cmp(R3, Operand(0));
+ Label args_count_ok;
+ __ b(&args_count_ok, EQ);
+ __ 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.
+ __ Bind(&args_count_ok);
+
// R2: Smi-tagged arguments array length.
PushArgumentsArray(assembler);

Powered by Google App Engine
This is Rietveld 408576698