diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-05-13 12:31:26 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-05-13 17:40:45 +0200 |
commit | e948073ae22167082ee672d8ac21507f7b3fa9f7 (patch) | |
tree | 6d1f9c6ef2888203b846cdb9a206483f5d02648f /src | |
parent | d430b03bc11c8fb279d9601fd33f5ac3ab48ed80 (diff) | |
download | scala-e948073ae22167082ee672d8ac21507f7b3fa9f7.tar.gz scala-e948073ae22167082ee672d8ac21507f7b3fa9f7.tar.bz2 scala-e948073ae22167082ee672d8ac21507f7b3fa9f7.zip |
SI-8582 emit InnerClasses attribute in GenBCode
I removed the `-bcode` test since we have a build that passes
`-Ybackend:GenBCode` to all tests.
Short intro do the [`InnerClass` attribute][1]:
- A class needs one `InnerClass` attribute for each of its nested
classes
- A class needs the `InnerClass` attribute for all (nested) classes
that are mentioned in its constant pool
The attribute for a nested class `A$B$C` consists of the long name of
the outer class `A$B`, the short name of the inner class `C`, and
an access flag set describig the visibility.
The attribute seems to be used for reflection.
[1]: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.6
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala index dae53bc0e5..ee9be5b11c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala @@ -116,12 +116,13 @@ abstract class BCodeSkelBuilder extends BCodeHelpers { addClassFields() innerClassBufferASM ++= trackMemberClasses(claszSymbol, Nil) - gen(cd.impl) + addInnerClassesASM(cnode, innerClassBufferASM.toList) if (AsmUtils.traceClassEnabled && cnode.name.contains(AsmUtils.traceClassPattern)) AsmUtils.traceClass(cnode) + cnode.innerClasses assert(cd.symbol == claszSymbol, "Someone messed up BCodePhase.claszSymbol during genPlainClass().") } // end of method genPlainClass() |