diff --git a/project/Build.scala b/project/Build.scala index 4dd86fa01d10..b395f6f09851 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -5,11 +5,15 @@ import java.nio.channels.FileLock object DottyBuild extends Build { + val travisMemLimit = List("-Xmx1g", "-Xss2m") + val TRAVIS_BUILD = "dotty.travis.build" val agentOptions = List( // "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" // "-agentpath:/home/dark/opt/yjp-2013-build-13072/bin/linux-x86-64/libyjpagent.so" + // "-agentpath:/Applications/YourKit_Java_Profiler_2015_build_15052.app/Contents/Resources/bin/mac/libyjpagent.jnilib", + // "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1g", "-Xss2m" ) var partestLock: FileLock = null @@ -79,7 +83,7 @@ object DottyBuild extends Build { val travis_build = // propagate if this is a travis build if (sys.props.isDefinedAt(TRAVIS_BUILD)) - List(s"-D$TRAVIS_BUILD=${sys.props(TRAVIS_BUILD)}") + List(s"-D$TRAVIS_BUILD=${sys.props(TRAVIS_BUILD)}") ::: travisMemLimit else List() diff --git a/src/dotty/runtime/LazyVals.scala b/src/dotty/runtime/LazyVals.scala index 4130d4d60335..2aa45e6fd144 100644 --- a/src/dotty/runtime/LazyVals.scala +++ b/src/dotty/runtime/LazyVals.scala @@ -11,8 +11,8 @@ object LazyVals { final val BITS_PER_LAZY_VAL = 2 final val LAZY_VAL_MASK = 3 - @inline def STATE(cur: Long, ord: Long) = (cur >> (ord * BITS_PER_LAZY_VAL)) & LAZY_VAL_MASK - @inline def CAS(t: Object, offset: Long, e: Long, v: Long, ord: Int) = { + @inline def STATE(cur: Long, ord: Int) = (cur >> (ord * BITS_PER_LAZY_VAL)) & LAZY_VAL_MASK + @inline def CAS(t: Object, offset: Long, e: Long, v: Int, ord: Int) = { val mask = ~(LAZY_VAL_MASK << ord * BITS_PER_LAZY_VAL) val n = (e & mask) | (v << (ord * BITS_PER_LAZY_VAL)) compareAndSet(t, offset, e, n) @@ -65,7 +65,7 @@ object LazyVals { monitors(id) } - @inline def getOffset(obj: Object, name: String) = unsafe.objectFieldOffset(obj.getClass.getDeclaredField(name)) + @inline def getOffset(clz: Class[_], name: String) = unsafe.objectFieldOffset(clz.getDeclaredField(name)) object Names { final val state = "STATE" diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 009b7fb2b9f7..2e904cc23532 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -589,7 +589,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ def isDeferred: Boolean = sym is Flags.Deferred def isPrivate: Boolean = sym is Flags.Private def getsJavaFinalFlag: Boolean = - isFinal && !toDenot(sym).isClassConstructor && !(sym is Flags.Mutable) && !(sym.enclosingClass is Flags.JavaInterface) + isFinal && !toDenot(sym).isClassConstructor && !(sym is Flags.Mutable) && !(sym.enclosingClass is Flags.Trait) def getsJavaPrivateFlag: Boolean = isPrivate //|| (sym.isPrimaryConstructor && sym.owner.isTopLevelModuleClass) diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index 1657adbbb739..102d99347c92 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -49,8 +49,7 @@ class Compiler { List(new PatternMatcher, new ExplicitOuter, new Splitter), - List(new LazyVals, - new SeqLiterals, + List(new SeqLiterals, new InterceptedMethods, new Literalize, new Getters, @@ -58,11 +57,12 @@ class Compiler { new ResolveSuper), List(new Erasure), List(new Mixin, + new LazyVals, new Memoize, - new CapturedVars, + new CapturedVars, // capturedVars has a transformUnit: no phases should introduce local mutable vars here new Constructors, new FunctionalInterfaces), - List(new LambdaLift, + List(new LambdaLift, // in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here new Flatten, new RestoreScopes), List(/*new PrivateToStatic,*/ new CollectEntryPoints, new LabelDefs, new ElimWildcardIdents, new TraitConstructors), diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala index 0a1611b61acd..de0ef3344e4e 100644 --- a/src/dotty/tools/dotc/ast/tpd.scala +++ b/src/dotty/tools/dotc/ast/tpd.scala @@ -2,6 +2,7 @@ package dotty.tools package dotc package ast +import dotty.tools.dotc.transform.ExplicitOuter import dotty.tools.dotc.typer.ProtoTypes.FunProtoTyped import transform.SymUtils._ import core._ @@ -243,6 +244,17 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { ta.assignType(untpd.TypeDef(cls.name, impl), cls) } + // {