Skip to content

Commit 67fab0b

Browse files
committed
deps: V8: increase RISC-V trampoline pool gap
Fixes: #60895 The error (trampoline_pos - fixup_pos) <= kMaxBranchOffset on RISC-V indicates that the trampoline pool is being emitted too late, causing branch targets to be out of range. This commit increases BlockPoolsScope::kGap in assembler-riscv.h from 16 slots to 32 slots. This increases the safety margin, ensuring that the trampoline pool is checked and emitted earlier, preventing the branch offset overflow.
1 parent 10837e3 commit 67fab0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps/v8/src/codegen/riscv/assembler-riscv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase,
481481
public:
482482
// We leave space for a number of trampoline pool slots, so we do not
483483
// have to pass in an explicit margin for all scopes.
484-
static constexpr int kGap = kTrampolineSlotsSize * 16;
484+
static constexpr int kGap = kTrampolineSlotsSize * 32;
485485

486486
explicit BlockPoolsScope(Assembler* assem, int margin = 0)
487487
: BlockPoolsScope(assem, ConstantPoolEmission::kCheck, margin) {}

0 commit comments

Comments
 (0)