mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Push layout interner further through Layout
This commit is contained in:
parent
ed04c2040a
commit
3b4b1838b8
34 changed files with 1279 additions and 634 deletions
|
@ -4,7 +4,7 @@ use bumpalo::Bump;
|
|||
use roc_collections::all::MutMap;
|
||||
use roc_error_macros::internal_error;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_mono::layout::Layout;
|
||||
use roc_mono::layout::{Layout, STLayoutInterner};
|
||||
|
||||
use crate::layout::{CallConv, ReturnMethod, StackMemoryFormat, WasmLayout};
|
||||
use crate::wasm_module::{Align, CodeBuilder, LocalId, ValueType, VmSymbolState};
|
||||
|
@ -168,11 +168,12 @@ impl<'a> Storage<'a> {
|
|||
/// They are allocated a certain offset and size in the stack frame.
|
||||
pub fn allocate_var(
|
||||
&mut self,
|
||||
interner: &STLayoutInterner<'a>,
|
||||
layout: Layout<'a>,
|
||||
symbol: Symbol,
|
||||
kind: StoredVarKind,
|
||||
) -> StoredValue {
|
||||
let wasm_layout = WasmLayout::new(&layout);
|
||||
let wasm_layout = WasmLayout::new(interner, &layout);
|
||||
self.symbol_layouts.insert(symbol, layout);
|
||||
|
||||
let storage = match wasm_layout {
|
||||
|
@ -217,6 +218,7 @@ impl<'a> Storage<'a> {
|
|||
/// stack frame, because it's a lot easier to keep track of the data flow.
|
||||
pub fn allocate_args(
|
||||
&mut self,
|
||||
interner: &STLayoutInterner<'a>,
|
||||
args: &[(Layout<'a>, Symbol)],
|
||||
code_builder: &mut CodeBuilder,
|
||||
arena: &'a Bump,
|
||||
|
@ -226,7 +228,7 @@ impl<'a> Storage<'a> {
|
|||
|
||||
for (layout, symbol) in args {
|
||||
self.symbol_layouts.insert(*symbol, *layout);
|
||||
let wasm_layout = WasmLayout::new(layout);
|
||||
let wasm_layout = WasmLayout::new(interner, layout);
|
||||
let local_index = self.arg_types.len() as u32;
|
||||
|
||||
let storage = match wasm_layout {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue