org.jruby.truffle.language.constants.LookupConstantWithLexicalScopeNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package org.jruby.truffle.language.constants;
import com.oracle.truffle.api.Assumption;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.internal.SpecializationNode;
import com.oracle.truffle.api.dsl.internal.SpecializedNode;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.InvalidAssumptionException;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.profiles.ConditionProfile;
import org.jruby.truffle.language.LexicalScope;
import org.jruby.truffle.language.RubyConstant;
@GeneratedBy(LookupConstantWithLexicalScopeNode.class)
public final class LookupConstantWithLexicalScopeNodeGen extends LookupConstantWithLexicalScopeNode implements SpecializedNode {
@Child private BaseNode_ specialization_;
private LookupConstantWithLexicalScopeNodeGen(LexicalScope lexicalScope, String name) {
super(lexicalScope, name);
this.specialization_ = UninitializedNode_.create(this);
}
@Override
public NodeCost getCost() {
return specialization_.getNodeCost();
}
@Override
public Object execute(VirtualFrame frameValue) {
return specialization_.execute(frameValue);
}
@Override
public RubyConstant executeLookupConstant(VirtualFrame frameValue) {
return specialization_.executeRubyConstant(frameValue);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
specialization_.executeVoid(frameValue);
return;
}
@Override
public SpecializationNode getSpecializationNode() {
return specialization_;
}
@Override
public Node deepCopy() {
return SpecializationNode.updateRoot(super.deepCopy());
}
public static LookupConstantWithLexicalScopeNode create(LexicalScope lexicalScope, String name) {
return new LookupConstantWithLexicalScopeNodeGen(lexicalScope, name);
}
@GeneratedBy(LookupConstantWithLexicalScopeNode.class)
private abstract static class BaseNode_ extends SpecializationNode {
@CompilationFinal protected LookupConstantWithLexicalScopeNodeGen root;
BaseNode_(LookupConstantWithLexicalScopeNodeGen root, int index) {
super(index);
this.root = root;
}
@Override
protected final void setRoot(Node root) {
this.root = (LookupConstantWithLexicalScopeNodeGen) root;
}
@Override
protected final Node[] getSuppliedChildren() {
return new Node[] {};
}
@Override
public final Object acceptAndExecute(Frame frameValue) {
return this.execute((VirtualFrame) frameValue);
}
public abstract Object execute(VirtualFrame frameValue);
public RubyConstant executeRubyConstant(VirtualFrame frameValue) {
return (RubyConstant) execute(frameValue);
}
public void executeVoid(VirtualFrame frameValue) {
executeRubyConstant(frameValue);
return;
}
@Override
protected final SpecializationNode createNext(Frame frameValue) {
RubyConstant constant1 = (root.doLookup());
boolean isVisible1 = (root.isVisible(constant1));
Assumption assumption0_1 = (root.getUnmodifiedAssumption(root.getModule()));
if (isValid(assumption0_1)) {
return LookupConstantNode_.create(root, constant1, isVisible1, assumption0_1);
}
ConditionProfile isVisibleProfile2 = (ConditionProfile.createBinaryProfile());
ConditionProfile isDeprecatedProfile2 = (ConditionProfile.createBinaryProfile());
return LookupConstantUncachedNode_.create(root, isVisibleProfile2, isDeprecatedProfile2);
}
}
@GeneratedBy(LookupConstantWithLexicalScopeNode.class)
private static final class UninitializedNode_ extends BaseNode_ {
UninitializedNode_(LookupConstantWithLexicalScopeNodeGen root) {
super(root, 2147483647);
}
@Override
public Object execute(VirtualFrame frameValue) {
return uninitialized(frameValue);
}
static BaseNode_ create(LookupConstantWithLexicalScopeNodeGen root) {
return new UninitializedNode_(root);
}
}
@GeneratedBy(methodName = "lookupConstant(VirtualFrame, RubyConstant, boolean)", value = LookupConstantWithLexicalScopeNode.class)
private static final class LookupConstantNode_ extends BaseNode_ {
private final RubyConstant constant;
private final boolean isVisible;
@CompilationFinal private final Assumption assumption0_;
LookupConstantNode_(LookupConstantWithLexicalScopeNodeGen root, RubyConstant constant, boolean isVisible, Assumption assumption0_) {
super(root, 1);
this.constant = constant;
this.isVisible = isVisible;
this.assumption0_ = assumption0_;
}
@Override
public Object execute(VirtualFrame frameValue) {
try {
check(this.assumption0_);
} catch (InvalidAssumptionException ae) {
return removeThis("Assumption [assumption0] invalidated", frameValue);
}
return root.lookupConstant(frameValue, this.constant, this.isVisible);
}
static BaseNode_ create(LookupConstantWithLexicalScopeNodeGen root, RubyConstant constant, boolean isVisible, Assumption assumption0_) {
return new LookupConstantNode_(root, constant, isVisible, assumption0_);
}
}
@GeneratedBy(methodName = "lookupConstantUncached(VirtualFrame, ConditionProfile, ConditionProfile)", value = LookupConstantWithLexicalScopeNode.class)
private static final class LookupConstantUncachedNode_ extends BaseNode_ {
private final ConditionProfile isVisibleProfile;
private final ConditionProfile isDeprecatedProfile;
LookupConstantUncachedNode_(LookupConstantWithLexicalScopeNodeGen root, ConditionProfile isVisibleProfile, ConditionProfile isDeprecatedProfile) {
super(root, 2);
this.isVisibleProfile = isVisibleProfile;
this.isDeprecatedProfile = isDeprecatedProfile;
}
@Override
public Object execute(VirtualFrame frameValue) {
return root.lookupConstantUncached(frameValue, this.isVisibleProfile, this.isDeprecatedProfile);
}
static BaseNode_ create(LookupConstantWithLexicalScopeNodeGen root, ConditionProfile isVisibleProfile, ConditionProfile isDeprecatedProfile) {
return new LookupConstantUncachedNode_(root, isVisibleProfile, isDeprecatedProfile);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy