Repository: groovy Updated Branches: refs/heads/indy-java-9-10-11 [created] 4e72bc9fa
Support Java 9, 10, and 11 bytecode with invokedynamic Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/4e72bc9f Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4e72bc9f Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4e72bc9f Branch: refs/heads/indy-java-9-10-11 Commit: 4e72bc9fac6d8993ec50b5c5813cda44c7330c55 Parents: ab9c39d Author: Keegan Witt <[email protected]> Authored: Sun Sep 2 12:16:17 2018 -0400 Committer: Keegan Witt <[email protected]> Committed: Sun Sep 2 12:34:06 2018 -0400 ---------------------------------------------------------------------- .../org/codehaus/groovy/classgen/asm/WriterController.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/4e72bc9f/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java index fe7a21e..cb3d266 100644 --- a/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java +++ b/src/main/java/org/codehaus/groovy/classgen/asm/WriterController.java @@ -146,15 +146,11 @@ public class WriterController { return new LoggableClassVisitor(cv); } private static int chooseBytecodeVersion(final boolean invokedynamic, final String targetBytecode) { - if (invokedynamic) { - if (CompilerConfiguration.JDK7.equals(targetBytecode)) { - return Opcodes.V1_7; - } + Integer bytecodeVersion = CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode); + if (invokedynamic && bytecodeVersion < Opcodes.V1_8) { return Opcodes.V1_8; } else { - Integer bytecodeVersion = CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode); - if (null != bytecodeVersion) { return bytecodeVersion; }
