diff --git a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java index a468af90460..b82bc30be2c 100644 --- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java +++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java @@ -51,7 +51,7 @@ */ public class CompilerConfiguration { - /** Optimization Option for enabling invokedynamic compilation. */ + /** Optimization Option for enabling invokedynamic compilation. Since 4.0 always enabled. */ public static final String INVOKEDYNAMIC = "indy"; /** Optimization Option for enabling attaching groovydoc as AST node metadata. */ @@ -1282,8 +1282,9 @@ public void setBytecodePostprocessor(final BytecodeProcessor bytecodePostprocess } /** - * Checks if invoke dynamic is enabled. + * Checks if invoke dynamic is enabled. Since 4.0 this is always true. */ + @Deprecated public boolean isIndyEnabled() { return !Boolean.FALSE.equals(getOptimizationOptions().get(INVOKEDYNAMIC)); } diff --git a/src/spec/doc/core-getting-started.adoc b/src/spec/doc/core-getting-started.adoc index 95a78365399..876b40487d7 100644 --- a/src/spec/doc/core-getting-started.adoc +++ b/src/spec/doc/core-getting-started.adoc @@ -42,8 +42,6 @@ Basic <> can be found below. You can learn more about this version in the https://groovy-lang.org/releasenotes/groovy-{groovy-short-version}.html[release notes] or in the https://groovy-lang.org/changelogs/changelog-{groovy-full-version}.html[changelog]. -If you plan on using invokedynamic support, link:invokedynamic-support.html[read those notes]. - === Snapshots For those who want to test the very latest versions of Groovy and live on the bleeding edge, you can use our https://repository.apache.org/content/groups/snapshots/org/apache/groovy[snapshot builds]. diff --git a/src/spec/doc/core-semantics.adoc b/src/spec/doc/core-semantics.adoc index e528523b74a..50d51150433 100644 --- a/src/spec/doc/core-semantics.adoc +++ b/src/spec/doc/core-semantics.adoc @@ -2258,11 +2258,5 @@ statically compiled code and dynamic code is barely noticeable. On highly CPU in is generated is very close, if not equal, to the one that Java would produce for an equivalent program, the performance is greatly improved. -TIP: Using the _invokedynamic_ version of Groovy, which is accessible to people using JDK 7 and above, the performance -of the dynamic code should be very close to the performance of statically compiled code. Sometimes, it can even be faster! -There is only one way to determine which version you should choose: measuring. The reason is that depending on your program -*and* the JVM that you use, the performance can be significantly different. In particular, the _invokedynamic_ version of -Groovy is very sensitive to the JVM version in use. - include::_type-checking-extensions.adoc[leveloffset=+1] diff --git a/src/spec/doc/invokedynamic-support.adoc b/src/spec/doc/invokedynamic-support.adoc index 9b0bc7009b7..77cbbd51988 100644 --- a/src/spec/doc/invokedynamic-support.adoc +++ b/src/spec/doc/invokedynamic-support.adoc @@ -31,6 +31,8 @@ This means that unlike APIs, AST transformations or syntactic sugar, this featur - it is possible to mix classes compiled with and without invokedynamic in the same project, as long as you run JDK 1.7+ - depending on the JVM (even different minor versions of the JVM), you can target close to Java performance for dynamic Groovy with invokedynamic support activated +https://groovy-lang.org/releasenotes/groovy-4.0.html#Groovy4.0-indy-only[Since Groovy 4.0] Invoke Dynamic is always enabled, indy jars are not distributed, and the Groovy runtime still contains any necessary support for classes compiled using older versions of Groovy. + == The distributions === Two jars diff --git a/subprojects/groovy-ant/src/spec/doc/groovyc-ant-task.adoc b/subprojects/groovy-ant/src/spec/doc/groovyc-ant-task.adoc index 56329240561..03089a00166 100644 --- a/subprojects/groovy-ant/src/spec/doc/groovyc-ant-task.adoc +++ b/subprojects/groovy-ant/src/spec/doc/groovyc-ant-task.adoc @@ -103,8 +103,7 @@ listed; defaults to no. |No |stacktrace |if true each compile error message will contain a stacktrace |No -|indy |Enable compilation with the ``invoke dynamic'' support when using -Groovy 2.0 and beyond and running on JDK 7 |No +|indy |Not used since Groovy 4.0 |No |scriptBaseClass |Sets the base class for Groovy scripts |No