We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a13c298 commit 9060aa0Copy full SHA for 9060aa0
jscomp/core/lam_analysis.ml
@@ -76,8 +76,10 @@ let rec no_side_effects (lam : Lam.t) : bool =
76
(* Float operations *)
77
| Pintoffloat | Pfloatofint | Pnegfloat
78
(* | Pabsfloat *)
79
- | Paddfloat | Psubfloat | Pmulfloat | Pdivfloat | Pfloatcomp _ | Pbigintcomp _ | Pjscomp _
+ | Paddfloat | Psubfloat | Pmulfloat | Pdivfloat | Pfloatcomp _ | Pjscomp _
80
| Pnegbigint | Paddbigint | Psubbigint | Pmulbigint | Ppowbigint
81
+ | Pandbigint | Porbigint | Pxorbigint | Plslbigint | Pasrbigint
82
+ | Pbigintcomp _
83
(* String operations *)
84
| Pstringlength | Pstringrefu | Pstringrefs | Pbyteslength | Pbytesrefu
85
| Pbytesrefs | Pmakearray | Parraylength | Parrayrefu | Parrayrefs
jscomp/core/lam_compile_primitive.ml
@@ -225,6 +225,8 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
225
| Plslint -> (
226
match args with [ e1; e2 ] -> E.int32_lsl e1 e2 | _ -> assert false)
227
| Plslint64 -> Js_long.lsl_ args
228
+ | Plslbigint -> (
229
+ match args with [ e1; e2 ] -> E.bigint_op Lsl e1 e2 | _ -> assert false)
230
| Plsrint -> (
231
match args with
232
| [ e1; { J.expression_desc = Number (Int { i = 0l; _ } | Uint 0l); _ } ]
@@ -236,15 +238,23 @@ let translate output_prefix loc (cxt : Lam_compile_context.t)
236
238
| Pasrint -> (
237
239
match args with [ e1; e2 ] -> E.int32_asr e1 e2 | _ -> assert false)
240
| Pasrint64 -> Js_long.asr_ args
241
+ | Pasrbigint -> (
242
+ match args with [ e1; e2 ] -> E.bigint_op Asr e1 e2 | _ -> assert false)
243
| Pandint -> (
244
match args with [ e1; e2 ] -> E.int32_band e1 e2 | _ -> assert false)
245
| Pandint64 -> Js_long.and_ args
246
+ | Pandbigint -> (
247
+ match args with [ e1; e2 ] -> E.bigint_op Band e1 e2 | _ -> assert false)
248
| Porint -> (
249
match args with [ e1; e2 ] -> E.int32_bor e1 e2 | _ -> assert false)
250
| Porint64 -> Js_long.or_ args
251
+ | Porbigint -> (
252
+ match args with [ e1; e2 ] -> E.bigint_op Bor e1 e2 | _ -> assert false)
253
| Pxorint -> (
254
match args with [ e1; e2 ] -> E.int32_bxor e1 e2 | _ -> assert false)
255
| Pxorint64 -> Js_long.xor args
256
+ | Pxorbigint -> (
257
+ match args with [ e1; e2 ] -> E.bigint_op Bxor e1 e2 | _ -> assert false)
258
| Pjscomp cmp -> (
259
match args with [ l; r ] -> E.js_comp cmp l r | _ -> assert false)
260
| Pfloatcomp cmp | Pintcomp cmp -> (
jscomp/core/lam_convert.ml
@@ -261,6 +261,11 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t =
261
| Pdivbigint _is_safe (*FIXME*) -> prim ~primitive:Pdivbigint ~args loc
262
| Pmodbigint _is_safe (*FIXME*) -> prim ~primitive:Pmodbigint ~args loc
263
| Ppowbigint -> prim ~primitive:Ppowbigint ~args loc
264
+ | Pandbigint -> prim ~primitive:Pandbigint ~args loc
265
+ | Porbigint -> prim ~primitive:Porbigint ~args loc
266
+ | Pxorbigint -> prim ~primitive:Pxorbigint ~args loc
267
+ | Plslbigint -> prim ~primitive:Plslbigint ~args loc
268
+ | Pasrbigint -> prim ~primitive:Pasrbigint ~args loc
269
| Pbigintcomp x -> prim ~primitive:(Pbigintcomp x) ~args loc
270
| Pintcomp x -> prim ~primitive:(Pintcomp x) ~args loc
271
| Poffsetint x -> prim ~primitive:(Poffsetint x) ~args loc
jscomp/core/lam_primitive.ml
@@ -87,6 +87,11 @@ type t =
87
| Pdivbigint
88
| Pmodbigint
89
| Ppowbigint
90
+ | Pandbigint
91
+ | Porbigint
92
+ | Pxorbigint
93
+ | Plslbigint
94
+ | Pasrbigint
95
| Pintcomp of Lam_compat.comparison
96
| Pfloatcomp of Lam_compat.comparison
97
| Pjscomp of Lam_compat.comparison
@@ -216,6 +221,11 @@ let eq_primitive_approx (lhs : t) (rhs : t) =
216
221
| Pdivbigint -> rhs = Pdivbigint
217
222
| Pmodbigint -> rhs = Pmodbigint
218
223
| Ppowbigint -> rhs = Ppowbigint
224
+ | Pandbigint -> rhs = Pandbigint
+ | Porbigint -> rhs = Porbigint
+ | Pxorbigint -> rhs = Pxorbigint
+ | Plslbigint -> rhs = Plslbigint
+ | Pasrbigint -> rhs = Pasrbigint
219
| Pjs_apply -> rhs = Pjs_apply
220
| Pjs_runtime_apply -> rhs = Pjs_runtime_apply
| Pstringlength -> rhs = Pstringlength
jscomp/core/lam_primitive.mli
@@ -77,6 +77,11 @@ type t =
86
jscomp/core/lam_print.ml
@@ -141,6 +141,11 @@ let primitive ppf (prim : Lam_primitive.t) =
141
| Pdivbigint -> fprintf ppf "/,"
142
| Pmodbigint -> fprintf ppf "modn"
143
| Ppowbigint -> fprintf ppf "**,"
144
+ | Pandbigint -> fprintf ppf "and,"
145
+ | Porbigint -> fprintf ppf "or,"
146
+ | Pxorbigint -> fprintf ppf "xor,"
147
+ | Plslbigint -> fprintf ppf "lsl,"
148
+ | Pasrbigint -> fprintf ppf "asr,"
149
| Pbigintcomp Ceq -> fprintf ppf "==,"
150
| Pbigintcomp Cneq -> fprintf ppf "!=,"
151
| Pbigintcomp Clt -> fprintf ppf "<,"
jscomp/ml/lambda.ml
@@ -232,6 +232,8 @@ type primitive =
(* Bigint operations *)
233
| Pnegbigint | Paddbigint | Psubbigint | Ppowbigint
234
| Pmulbigint | Pdivbigint of is_safe | Pmodbigint of is_safe
235
+ | Pandbigint | Porbigint | Pxorbigint
+ | Plslbigint | Pasrbigint
| Pbigintcomp of comparison
| Pstringlength | Pstringrefu | Pstringrefs
jscomp/ml/lambda.mli
@@ -198,6 +198,8 @@ type primitive =
198
199
200
201
202
203
204
205
jscomp/ml/printlambda.ml
@@ -182,6 +182,11 @@ let primitive ppf = function
182
| Psubbigint -> fprintf ppf "-,"
183
| Pmulbigint -> fprintf ppf "*,"
184
185
186
187
188
189
190
| Pdivbigint Safe -> fprintf ppf "/n"
191
| Pdivbigint Unsafe -> fprintf ppf "/nu"
192
| Pmodbigint Safe -> fprintf ppf "mod"
@@ -300,6 +305,11 @@ let name_of_primitive = function
300
305
| Pdivbigint _ -> "Pdivbigint"
301
306
| Pmodbigint _ -> "Pmodbigint"
302
307
| Ppowbigint -> "Ppowbigint"
308
+ | Pandbigint -> "Pandbigint"
309
+ | Porbigint -> "Porbigint"
310
+ | Pxorbigint -> "Pxorbigint"
311
+ | Plslbigint -> "Plslbigint"
312
+ | Pasrbigint -> "Pasrbigint"
303
313
| Pbigintcomp _ -> "Pbigintcomp"
304
314
| Pstringlength -> "Pstringlength"
315
| Pstringrefu -> "Pstringrefu"
jscomp/ml/translcore.ml
@@ -345,6 +345,11 @@ let primitives_table =
345
("%lslint", Plslint);
346
("%lsrint", Plsrint);
347
("%asrint", Pasrint);
348
+ ("%andbigint", Pandbigint);
349
+ ("%orbigint", Porbigint);
350
+ ("%xorbigint", Pxorbigint);
351
+ ("%lslbigint", Plslbigint);
352
+ ("%asrbigint", Pasrbigint);
353
("%eq", Pintcomp Ceq);
354
("%noteq", Pintcomp Cneq);
355
("%ltint", Pintcomp Clt);
0 commit comments