diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 5ab8a3d751..49a3a13247 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -780,6 +780,12 @@ abstract class GenASM extends SubComponent with BytecodeWriters { /** functionality for building plain and mirror classes */
abstract class JCommonBuilder(wuQ: WorkUnitQueue, needsOutfileForSymbol: Boolean) extends JBuilder(wuQ, needsOutfileForSymbol) {
+ def debugLevel = settings.debuginfo.indexOfChoice
+
+ val emitSource = debugLevel >= 1
+ val emitLines = debugLevel >= 2
+ val emitVars = debugLevel >= 3
+
// -----------------------------------------------------------------------------------------
// more constants
// -----------------------------------------------------------------------------------------
@@ -1427,8 +1433,10 @@ abstract class GenASM extends SubComponent with BytecodeWriters { // typestate: entering mode with valid call sequences:
// [ visitSource ] [ visitOuterClass ] ( visitAnnotation | visitAttribute )*
- jclass.visitSource(c.cunit.source.toString,
- null /* SourceDebugExtension */)
+ if(emitSource) {
+ jclass.visitSource(c.cunit.source.toString,
+ null /* SourceDebugExtension */)
+ }
val enclM = getEnclosingMethodAttribute()
if(enclM != null) {
@@ -1556,12 +1564,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters { jfield.visitEnd()
}
- def debugLevel = settings.debuginfo.indexOfChoice
-
- // val emitSource = debugLevel >= 1
- val emitLines = debugLevel >= 2
- val emitVars = debugLevel >= 3
-
var method: IMethod = _
var jmethod: asm.MethodVisitor = _
var jMethodName: String = _
@@ -2957,8 +2959,10 @@ abstract class GenASM extends SubComponent with BytecodeWriters { // typestate: entering mode with valid call sequences:
// [ visitSource ] [ visitOuterClass ] ( visitAnnotation | visitAttribute )*
- mirrorClass.visitSource("" + cunit.source,
- null /* SourceDebugExtension */)
+ if(emitSource) {
+ mirrorClass.visitSource("" + cunit.source,
+ null /* SourceDebugExtension */)
+ }
val ssa = getAnnotPickle(mirrorName, modsym.companionSymbol)
mirrorClass.visitAttribute(if(ssa.isDefined) pickleMarkerLocal else pickleMarkerForeign)
|