@@ -110689,57 +110689,6 @@ let translate loc (prim_name : string)
110689110689 | [e] -> e
110690110690 | _ -> assert false
110691110691 end
110692- | "caml_array_get" ->
110693- call Js_runtime_modules.array
110694- | "caml_array_set" ->
110695- call Js_runtime_modules.array
110696- | "caml_array_unsafe_set"
110697- ->
110698- begin match args with
110699- | [e0;e1;e2] ->
110700- Js_of_lam_array.set_array e0 e1 e2
110701- | _ -> assert false
110702- end
110703-
110704- | "caml_int32_add"
110705- ->
110706- begin match args with
110707- | [e0;e1] -> E.int32_add e0 e1
110708- | _ -> assert false
110709- end
110710-
110711- | "caml_nativeint_add"
110712- ->
110713- begin match args with
110714- | [e0;e1] -> E.unchecked_int32_add e0 e1
110715- | _ -> assert false
110716- end
110717- | "caml_int32_div"
110718- ->
110719- begin match args with
110720- | [e0;e1] ->
110721- E.int32_div ~checked:(!Js_config.check_div_by_zero) e0 e1
110722- | _ -> assert false
110723- end
110724-
110725- | "caml_nativeint_div"
110726- -> (* nativeint behaves exactly the same as js numbers except division *)
110727- begin match args with
110728- | [e0;e1] -> E.int32_div ~checked:false e0 e1
110729- | _ -> assert false
110730- end
110731-
110732- | "caml_int32_mul"
110733- ->
110734- begin match args with
110735- | [e0;e1] -> E.int32_mul e0 e1
110736- | _ -> assert false
110737- end
110738- | "caml_nativeint_mul" ->
110739- begin match args with
110740- | [e0;e1] -> E.unchecked_int32_mul e0 e1
110741- | _ -> assert false
110742- end
110743110692 | "caml_int32_of_int"
110744110693 | "caml_nativeint_of_int"
110745110694 | "caml_nativeint_of_int32" ->
@@ -110763,63 +110712,6 @@ let translate loc (prim_name : string)
110763110712 | [e] -> e (* TODO: do more checking when [to_int32]*)
110764110713 | _ -> assert false
110765110714 end
110766- | "caml_int32_sub" ->
110767- begin match args with
110768- | [e0;e1] -> E.int32_minus e0 e1
110769- | _ -> assert false
110770- end
110771-
110772- | "caml_nativeint_sub" ->
110773- begin match args with
110774- | [e0;e1] -> E.unchecked_int32_minus e0 e1
110775- | _ -> assert false
110776- end
110777- | "caml_int32_xor"
110778- | "caml_nativeint_xor" ->
110779- begin match args with
110780- | [e0; e1] -> E.int32_bxor e0 e1
110781- | _ -> assert false
110782- end
110783-
110784- | "caml_int32_and"
110785- | "caml_nativeint_and" ->
110786- begin match args with
110787- | [e0;e1] -> E.int32_band e0 e1
110788- | _ -> assert false
110789- end
110790- | "caml_int32_or"
110791- | "caml_nativeint_or" ->
110792- begin match args with
110793- | [e0;e1] -> E.int32_bor e0 e1
110794- | _ -> assert false
110795- end
110796- | "caml_le_float" ->
110797- begin match args with
110798- | [e0;e1] -> E.float_comp Cle e0 e1
110799- | _ -> assert false
110800- end
110801- | "caml_lt_float" ->
110802- begin match args with
110803- | [e0;e1] -> E.float_comp Clt e0 e1
110804- | _ -> assert false
110805- end
110806- | "caml_neg_float" ->
110807- begin match args with
110808- | [e] ->
110809- (** TODO: use float.. *)
110810- E.int32_minus E.zero_int_literal e
110811- | _ -> assert false
110812- end
110813- | "caml_neq_float" ->
110814- begin match args with
110815- | [e0;e1] -> E.float_notequal e0 e1
110816- | _ -> assert false
110817- end
110818- | "caml_mul_float" ->
110819- begin match args with
110820- | [e0; e1] -> E.float_mul e0 e1
110821- | _ -> assert false
110822- end
110823110715 | "caml_bytes_compare"
110824110716 | "caml_bytes_equal"
110825110717 ->
@@ -111044,7 +110936,7 @@ let translate loc (prim_name : string)
111044110936 begin match args with
111045110937 | [{expression_desc = Bool a} ; {expression_desc = Bool b} ]
111046110938 ->
111047- let c = compare a b in
110939+ let c = compare (a : bool) b in
111048110940 E.int (if c = 0 then 0l else if c > 0 then 1l else -1l)
111049110941 | _ ->
111050110942 call Js_runtime_modules.caml_primitive
@@ -111876,15 +111768,15 @@ let translate loc
111876111768 | [e;e1] -> Js_of_lam_array.ref_array e e1 (* Todo: Constant Folding *)
111877111769 | _ -> assert false)
111878111770 | Parrayrefs ->
111879- Lam_dispatch_primitive.translate loc "caml_array_get" args
111771+ E.runtime_call Js_runtime_modules.array "caml_array_get" args
111772+ | Parraysets ->
111773+ E.runtime_call Js_runtime_modules.array "caml_array_set" args
111880111774 | Pmakearray ->
111881111775 Js_of_lam_array.make_array Mutable args
111882111776 | Parraysetu ->
111883111777 (match args with (* wrong*)
111884111778 | [e;e0;e1] -> ensure_value_unit cxt.continuation (Js_of_lam_array.set_array e e0 e1)
111885111779 | _ -> assert false)
111886- | Parraysets ->
111887- Lam_dispatch_primitive.translate loc "caml_array_set" args
111888111780 | Pccall prim ->
111889111781 Lam_dispatch_primitive.translate loc prim.prim_name args
111890111782 (* Lam_compile_external_call.translate loc cxt prim args *)
0 commit comments