aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Symbols.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-26 18:44:34 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-26 18:52:33 +0100
commitaafa0c16dbf95fb880573dea6f9ee6db02470740 (patch)
treeaa738e536b5032261315cd2453f0393b7657b602 /src/dotty/tools/dotc/core/Symbols.scala
parent5b69fbbe68705ece7d892cbda555191853f1c5be (diff)
downloaddotty-aafa0c16dbf95fb880573dea6f9ee6db02470740.tar.gz
dotty-aafa0c16dbf95fb880573dea6f9ee6db02470740.tar.bz2
dotty-aafa0c16dbf95fb880573dea6f9ee6db02470740.zip
New treatment of uniques
To avoid to always create a type before checking its uniqueness we specialize on the three most common categories: RefinedTypes, TypeBounds and NamedTypes. Each category gets its own uniques map. Hashing is disentangled from Types. The new treatement seems to give some improvement (2-5%?) but not much.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index b454add44..53cb38b48 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -338,8 +338,8 @@ object Symbols {
final def isType(implicit ctx: Context): Boolean = denot.isType
final def isClass: Boolean = isInstanceOf[ClassSymbol]
- final def asTerm(implicit ctx: Context): TermSymbol = { assert(isTerm, this); asInstanceOf[TermSymbol] }
- final def asType(implicit ctx: Context): TypeSymbol = { assert(isType, this); asInstanceOf[TypeSymbol] }
+ final def asTerm(implicit ctx: Context): TermSymbol = { assert(isTerm); asInstanceOf[TermSymbol] }
+ final def asType(implicit ctx: Context): TypeSymbol = { assert(isType); asInstanceOf[TypeSymbol] }
final def asClass: ClassSymbol = asInstanceOf[ClassSymbol]
/** A unique, densely packed integer tag for each class symbol, -1
@@ -350,7 +350,7 @@ object Symbols {
/** This symbol entered into owner's scope (owner must be a class). */
final def entered(implicit ctx: Context): this.type = {
- assert(this.owner.isClass, this.owner.denot) // !!! DEBUG
+ assert(this.owner.isClass) // !!! DEBUG
this.owner.asClass.enter(this)
if (this is Module) this.owner.asClass.enter(this.moduleClass)
this