Skip to content

Commit d6454de

Browse files
vouillonhhugo
authored andcommitted
Less aggressive functor inlining for JavaScript code
1 parent 01ff409 commit d6454de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/lib/inline.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,10 @@ let interesting_parameters ~context info =
326326
code elimination, ...
327327
*)
328328
let functor_like ~context info =
329-
(match context.profile with
330-
| O1 -> body_size ~context info <= 15
331-
| O2 | O3 -> true)
329+
(match Config.target (), context.profile with
330+
| `Wasm, (O2 | O3) -> true
331+
| `Wasm, O1 -> body_size ~context info <= 15
332+
| `JavaScript, (O1 | O2 | O3) -> body_size ~context info <= 15)
332333
&& (not info.recursive)
333334
&& (not (contains_loop ~context info))
334335
&& returns_a_block ~context info

0 commit comments

Comments
 (0)