Skip to content

Commit 953b91e

Browse files
committed
Compiler/wasm: no longer resolve js prims aliases for wasmoo
1 parent e317f23 commit 953b91e

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

compiler/lib-wasm/generate.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ module Generate (Target : Target_sig.S) = struct
663663
in
664664
Memory.allocate ~tag:0 ~deadcode_sentinal:ctx.deadcode_sentinal l
665665
| Extern name, l -> (
666-
let name = Primitive.resolve name in
667666
try
668667
let typ = Hashtbl.find specialized_primitives name in
669668
let* f = register_import ~name (Fun (specialized_func_type typ)) in
@@ -1195,10 +1194,7 @@ module Generate (Target : Target_sig.S) = struct
11951194
List.rev_append context.other_fields (imports @ constant_data)
11961195
end
11971196

1198-
let init () =
1199-
let l = [ "caml_make_array", "caml_array_of_uniform_array" ] in
1200-
Primitive.register "caml_array_of_uniform_array" `Mutable None None;
1201-
List.iter ~f:(fun (nm, nm') -> Primitive.alias nm nm') l
1197+
let init () = ()
12021198

12031199
(* Make sure we can use [br_table] for switches *)
12041200
let fix_switch_branches p =

compiler/lib/eval.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ let eval_prim x =
185185
| Neq, [ Int i; Int j ] -> bool Targetint.(i <> j)
186186
| Ult, [ Int i; Int j ] -> bool (Targetint.(j < zero) || Targetint.(i < j))
187187
| Extern name, l -> (
188-
let name = Primitive.resolve name in
189188
match name, l with
190189
(* int *)
191190
| "%int_add", _ -> int_binop l Targetint.add

runtime/wasm/array.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
(if (i32.eqz (local.get $sz)) (then (return (global.get $empty_array))))
7272
(array.new $float_array (f64.const 0) (local.get $sz)))
7373

74-
(func (export "caml_array_of_uniform_array")
74+
(func (export "caml_array_of_uniform_array") (export "caml_make_array")
7575
(param $vinit (ref eq)) (result (ref eq))
7676
(local $init (ref $block)) (local $res (ref $float_array))
7777
(local $size i32) (local $i i32)

0 commit comments

Comments
 (0)