Skip to content

Commit 0da25da

Browse files
committed
even faster compiler
1 parent 40fe679 commit 0da25da

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

jscomp/bin/whole_compiler.ml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26636,6 +26636,7 @@ and ext_status =
2663626636
| Text_next (* not first constructor in an extension *)
2663726637
| Text_exception
2663826638

26639+
val equal_tag : constructor_tag -> constructor_tag -> bool
2663926640
end = struct
2664026641
#1 "types.ml"
2664126642
(***********************************************************************)
@@ -26946,6 +26947,15 @@ and ext_status =
2694626947
| Text_next (* not first constructor of an extension *)
2694726948
| Text_exception (* an exception *)
2694826949

26950+
let equal_tag t1 t2 =
26951+
match (t1, t2) with
26952+
| Cstr_constant i1, Cstr_constant i2 -> i2 = i1
26953+
| Cstr_block i1, Cstr_block i2 -> i2 = i1
26954+
| Cstr_extension (path1, b1), Cstr_extension (path2, b2) ->
26955+
Path.same path1 path2 && b1 = b2
26956+
| (Cstr_constant _|Cstr_block _|Cstr_extension _), _ -> false
26957+
26958+
2694926959
end
2695026960
module Btype : sig
2695126961
#1 "btype.mli"
@@ -44011,7 +44021,7 @@ let rec compat p q =
4401144021
| Tpat_tuple ps, Tpat_tuple qs -> compats ps qs
4401244022
| Tpat_lazy p, Tpat_lazy q -> compat p q
4401344023
| Tpat_construct (_, c1,ps1), Tpat_construct (_, c2,ps2) ->
44014-
c1.cstr_tag = c2.cstr_tag && compats ps1 ps2
44024+
Types.equal_tag c1.cstr_tag c2.cstr_tag && compats ps1 ps2
4401544025
| Tpat_variant(l1,Some p1, r1), Tpat_variant(l2,Some p2,_) ->
4401644026
l1=l2 && compat p1 p2
4401744027
| Tpat_variant (l1,None,r1), Tpat_variant(l2,None,_) ->
@@ -44192,7 +44202,7 @@ let pretty_matrix (pss : matrix) =
4419244202
let simple_match p1 p2 =
4419344203
match p1.pat_desc, p2.pat_desc with
4419444204
| Tpat_construct(_, c1, _), Tpat_construct(_, c2, _) ->
44195-
c1.cstr_tag = c2.cstr_tag
44205+
Types.equal_tag c1.cstr_tag c2.cstr_tag
4419644206
| Tpat_variant(l1, _, _), Tpat_variant(l2, _, _) ->
4419744207
l1 = l2
4419844208
| Tpat_constant(c1), Tpat_constant(c2) -> const_compare c1 c2 = 0
@@ -44680,7 +44690,7 @@ let complete_constrs p all_tags =
4468044690
let constrs = get_variant_constructors p.pat_env c.cstr_res in
4468144691
map_filter
4468244692
(fun cnstr ->
44683-
if List.mem cnstr.cstr_tag not_tags then Some cnstr else None)
44693+
if List.exists (fun tag -> Types.equal_tag tag cnstr.cstr_tag) not_tags then Some cnstr else None)
4468444694
constrs
4468544695
| _ -> fatal_error "Parmatch.complete_constr"
4468644696

@@ -45391,7 +45401,7 @@ let rec le_pat p q =
4539145401
| _, Tpat_alias(q,_,_) -> le_pat p q
4539245402
| Tpat_constant(c1), Tpat_constant(c2) -> const_compare c1 c2 = 0
4539345403
| Tpat_construct(_,c1,ps), Tpat_construct(_,c2,qs) ->
45394-
c1.cstr_tag = c2.cstr_tag && le_pats ps qs
45404+
Types.equal_tag c1.cstr_tag c2.cstr_tag && le_pats ps qs
4539545405
| Tpat_variant(l1,Some p1,_), Tpat_variant(l2,Some p2,_) ->
4539645406
(l1 = l2 && le_pat p1 p2)
4539745407
| Tpat_variant(l1,None,r1), Tpat_variant(l2,None,_) ->
@@ -45441,7 +45451,7 @@ let rec lub p q = match p.pat_desc,q.pat_desc with
4544145451
let r = lub p q in
4544245452
make_pat (Tpat_lazy r) p.pat_type p.pat_env
4544345453
| Tpat_construct (lid, c1,ps1), Tpat_construct (_,c2,ps2)
45444-
when c1.cstr_tag = c2.cstr_tag ->
45454+
when Types.equal_tag c1.cstr_tag c2.cstr_tag ->
4544545455
let rs = lubs ps1 ps2 in
4544645456
make_pat (Tpat_construct (lid, c1,rs))
4544745457
p.pat_type p.pat_env

ocaml

Submodule ocaml updated from ee951e7 to c29feb0

0 commit comments

Comments
 (0)