mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Update wasm backend
This commit is contained in:
parent
6859c2e15c
commit
9d70c45781
6 changed files with 303 additions and 261 deletions
|
@ -2730,6 +2730,16 @@ impl<'a> Layout<'a> {
|
|||
other => *other,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn runtime_representation_in<I>(layout: InLayout<'a>, interner: &I) -> InLayout<'a>
|
||||
where
|
||||
I: LayoutInterner<'a>,
|
||||
{
|
||||
match interner.get(layout) {
|
||||
Layout::LambdaSet(lambda_set) => lambda_set.runtime_representation(),
|
||||
_ => layout,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Layout<'a> {
|
||||
|
|
|
@ -135,6 +135,11 @@ pub trait LayoutInterner<'a>: Sized {
|
|||
self.get(layout).stack_size(self, self.target_info())
|
||||
}
|
||||
|
||||
fn stack_size_and_alignment(&self, layout: InLayout<'a>) -> (u32, u32) {
|
||||
self.get(layout)
|
||||
.stack_size_and_alignment(self, self.target_info())
|
||||
}
|
||||
|
||||
fn contains_refcounted(&self, layout: InLayout<'a>) -> bool {
|
||||
self.get(layout).contains_refcounted(self)
|
||||
}
|
||||
|
@ -143,6 +148,14 @@ pub trait LayoutInterner<'a>: Sized {
|
|||
self.get(layout).is_refcounted()
|
||||
}
|
||||
|
||||
fn runtime_representation(&self, layout: InLayout<'a>) -> Layout<'a> {
|
||||
self.get(layout).runtime_representation(self)
|
||||
}
|
||||
|
||||
fn runtime_representation_in(&self, layout: InLayout<'a>) -> InLayout<'a> {
|
||||
Layout::runtime_representation_in(layout, self)
|
||||
}
|
||||
|
||||
fn to_doc<'b, D, A>(
|
||||
&self,
|
||||
layout: InLayout<'a>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue