Skip to content

Commit

Permalink
[GR-51671] Allow bootstrap method TemplateRuntime#processStringTempla…
Browse files Browse the repository at this point in the history
…te at build time

PullRequest: graal/16951
  • Loading branch information
cmsigrist authored and vjovanov committed Apr 17, 2024
2 parents 64e1fd0 + 68c576d commit 407ca89
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ public BootstrapMethodConfiguration() {
Method typeSwitch = ReflectionUtil.lookupMethod(SwitchBootstraps.class, "typeSwitch", MethodHandles.Lookup.class, String.class, MethodType.class, Object[].class);
Method enumSwitch = ReflectionUtil.lookupMethod(SwitchBootstraps.class, "enumSwitch", MethodHandles.Lookup.class, String.class, MethodType.class, Object[].class);

indyBuildTimeAllowList = Set.of(metafactory, altMetafactory, makeConcat, makeConcatWithConstants, bootstrap, typeSwitch, enumSwitch);
/* Bootstrap method used for retrieving the value of static final processors. */
Class<?> templateRuntime = ReflectionUtil.lookupClass(false, "java.lang.runtime.TemplateRuntime");
Method processStringTemplate = ReflectionUtil.lookupMethod(templateRuntime, "processStringTemplate", MethodHandles.Lookup.class, String.class, MethodType.class, MethodHandle.class,
String[].class);

indyBuildTimeAllowList = Set.of(metafactory, altMetafactory, makeConcat, makeConcatWithConstants, bootstrap, typeSwitch, enumSwitch, processStringTemplate);

/* Bootstrap methods used for various dynamic constants. */
Method nullConstant = ReflectionUtil.lookupMethod(ConstantBootstraps.class, "nullConstant", MethodHandles.Lookup.class, String.class, Class.class);
Expand Down

0 comments on commit 407ca89

Please sign in to comment.