Skip to content

Commit

Permalink
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/src/main/java/org/jruby/compiler/JITCompiler.java
Original file line number Diff line number Diff line change
@@ -173,18 +173,20 @@ public void jitThresholdReached(final InterpretedIRMethod method, final RubyInst
jitTask.run();
}
}


private static final MethodHandles.Lookup PUBLIC_LOOKUP = MethodHandles.publicLookup().in(Ruby.class);

private class JITTask implements Runnable {
private final String className;
private final InterpretedIRMethod method;
private final String methodName;

public JITTask(String className, InterpretedIRMethod method, String methodName) {
this.className = className;
this.method = method;
this.methodName = methodName;
}

public void run() {
try {
// Check if the method has been explicitly excluded
@@ -247,7 +249,7 @@ public void run() {
// only variable-arity
method.switchToJitted(
new CompiledIRMethod(
MethodHandles.publicLookup().in(Ruby.class).findStatic(sourceClass, jittedName, signatures.get(-1)),
PUBLIC_LOOKUP.findStatic(sourceClass, jittedName, signatures.get(-1)),
method.getIRMethod(),
method.getVisibility(),
method.getImplementationClass()));
@@ -258,8 +260,8 @@ public void run() {

method.switchToJitted(
new CompiledIRMethod(
MethodHandles.publicLookup().in(Ruby.class).findStatic(sourceClass, jittedName, signatures.get(-1)),
MethodHandles.publicLookup().in(Ruby.class).findStatic(sourceClass, jittedName, entry.getValue()),
PUBLIC_LOOKUP.findStatic(sourceClass, jittedName, signatures.get(-1)),
PUBLIC_LOOKUP.findStatic(sourceClass, jittedName, entry.getValue()),
entry.getKey(),
method.getIRMethod(),
method.getVisibility(),

0 comments on commit db10c66

Please sign in to comment.