Do not require allocating Layouts in arena before interning

This should reduce memory spend, the interner has its own effective
arena anyway
This commit is contained in:
Ayaz Hafiz 2023-01-03 15:43:18 -06:00
parent 4652661a5c
commit ce717dca8b
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
19 changed files with 161 additions and 171 deletions

View file

@ -506,7 +506,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
let heap_return_ptr_id = LocalId(wrapper_arg_layouts.len() as u32 - 1);
let inner_ret_layout = match wrapper_arg_layouts.last() {
Some(Layout::Boxed(inner)) => {
WasmLayout::new(self.layout_interner, self.layout_interner.get(*inner))
WasmLayout::new(self.layout_interner, &self.layout_interner.get(*inner))
}
x => internal_error!("Higher-order wrapper: invalid return layout {:?}", x),
};
@ -548,7 +548,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
// Load the argument pointer. If it's a primitive value, dereference it too.
n_inner_wasm_args += 1;
self.code_builder.get_local(LocalId(i as u32));
self.dereference_boxed_value(inner_layout);
self.dereference_boxed_value(&inner_layout);
}
// If the inner function has closure data, it's the last arg of the inner fn
@ -638,9 +638,9 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
x => internal_error!("Expected a Boxed layout, got {:?}", x),
};
self.code_builder.get_local(LocalId(1));
self.dereference_boxed_value(inner_layout);
self.dereference_boxed_value(&inner_layout);
self.code_builder.get_local(LocalId(2));
self.dereference_boxed_value(inner_layout);
self.dereference_boxed_value(&inner_layout);
// Call the wrapped inner function
let inner_wasm_fn_index = self.fn_index_offset + inner_lookup_idx as u32;