mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-20 03:59:54 +00:00
Put the capture niche in the lambda name instead of generating new names
This commit is contained in:
parent
1ed2e1a8e9
commit
019ebd93f7
20 changed files with 592 additions and 486 deletions
|
|
@ -380,7 +380,7 @@ impl<'a> WasmBackend<'a> {
|
|||
println!("\ngenerating procedure {:?}\n", proc.name);
|
||||
}
|
||||
|
||||
self.append_proc_debug_name(proc.name.call_name());
|
||||
self.append_proc_debug_name(proc.name.name());
|
||||
|
||||
self.start_proc(proc);
|
||||
|
||||
|
|
@ -1125,9 +1125,10 @@ impl<'a> WasmBackend<'a> {
|
|||
let proc_layout = ProcLayout {
|
||||
arguments: arg_layouts,
|
||||
result: **result,
|
||||
captures_niche: func_sym.captures_niche,
|
||||
};
|
||||
self.expr_call_by_name(
|
||||
*func_sym,
|
||||
func_sym.name(),
|
||||
&proc_layout,
|
||||
arguments,
|
||||
ret_sym,
|
||||
|
|
|
|||
|
|
@ -1951,12 +1951,13 @@ pub fn call_higher_order_lowlevel<'a>(
|
|||
let passed_proc_layout = ProcLayout {
|
||||
arguments: argument_layouts,
|
||||
result: *result_layout,
|
||||
captures_niche: fn_name.captures_niche,
|
||||
};
|
||||
let passed_proc_index = backend
|
||||
.proc_lookup
|
||||
.iter()
|
||||
.position(|ProcLookupData { name, layout, .. }| {
|
||||
name == fn_name && layout == &passed_proc_layout
|
||||
*name == fn_name.name() && layout == &passed_proc_layout
|
||||
})
|
||||
.unwrap();
|
||||
ProcSource::HigherOrderWrapper(passed_proc_index)
|
||||
|
|
@ -1984,6 +1985,7 @@ pub fn call_higher_order_lowlevel<'a>(
|
|||
ProcLayout {
|
||||
arguments: wrapper_arg_layouts.into_bump_slice(),
|
||||
result: Layout::UNIT,
|
||||
captures_niche: &[],
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue