
com.oracle.truffle.host.HostTargetMappingNodeGen Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truffle-api Show documentation
Show all versions of truffle-api Show documentation
Truffle is a multi-language framework for executing dynamic languages
that achieves high performance when combined with Graal.
// CheckStyle: start generated
package com.oracle.truffle.host;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
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.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link HostTargetMappingNode#doCached}
* Activation probability: 0.65000
* With/without class size: 19/8 bytes
* Specialization {@link HostTargetMappingNode#doUncached}
* Activation probability: 0.35000
* With/without class size: 8/0 bytes
*
*/
@GeneratedBy(HostTargetMappingNode.class)
@SuppressWarnings({"javadoc", "unused"})
final class HostTargetMappingNodeGen extends HostTargetMappingNode {
private static final Uncached UNCACHED = new Uncached();
/**
* State Info:
* 0: SpecializationActive {@link HostTargetMappingNode#doCached}
* 1: SpecializationActive {@link HostTargetMappingNode#doUncached}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link HostTargetMappingNode#doCached}
* Parameter: {@link HostTargetMapping} mappings
*/
@CompilationFinal(dimensions = 1) private HostTargetMapping[] cached_mappings_;
/**
* Source Info:
* Specialization: {@link HostTargetMappingNode#doCached}
* Parameter: {@link SingleMappingNode} mappingNodes
*/
@Children private SingleMappingNode[] cached_mappingNodes_;
private HostTargetMappingNodeGen() {
}
@Override
Object execute(Node arg0Value, Object arg1Value, Class> arg2Value, HostContext arg3Value, InteropLibrary arg4Value, boolean arg5Value, int arg6Value, int arg7Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] || SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] */) {
{
HostTargetMapping[] mappings__ = this.cached_mappings_;
if (mappings__ != null) {
SingleMappingNode[] mappingNodes__ = this.cached_mappingNodes_;
if (mappingNodes__ != null) {
if ((arg2Value != null)) {
return doCached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value, mappings__, mappingNodes__);
}
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */) {
return doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
private Object executeAndSpecialize(Node arg0Value, Object arg1Value, Class> arg2Value, HostContext arg3Value, InteropLibrary arg4Value, boolean arg5Value, int arg6Value, int arg7Value) {
int state_0 = this.state_0_;
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */) {
if ((arg2Value != null)) {
HostTargetMapping[] mappings__ = (HostTargetMappingNode.getMappings(arg3Value, arg2Value));
Objects.requireNonNull(mappings__, "Specialization 'doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])' cache 'mappings' 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.cached_mappings_ = mappings__;
SingleMappingNode[] mappingNodes__ = this.insert((HostTargetMappingNode.createMappingNodes(mappings__)));
Objects.requireNonNull(mappingNodes__, "Specialization 'doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])' cache 'mappingNodes' 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.cached_mappingNodes_ = mappingNodes__;
state_0 = state_0 | 0b1 /* add SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] */;
this.state_0_ = state_0;
return doCached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value, mappings__, mappingNodes__);
}
}
this.cached_mappings_ = null;
this.cached_mappingNodes_ = null;
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */;
this.state_0_ = state_0;
return doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if (state_0 == 0) {
return NodeCost.UNINITIALIZED;
} else {
if ((state_0 & (state_0 - 1)) == 0 /* is-single */) {
return NodeCost.MONOMORPHIC;
}
}
return NodeCost.POLYMORPHIC;
}
@NeverDefault
public static HostTargetMappingNode create() {
return new HostTargetMappingNodeGen();
}
@NeverDefault
public static HostTargetMappingNode getUncached() {
return HostTargetMappingNodeGen.UNCACHED;
}
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#cached_mappings_}
*
- {@link Inlined#cached_mappingNodes_}
*
*/
@NeverDefault
public static HostTargetMappingNode inline(@RequiredField(bits = 2, value = StateField.class)@RequiredField(dimensions = 1, type = Object[].class, value = ReferenceField.class)@RequiredField(type = Node[].class, value = ReferenceField.class) InlineTarget target) {
return new HostTargetMappingNodeGen.Inlined(target);
}
@GeneratedBy(HostTargetMappingNode.class)
@DenyReplace
private static final class Inlined extends HostTargetMappingNode {
/**
* State Info:
* 0: SpecializationActive {@link HostTargetMappingNode#doCached}
* 1: SpecializationActive {@link HostTargetMappingNode#doUncached}
*
*/
private final StateField state_0_;
private final ReferenceField cached_mappings_;
private final ReferenceField cached_mappingNodes_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(HostTargetMappingNode.class);
this.state_0_ = target.getState(0, 2);
this.cached_mappings_ = target.getReference(1, HostTargetMapping[].class);
this.cached_mappingNodes_ = target.getReference(2, SingleMappingNode[].class);
}
@Override
Object execute(Node arg0Value, Object arg1Value, Class> arg2Value, HostContext arg3Value, InteropLibrary arg4Value, boolean arg5Value, int arg6Value, int arg7Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] || SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] */) {
{
HostTargetMapping[] mappings__ = this.cached_mappings_.get(arg0Value);
if (mappings__ != null) {
SingleMappingNode[] mappingNodes__ = this.cached_mappingNodes_.get(arg0Value);
if (mappingNodes__ != null) {
if ((arg2Value != null)) {
return doCached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value, mappings__, mappingNodes__);
}
}
}
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */) {
return doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
private Object executeAndSpecialize(Node arg0Value, Object arg1Value, Class> arg2Value, HostContext arg3Value, InteropLibrary arg4Value, boolean arg5Value, int arg6Value, int arg7Value) {
int state_0 = this.state_0_.get(arg0Value);
if (((state_0 & 0b10)) == 0 /* is-not SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */) {
if ((arg2Value != null)) {
HostTargetMapping[] mappings__ = (HostTargetMappingNode.getMappings(arg3Value, arg2Value));
Objects.requireNonNull(mappings__, "Specialization 'doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])' cache 'mappings' 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.cached_mappings_.set(arg0Value, mappings__);
SingleMappingNode[] mappingNodes__ = arg0Value.insert((HostTargetMappingNode.createMappingNodes(mappings__)));
Objects.requireNonNull(mappingNodes__, "Specialization 'doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])' cache 'mappingNodes' 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.cached_mappingNodes_.set(arg0Value, mappingNodes__);
state_0 = state_0 | 0b1 /* add SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] */;
this.state_0_.set(arg0Value, state_0);
return doCached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value, mappings__, mappingNodes__);
}
}
this.cached_mappings_.set(arg0Value, null);
this.cached_mappingNodes_.set(arg0Value, null);
state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[HostTargetMappingNode.doCached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int, HostTargetMapping[], SingleMappingNode[])] */;
state_0 = state_0 | 0b10 /* add SpecializationActive[HostTargetMappingNode.doUncached(Object, Class<>, HostContext, InteropLibrary, boolean, int, int)] */;
this.state_0_.set(arg0Value, state_0);
return doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
@Override
public boolean isAdoptable() {
return false;
}
}
@GeneratedBy(HostTargetMappingNode.class)
@DenyReplace
private static final class Uncached extends HostTargetMappingNode {
@TruffleBoundary
@Override
Object execute(Node arg0Value, Object arg1Value, Class> arg2Value, HostContext arg3Value, InteropLibrary arg4Value, boolean arg5Value, int arg6Value, int arg7Value) {
return doUncached(arg1Value, arg2Value, arg3Value, arg4Value, arg5Value, arg6Value, arg7Value);
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
/**
* Debug Info:
* Specialization {@link SingleMappingNode#doDefault}
* Activation probability: 1.00000
* With/without class size: 32/9 bytes
*
*/
@GeneratedBy(SingleMappingNode.class)
@SuppressWarnings("javadoc")
static final class SingleMappingNodeGen extends SingleMappingNode {
private static final StateField STATE_0_SingleMappingNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link SingleMappingNode#doDefault}
* Parameter: {@link InlinedConditionProfile} acceptsProfile
* Inline method: {@link InlinedConditionProfile#inline}
*/
private static final InlinedConditionProfile INLINED_ACCEPTS_PROFILE_ = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, STATE_0_SingleMappingNode_UPDATER.subUpdater(1, 2)));
/**
* Source Info:
* Specialization: {@link SingleMappingNode#doDefault}
* Parameter: {@link HostToTypeNode} toHostRecursive
* Inline method: {@link HostToTypeNodeGen#inline}
*/
private static final HostToTypeNode INLINED_TO_HOST_RECURSIVE_ = HostToTypeNodeGen.inline(InlineTarget.create(HostToTypeNode.class, STATE_0_SingleMappingNode_UPDATER.subUpdater(3, 2), ReferenceField.create(MethodHandles.lookup(), "toHostRecursive__field1_", Node.class)));
private static final Uncached UNCACHED = new Uncached();
/**
* State Info:
* 0: SpecializationActive {@link SingleMappingNode#doDefault}
* 1-2: InlinedCache
* Specialization: {@link SingleMappingNode#doDefault}
* Parameter: {@link InlinedConditionProfile} acceptsProfile
* Inline method: {@link InlinedConditionProfile#inline}
* 3-4: InlinedCache
* Specialization: {@link SingleMappingNode#doDefault}
* Parameter: {@link HostToTypeNode} toHostRecursive
* Inline method: {@link HostToTypeNodeGen#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* Source Info:
* Specialization: {@link SingleMappingNode#doDefault}
* Parameter: {@link Boolean} allowsImplementation
*/
@CompilationFinal private Boolean allowsImplementation_;
/**
* Source Info:
* Specialization: {@link SingleMappingNode#doDefault}
* Parameter: {@link HostToTypeNode} toHostRecursive
* Inline method: {@link HostToTypeNodeGen#inline}
* Inline field: {@link Node} field1
*/
@Child @UnsafeAccessedField @SuppressWarnings("unused") private Node toHostRecursive__field1_;
private SingleMappingNodeGen() {
}
@Override
Object execute(Object arg0Value, HostTargetMapping arg1Value, HostContext arg2Value, InteropLibrary arg3Value, boolean arg4Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[HostTargetMappingNode.SingleMappingNode.doDefault(Object, HostTargetMapping, HostContext, InteropLibrary, boolean, Node, InlinedConditionProfile, Boolean, HostToTypeNode)] */) {
{
Boolean allowsImplementation__ = this.allowsImplementation_;
if (allowsImplementation__ != null) {
Node node__ = (this);
return SingleMappingNode.doDefault(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value, node__, INLINED_ACCEPTS_PROFILE_, allowsImplementation__, INLINED_TO_HOST_RECURSIVE_);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value);
}
private Object executeAndSpecialize(Object arg0Value, HostTargetMapping arg1Value, HostContext arg2Value, InteropLibrary arg3Value, boolean arg4Value) {
int state_0 = this.state_0_;
{
Node node__ = null;
node__ = (this);
VarHandle.storeStoreFence();
this.allowsImplementation_ = (SingleMappingNode.allowsImplementation(arg2Value, arg1Value.sourceType));
state_0 = state_0 | 0b1 /* add SpecializationActive[HostTargetMappingNode.SingleMappingNode.doDefault(Object, HostTargetMapping, HostContext, InteropLibrary, boolean, Node, InlinedConditionProfile, Boolean, HostToTypeNode)] */;
this.state_0_ = state_0;
return SingleMappingNode.doDefault(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value, node__, INLINED_ACCEPTS_PROFILE_, this.allowsImplementation_, INLINED_TO_HOST_RECURSIVE_);
}
}
@Override
public NodeCost getCost() {
int state_0 = this.state_0_;
if ((state_0 & 0b1) == 0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
@NeverDefault
public static SingleMappingNode create() {
return new SingleMappingNodeGen();
}
@NeverDefault
public static SingleMappingNode getUncached() {
return SingleMappingNodeGen.UNCACHED;
}
@GeneratedBy(SingleMappingNode.class)
@DenyReplace
private static final class Uncached extends SingleMappingNode {
@TruffleBoundary
@Override
Object execute(Object arg0Value, HostTargetMapping arg1Value, HostContext arg2Value, InteropLibrary arg3Value, boolean arg4Value) {
return SingleMappingNode.doDefault(arg0Value, arg1Value, arg2Value, arg3Value, arg4Value, (this), (InlinedConditionProfile.getUncached()), (SingleMappingNode.allowsImplementation(arg2Value, arg1Value.sourceType)), (HostToTypeNodeGen.getUncached()));
}
@Override
public NodeCost getCost() {
return NodeCost.MEGAMORPHIC;
}
@Override
public boolean isAdoptable() {
return false;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy