@@ -173,18 +173,20 @@ public void jitThresholdReached(final InterpretedIRMethod method, final RubyInst
173
173
jitTask .run ();
174
174
}
175
175
}
176
-
176
+
177
+ private static final MethodHandles .Lookup PUBLIC_LOOKUP = MethodHandles .publicLookup ().in (Ruby .class );
178
+
177
179
private class JITTask implements Runnable {
178
180
private final String className ;
179
181
private final InterpretedIRMethod method ;
180
182
private final String methodName ;
181
-
183
+
182
184
public JITTask (String className , InterpretedIRMethod method , String methodName ) {
183
185
this .className = className ;
184
186
this .method = method ;
185
187
this .methodName = methodName ;
186
188
}
187
-
189
+
188
190
public void run () {
189
191
try {
190
192
// Check if the method has been explicitly excluded
@@ -247,7 +249,7 @@ public void run() {
247
249
// only variable-arity
248
250
method .switchToJitted (
249
251
new CompiledIRMethod (
250
- MethodHandles . publicLookup (). in ( Ruby . class ) .findStatic (sourceClass , jittedName , signatures .get (-1 )),
252
+ PUBLIC_LOOKUP .findStatic (sourceClass , jittedName , signatures .get (-1 )),
251
253
method .getIRMethod (),
252
254
method .getVisibility (),
253
255
method .getImplementationClass ()));
@@ -258,8 +260,8 @@ public void run() {
258
260
259
261
method .switchToJitted (
260
262
new CompiledIRMethod (
261
- MethodHandles . publicLookup (). in ( Ruby . class ) .findStatic (sourceClass , jittedName , signatures .get (-1 )),
262
- MethodHandles . publicLookup (). in ( Ruby . class ) .findStatic (sourceClass , jittedName , entry .getValue ()),
263
+ PUBLIC_LOOKUP .findStatic (sourceClass , jittedName , signatures .get (-1 )),
264
+ PUBLIC_LOOKUP .findStatic (sourceClass , jittedName , entry .getValue ()),
263
265
entry .getKey (),
264
266
method .getIRMethod (),
265
267
method .getVisibility (),
0 commit comments