mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
refactor passed (to higher order lowlevel) funcion
This commit is contained in:
parent
d29d05ea87
commit
bec74c36c5
5 changed files with 92 additions and 88 deletions
|
@ -468,12 +468,8 @@ impl<'a> Context<'a> {
|
|||
HigherOrder(HigherOrderLowLevel {
|
||||
op,
|
||||
closure_env_layout,
|
||||
specialization_id,
|
||||
update_mode,
|
||||
arg_layouts,
|
||||
ret_layout,
|
||||
function_name,
|
||||
function_env,
|
||||
passed_function,
|
||||
..
|
||||
}) => {
|
||||
// setup
|
||||
|
@ -486,13 +482,8 @@ impl<'a> Context<'a> {
|
|||
let higher_order = HigherOrderLowLevel {
|
||||
op: *op,
|
||||
closure_env_layout: *closure_env_layout,
|
||||
function_owns_closure_data: true,
|
||||
specialization_id: *specialization_id,
|
||||
update_mode: *update_mode,
|
||||
function_name: *function_name,
|
||||
function_env: *function_env,
|
||||
arg_layouts,
|
||||
ret_layout: *ret_layout,
|
||||
passed_function: *passed_function,
|
||||
};
|
||||
|
||||
CallType::HigherOrder(self.arena.alloc(higher_order))
|
||||
|
@ -521,11 +512,14 @@ impl<'a> Context<'a> {
|
|||
const CLOSURE_DATA: bool = BORROWED;
|
||||
|
||||
let function_layout = ProcLayout {
|
||||
arguments: arg_layouts,
|
||||
result: *ret_layout,
|
||||
arguments: passed_function.argument_layouts,
|
||||
result: passed_function.return_layout,
|
||||
};
|
||||
|
||||
let function_ps = match self.param_map.get_symbol(*function_name, function_layout) {
|
||||
let function_ps = match self
|
||||
.param_map
|
||||
.get_symbol(passed_function.name, function_layout)
|
||||
{
|
||||
Some(function_ps) => function_ps,
|
||||
None => unreachable!(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue