[vm, compiler] Fix accessing unboxed double parameters in the presence of optional parameters on RV32.
Apparently LoadIndexedUnsafe expects kWordSize scaling even when accessing doubles. Cf. ARM32.
TEST=bigint_from_test
Bug: https://github.com/dart-lang/sdk/issues/48333
Change-Id: I21e300feabec28d763f2b679db5656f5dd0f0ea6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233420
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/compiler/backend/il_riscv.cc b/runtime/vm/compiler/backend/il_riscv.cc
index c9067af..51aa2b4 100644
--- a/runtime/vm/compiler/backend/il_riscv.cc
+++ b/runtime/vm/compiler/backend/il_riscv.cc
@@ -132,8 +132,7 @@
}
case kUnboxedDouble: {
const auto out = locs()->out(0).fpu_reg();
- const intptr_t kDoubleSizeLog2 = 3;
- __ slli(TMP, index, kDoubleSizeLog2 - kSmiTagSize);
+ __ slli(TMP, index, kWordSizeLog2 - kSmiTagSize);
__ add(TMP, TMP, base_reg());
__ LoadDFromOffset(out, TMP, offset());
break;