@@ -1452,42 +1452,6 @@ object SymDenotations {
1452
1452
1453
1453
final override def typeParamCreationFlags = ClassTypeParamCreationFlags
1454
1454
1455
- private [this ] var myMemberFingerPrint : FingerPrint = FingerPrint .unknown
1456
-
1457
- private def computeMemberFingerPrint (implicit ctx : Context ): FingerPrint = {
1458
- var fp = FingerPrint ()
1459
- var e = info.decls.lastEntry
1460
- while (e != null ) {
1461
- fp.include(e.name)
1462
- e = e.prev
1463
- }
1464
- var ps = classParents
1465
- while (ps.nonEmpty) {
1466
- val parent = ps.head.typeSymbol
1467
- parent.denot match {
1468
- case parentDenot : ClassDenotation =>
1469
- fp.include(parentDenot.memberFingerPrint)
1470
- if (parentDenot.isFullyCompleted) parentDenot.setFlag(Frozen )
1471
- case _ =>
1472
- }
1473
- ps = ps.tail
1474
- }
1475
- fp
1476
- }
1477
-
1478
- /** A bloom filter for the names of all members in this class.
1479
- * Makes sense only for parent classes, and should definitely
1480
- * not be used for package classes because cache never
1481
- * gets invalidated.
1482
- */
1483
- def memberFingerPrint (implicit ctx : Context ): FingerPrint =
1484
- if (myMemberFingerPrint != FingerPrint .unknown) myMemberFingerPrint
1485
- else {
1486
- val fp = computeMemberFingerPrint
1487
- if (isFullyCompleted) myMemberFingerPrint = fp
1488
- fp
1489
- }
1490
-
1491
1455
/** Hook to do a pre-enter test. Overridden in PackageDenotation */
1492
1456
protected def proceedWithEnter (sym : Symbol , mscope : MutableScope )(implicit ctx : Context ): Boolean = true
1493
1457
@@ -1530,8 +1494,6 @@ object SymDenotations {
1530
1494
1531
1495
scope.enter(sym)
1532
1496
1533
- if (myMemberFingerPrint != FingerPrint .unknown)
1534
- myMemberFingerPrint.include(sym.name)
1535
1497
if (myMemberCache != null ) myMemberCache.invalidate(sym.name)
1536
1498
if (! sym.flagsUNSAFE.is(Private )) invalidateMemberNamesCache()
1537
1499
}
@@ -1553,7 +1515,6 @@ object SymDenotations {
1553
1515
def delete (sym : Symbol )(implicit ctx : Context ) = {
1554
1516
require(! (this is Frozen ))
1555
1517
info.decls.openForMutations.unlink(sym)
1556
- myMemberFingerPrint = FingerPrint .unknown
1557
1518
if (myMemberCache != null ) myMemberCache.invalidate(sym.name)
1558
1519
if (! sym.flagsUNSAFE.is(Private )) invalidateMemberNamesCache()
1559
1520
}
@@ -1603,31 +1564,27 @@ object SymDenotations {
1603
1564
}
1604
1565
1605
1566
private [core] def computeNPMembersNamed (name : Name , inherited : Boolean )(implicit ctx : Context ): PreDenotation = /* >|>*/ Stats .track(" computeNPMembersNamed" ) /* <|<*/ {
1606
- if (! inherited ||
1607
- ! Config .useFingerPrints ||
1608
- (memberFingerPrint contains name)) {
1609
- Stats .record(" computeNPMembersNamed after fingerprint" )
1610
- ensureCompleted()
1611
- val ownDenots = info.decls.denotsNamed(name, selectNonPrivate)
1612
- if (debugTrace) // DEBUG
1613
- println(s " $this.member( $name), ownDenots = $ownDenots" )
1614
- def collect (denots : PreDenotation , parents : List [TypeRef ]): PreDenotation = parents match {
1615
- case p :: ps =>
1616
- val denots1 = collect(denots, ps)
1617
- p.symbol.denot match {
1618
- case parentd : ClassDenotation =>
1619
- denots1 union
1620
- parentd.nonPrivateMembersNamed(name, inherited = true )
1621
- .mapInherited(ownDenots, denots1, thisType)
1622
- case _ =>
1623
- denots1
1624
- }
1625
- case nil =>
1626
- denots
1627
- }
1628
- if (name.isConstructorName) ownDenots
1629
- else collect(ownDenots, classParents)
1630
- } else NoDenotation
1567
+ Stats .record(" computeNPMembersNamed after fingerprint" )
1568
+ ensureCompleted()
1569
+ val ownDenots = info.decls.denotsNamed(name, selectNonPrivate)
1570
+ if (debugTrace) // DEBUG
1571
+ println(s " $this.member( $name), ownDenots = $ownDenots" )
1572
+ def collect (denots : PreDenotation , parents : List [TypeRef ]): PreDenotation = parents match {
1573
+ case p :: ps =>
1574
+ val denots1 = collect(denots, ps)
1575
+ p.symbol.denot match {
1576
+ case parentd : ClassDenotation =>
1577
+ denots1 union
1578
+ parentd.nonPrivateMembersNamed(name, inherited = true )
1579
+ .mapInherited(ownDenots, denots1, thisType)
1580
+ case _ =>
1581
+ denots1
1582
+ }
1583
+ case nil =>
1584
+ denots
1585
+ }
1586
+ if (name.isConstructorName) ownDenots
1587
+ else collect(ownDenots, classParents)
1631
1588
}
1632
1589
1633
1590
override final def findMember (name : Name , pre : Type , excluded : FlagSet )(implicit ctx : Context ): Denotation = {
@@ -1981,30 +1938,7 @@ object SymDenotations {
1981
1938
}
1982
1939
}
1983
1940
1984
- // ---- Fingerprints -----------------------------------------------------
1985
-
1986
- /** A fingerprint is a bitset that acts as a bloom filter for sets
1987
- * of names.
1988
- */
1989
- class FingerPrint (val bits : Array [Long ]) extends AnyVal {
1990
- import FingerPrint ._
1991
-
1992
- /** Include some bits of name's hashcode in set */
1993
- def include (name : Name ): Unit = {
1994
- val hash = name.hashCode & Mask
1995
- bits(hash >> WordSizeLog ) |= (1L << hash)
1996
- }
1997
-
1998
- /** Include all bits of `that` fingerprint in set */
1999
- def include (that : FingerPrint ): Unit =
2000
- for (i <- 0 until NumWords ) bits(i) |= that.bits(i)
2001
-
2002
- /** Does set contain hash bits of given name? */
2003
- def contains (name : Name ): Boolean = {
2004
- val hash = name.hashCode & Mask
2005
- (bits(hash >> WordSizeLog ) & (1L << hash)) != 0
2006
- }
2007
- }
1941
+ // ---- Caches for inherited info -----------------------------------------
2008
1942
2009
1943
trait InheritedCache {
2010
1944
def isValid (implicit ctx : Context ): Boolean
@@ -2147,15 +2081,6 @@ object SymDenotations {
2147
2081
def sameGroup (p1 : Phase , p2 : Phase ) = p1.parentsGroup == p2.parentsGroup
2148
2082
}
2149
2083
2150
- object FingerPrint {
2151
- def apply () = new FingerPrint (new Array [Long ](NumWords ))
2152
- val unknown = new FingerPrint (null )
2153
- private final val WordSizeLog = 6
2154
- private final val NumWords = 32
2155
- private final val NumBits = NumWords << WordSizeLog
2156
- private final val Mask = NumBits - 1
2157
- }
2158
-
2159
2084
class BaseClassSet (val classIds : Array [Int ]) extends AnyVal {
2160
2085
def contains (sym : Symbol ): Boolean = {
2161
2086
val id = sym.id
0 commit comments