Update wasm backend

This commit is contained in:
Ayaz Hafiz 2023-01-03 21:22:47 -06:00
parent 6859c2e15c
commit 9d70c45781
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
6 changed files with 303 additions and 261 deletions

View file

@ -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> {

View file

@ -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>,