Skip to content

Commit bfc2fc2

Browse files
committed
inline is_a_functor_test due to simplification
1 parent b0b4b30 commit bfc2fc2

File tree

4 files changed

+5
-85
lines changed

4 files changed

+5
-85
lines changed

jscomp/core/lam_inline_util.ml

Lines changed: 0 additions & 44 deletions
This file was deleted.

jscomp/core/lam_inline_util.mli

Lines changed: 0 additions & 36 deletions
This file was deleted.

jscomp/core/lam_pass_remove_alias.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ let simplify_alias
155155
let normal () = Lam.apply ( simpl fn) (Ext_list.map args simpl) loc status in
156156
begin
157157
match Hash_ident.find_opt meta.ident_tbl v with
158-
| Some (FunctionId {lambda = Some(Lfunction ({params; body} as m),
158+
| Some (FunctionId {lambda = Some(Lfunction ({params; body; attr = {is_a_functor}} as m),
159159
rec_flag)
160160
})
161161
->
162162

163163
if Ext_list.same_length args params (* && false *)
164164
then
165-
if Lam_inline_util.maybe_functor v.name
165+
if is_a_functor = Functor_yes
166166
(* && (Set_ident.mem v meta.export_idents) && false *)
167167
then
168168
(* TODO: check l1 if it is exported,

jscomp/core/lam_stats_export.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ let values_of_export
7474
only truly immutable values can be inlined
7575
*)
7676
then
77-
if Lam_inline_util.should_be_functor lambda (* can also be submodule *)
78-
then
77+
match lambda with
78+
| Lfunction {attr = {is_a_functor = Functor_yes}} ->
7979
if Lam_closure.is_closed lambda (* TODO: seriealize more*)
8080
then Some lambda
8181
else None
82-
else
82+
| _ ->
8383
let lam_size = Lam_analysis.size lambda in
8484
(* TODO:
8585
1. global need re-assocate when do the beta reduction

0 commit comments

Comments
 (0)