33
33
(* module S = Js_stmt_make *)
34
34
35
35
36
- let compile_group (meta : Lam_stats.t )
36
+ let compile_group ~ output_prefix (meta : Lam_stats.t )
37
37
(x : Lam_group.t ) : Js_output.t =
38
38
match x with
39
39
(*
@@ -60,20 +60,20 @@ let compile_group (meta : Lam_stats.t)
60
60
(* let lam = Optimizer.simplify_lets [] lam in *)
61
61
(* can not apply again, it's wrong USE it with care*)
62
62
(* ([Js_stmt_make.comment (Gen_of_env.query_type id env )], None) ++ *)
63
- Lam_compile. compile_lambda { continuation = Declare (kind, id);
63
+ Lam_compile. compile_lambda ~output_prefix { continuation = Declare (kind, id);
64
64
jmp_table = Lam_compile_context. empty_handler_map;
65
65
meta
66
66
} lam
67
67
68
68
| Recursive id_lams ->
69
- Lam_compile. compile_recursive_lets
69
+ Lam_compile. compile_recursive_lets ~output_prefix
70
70
{ continuation = EffectCall Not_tail ;
71
71
jmp_table = Lam_compile_context. empty_handler_map;
72
72
meta
73
73
}
74
74
id_lams
75
75
| Nop lam -> (* TODO: Side effect callls, log and see statistics *)
76
- Lam_compile. compile_lambda {continuation = EffectCall Not_tail ;
76
+ Lam_compile. compile_lambda ~output_prefix {continuation = EffectCall Not_tail ;
77
77
jmp_table = Lam_compile_context. empty_handler_map;
78
78
meta
79
79
} lam
@@ -122,7 +122,7 @@ let _j = Js_pass_debug.dump
122
122
it's used or not
123
123
*)
124
124
let compile
125
- ( output_prefix : string )
125
+ ~ output_prefix
126
126
export_idents
127
127
(lam : Lambda.lambda ) =
128
128
let export_ident_sets = Set_ident. of_list export_idents in
@@ -222,7 +222,7 @@ let maybe_pure = no_side_effects groups in
222
222
let () = Ext_log. dwarn ~__POS__ " \n @[[TIME:]Pre-compile: %f@]@." (Sys. time () *. 1000. ) in
223
223
#endif
224
224
let body =
225
- Ext_list. map groups (fun group -> compile_group meta group)
225
+ Ext_list. map groups (fun group -> compile_group ~output_prefix meta group)
226
226
|> Js_output. concat
227
227
|> Js_output. output_as_block
228
228
in
0 commit comments