Push the layout interner through the backends

This commit is contained in:
Ayaz Hafiz 2022-08-31 12:19:51 -05:00
parent c5466810a4
commit ed04c2040a
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
11 changed files with 34 additions and 14 deletions

View file

@ -16,7 +16,7 @@ use roc_collections::all::{MutMap, MutSet};
use roc_module::symbol::{Interns, ModuleId, Symbol};
use roc_mono::code_gen_help::CodeGenHelp;
use roc_mono::ir::{Proc, ProcLayout};
use roc_mono::layout::LayoutIds;
use roc_mono::layout::{LayoutIds, STLayoutInterner};
use roc_target::TargetInfo;
use wasm_module::parse::ParseError;
@ -43,6 +43,7 @@ pub const STACK_POINTER_NAME: &str = "__stack_pointer";
pub struct Env<'a> {
pub arena: &'a Bump,
pub layout_interner: &'a STLayoutInterner<'a>,
pub module_id: ModuleId,
pub exposed_to_host: MutSet<Symbol>,
pub stack_bytes: u32,

View file

@ -2136,7 +2136,10 @@ pub fn call_higher_order_lowlevel<'a>(
let (closure_data_layout, closure_data_exists) =
match backend.storage.symbol_layouts[captured_environment] {
Layout::LambdaSet(lambda_set) => {
if lambda_set.is_represented().is_some() {
if lambda_set
.is_represented(backend.env.layout_interner)
.is_some()
{
(lambda_set.runtime_representation(), true)
} else {
// Closure data is a lambda set, which *itself* has no closure data!