Skip to content

Commit 132071e

Browse files
committed
interpreter: high-water mark register sizing
1 parent 98051c5 commit 132071e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

interpreter/src/vm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ pub struct Consts<'a>(pub IndexSet<Value<'a>, RandomState, &'a Bump>);
6161

6262
impl<'a> Interpreter<'a> {
6363
pub fn new(compat: ExecMode, code: Code<'a>) -> Self {
64+
let n_regs = code.reg_pointer.max(1) as usize;
6465
Self {
6566
arena: code.arena,
6667
bc: code.bc,
6768
program_counter: 0,
68-
registers: Registers(bumpalo::vec![in code.arena; Value::Untyped; 8]),
69+
registers: Registers(bumpalo::vec![in code.arena; Value::Untyped; n_regs]),
6970
symbols: code.symbols,
7071
consts: code.consts,
7172
compat,

0 commit comments

Comments
 (0)