com.oracle.graal.python.lib.PyEvalGetLocalsNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.nodes.frame.GetFrameLocalsNode;
import com.oracle.graal.python.nodes.frame.GetFrameLocalsNodeGen;
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.InlineSupport;
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 PyEvalGetLocals#getLocals}
* Activation probability: 1.00000
* With/without class size: 36/13 bytes
*
*/
@GeneratedBy(PyEvalGetLocals.class)
@SuppressWarnings("javadoc")
public final class PyEvalGetLocalsNodeGen {
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#readCallerFrameNode_}
*
- {@link Inlined#getFrameLocalsNode__field1_}
*
- {@link Inlined#getFrameLocalsNode__field2_}
*
*/
@NeverDefault
public static PyEvalGetLocals inline(@RequiredField(bits = 3, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new PyEvalGetLocalsNodeGen.Inlined(target);
}
@GeneratedBy(PyEvalGetLocals.class)
@DenyReplace
private static final class Inlined extends PyEvalGetLocals {
/**
* State Info:
* 0: SpecializationActive {@link PyEvalGetLocals#getLocals}
* 1-2: InlinedCache
* Specialization: {@link PyEvalGetLocals#getLocals}
* Parameter: {@link GetFrameLocalsNode} getFrameLocalsNode
* Inline method: {@link GetFrameLocalsNodeGen#inline}
*
*/
private final StateField state_0_;
private final ReferenceField readCallerFrameNode_;
private final ReferenceField getFrameLocalsNode__field1_;
private final ReferenceField getFrameLocalsNode__field2_;
/**
* Source Info:
* Specialization: {@link PyEvalGetLocals#getLocals}
* Parameter: {@link GetFrameLocalsNode} getFrameLocalsNode
* Inline method: {@link GetFrameLocalsNodeGen#inline}
*/
private final GetFrameLocalsNode getFrameLocalsNode_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyEvalGetLocals.class);
this.state_0_ = target.getState(0, 3);
this.readCallerFrameNode_ = target.getReference(1, ReadCallerFrameNode.class);
this.getFrameLocalsNode__field1_ = target.getReference(2, Node.class);
this.getFrameLocalsNode__field2_ = target.getReference(3, Node.class);
this.getFrameLocalsNode_ = GetFrameLocalsNodeGen.inline(InlineTarget.create(GetFrameLocalsNode.class, state_0_.subUpdater(1, 2), getFrameLocalsNode__field1_, getFrameLocalsNode__field2_));
}
@Override
public Object execute(VirtualFrame frameValue, Node arg0Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyEvalGetLocals.getLocals(VirtualFrame, Node, ReadCallerFrameNode, GetFrameLocalsNode)] */) {
{
ReadCallerFrameNode readCallerFrameNode__ = this.readCallerFrameNode_.get(arg0Value);
if (readCallerFrameNode__ != null) {
assert InlineSupport.validate(arg0Value, this.state_0_, this.getFrameLocalsNode__field1_, this.getFrameLocalsNode__field2_);
return PyEvalGetLocals.getLocals(frameValue, arg0Value, readCallerFrameNode__, this.getFrameLocalsNode_);
}
}
}
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 'getLocals(VirtualFrame, Node, ReadCallerFrameNode, GetFrameLocalsNode)' 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[PyEvalGetLocals.getLocals(VirtualFrame, Node, ReadCallerFrameNode, GetFrameLocalsNode)] */;
this.state_0_.set(arg0Value, state_0);
assert InlineSupport.validate(arg0Value, this.state_0_, this.getFrameLocalsNode__field1_, this.getFrameLocalsNode__field2_);
return PyEvalGetLocals.getLocals(frameValue, arg0Value, readCallerFrameNode__, this.getFrameLocalsNode_);
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy