aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/Compiler.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-14 12:56:11 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-19 14:13:47 +0100
commit5cbd2fbc8409b446f8751792b006693e1d091055 (patch)
tree6440bff96597df0e10e69a66ec673091f92ea284 /src/dotty/tools/dotc/Compiler.scala
parent46856320f4e21d94b3c5c29a921efac40e12421f (diff)
downloaddotty-5cbd2fbc8409b446f8751792b006693e1d091055.tar.gz
dotty-5cbd2fbc8409b446f8751792b006693e1d091055.tar.bz2
dotty-5cbd2fbc8409b446f8751792b006693e1d091055.zip
LazyVals phase.
Creates accessors for lazy vals: 1) lazy local vals are rewritten to dotty.runtime.Lazy*** holders 2) for a non-volatile field lazy val create a non-thread-safe accessor and flag: 2.a) if lazy val type indicates that val is not nullable, uses null value as a flag 2.b) else uses boolean flag for sake of performance, method size, and allowing more jvm optimizations 3) for a volatile field lazy val use double locking scheme, that guaranties no spurious deadlocks, using long bits as bitmaps and creating companion objects to store offsets needed for unsafe methods. Conflicts: test/dotc/tests.scala
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r--src/dotty/tools/dotc/Compiler.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala
index 84e11e7ed..132a25d0b 100644
--- a/src/dotty/tools/dotc/Compiler.scala
+++ b/src/dotty/tools/dotc/Compiler.scala
@@ -8,15 +8,19 @@ import Symbols._
import typer.{FrontEnd, Typer, Mode, ImportInfo}
import reporting.ConsoleReporter
import dotty.tools.dotc.core.Phases.Phase
+import dotty.tools.dotc.transform.{LazyValsCreateCompanionObjects, LazyValTranformContext}
+import dotty.tools.dotc.transform.TreeTransforms.{TreeTransform, TreeTransformer}
+import dotty.tools.dotc.transform.PostTyperTransformers.PostTyperTransformer
class Compiler {
- def phases: List[Phase] = List(
- new FrontEnd,
- new transform.SamplePhase)
+
+ def phases: List[Phase] = List(new FrontEnd, new transform.SamplePhase)
var runId = 1
- def nextRunId = { runId += 1; runId }
+ def nextRunId = {
+ runId += 1; runId
+ }
def rootContext(implicit ctx: Context): Context = {
ctx.definitions.init(ctx)