Skip to content

Commit a87d15f

Browse files
committed
inline Math.imul
1 parent 7df695b commit a87d15f

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

jscomp/core/js_exp_make.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,11 @@ let int32_mul ?comment
12561256
else
12571257
call ?comment
12581258
~info:Js_call_info.builtin_runtime_call
1259-
(runtime_var_dot Js_runtime_modules.int32 Literals.imul) [e1;e2]
1259+
(dot (js_global "Math") Literals.imul) [e1;e2]
12601260
| _ ->
12611261
call ?comment
12621262
~info:Js_call_info.builtin_runtime_call
1263-
(runtime_var_dot Js_runtime_modules.int32 Literals.imul) [e1;e2]
1263+
(dot (js_global "Math") Literals.imul) [e1;e2]
12641264

12651265

12661266
let unchecked_int32_mul ?comment e1 e2 : J.expression =

jscomp/runtime/caml_int32.ml

-8
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,3 @@ let mod_ (x : nativeint) (y:nativeint) =
3737
raise Division_by_zero
3838
else Caml_nativeint_extern.rem x y
3939

40-
41-
42-
43-
(* -FIXME not polyfill any more in next release *)
44-
let imul : int32 -> int32 -> int32 = [%bs.raw{| Math.imul || function (x,y) {
45-
y |= 0; return ((((x >> 16) * y) << 16) + (x & 0xffff) * y)|0;
46-
}
47-
|}]

jscomp/runtime/caml_int32.mli

-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,3 @@ val div : nativeint -> nativeint -> nativeint
2929
val mod_ : nativeint -> nativeint -> nativeint
3030

3131

32-
33-
val imul :int32 -> int32 -> int32
34-

0 commit comments

Comments
 (0)