diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-07-03 10:33:21 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-07-23 15:02:17 +0200 |
commit | 60747c75555fdcfefc9d10460050be5e2a11ad85 (patch) | |
tree | 44bf9f26d4bd97659f8b6784d76416029d6f8e87 | |
parent | 404e86239e445307fdff4fb0cb4e512993ac56b8 (diff) | |
download | scala-60747c75555fdcfefc9d10460050be5e2a11ad85.tar.gz scala-60747c75555fdcfefc9d10460050be5e2a11ad85.tar.bz2 scala-60747c75555fdcfefc9d10460050be5e2a11ad85.zip |
[backport] Skip mirror class when invoking deserializeLambda
Generate the invocation to LambdaDeserializer.deserializeLambda by
loading the static MODULE$ field instead of calling the static method
in the mirror class.
This is more scala-y. Also, mirror classes don't have an InlineInfo
classfile attribute, so the inliner would yield a warning about
the mirror class callsite.
Also skip the stack map frame instruction - frames are computed by
the ams classfile writer.
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala index d53e88a11c..65a6b82570 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala @@ -728,11 +728,11 @@ abstract class BCodeHelpers extends BCodeIdiomatic with BytecodeWriters { mv.visitVarInsn(ALOAD, 1) mv.visitFieldInsn(PUTSTATIC, clazz.javaBinaryName.toString, "$deserializeLambdaCache$", "Ljava/util/Map;") mv.visitLabel(l0) - mv.visitFrame(asm.Opcodes.F_APPEND,1, Array("java/util/Map"), 0, null) + mv.visitFieldInsn(GETSTATIC, "scala/compat/java8/runtime/LambdaDeserializer$", "MODULE$", "Lscala/compat/java8/runtime/LambdaDeserializer$;") mv.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandles", "lookup", "()Ljava/lang/invoke/MethodHandles$Lookup;", false) mv.visitVarInsn(ALOAD, 1) mv.visitVarInsn(ALOAD, 0) - mv.visitMethodInsn(INVOKESTATIC, "scala/compat/java8/runtime/LambdaDeserializer", "deserializeLambda", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/util/Map;Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;", false) + mv.visitMethodInsn(INVOKEVIRTUAL, "scala/compat/java8/runtime/LambdaDeserializer$", "deserializeLambda", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/util/Map;Ljava/lang/invoke/SerializedLambda;)Ljava/lang/Object;", false) mv.visitInsn(ARETURN) mv.visitEnd() } |