Skip to content

Commit 09e822c

Browse files
committed
Remove the boxed field
1 parent 579cb1b commit 09e822c

File tree

5 files changed

+30
-45
lines changed

5 files changed

+30
-45
lines changed

jscomp/core/lam_compile_env.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,13 @@ let cached_find_ml_id_pos (module_id : Ident.t) name : ident_info =
152152

153153

154154

155-
type module_info = {
156-
pure : bool
157-
}
155+
158156
(* TODO: it does not make sense to cache
159157
[Runtime]
160158
and [externals]*)
161159
type _ t =
162160
| No_env : (path * Js_cmj_format.t) t
163-
| Has_env : Env.t -> module_info t
161+
| Has_env : Env.t -> bool t (* Indicate it is pure or not *)
164162

165163

166164
(* -FIXME:
@@ -178,7 +176,7 @@ let query_and_add_if_not_exist
178176
oid +> Runtime {cmj_path;cmj_table} ;
179177
(match env with
180178
| Has_env _ ->
181-
found { pure = true}
179+
found true
182180
| No_env ->
183181
found cmj_info)
184182
| Ml
@@ -192,7 +190,7 @@ let query_and_add_if_not_exist
192190
| None -> not_found () (* actually when [not_found] in the call site, we throw... *)
193191
| Some _ ->
194192
oid +> Visit {cmj_table;cmj_path } ;
195-
found { pure = Js_cmj_format.is_pure cmj_table}
193+
found (Js_cmj_format.is_pure cmj_table)
196194
end
197195
| No_env ->
198196
found cmj_info)
@@ -206,7 +204,7 @@ let query_and_add_if_not_exist
206204
begin match env with
207205
| Has_env _
208206
->
209-
found { pure = false}
207+
found false
210208
| No_env ->
211209
found (Ext_string.empty, Js_cmj_format.no_pure_dummy)
212210
(* FIXME: #154, it come from External, should be okay *)
@@ -216,21 +214,21 @@ let query_and_add_if_not_exist
216214
| Some (Visit { cmj_table; cmj_path}) ->
217215
begin match env with
218216
| Has_env _ ->
219-
found { pure = Js_cmj_format.is_pure cmj_table}
217+
found (Js_cmj_format.is_pure cmj_table)
220218
| No_env -> found (cmj_path,cmj_table)
221219
end
222220

223221
| Some (Runtime {cmj_path; cmj_table}) ->
224222
begin match env with
225223
| Has_env _ ->
226-
found {pure = true}
224+
found true
227225
| No_env ->
228226
found (cmj_path, cmj_table)
229227
end
230228
| Some External ->
231229
begin match env with
232230
| Has_env _ ->
233-
found {pure = false}
231+
found false
234232
| No_env ->
235233
found (Ext_string.empty, Js_cmj_format.no_pure_dummy) (* External is okay *)
236234
end

jscomp/core/lam_compile_env.mli

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@ type path = string
3737

3838

3939

40-
type module_info = {
41-
pure : bool
42-
}
4340

4441
type _ t =
4542
| No_env : (path * Js_cmj_format.t) t
46-
| Has_env : Env.t -> module_info t
43+
| Has_env : Env.t -> bool t
4744

4845

4946
type ident_info = {

jscomp/core/lam_stats_export.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ let get_dependent_module_effect
113113
Lam_compile_env.query_and_add_if_not_exist id
114114
(Has_env meta.env )
115115
~not_found:(fun _ -> false )
116-
~found:(fun {pure} -> pure)
116+
~found:(fun pure -> pure)
117117
) in
118118
Ext_option.map non_pure_module (fun x -> Lam_module_ident.name x)
119119
else

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96482,13 +96482,10 @@ type path = string
9648296482

9648396483

9648496484

96485-
type module_info = {
96486-
pure : bool
96487-
}
9648896485

9648996486
type _ t =
9649096487
| No_env : (path * Js_cmj_format.t) t
96491-
| Has_env : Env.t -> module_info t
96488+
| Has_env : Env.t -> bool t
9649296489

9649396490

9649496491
type ident_info = {
@@ -96724,15 +96721,13 @@ let cached_find_ml_id_pos (module_id : Ident.t) name : ident_info =
9672496721

9672596722

9672696723

96727-
type module_info = {
96728-
pure : bool
96729-
}
96724+
9673096725
(* TODO: it does not make sense to cache
9673196726
[Runtime]
9673296727
and [externals]*)
9673396728
type _ t =
9673496729
| No_env : (path * Js_cmj_format.t) t
96735-
| Has_env : Env.t -> module_info t
96730+
| Has_env : Env.t -> bool t (* Indicate it is pure or not *)
9673696731

9673796732

9673896733
(* -FIXME:
@@ -96750,7 +96745,7 @@ let query_and_add_if_not_exist
9675096745
oid +> Runtime {cmj_path;cmj_table} ;
9675196746
(match env with
9675296747
| Has_env _ ->
96753-
found { pure = true}
96748+
found true
9675496749
| No_env ->
9675596750
found cmj_info)
9675696751
| Ml
@@ -96764,7 +96759,7 @@ let query_and_add_if_not_exist
9676496759
| None -> not_found () (* actually when [not_found] in the call site, we throw... *)
9676596760
| Some _ ->
9676696761
oid +> Visit {cmj_table;cmj_path } ;
96767-
found { pure = Js_cmj_format.is_pure cmj_table}
96762+
found (Js_cmj_format.is_pure cmj_table)
9676896763
end
9676996764
| No_env ->
9677096765
found cmj_info)
@@ -96778,7 +96773,7 @@ let query_and_add_if_not_exist
9677896773
begin match env with
9677996774
| Has_env _
9678096775
->
96781-
found { pure = false}
96776+
found false
9678296777
| No_env ->
9678396778
found (Ext_string.empty, Js_cmj_format.no_pure_dummy)
9678496779
(* FIXME: #154, it come from External, should be okay *)
@@ -96788,21 +96783,21 @@ let query_and_add_if_not_exist
9678896783
| Some (Visit { cmj_table; cmj_path}) ->
9678996784
begin match env with
9679096785
| Has_env _ ->
96791-
found { pure = Js_cmj_format.is_pure cmj_table}
96786+
found (Js_cmj_format.is_pure cmj_table)
9679296787
| No_env -> found (cmj_path,cmj_table)
9679396788
end
9679496789

9679596790
| Some (Runtime {cmj_path; cmj_table}) ->
9679696791
begin match env with
9679796792
| Has_env _ ->
96798-
found {pure = true}
96793+
found true
9679996794
| No_env ->
9680096795
found (cmj_path, cmj_table)
9680196796
end
9680296797
| Some External ->
9680396798
begin match env with
9680496799
| Has_env _ ->
96805-
found {pure = false}
96800+
found false
9680696801
| No_env ->
9680796802
found (Ext_string.empty, Js_cmj_format.no_pure_dummy) (* External is okay *)
9680896803
end
@@ -116084,7 +116079,7 @@ let get_dependent_module_effect
116084116079
Lam_compile_env.query_and_add_if_not_exist id
116085116080
(Has_env meta.env )
116086116081
~not_found:(fun _ -> false )
116087-
~found:(fun {pure} -> pure)
116082+
~found:(fun pure -> pure)
116088116083
) in
116089116084
Ext_option.map non_pure_module (fun x -> Lam_module_ident.name x)
116090116085
else

lib/4.02.3/whole_compiler.ml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84003,13 +84003,10 @@ type path = string
8400384003

8400484004

8400584005

84006-
type module_info = {
84007-
pure : bool
84008-
}
8400984006

8401084007
type _ t =
8401184008
| No_env : (path * Js_cmj_format.t) t
84012-
| Has_env : Env.t -> module_info t
84009+
| Has_env : Env.t -> bool t
8401384010

8401484011

8401584012
type ident_info = {
@@ -84245,15 +84242,13 @@ let cached_find_ml_id_pos (module_id : Ident.t) name : ident_info =
8424584242

8424684243

8424784244

84248-
type module_info = {
84249-
pure : bool
84250-
}
84245+
8425184246
(* TODO: it does not make sense to cache
8425284247
[Runtime]
8425384248
and [externals]*)
8425484249
type _ t =
8425584250
| No_env : (path * Js_cmj_format.t) t
84256-
| Has_env : Env.t -> module_info t
84251+
| Has_env : Env.t -> bool t (* Indicate it is pure or not *)
8425784252

8425884253

8425984254
(* -FIXME:
@@ -84271,7 +84266,7 @@ let query_and_add_if_not_exist
8427184266
oid +> Runtime {cmj_path;cmj_table} ;
8427284267
(match env with
8427384268
| Has_env _ ->
84274-
found { pure = true}
84269+
found true
8427584270
| No_env ->
8427684271
found cmj_info)
8427784272
| Ml
@@ -84285,7 +84280,7 @@ let query_and_add_if_not_exist
8428584280
| None -> not_found () (* actually when [not_found] in the call site, we throw... *)
8428684281
| Some _ ->
8428784282
oid +> Visit {cmj_table;cmj_path } ;
84288-
found { pure = Js_cmj_format.is_pure cmj_table}
84283+
found (Js_cmj_format.is_pure cmj_table)
8428984284
end
8429084285
| No_env ->
8429184286
found cmj_info)
@@ -84299,7 +84294,7 @@ let query_and_add_if_not_exist
8429984294
begin match env with
8430084295
| Has_env _
8430184296
->
84302-
found { pure = false}
84297+
found false
8430384298
| No_env ->
8430484299
found (Ext_string.empty, Js_cmj_format.no_pure_dummy)
8430584300
(* FIXME: #154, it come from External, should be okay *)
@@ -84309,21 +84304,21 @@ let query_and_add_if_not_exist
8430984304
| Some (Visit { cmj_table; cmj_path}) ->
8431084305
begin match env with
8431184306
| Has_env _ ->
84312-
found { pure = Js_cmj_format.is_pure cmj_table}
84307+
found (Js_cmj_format.is_pure cmj_table)
8431384308
| No_env -> found (cmj_path,cmj_table)
8431484309
end
8431584310

8431684311
| Some (Runtime {cmj_path; cmj_table}) ->
8431784312
begin match env with
8431884313
| Has_env _ ->
84319-
found {pure = true}
84314+
found true
8432084315
| No_env ->
8432184316
found (cmj_path, cmj_table)
8432284317
end
8432384318
| Some External ->
8432484319
begin match env with
8432584320
| Has_env _ ->
84326-
found {pure = false}
84321+
found false
8432784322
| No_env ->
8432884323
found (Ext_string.empty, Js_cmj_format.no_pure_dummy) (* External is okay *)
8432984324
end
@@ -113793,7 +113788,7 @@ let get_dependent_module_effect
113793113788
Lam_compile_env.query_and_add_if_not_exist id
113794113789
(Has_env meta.env )
113795113790
~not_found:(fun _ -> false )
113796-
~found:(fun {pure} -> pure)
113791+
~found:(fun pure -> pure)
113797113792
) in
113798113793
Ext_option.map non_pure_module (fun x -> Lam_module_ident.name x)
113799113794
else

0 commit comments

Comments
 (0)