use of org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin in project graal by oracle.
the class Target_com_oracle_truffle_api_interop_java_ObjectProxyHandler method registerNeverPartOfCompilation.
private void registerNeverPartOfCompilation(InvocationPlugins plugins) {
Registration r = new Registration(plugins, CompilerAsserts.class);
r.setAllowOverwrite(true);
r.register0("neverPartOfCompilation", new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
return handleNeverPartOfCompilation(b, targetMethod, null);
}
});
r.register1("neverPartOfCompilation", String.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode message) {
return handleNeverPartOfCompilation(b, targetMethod, message);
}
});
}
use of org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin in project graal by oracle.
the class Target_com_oracle_truffle_api_interop_java_ObjectProxyHandler method registerInvocationPlugins.
@Override
public void registerInvocationPlugins(Providers providers, SnippetReflectionProvider snippetReflection, InvocationPlugins invocationPlugins, boolean hosted) {
/*
* We need to constant-fold Profile.isProfilingEnabled already during static analysis, so
* that we get exact types for fields that store profiles.
*/
Registration r = new Registration(invocationPlugins, Profile.class);
r.register0("isProfilingEnabled", new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
b.addPush(JavaKind.Boolean, ConstantNode.forBoolean(Truffle.getRuntime().isProfilingEnabled()));
return true;
}
});
}
Aggregations