Skip to content

Commit 6fc01c3

Browse files
committed
remve caml_obj_set_tag which is not used
1 parent dd4f597 commit 6fc01c3

File tree

9 files changed

+5
-28
lines changed

9 files changed

+5
-28
lines changed

jscomp/core/js_of_lam_exception.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ module E = Js_exp_make
3737
Note if we inline {!Caml_exceptions.create},
3838
it seems can be useful for optimizations in theory,
3939
in practice, it never happen, since the pattern match
40-
never dig into it internally, so maybe {!Obj.set_tag}
41-
is not necessary at all
40+
never dig into it internally.
41+
Alternative is to create a block `["xx"]` which relies on object identity
42+
We try to avoid this, since inlining would break this, this would make reason
43+
about the correctness of inlining more difficult
4244
*)
4345
let make exception_str : J.expression =
4446
E.runtime_call Js_runtime_modules.exceptions Literals.create [exception_str]

jscomp/core/lam_dispatch_primitive.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,6 @@ let translate loc (prim_name : string)
706706

707707
Location.prerr_warning loc Warnings.Bs_polymorphic_comparison ;
708708
call Js_runtime_modules.obj_runtime
709-
| "caml_obj_set_tag"
710-
->
711-
call Js_runtime_modules.obj_runtime
712709
| "caml_obj_tag" ->
713710
(* Note that in ocaml, [int] has tag [1000] and [string] has tag [252]
714711
also now we need do nullary check

jscomp/runtime/caml_obj.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,5 +346,5 @@ let caml_min (x : Obj.t) y =
346346
let caml_max (x : Obj.t) y =
347347
if caml_compare x y >= 0 then x else y
348348

349-
let caml_obj_set_tag = Obj.set_tag
349+
350350

jscomp/runtime/caml_obj.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ val caml_min :
6060
val caml_max :
6161
t -> t -> t
6262

63-
val caml_obj_set_tag : Obj.t -> int -> unit

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111416,9 +111416,6 @@ let translate loc (prim_name : string)
111416111416

111417111417
Location.prerr_warning loc Warnings.Bs_polymorphic_comparison ;
111418111418
call Js_runtime_modules.obj_runtime
111419-
| "caml_obj_set_tag"
111420-
->
111421-
call Js_runtime_modules.obj_runtime
111422111419
| "caml_obj_tag" ->
111423111420
(* Note that in ocaml, [int] has tag [1000] and [string] has tag [252]
111424111421
also now we need do nullary check

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111416,9 +111416,6 @@ let translate loc (prim_name : string)
111416111416

111417111417
Location.prerr_warning loc Warnings.Bs_polymorphic_comparison ;
111418111418
call Js_runtime_modules.obj_runtime
111419-
| "caml_obj_set_tag"
111420-
->
111421-
call Js_runtime_modules.obj_runtime
111422111419
| "caml_obj_tag" ->
111423111420
(* Note that in ocaml, [int] has tag [1000] and [string] has tag [252]
111424111421
also now we need do nullary check

lib/4.06.1/whole_compiler.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394010,9 +394010,6 @@ let translate loc (prim_name : string)
394010394010

394011394011
Location.prerr_warning loc Warnings.Bs_polymorphic_comparison ;
394012394012
call Js_runtime_modules.obj_runtime
394013-
| "caml_obj_set_tag"
394014-
->
394015-
call Js_runtime_modules.obj_runtime
394016394013
| "caml_obj_tag" ->
394017394014
(* Note that in ocaml, [int] has tag [1000] and [string] has tag [252]
394018394015
also now we need do nullary check

lib/es6/caml_obj.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,6 @@ function caml_max(x, y) {
394394
}
395395
}
396396

397-
function caml_obj_set_tag(prim, prim$1) {
398-
prim.TAG = prim$1;
399-
400-
}
401-
402397
export {
403398
caml_obj_dup ,
404399
update_dummy ,
@@ -414,7 +409,6 @@ export {
414409
caml_lessequal ,
415410
caml_min ,
416411
caml_max ,
417-
caml_obj_set_tag ,
418412

419413
}
420414
/* No side effect */

lib/js/caml_obj.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,6 @@ function caml_max(x, y) {
394394
}
395395
}
396396

397-
function caml_obj_set_tag(prim, prim$1) {
398-
prim.TAG = prim$1;
399-
400-
}
401-
402397
exports.caml_obj_dup = caml_obj_dup;
403398
exports.update_dummy = update_dummy;
404399
exports.caml_compare = caml_compare;
@@ -413,5 +408,4 @@ exports.caml_lessthan = caml_lessthan;
413408
exports.caml_lessequal = caml_lessequal;
414409
exports.caml_min = caml_min;
415410
exports.caml_max = caml_max;
416-
exports.caml_obj_set_tag = caml_obj_set_tag;
417411
/* No side effect */

0 commit comments

Comments
 (0)