Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
public class CompilerConfiguration {

/** Optimization Option for enabling <code>invokedynamic</code> compilation. */
/** Optimization Option for enabling <code>invokedynamic</code> compilation. Since 4.0 always enabled. */
public static final String INVOKEDYNAMIC = "indy";

/** Optimization Option for enabling attaching groovydoc as AST node metadata. */
Expand Down Expand Up @@ -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));
}
Expand Down
2 changes: 0 additions & 2 deletions src/spec/doc/core-getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ Basic <<SDKMAN,instructions>> 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].
Expand Down
6 changes: 0 additions & 6 deletions src/spec/doc/core-semantics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]

2 changes: 2 additions & 0 deletions src/spec/doc/invokedynamic-support.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions subprojects/groovy-ant/src/spec/doc/groovyc-ant-task.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down