Skip to content

Commit

Permalink
WIP: Make java.lang.Thread.ensureMaterializedForStackWalk intrinsic
Browse files Browse the repository at this point in the history
We still need to force its argument to be materialized.
  • Loading branch information
zakkak committed Jan 19, 2023
1 parent 7a5a45b commit 44c1201
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ public static void registerInvocationPlugins(SnippetReflectionProvider snippetRe
registerMethodHandleImplPlugins(plugins, replacements);
registerPreconditionsPlugins(plugins, replacements);
registerJcovCollectPlugins(plugins, replacements);
registerThreadPlugin(plugins, replacements);

if (supportsStubBasedPlugins) {
registerArraysPlugins(plugins, replacements);
Expand Down Expand Up @@ -2282,4 +2283,15 @@ public SnippetTemplate.SnippetInfo getSnippet(BigIntegerSnippets.Templates templ
}
});
}

private static void registerThreadPlugin(InvocationPlugins plugins, Replacements replacements) {
Registration r = new Registration(plugins, "java.lang.Thread", replacements);
r.register(new InvocationPlugin("ensureMaterializedForStackWalk", Object.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode object) {
// TODO: make sure object is "materialized" or considered "escaped"
return true;
}
});
}
}

0 comments on commit 44c1201

Please sign in to comment.