Skip to content

Commit ae9c9de

Browse files
committed
remove unused pointer info
1 parent 31672bc commit ae9c9de

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

jscomp/core/lam.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type primitive =
7878
(* Operations on heap blocks *)
7979
| Pmakeblock of int * tag_info * mutable_flag
8080
| Pfield of int * field_dbg_info
81-
| Psetfield of int * bool * set_field_dbg_info
81+
| Psetfield of int * set_field_dbg_info
8282
(* could have field info at least for record *)
8383
| Pfloatfield of int * field_dbg_info
8484
| Psetfloatfield of int * set_field_dbg_info
@@ -1555,7 +1555,7 @@ let lam_prim ~primitive:( p : Lambda.primitive) ~args loc : t =
15551555
-> prim ~primitive:(Pfield (id,info)) ~args loc
15561556

15571557
| Psetfield (id,b,info)
1558-
-> prim ~primitive:(Psetfield (id,b,info)) ~args loc
1558+
-> prim ~primitive:(Psetfield (id,info)) ~args loc
15591559

15601560
| Pfloatfield (id,info)
15611561
-> prim ~primitive:(Pfloatfield (id,info)) ~args loc
@@ -1857,7 +1857,7 @@ let convert exports lam : _ * _ =
18571857
| "#makemutablelist" ->
18581858
Pmakeblock(0,Lambda.Blk_constructor("::",1),Mutable)
18591859
| "#setfield1" ->
1860-
Psetfield(1, true, Fld_set_na)
1860+
Psetfield(1, Fld_set_na)
18611861
| "#undefined_to_opt" -> Pundefined_to_opt
18621862
| "#null_undefined_to_opt" -> Pnull_undefined_to_opt
18631863
| "#null_to_opt" -> Pnull_to_opt

jscomp/core/lam.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type primitive =
7575
| Pglobal_exception of ident
7676
| Pmakeblock of int * Lambda.tag_info * Asttypes.mutable_flag
7777
| Pfield of int * Lambda.field_dbg_info
78-
| Psetfield of int * bool * Lambda.set_field_dbg_info
78+
| Psetfield of int * Lambda.set_field_dbg_info
7979
| Pfloatfield of int * Lambda.field_dbg_info
8080
| Psetfloatfield of int * Lambda.set_field_dbg_info
8181
| Pduprecord of Types.record_representation * int

jscomp/core/lam_analysis.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ and eq_primitive ( lhs : Lam.primitive) (rhs : Lam.primitive) =
546546
| Pcaml_obj_set_length -> rhs = Pcaml_obj_set_length
547547
| Pccall {prim_name = n0 ; prim_native_name = nn0} -> (match rhs with Pccall {prim_name = n1; prim_native_name = nn1} -> n0 = n1 && nn0 = nn1 | _ -> false )
548548
| Pfield (n0, _dbg_info0) -> (match rhs with Pfield (n1, _dbg_info1) -> n0 = n1 | _ -> false )
549-
| Psetfield(i0, b0, _dbg_info0) -> (match rhs with Psetfield(i1, b1, _dbg_info1) -> i0 = i1 && b0 = b1 | _ -> false)
549+
| Psetfield(i0, _dbg_info0) -> (match rhs with Psetfield(i1, _dbg_info1) -> i0 = i1 | _ -> false)
550550
| Pglobal_exception ident -> (match rhs with Pglobal_exception ident2 -> Ident.same ident ident2 | _ -> false )
551551
| Pmakeblock (i, _tag_info, mutable_flag) -> (match rhs with Pmakeblock(i1,_,mutable_flag1) -> i = i1 && mutable_flag = mutable_flag1 | _ -> false)
552552
| Pfloatfield (i0,_dbg_info) -> (match rhs with Pfloatfield (i1,_) -> i0 = i1 | _ -> false)

jscomp/core/lam_compile_primitive.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ let translate loc
609609
| [e] -> E.array_length e
610610
| _ -> assert false
611611
end
612-
| Psetfield (i, _, field_info) ->
612+
| Psetfield (i, field_info) ->
613613
begin match args with
614614
| [e0;e1] -> (** RUNTIME *)
615615
decorate_side_effect cxt

