com.oracle.graal.python.lib.PyImportGetModuleNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.graal.python.lib;
import com.oracle.graal.python.builtins.objects.dict.DictBuiltins.GetItemNode;
import com.oracle.graal.python.builtins.objects.dict.DictBuiltinsFactory.GetItemNodeFactory;
import com.oracle.graal.python.nodes.PRaiseNode.Lazy;
import com.oracle.graal.python.nodes.PRaiseNodeGen.LazyNodeGen;
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 com.oracle.truffle.api.profiles.InlinedConditionProfile;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link PyImportGetModule#doGeneric}
* Activation probability: 1.00000
* With/without class size: 32/9 bytes
*
*/
@GeneratedBy(PyImportGetModule.class)
@SuppressWarnings("javadoc")
public final class PyImportGetModuleNodeGen {
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#getDictItemNode_}
*
- {@link Inlined#raise__field1_}
*
*/
@NeverDefault
public static PyImportGetModule inline(@RequiredField(bits = 4, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new PyImportGetModuleNodeGen.Inlined(target);
}
@GeneratedBy(PyImportGetModule.class)
@DenyReplace
private static final class Inlined extends PyImportGetModule {
/**
* State Info:
* 0: SpecializationActive {@link PyImportGetModule#doGeneric}
* 1-2: InlinedCache
* Specialization: {@link PyImportGetModule#doGeneric}
* Parameter: {@link InlinedConditionProfile} noSysModulesProfile
* Inline method: {@link InlinedConditionProfile#inline}
* 3: InlinedCache
* Specialization: {@link PyImportGetModule#doGeneric}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
*
*/
private final StateField state_0_;
private final ReferenceField getDictItemNode_;
private final ReferenceField raise__field1_;
/**
* Source Info:
* Specialization: {@link PyImportGetModule#doGeneric}
* Parameter: {@link InlinedConditionProfile} noSysModulesProfile
* Inline method: {@link InlinedConditionProfile#inline}
*/
private final InlinedConditionProfile noSysModulesProfile_;
/**
* Source Info:
* Specialization: {@link PyImportGetModule#doGeneric}
* Parameter: {@link Lazy} raise
* Inline method: {@link LazyNodeGen#inline}
*/
private final Lazy raise_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(PyImportGetModule.class);
this.state_0_ = target.getState(0, 4);
this.getDictItemNode_ = target.getReference(1, GetItemNode.class);
this.raise__field1_ = target.getReference(2, Node.class);
this.noSysModulesProfile_ = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, state_0_.subUpdater(1, 2)));
this.raise_ = LazyNodeGen.inline(InlineTarget.create(Lazy.class, state_0_.subUpdater(3, 1), raise__field1_));
}
@Override
public Object execute(VirtualFrame frameValue, Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if ((state_0 & 0b1) != 0 /* is SpecializationActive[PyImportGetModule.doGeneric(VirtualFrame, Node, Object, Node, InlinedConditionProfile, GetItemNode, Lazy)] */) {
{
GetItemNode getDictItemNode__ = this.getDictItemNode_.get(arg0Value);
if (getDictItemNode__ != null) {
Node inliningTarget__ = (arg0Value);
assert InlineSupport.validate(arg0Value, this.state_0_, this.state_0_, this.raise__field1_);
return PyImportGetModule.doGeneric(frameValue, arg0Value, arg1Value, inliningTarget__, this.noSysModulesProfile_, getDictItemNode__, this.raise_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(frameValue, arg0Value, arg1Value);
}
private Object executeAndSpecialize(VirtualFrame frameValue, Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
{
Node inliningTarget__ = null;
inliningTarget__ = (arg0Value);
GetItemNode getDictItemNode__ = arg0Value.insert((GetItemNodeFactory.create()));
Objects.requireNonNull(getDictItemNode__, "Specialization 'doGeneric(VirtualFrame, Node, Object, Node, InlinedConditionProfile, GetItemNode, Lazy)' cache 'getDictItemNode' 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.getDictItemNode_.set(arg0Value, getDictItemNode__);
state_0 = state_0 | 0b1 /* add SpecializationActive[PyImportGetModule.doGeneric(VirtualFrame, Node, Object, Node, InlinedConditionProfile, GetItemNode, Lazy)] */;
this.state_0_.set(arg0Value, state_0);
assert InlineSupport.validate(arg0Value, this.state_0_, this.state_0_, this.raise__field1_);
return PyImportGetModule.doGeneric(frameValue, arg0Value, arg1Value, inliningTarget__, this.noSysModulesProfile_, getDictItemNode__, this.raise_);
}
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy