Skip to content

Commit

Permalink
feat(compiler)!: Allocate closures only when necessary (grain-lang#1660)
Browse files Browse the repository at this point in the history
* feat(compiler)!: Allocate closures only when necessary

* snapshots
  • Loading branch information
ospencer authored Feb 23, 2023
1 parent b16b455 commit c40df12
Show file tree
Hide file tree
Showing 46 changed files with 608 additions and 1,270 deletions.
2 changes: 1 addition & 1 deletion compiler/src/codegen/comp_utils.re
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ let write_universal_exports =
);
let function_call =
switch (direct) {
| Direct(name) =>
| Direct({name}) =>
Expression.Call.make(
wasm_mod,
Hashtbl.find(exported_names, name),
Expand Down
1 change: 1 addition & 0 deletions compiler/src/codegen/compcore.re
Original file line number Diff line number Diff line change
Expand Up @@ -3821,6 +3821,7 @@ let compile_main = (wasm_mod, env, prog) => {
name: Some(grain_main),
args: [],
return_type: [Types.Unmanaged(WasmI32)],
has_closure: false,
body: prog.main_body,
stack_size: prog.main_body_stack_size,
attrs: [],
Expand Down
1 change: 1 addition & 0 deletions compiler/src/codegen/mashtree.re
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ type mash_function = {
name: option(string),
args: list(Types.allocation_type),
return_type: list(Types.allocation_type),
has_closure: bool,
body: block,
stack_size,
attrs: attributes,
Expand Down
Loading

0 comments on commit c40df12

Please sign in to comment.