Skip to content

Commit

Permalink
Enable invokedynamic by default
Browse files Browse the repository at this point in the history
There will be some impact to startup and warmup time initially but
this is the future of JRuby.
  • Loading branch information
headius committed May 29, 2024
1 parent a29afff commit 890f675
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: rake test:jruby
run: bin/jruby --dev -S rake test:jruby

rake-test-17-indy:
rake-test-17-indy-off:
runs-on: ubuntu-latest

strategy:
Expand All @@ -94,7 +94,7 @@ jobs:
name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }} +indy)

env:
JRUBY_OPTS: '-Xcompile.invokedynamic -X+C -Xjit.threshold=0'
JRUBY_OPTS: '-Xcompile.invokedynamic=false -X+C -Xjit.threshold=0'

steps:
- name: Bootstrap build
Expand Down
8 changes: 1 addition & 7 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
*/
public class Options {
private static final List<Option> _loadedOptions = new ArrayList<>(240);
private static final boolean INVOKEDYNAMIC_DEFAULT = calculateInvokedynamicDefault();
private static final boolean COLOR = System.console() != null;

// This section holds all Options for JRuby. They will be listed in the
Expand All @@ -71,7 +70,7 @@ public class Options {

public static final Option<CompileMode> COMPILE_MODE = enumeration(COMPILER, "compile.mode", CompileMode.class, CompileMode.JIT, "Set compilation mode. JIT = at runtime; FORCE = before execution.");
public static final Option<Boolean> COMPILE_DUMP = bool(COMPILER, "compile.dump", false, "Dump to console all bytecode generated at runtime.");
public static final Option<Boolean> COMPILE_INVOKEDYNAMIC = bool(COMPILER, "compile.invokedynamic", INVOKEDYNAMIC_DEFAULT, "Use invokedynamic for optimizing Ruby code.");
public static final Option<Boolean> COMPILE_INVOKEDYNAMIC = bool(COMPILER, "compile.invokedynamic", true, "Use invokedynamic for optimizing Ruby code.");
public static final Option<Boolean> COMPILE_CACHE_CLASSES = bool(COMPILER, "compile.cache.classes", false, "Use cache of compiled script classes");
public static final Option<Boolean> COMPILE_CACHE_CLASSES_LOGGING = bool(COMPILER, "compile.cache.classes.logging", false, "Log whether cached script classes are being saved or used");

Expand Down Expand Up @@ -287,11 +286,6 @@ private static <T extends Enum<T>> Option<T> enumeration(Category category, Stri
return option;
}

private static boolean calculateInvokedynamicDefault() {
// We were defaulting on for Java 8 and might again later if JEP 210 helps reduce warmup time.
return false;
}

private static Verbosity calculateVerbosityDefault() {
Boolean verbose = CLI_VERBOSE.load();
if (verbose == null) return Verbosity.NIL;
Expand Down

0 comments on commit 890f675

Please sign in to comment.