Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Oct 6, 2024
1 parent 961d9a2 commit 081f4de
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
7 changes: 3 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
melange-compiler-libs = {
# this changes rarely, and it's better than having to rely on nix's poor
# support for submodules
url = "github:melange-re/melange-compiler-libs/anmonteiro/merge-5.3";
url = "github:melange-re/melange-compiler-libs";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
Expand Down
7 changes: 4 additions & 3 deletions jscomp/core/lam_analysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ let rec no_side_effects (lam : Lam.t) : bool =
(* non-observable side effect *)
| "caml_sys_get_config" | "caml_sys_argv" (* should be fine *)
| "caml_sys_executable_name" | "caml_string_repeat"
| "caml_make_vect" | "caml_create_bytes" | "caml_obj_dup"
| "caml_array_dup" | "nativeint_add" | "nativeint_div"
| "nativeint_mod" | "nativeint_lsr" | "nativeint_mul" ),
| "caml_make_vect" | "caml_array_make" | "caml_create_bytes"
| "caml_obj_dup" | "caml_array_dup" | "nativeint_add"
| "nativeint_div" | "nativeint_mod" | "nativeint_lsr"
| "nativeint_mul" ),
_ ) ->
true
| "caml_ml_open_descriptor_in", [ Lconst (Const_int { i = 0l; _ }) ]
Expand Down
4 changes: 2 additions & 2 deletions jscomp/core/lam_dispatch_primitive.ml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ let translate loc (prim_name : string) (args : J.expression list) : J.expression
| "caml_lex_engine" | "caml_new_lex_engine" -> call Js_runtime_modules.lexer
| "caml_parse_engine" | "caml_set_parser_trace" ->
call Js_runtime_modules.parser
| "caml_make_float_vect"
| "caml_make_float_vect" | "caml_array_create_float"
| "caml_floatarray_create" (* TODO: compile float array into TypedArray*) ->
E.runtime_call ~module_name:Js_runtime_modules.array ~fn_name:"make_float"
args
Expand All @@ -266,7 +266,7 @@ let translate loc (prim_name : string) (args : J.expression list) : J.expression
Not good for inline *)
| "caml_array_blit" ->
E.runtime_call ~module_name:Js_runtime_modules.array ~fn_name:"blit" args
| "caml_make_vect" ->
| "caml_make_vect" | "caml_array_make" ->
E.runtime_call ~module_name:Js_runtime_modules.array ~fn_name:"make" args
| "caml_ml_flush" | "caml_ml_out_channels_list" | "caml_ml_output_char"
| "caml_ml_output" ->
Expand Down
2 changes: 1 addition & 1 deletion vendor/melange-compiler-libs

0 comments on commit 081f4de

Please sign in to comment.