Search in sources :

Example 6 with ClassInitializationPlugin

use of org.graalvm.compiler.nodes.graphbuilderconf.ClassInitializationPlugin in project graal by oracle.

the class BytecodeParser method genPutStatic.

protected void genPutStatic(JavaField field) {
    ValueNode value = frameState.pop(field.getJavaKind());
    ResolvedJavaField resolvedField = resolveStaticFieldAccess(field, value);
    if (resolvedField == null) {
        return;
    }
    if (!parsingIntrinsic() && GeneratePIC.getValue(getOptions())) {
        graph.recordField(resolvedField);
    }
    ClassInitializationPlugin classInitializationPlugin = this.graphBuilderConfig.getPlugins().getClassInitializationPlugin();
    if (classInitializationPlugin != null && classInitializationPlugin.shouldApply(this, resolvedField.getDeclaringClass())) {
        FrameState stateBefore = frameState.create(bci(), getNonIntrinsicAncestor(), false, null, null);
        classInitializationPlugin.apply(this, resolvedField.getDeclaringClass(), stateBefore);
    }
    for (NodePlugin plugin : graphBuilderConfig.getPlugins().getNodePlugins()) {
        if (plugin.handleStoreStaticField(this, resolvedField, value)) {
            return;
        }
    }
    genStoreField(null, resolvedField, value);
}
Also used : NodePlugin(org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin) ValueNode(org.graalvm.compiler.nodes.ValueNode) FrameState(org.graalvm.compiler.nodes.FrameState) ClassInitializationPlugin(org.graalvm.compiler.nodes.graphbuilderconf.ClassInitializationPlugin) ResolvedJavaField(jdk.vm.ci.meta.ResolvedJavaField)

Aggregations

FrameState (org.graalvm.compiler.nodes.FrameState)6 ClassInitializationPlugin (org.graalvm.compiler.nodes.graphbuilderconf.ClassInitializationPlugin)6 NodePlugin (org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin)5 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)4 ValueNode (org.graalvm.compiler.nodes.ValueNode)4 JavaType (jdk.vm.ci.meta.JavaType)2 ResolvedJavaField (jdk.vm.ci.meta.ResolvedJavaField)2 RuntimeConstraint (jdk.vm.ci.meta.DeoptimizationReason.RuntimeConstraint)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 ResolveClassBeforeStaticInvoke (org.graalvm.compiler.core.common.GraalOptions.ResolveClassBeforeStaticInvoke)1 DeoptimizeNode (org.graalvm.compiler.nodes.DeoptimizeNode)1 Invoke (org.graalvm.compiler.nodes.Invoke)1