Index: runtime/vm/stub_code_mips.cc |
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc |
index f94b884192aa5bc36f1bbb502b28730fc03c96eb..4da10c9ad5d92de6ffa40e8c92c571621ddb8572 100644 |
--- a/runtime/vm/stub_code_mips.cc |
+++ b/runtime/vm/stub_code_mips.cc |
@@ -623,6 +623,14 @@ static void GenerateDispatcherCode(Assembler* assembler, |
__ sw(T6, Address(SP, 2 * kWordSize)); |
__ sw(S5, Address(SP, 1 * kWordSize)); |
__ sw(S4, Address(SP, 0 * kWordSize)); |
+ |
+ // Adjust arguments count. |
+ __ lw(TMP, FieldAddress(S4, ArgumentsDescriptor::type_args_len_offset())); |
+ Label args_count_ok; |
+ __ BranchEqual(TMP, Immediate(0), &args_count_ok); |
+ __ AddImmediate(A1, A1, Smi::RawValue(1)); // Include the type arguments. |
+ __ Bind(&args_count_ok); |
+ |
// A1: Smi-tagged arguments array length. |
PushArgumentsArray(assembler); |
const intptr_t kNumArgs = 4; |
@@ -1308,6 +1316,13 @@ void StubCode::GenerateCallClosureNoSuchMethodStub(Assembler* assembler) { |
__ sw(T6, Address(SP, 1 * kWordSize)); |
__ sw(S4, Address(SP, 0 * kWordSize)); |
+ // Adjust arguments count. |
+ __ lw(TMP, FieldAddress(S4, ArgumentsDescriptor::type_args_len_offset())); |
+ Label args_count_ok; |
+ __ BranchEqual(TMP, Immediate(0), &args_count_ok); |
+ __ AddImmediate(A1, A1, Smi::RawValue(1)); // Include the type arguments. |
+ __ Bind(&args_count_ok); |
+ |
// A1: Smi-tagged arguments array length. |
PushArgumentsArray(assembler); |