From 24a95aa44a02d438d4df179a6475edfc690f9d9a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 18 May 2015 19:30:01 +0200 Subject: Move threshold values to Config It's a more logical home for them than the Context object. --- src/dotty/tools/dotc/core/Contexts.scala | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 5d2750aa8..88923d31d 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -20,6 +20,7 @@ import util.{FreshNameCreator, SimpleMap, SourceFile, NoSource} import typer._ import Implicits.ContextualImplicits import config.Settings._ +import config.Config import reporting._ import collection.mutable import collection.immutable.BitSet @@ -508,7 +509,7 @@ object Contexts { def nextId = { _nextId += 1; _nextId } /** A map from a superclass id to the typeref of the class that has it */ - private[core] var classOfId = new Array[ClassSymbol](InitialSuperIdsSize) + private[core] var classOfId = new Array[ClassSymbol](Config.InitialSuperIdsSize) /** A map from a the typeref of a class to its superclass id */ private[core] val superIdOfClass = new mutable.AnyRefMap[ClassSymbol, Int] @@ -529,7 +530,7 @@ object Contexts { // Types state /** A table for hash consing unique types */ - private[core] val uniques = new util.HashSet[Type](initialUniquesCapacity) { + private[core] val uniques = new util.HashSet[Type](Config.initialUniquesCapacity) { override def hash(x: Type): Int = x.hash } @@ -614,20 +615,4 @@ object Contexts { myBounds = myBounds.updated(sym, b) def bounds = myBounds } - - /** Initial size of superId table */ - private final val InitialSuperIdsSize = 4096 - - /** Initial capacity of uniques HashMap */ - private[core] final val initialUniquesCapacity = 40000 - - /** How many recursive calls to NamedType#underlying are performed before - * logging starts. - */ - private[core] final val LogPendingUnderlyingThreshold = 50 - - /** How many recursive calls to isSubType are performed before - * logging starts. - */ - private[core] final val LogPendingSubTypesThreshold = 50 } -- cgit v1.2.3