Skip to content

Commit 939a07e

Browse files
authored
Merge pull request #6957 from dotty-staging/drop-track
Fix #6934: Drop track
2 parents 51ccfb3 + 01ad50d commit 939a07e

File tree

11 files changed

+178
-178
lines changed

11 files changed

+178
-178
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ class ScalaSettings extends Settings.SettingGroup {
125125
val YtraceContextCreation: Setting[Boolean] = BooleanSetting("-Ytrace-context-creation", "Store stack trace of context creations.")
126126
val YshowSuppressedErrors: Setting[Boolean] = BooleanSetting("-Yshow-suppressed-errors", "Also show follow-on errors and warnings that are normally suppressed.")
127127
val YdetailedStats: Setting[Boolean] = BooleanSetting("-Ydetailed-stats", "show detailed internal compiler stats (needs Stats.enabled to be set to true).")
128-
val Yheartbeat: Setting[Boolean] = BooleanSetting("-Yheartbeat", "show heartbeat stack trace of compiler operations (needs Stats.enabled to be set to true).")
129128
val YkindProjector: Setting[Boolean] = BooleanSetting("-Ykind-projector", "allow `*` as wildcard to be compatible with kind projector")
130129
val YprintPos: Setting[Boolean] = BooleanSetting("-Yprint-pos", "show tree positions.")
131130
val YprintPosSyms: Setting[Boolean] = BooleanSetting("-Yprint-pos-syms", "show symbol definitions positions.")

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ object SymDenotations {
17831783
} else computeNPMembersNamed(name)
17841784
}
17851785