jscomp/core/lam_pass_eliminate_ref.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let rec eliminate_ref id (lam : Lam.t) =
4949
TODO: we can refine analysis in later
5050
*)
5151
(* Lfunction(kind, params, eliminate_ref id body) *)
52-
| Lprim {primitive = Psetfield(0, _,_);
52+
| Lprim {primitive = Psetfield(0,_);
5353
args = [Lvar v; e]} when Ident.same v id ->
5454
Lam.assign id (eliminate_ref id e)
5555
| Lprim {primitive = Poffsetref delta ;

jscomp/core/lam_print.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ let primitive ppf (prim : Lam.primitive) = match prim with
139139
| Pmakeblock(tag, _, Immutable) -> fprintf ppf "makeblock %i" tag
140140
| Pmakeblock(tag, _, Mutable) -> fprintf ppf "makemutable %i" tag
141141
| Pfield (n,_) -> fprintf ppf "field %i" n
142-
| Psetfield(n, ptr, _) ->
143-
let instr = if ptr then "setfield_ptr " else "setfield_imm " in
142+
| Psetfield(n, _) ->
143+
let instr = "setfield " in
144144
fprintf ppf "%s%i" instr n
145145
| Pfloatfield (n,_) -> fprintf ppf "floatfield %i" n
146146
| Psetfloatfield (n,_) -> fprintf ppf "setfloatfield %i" n
@@ -418,7 +418,7 @@ let lambda use_env env ppf v =
418418
fprintf ppf "%s.%s/%d" id.name (get_string (id,n) env) n
419419

420420
| Lprim {
421-
primitive = Psetfield (n,_,_);
421+
primitive = Psetfield (n,_);
422422
args = [ Lglobal_module id ;
423423
e ]
424424
; _} when use_env ->

lib/whole_compiler.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66574,7 +66574,7 @@ type primitive =
6657466574
| Pglobal_exception of ident
6657566575
| Pmakeblock of int * Lambda.tag_info * Asttypes.mutable_flag
6657666576
| Pfield of int * Lambda.field_dbg_info
66577-
| Psetfield of int * bool * Lambda.set_field_dbg_info
66577+
| Psetfield of int * Lambda.set_field_dbg_info
6657866578
| Pfloatfield of int * Lambda.field_dbg_info
6657966579
| Psetfloatfield of int * Lambda.set_field_dbg_info
6658066580
| Pduprecord of Types.record_representation * int
@@ -66932,7 +66932,7 @@ type primitive =
6693266932
(* Operations on heap blocks *)
6693366933
| Pmakeblock of int * tag_info * mutable_flag
6693466934
| Pfield of int * field_dbg_info
66935-
| Psetfield of int * bool * set_field_dbg_info
66935+
| Psetfield of int * set_field_dbg_info
6693666936
(* could have field info at least for record *)
6693766937
| Pfloatfield of int * field_dbg_info
6693866938
| Psetfloatfield of int * set_field_dbg_info
@@ -68409,7 +68409,7 @@ let lam_prim ~primitive:( p : Lambda.primitive) ~args loc : t =
6840968409
-> prim ~primitive:(Pfield (id,info)) ~args loc
6841068410

6841168411
| Psetfield (id,b,info)
68412-
-> prim ~primitive:(Psetfield (id,b,info)) ~args loc
68412+
-> prim ~primitive:(Psetfield (id,info)) ~args loc
6841368413

6841468414
| Pfloatfield (id,info)
6841568415
-> prim ~primitive:(Pfloatfield (id,info)) ~args loc
@@ -68711,7 +68711,7 @@ let convert exports lam : _ * _ =
6871168711
| "#makemutablelist" ->
6871268712
Pmakeblock(0,Lambda.Blk_constructor("::",1),Mutable)
6871368713
| "#setfield1" ->
68714-
Psetfield(1, true, Fld_set_na)
68714+
Psetfield(1, Fld_set_na)
6871568715
| "#undefined_to_opt" -> Pundefined_to_opt
6871668716
| "#null_undefined_to_opt" -> Pnull_undefined_to_opt
6871768717
| "#null_to_opt" -> Pnull_to_opt
@@ -72492,8 +72492,8 @@ let primitive ppf (prim : Lam.primitive) = match prim with
7249272492
| Pmakeblock(tag, _, Immutable) -> fprintf ppf "makeblock %i" tag
7249372493
| Pmakeblock(tag, _, Mutable) -> fprintf ppf "makemutable %i" tag
7249472494
| Pfield (n,_) -> fprintf ppf "field %i" n
72495-
| Psetfield(n, ptr, _) ->
72496-
let instr = if ptr then "setfield_ptr " else "setfield_imm " in
72495+
| Psetfield(n, _) ->
72496+
let instr = "setfield " in
7249772497
fprintf ppf "%s%i" instr n
7249872498
| Pfloatfield (n,_) -> fprintf ppf "floatfield %i" n
7249972499
| Psetfloatfield (n,_) -> fprintf ppf "setfloatfield %i" n
@@ -72771,7 +72771,7 @@ let lambda use_env env ppf v =
7277172771
fprintf ppf "%s.%s/%d" id.name (get_string (id,n) env) n
7277272772

7277372773
| Lprim {
72774-
primitive = Psetfield (n,_,_);
72774+
primitive = Psetfield (n,_);
7277572775
args = [ Lglobal_module id ;
7277672776
e ]
7277772777
; _} when use_env ->
@@ -86863,7 +86863,7 @@ and eq_primitive ( lhs : Lam.primitive) (rhs : Lam.primitive) =
8686386863
| Pcaml_obj_set_length -> rhs = Pcaml_obj_set_length
8686486864
| Pccall {prim_name = n0 ; prim_native_name = nn0} -> (match rhs with Pccall {prim_name = n1; prim_native_name = nn1} -> n0 = n1 && nn0 = nn1 | _ -> false )
8686586865
| Pfield (n0, _dbg_info0) -> (match rhs with Pfield (n1, _dbg_info1) -> n0 = n1 | _ -> false )
86866-
| Psetfield(i0, b0, _dbg_info0) -> (match rhs with Psetfield(i1, b1, _dbg_info1) -> i0 = i1 && b0 = b1 | _ -> false)
86866+
| Psetfield(i0, _dbg_info0) -> (match rhs with Psetfield(i1, _dbg_info1) -> i0 = i1 | _ -> false)
8686786867
| Pglobal_exception ident -> (match rhs with Pglobal_exception ident2 -> Ident.same ident ident2 | _ -> false )
8686886868
| Pmakeblock (i, _tag_info, mutable_flag) -> (match rhs with Pmakeblock(i1,_,mutable_flag1) -> i = i1 && mutable_flag = mutable_flag1 | _ -> false)
8686986869
| Pfloatfield (i0,_dbg_info) -> (match rhs with Pfloatfield (i1,_) -> i0 = i1 | _ -> false)
@@ -96173,7 +96173,7 @@ let translate loc
9617396173
| [e] -> E.array_length e
9617496174
| _ -> assert false
9617596175
end
96176-
| Psetfield (i, _, field_info) ->
96176+
| Psetfield (i, field_info) ->
9617796177
begin match args with
9617896178
| [e0;e1] -> (** RUNTIME *)
9617996179
decorate_side_effect cxt
@@ -100504,7 +100504,7 @@ let rec eliminate_ref id (lam : Lam.t) =
100504100504
TODO: we can refine analysis in later
100505100505
*)
100506100506
(* Lfunction(kind, params, eliminate_ref id body) *)
100507-
| Lprim {primitive = Psetfield(0, _,_);
100507+
| Lprim {primitive = Psetfield(0,_);
100508100508
args = [Lvar v; e]} when Ident.same v id ->
100509100509
Lam.assign id (eliminate_ref id e)
100510100510
| Lprim {primitive = Poffsetref delta ;

0 commit comments

Comments
 (0)