Skip to content

Commit 18983b1

Browse files
committed
Remove unused set_tag from compiler internals.
1 parent 4877a70 commit 18983b1

File tree

6 files changed

+1
-13
lines changed

6 files changed

+1
-13
lines changed

jscomp/core/j.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ and expression_desc =
161161
you have to use [E.tag] in a safe way
162162
*)
163163
| Caml_block_tag of expression
164-
(* | Caml_block_set_tag of expression * expression *)
165164
(* | Caml_block_set_length of expression * expression *)
166165
(* It will just fetch tag, to make it safe, when creating it,
167166
we need apply "|0", we don't do it in the

jscomp/core/js_analyzer.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ let rec no_side_effect_expression_desc (x : J.expression_desc) =
104104
| Length (e, _) | Caml_block_tag e | Typeof e -> no_side_effect e
105105
| Bin (op, a, b) -> op <> Eq && no_side_effect a && no_side_effect b
106106
| Js_not _ | Cond _ | FlatCall _ | Call _ | New _ | Raw_js_code _
107-
(* | Caml_block_set_tag _ *)
108107
(* actually true? *) ->
109108
false
110109
| Await _ -> false

jscomp/others/belt_internals.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ module Obj : sig
5858
external field : t -> int -> t = "%obj_field"
5959
external set_field : t -> int -> t -> unit = "%obj_set_field"
6060
external tag : t -> int = "?obj_tag"
61-
(* The compiler ensures (|0) operation *)
62-
external set_tag : t -> int -> unit = "TAG" [@@bs.set]
6361
external repr : 'a -> t = "%identity"
6462
external obj : t -> 'a = "%identity"
6563
external magic : 'a -> 'b = "%identity"

jscomp/runtime/bs_stdlib_mini.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ module Obj : sig
5858
external field : t -> int -> t = "%obj_field"
5959
external set_field : t -> int -> t -> unit = "%obj_set_field"
6060
external tag : t -> int = "?obj_tag"
61-
(* The compiler ensures (|0) operation *)
62-
external set_tag : t -> int -> unit = "TAG" [@@bs.set]
6361
external repr : 'a -> t = "%identity"
6462
external obj : t -> 'a = "%identity"
6563
external magic : 'a -> 'b = "%identity"

jscomp/stdlib-406/camlinternalLazy.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ exception Undefined
4646

4747
let%private forward_with_closure (type a ) (blk : a t) (closure : unit -> a [@bs]) : a =
4848
let result = closure () [@bs] in
49-
(* do set_field BEFORE set_tag *)
5049
blk.value <- result;
5150
blk.tag<- true;
5251
result

jscomp/stdlib-406/obj.mli

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ external field : t -> int -> t = "%obj_field"
4242
4343
[set_field] MUST NOT be called on immutable blocks. (Blocks allocated
4444
in C stubs, or with [new_block] below, are always considered mutable.)
45-
46-
The same goes for [set_double_field] and [set_tag]. However, for
47-
[set_tag], in the case of immutable blocks where the middle-end optimizers
48-
never see code that discriminates on their tag (for example records), the
49-
operation should be safe. Such uses are nonetheless discouraged.
50-
45+
5146
For experts only:
5247
[set_field] et al can be made safe by first wrapping the block in
5348
{!Sys.opaque_identity}, so any information about its contents will not

0 commit comments

Comments
 (0)