summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-02-23 20:43:21 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2015-03-11 12:53:28 -0700
commit42054a1bebcc2155f773787ffda781b497d4178b (patch)
treec5cf4f830c1d27cba397e5060a9bd29cc08ad9b4 /src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
parent3a32ae3651f69237bde32598674bc135ad9e4064 (diff)
downloadscala-42054a1bebcc2155f773787ffda781b497d4178b.tar.gz
scala-42054a1bebcc2155f773787ffda781b497d4178b.tar.bz2
scala-42054a1bebcc2155f773787ffda781b497d4178b.zip
Emit the ScalaInlineInfo attribute under GenASM
The goal of this commit is to allow the new inliner (in GenBCode, coming soon) to inline methods generated by the GenASM backend of 2.11.6. The ScalaInlineInfo attribute is added to every classfile generated by GenASM. It contains metadata about the class and its methods that will be used by the new inliner. Storing this metadata to the classfile prevents the need to look up a class symbol for a certain class file name, a process that is known to be brittle due to name mangling. Also, some symbols are not exactly the same when originating in a class being compiled or an unpickled one. For example, method symbols for mixed-in members are only added to classes being compiled. The classfile attribute is relatively small, because all strings it references (class internal names, method names, method descriptors) would exist anyway in the constant pool. It just adds a few references and bits for each method in the classfile. Jar sizes before: 480142 scala-actors.jar 15531408 scala-compiler.jar 5543249 scala-library.jar 4663078 scala-reflect.jar 785953 scalap.jar After: 490491 scala-actors.jar (102.1%) 15865500 scala-compiler.jar (102.1%) 5722504 scala-library.jar (103.2%) 4788370 scala-reflect.jar (102.7%) 805890 scalap.jar (102.5%)
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/AddInterfaces.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/AddInterfaces.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
index f786ffb8f3..3591372bbe 100644
--- a/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
+++ b/src/compiler/scala/tools/nsc/transform/AddInterfaces.scala
@@ -55,7 +55,7 @@ abstract class AddInterfaces extends InfoTransform { self: Erasure =>
)
/** Does symbol need an implementation method? */
- private def needsImplMethod(sym: Symbol) = (
+ def needsImplMethod(sym: Symbol) = (
sym.isMethod
&& isInterfaceMember(sym)
&& (!sym.hasFlag(DEFERRED | SUPERACCESSOR) || (sym hasFlag lateDEFERRED))