Skip to content

Commit 67be0f5

Browse files
committed
WIP
1 parent 7d06148 commit 67be0f5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/lib-wasm/call_graph_analysis.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ let block_deps ~info ~non_escaping ~unambiguous ~ambiguous ~blocks pc =
2929
if Var.Set.cardinal known = 1 && (not others) && Var.Set.mem x known
3030
then (
3131
let may_escape = Var.ISet.mem info.Global_flow.info_may_escape x in
32-
if debug () then Format.eprintf "CLOSURE may-escape:%b@." may_escape;
32+
if debug ()
33+
then
34+
Format.eprintf "CLOSURE %a may-escape:%b@." Code.Var.print x may_escape;
3335
if not may_escape then Var.Hashtbl.replace non_escaping x ()))
3436
| Let (_, (Prim _ | Block _ | Constant _ | Field _ | Special _))
3537
| Event _ | Assign _ | Set_field _ | Offset_ref _ | Array_set _ -> ())

compiler/lib-wasm/generate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ module Generate (Target : Target_sig.S) = struct
803803
(* Functions with constant closures ignore their
804804
environment. *)
805805
match closure with
806-
| GlobalGet _ -> Value.unit
806+
| GlobalGet _ -> return closure (*Value.unit*)
807807
| _ -> return closure
808808
in
809809
let params =

0 commit comments

Comments
 (0)