Skip to content

Commit 8c02036

Browse files
committed
pickle java
1 parent 6c36185 commit 8c02036

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,18 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
405405

406406
def apply(unit: CompilationUnit): Unit
407407

408+
// run only the phases needed
409+
private[this] val runThisPhaseForJava: Boolean = shouldRunThisPhaseForJava
410+
411+
protected def shouldRunThisPhaseForJava: Boolean = {
412+
this.id > (if (createJavadoc) currentRun.typerPhase.id
413+
else currentRun.namerPhase.id)
414+
}
415+
408416
/** Is current phase cancelled on this unit? */
409417
def cancelled(unit: CompilationUnit) = {
410-
// run the typer only if in `createJavadoc` mode
411-
val maxJavaPhase = if (createJavadoc) currentRun.typerPhase.id else currentRun.namerPhase.id
412418
if (Thread.interrupted()) reporter.cancelled = true
413-
reporter.cancelled || unit.isJava && this.id > maxJavaPhase
419+
reporter.cancelled || unit.isJava && runThisPhaseForJava
414420
}
415421

416422
private def beforeUnit(unit: CompilationUnit): Unit = {

src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ abstract class Pickler extends SubComponent {
9090
throw e
9191
}
9292
}
93+
94+
override protected def shouldRunThisPhaseForJava: Boolean = true //from some -Y ??
9395
}
9496

9597
private class Pickle(root: Symbol) extends PickleBuffer(new Array[Byte](4096), -1, 0) {

0 commit comments

Comments
 (0)