mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-7276 Keep dynamic call targets after bootstrap
This commit is contained in:
@@ -114,8 +114,11 @@ public class JBRApi {
|
||||
}
|
||||
|
||||
public static MethodHandle bindDynamic(Lookup caller, String name, MethodType type) {
|
||||
if (VERBOSE) {
|
||||
System.out.println("Binding call site " + caller.lookupClass().getName() + "#" + name + ": " + type);
|
||||
}
|
||||
if (!caller.hasFullPrivilegeAccess()) throw new Error("Caller lookup must have full privilege access"); // Authenticity check.
|
||||
return dynamicCallTargets.remove(new DynamicCallTargetKey(caller.lookupClass(), name, type.descriptorString())).get().asType(type);
|
||||
return dynamicCallTargets.get(new DynamicCallTargetKey(caller.lookupClass(), name, type.descriptorString())).get().asType(type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -173,6 +173,9 @@ class ProxyGenerator {
|
||||
* Initialize method handles used by generated class via {@code invokedynamic}.
|
||||
*/
|
||||
void init() {
|
||||
if (JBRApi.VERBOSE) {
|
||||
System.out.println("Initializing proxy " + interFace.getName());
|
||||
}
|
||||
for (var t : accessContext.dynamicCallTargets) {
|
||||
JBRApi.dynamicCallTargets.put(new JBRApi.DynamicCallTargetKey(
|
||||
generatedProxy.lookupClass(), t.name(), t.descriptor()
|
||||
|
||||
Reference in New Issue
Block a user