com.oracle.graal.python.lib.PyEvalGetGlobalsNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.nodes.frame.ReadCallerFrameNode;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.ReferenceField;
import com.oracle.truffle.api.dsl.InlineSupport.RequiredField;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link PyEvalGetGlobals#doGeneric}
* Activation probability: 1.00000
* With/without class size: 24/4 bytes
*
*/
@GeneratedBy(PyEvalGetGlobals.class)
@SuppressWarnings("javadoc")
public final class PyEvalGetGlobalsNodeGen {
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#readCallerFrameNode_}
*
*/
@NeverDefault
public static PyEvalGetGlobals inline(@RequiredField(bits = 1, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new PyEvalGetGlobalsNodeGen.Inlined(target);
}
@GeneratedBy(PyEvalGetGlobals.class)
@DenyReplace
private static final class Inlined extends PyEvalGetGlobals {
/**
* State Info:
* 0: SpecializationActive {@link PyEvalGetGlobals#doGeneric}
*
*/
private final StateField state_0_;
private final ReferenceField readCallerFrameNode_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyEvalGetGlobals.class);
this.state_0_ = target.getState(0, 1);
this.readCallerFrameNode_ = target.getReference(1, ReadCallerFrameNode.class);
}
@Override
public Object execute(VirtualFrame frameValue, Node arg0Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[PyEvalGetGlobals.doGeneric(VirtualFrame, ReadCallerFrameNode)] */) {
{
ReadCallerFrameNode readCallerFrameNode__ = this.readCallerFrameNode_.get(arg0Value);
if (readCallerFrameNode__ != null) {
return PyEvalGetGlobals.doGeneric(frameValue, readCallerFrameNode__);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value);
}
private Object executeAndSpecialize(VirtualFrame frameValue, Node arg0Value) {
int state_0 = this.state_0_.get(arg0Value);
ReadCallerFrameNode readCallerFrameNode__ = arg0Value.insert((ReadCallerFrameNode.create()));
Objects.requireNonNull(readCallerFrameNode__, "Specialization 'doGeneric(VirtualFrame, ReadCallerFrameNode)' cache 'readCallerFrameNode' returned a 'null' default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns 'null'.");
VarHandle.storeStoreFence();
this.readCallerFrameNode_.set(arg0Value, readCallerFrameNode__);
state_0 = state_0 | 0b1 /* add SpecializationActive[PyEvalGetGlobals.doGeneric(VirtualFrame, ReadCallerFrameNode)] */;
this.state_0_.set(arg0Value, state_0);
return PyEvalGetGlobals.doGeneric(frameValue, readCallerFrameNode__);
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy