use of org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration in project graal by oracle.
the class AArch64GraphBuilderPlugins method registerMathPlugins.
private static void registerMathPlugins(InvocationPlugins plugins) {
Registration r = new Registration(plugins, Math.class);
registerUnaryMath(r, "sin", SIN);
registerUnaryMath(r, "cos", COS);
registerUnaryMath(r, "tan", TAN);
registerUnaryMath(r, "exp", EXP);
registerUnaryMath(r, "log", LOG);
registerUnaryMath(r, "log10", LOG10);
r.register2("pow", Double.TYPE, Double.TYPE, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode x, ValueNode y) {
b.push(JavaKind.Double, b.append(BinaryMathIntrinsicNode.create(x, y, BinaryMathIntrinsicNode.BinaryOperation.POW)));
return true;
}
});
}
use of org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration 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.InvocationPlugins.Registration 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