1786-
private[core] def computeNPMembersNamed(name: Name)(implicit ctx: Context): PreDenotation = /*>|>*/ Stats.track("computeNPMembersNamed") /*<|<*/ {
1786+
private[core] def computeNPMembersNamed(name: Name)(implicit ctx: Context): PreDenotation = {
17871787
Stats.record("computeNPMembersNamed after fingerprint")
17881788
ensureCompleted()
17891789
val ownDenots = info.decls.denotsNamed(name, selectNonPrivate)

compiler/src/dotty/tools/dotc/core/TypeApplications.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ class TypeApplications(val self: Type) extends AnyVal {
161161
* For a refinement type, the type parameters of its parent, dropping
162162
* any type parameter that is-rebound by the refinement.
163163
*/
164-
final def typeParams(implicit ctx: Context): List[TypeParamInfo] = /*>|>*/ track("typeParams") /*<|<*/ {
164+
final def typeParams(implicit ctx: Context): List[TypeParamInfo] = {
165+
record("typeParams")
165166
def isTrivial(prefix: Type, tycon: Symbol) = prefix match {
166167
case prefix: ThisType => prefix.cls `eq` tycon.owner
167168
case NoPrefix => true
@@ -353,7 +354,8 @@ class TypeApplications(val self: Type) extends AnyVal {
353354
* @param self = `T`
354355
* @param args = `U1,...,Un`
355356
*/
356-
final def appliedTo(args: List[Type])(implicit ctx: Context): Type = /*>|>*/ track("appliedTo") /*<|<*/ {
357+
final def appliedTo(args: List[Type])(implicit ctx: Context): Type = {
358+
record("appliedTo")
357359
val typParams = self.typeParams
358360
val stripped = self.stripTypeVar
359361
val dealiased = stripped.safeDealias

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ object Types {
472472
* Inherited by all type proxies. Overridden for And and Or types.
473473
* `Nil` for all other types.
474474
*/
475-
def baseClasses(implicit ctx: Context): List[ClassSymbol] = track("baseClasses") {
475+
def baseClasses(implicit ctx: Context): List[ClassSymbol] = {
476+
record("baseClasses")
476477
this match {
477478
case tp: TypeProxy =>
478479
tp.underlying.baseClasses
@@ -501,12 +502,13 @@ object Types {
501502
* The result is either a SymDenotation or a MultiDenotation of SymDenotations.
502503
* The info(s) are the original symbol infos, no translation takes place.
503504
*/
504-
final def decl(name: Name)(implicit ctx: Context): Denotation = track("decl") {
505+
final def decl(name: Name)(implicit ctx: Context): Denotation = {
506+
record("decl")
505507
findDecl(name, EmptyFlags)
506508
}
507509

508510
/** A denotation containing the non-private declaration(s) in this type with the given name */
509-
final def nonPrivateDecl(name: Name)(implicit ctx: Context): Denotation = track("nonPrivateDecl") {
511+
final def nonPrivateDecl(name: Name)(implicit ctx: Context): Denotation = {
510512
findDecl(name, Private)
511513
}
512514

@@ -526,12 +528,14 @@ object Types {
526528
}
527529

528530
/** The member of this type with the given name */
529-
final def member(name: Name)(implicit ctx: Context): Denotation = /*>|>*/ track("member") /*<|<*/ {
531+
final def member(name: Name)(implicit ctx: Context): Denotation = /*>|>*/ {
532+
record("member")
530533
memberBasedOnFlags(name, required = EmptyFlags, excluded = EmptyFlags)
531534
}
532535

533536
/** The non-private member of this type with the given name. */
534-
final def nonPrivateMember(name: Name)(implicit ctx: Context): Denotation = track("nonPrivateMember") {
537+
final def nonPrivateMember(name: Name)(implicit ctx: Context): Denotation = {
538+
record("nonPrivateMember")
535539
memberBasedOnFlags(name, required = EmptyFlags, excluded = Flags.Private)
536540
}
537541

@@ -759,31 +763,36 @@ object Types {
759763
}
760764

761765
/** The set of abstract term members of this type. */
762-
final def abstractTermMembers(implicit ctx: Context): Seq[SingleDenotation] = track("abstractTermMembers") {
766+
final def abstractTermMembers(implicit ctx: Context): Seq[SingleDenotation] = {
767+
record("abstractTermMembers")
763768
memberDenots(abstractTermNameFilter,
764769
(name, buf) => buf ++= nonPrivateMember(name).altsWith(_.is(Deferred)))
765770
}
766771

767772
/** The set of abstract type members of this type. */
768-
final def abstractTypeMembers(implicit ctx: Context): Seq[SingleDenotation] = track("abstractTypeMembers") {
773+
final def abstractTypeMembers(implicit ctx: Context): Seq[SingleDenotation] = {
774+
record("abstractTypeMembers")
769775
memberDenots(abstractTypeNameFilter,
770776
(name, buf) => buf += nonPrivateMember(name).asSingleDenotation)
771777
}
772778

773779
/** The set of abstract type members of this type. */
774-
final def nonClassTypeMembers(implicit ctx: Context): Seq[SingleDenotation] = track("nonClassTypeMembers") {
780+
final def nonClassTypeMembers(implicit ctx: Context): Seq[SingleDenotation] = {
781+
record("nonClassTypeMembers")
775782
memberDenots(nonClassTypeNameFilter,
776783
(name, buf) => buf += member(name).asSingleDenotation)
777784
}
778785

779786
/** The set of type alias members of this type */
780-
final def typeAliasMembers(implicit ctx: Context): Seq[SingleDenotation] = track("typeAlias") {
787+
final def typeAliasMembers(implicit ctx: Context): Seq[SingleDenotation] = {
788+
record("typeAliasMembers")
781789
memberDenots(typeAliasNameFilter,
782790
(name, buf) => buf += member(name).asSingleDenotation)
783791
}
784792

785793
/** The set of type members of this type */
786-
final def typeMembers(implicit ctx: Context): Seq[SingleDenotation] = track("typeMembers") {
794+
final def typeMembers(implicit ctx: Context): Seq[SingleDenotation] = {
795+
record("typeMembers")
787796
memberDenots(typeNameFilter,
788797
(name, buf) => buf += member(name).asSingleDenotation)
789798
}
@@ -792,31 +801,36 @@ object Types {
792801
* @param kind A subset of {Implicit, Given} that specifies what kind of implicit should
793802
* be returned
794803
*/
795-
final def implicitMembers(kind: FlagSet)(implicit ctx: Context): List[TermRef] = track("implicitMembers") {
804+
final def implicitMembers(kind: FlagSet)(implicit ctx: Context): List[TermRef] = {
805+
record("implicitMembers")
796806
memberDenots(implicitFilter,
797807
(name, buf) => buf ++= member(name).altsWith(_.isOneOf(GivenOrImplicitVal & kind)))
798808
.toList.map(d => TermRef(this, d.symbol.asTerm))
799809
}
800810

801811
/** The set of member classes of this type */
802-
final def memberClasses(implicit ctx: Context): Seq[SingleDenotation] = track("memberClasses") {
812+
final def memberClasses(implicit ctx: Context): Seq[SingleDenotation] = {
813+
record("memberClasses")
803814
memberDenots(typeNameFilter,
804815
(name, buf) => buf ++= member(name).altsWith(x => x.isClass))
805816
}
806817

807-
final def fields(implicit ctx: Context): Seq[SingleDenotation] = track("fields") {
818+
final def fields(implicit ctx: Context): Seq[SingleDenotation] = {
819+
record("fields")
808820
memberDenots(fieldFilter,
809821
(name, buf) => buf ++= member(name).altsWith(x => !x.is(Method)))
810822
}
811823

812824
/** The set of members of this type that have all of `required` flags but none of `excluded` flags set. */
813-
final def membersBasedOnFlags(required: FlagSet, excluded: FlagSet)(implicit ctx: Context): Seq[SingleDenotation] = track("membersBasedOnFlags") {
825+
final def membersBasedOnFlags(required: FlagSet, excluded: FlagSet)(implicit ctx: Context): Seq[SingleDenotation] = {
826+
record("membersBasedOnFlags")
814827
memberDenots(takeAllFilter,
815828
(name, buf) => buf ++= memberBasedOnFlags(name, required, excluded).alternatives)
816829
}
817830

818831
/** All members of this type. Warning: this can be expensive to compute! */
819-
final def allMembers(implicit ctx: Context): Seq[SingleDenotation] = track("allMembers") {
832+
final def allMembers(implicit ctx: Context): Seq[SingleDenotation] = {
833+
record("allMembers")
820834
memberDenots(takeAllFilter, (name, buf) => buf ++= member(name).alternatives)
821835
}
822836

@@ -827,27 +841,31 @@ object Types {
827841
/** This type seen as if it were the type of a member of prefix type `pre`
828842
* declared in class `cls`.
829843
*/
830-
final def asSeenFrom(pre: Type, cls: Symbol)(implicit ctx: Context): Type = track("asSeenFrom") {
844+
final def asSeenFrom(pre: Type, cls: Symbol)(implicit ctx: Context): Type = {
845+
record("asSeenFrom")
831846
if (!cls.membersNeedAsSeenFrom(pre)) this
832847
else ctx.asSeenFrom(this, pre, cls)
833848
}
834849

835850
// ----- Subtype-related --------------------------------------------
836851

837852
/** Is this type a subtype of that type? */
838-
final def <:<(that: Type)(implicit ctx: Context): Boolean = track("<:<") {
853+
final def <:<(that: Type)(implicit ctx: Context): Boolean = {
854+
record("<:<")
839855
ctx.typeComparer.topLevelSubType(this, that)
840856
}
841857

842858
/** Is this type a subtype of that type? */
843-
final def frozen_<:<(that: Type)(implicit ctx: Context): Boolean = track("frozen_<:<") {
859+
final def frozen_<:<(that: Type)(implicit ctx: Context): Boolean = {
860+
record("frozen_<:<")
844861
ctx.typeComparer.isSubTypeWhenFrozen(this, that)
845862
}
846863

847864
/** Is this type the same as that type?
848865
* This is the case iff `this <:< that` and `that <:< this`.
849866
*/
850-
final def =:=(that: Type)(implicit ctx: Context): Boolean = track("=:=") {
867+
final def =:=(that: Type)(implicit ctx: Context): Boolean = {
868+
record("=:=")
851869
ctx.typeComparer.isSameType(this, that)
852870
}
853871

@@ -905,7 +923,8 @@ object Types {
905923
* (*) when matching with a Java method, we also regard Any and Object as equivalent
906924
* parameter types.
907925
*/
908-
def matches(that: Type)(implicit ctx: Context): Boolean = track("matches") {
926+
def matches(that: Type)(implicit ctx: Context): Boolean = {
927+
record("matches")
909928
ctx.typeComparer.matchesType(this, that, relaxed = !ctx.phase.erasedTypes)
910929
}
911930

@@ -920,14 +939,16 @@ object Types {
920939
}
921940

922941
/** The basetype of this type with given class symbol, NoType if `base` is not a class. */
923-
final def baseType(base: Symbol)(implicit ctx: Context): Type = /*trace(s"$this baseType $base")*/ /*>|>*/ track("base type") /*<|<*/ {
942+
final def baseType(base: Symbol)(implicit ctx: Context): Type = {
943+
record("baseType")
924944
base.denot match {
925945
case classd: ClassDenotation => classd.baseTypeOf(this)
926946
case _ => NoType
927947
}
928948
}
929949

930-
def & (that: Type)(implicit ctx: Context): Type = track("&") {
950+
def & (that: Type)(implicit ctx: Context): Type = {
951+
record("&")
931952
ctx.typeComparer.glb(this, that)
932953
}
933954

@@ -956,7 +977,8 @@ object Types {
956977
// superclass.
957978
}
958979

959-
def | (that: Type)(implicit ctx: Context): Type = track("|") {
980+
def | (that: Type)(implicit ctx: Context): Type = {
981+
record("|")
960982
ctx.typeComparer.lub(this, that)
961983
}
962984

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package typer
55
import core._
66
import ast.{Trees, tpd, untpd}
77
import util.Spans._
8-
import util.Stats.{track, record}
8+
import util.Stats.record
99
import util.{SourcePosition, NoSourcePosition, SourceFile}
1010
import Trees.Untyped
1111
import Contexts._
@@ -805,7 +805,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
805805
*/
806806
def typedApply(tree: untpd.Apply, pt: Type)(implicit ctx: Context): Tree = {
807807

808-
def realApply(implicit ctx: Context): Tree = track("realApply") {
808+
def realApply(implicit ctx: Context): Tree = {
809809
val originalProto = new FunProto(tree.args, IgnoredProto(pt))(this, tree.isGivenApply)(argCtx(tree))
810810
record("typedApply")
811811
val fun1 = typedFunPart(tree.fun, originalProto)
@@ -888,7 +888,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
888888
*
889889
* { val xs = es; e' = e' + args }
890890
*/
891-
def typedOpAssign(implicit ctx: Context): Tree = track("typedOpAssign") {
891+
def typedOpAssign(implicit ctx: Context): Tree = {
892892
val Apply(Select(lhs, name), rhss) = tree
893893
val lhs1 = typedExpr(lhs)
894894
val liftedDefs = new mutable.ListBuffer[Tree]
@@ -939,7 +939,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
939939
cpy.NamedArg(arg)(id, argtpt1).withType(argtpt1.tpe)
940940
}
941941

942-
def typedTypeApply(tree: untpd.TypeApply, pt: Type)(implicit ctx: Context): Tree = track("typedTypeApply") {
942+
def typedTypeApply(tree: untpd.TypeApply, pt: Type)(implicit ctx: Context): Tree = {
943943
if (ctx.mode.is(Mode.Pattern)) {
944944
return errorTree(tree, "invalid pattern")
945945
}
@@ -992,7 +992,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
992992
tree
993993
}
994994

995-
def typedUnApply(tree: untpd.Apply, selType: Type)(implicit ctx: Context): Tree = track("typedUnApply") {
995+
def typedUnApply(tree: untpd.Apply, selType: Type)(implicit ctx: Context): Tree = {
996+
record("typedUnApply")
996997
val Apply(qual, args) = tree
997998

998999
def notAnExtractor(tree: Tree) =
@@ -1239,8 +1240,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
12391240
* an alternative that takes more implicit parameters wins over one
12401241
* that takes fewer.
12411242
*/
1242-
def compare(alt1: TermRef, alt2: TermRef)(implicit ctx: Context): Int = track("compare") { trace(i"compare($alt1, $alt2)", overload) {
1243-
1243+
def compare(alt1: TermRef, alt2: TermRef)(implicit ctx: Context): Int = trace(i"compare($alt1, $alt2)", overload) {
1244+
record("compare")
12441245
assert(alt1 ne alt2)
12451246

12461247
/** Is alternative `alt1` with type `tp1` as specific as alternative
@@ -1412,9 +1413,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
14121413
else 1 // prefer 1st alternative with no implicits
14131414
else if (strippedType2 eq fullType2) -1 // prefer 2nd alternative with no implicits
14141415
else compareWithTypes(fullType1, fullType2) // continue by comparing implicits parameters
1415-
}}
1416+
}
14161417

1417-
def narrowMostSpecific(alts: List[TermRef])(implicit ctx: Context): List[TermRef] = track("narrowMostSpecific") {
1418+
def narrowMostSpecific(alts: List[TermRef])(implicit ctx: Context): List[TermRef] = {
1419+
record("narrowMostSpecific")
14181420
alts match {
14191421
case Nil => alts
14201422
case _ :: Nil => alts
@@ -1451,7 +1453,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
14511453
* Two trials: First, without implicits or SAM conversions enabled. Then,
14521454
* if the first finds no eligible candidates, with implicits and SAM conversions enabled.
14531455
*/
1454-
def resolveOverloaded(alts: List[TermRef], pt: Type)(implicit ctx: Context): List[TermRef] = track("resolveOverloaded") {
1456+
def resolveOverloaded(alts: List[TermRef], pt: Type)(implicit ctx: Context): List[TermRef] = {
1457+
record("resolveOverloaded")
14551458

14561459
/** Is `alt` a method or polytype whose result type after the first value parameter
14571460
* section conforms to the expected type `resultType`? If `resultType`
@@ -1547,7 +1550,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
15471550
* called twice from the public `resolveOverloaded` method, once with
15481551
* implicits and SAM conversions enabled, and once without.
15491552
*/
1550-
private def resolveOverloaded(alts: List[TermRef], pt: Type, targs: List[Type])(implicit ctx: Context): List[TermRef] = track("resolveOverloaded") {
1553+
private def resolveOverloaded(alts: List[TermRef], pt: Type, targs: List[Type])(implicit ctx: Context): List[TermRef] = {
1554+
record("resolveOverloaded/2")
15511555

15521556
def isDetermined(alts: List[TermRef]) = alts.isEmpty || alts.tail.isEmpty
15531557

0 commit comments

Comments
 (0)