org.truffleruby.language.LazyWarningNodeGen Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ruby-language Show documentation
Show all versions of ruby-language Show documentation
Core module of Ruby on Truffle
The newest version!
// CheckStyle: start generated
package org.truffleruby.language;
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.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnadoptableNode;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link LazyWarningNode#doLazy}
* Activation probability: 1.00000
* With/without class size: 24/4 bytes
*
*/
@GeneratedBy(LazyWarningNode.class)
@SuppressWarnings("javadoc")
public final class LazyWarningNodeGen {
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
- {@link Inlined#warningNode_}
*
*/
@NeverDefault
public static LazyWarningNode inline(@RequiredField(bits = 1, value = StateField.class)@RequiredField(type = Node.class, value = ReferenceField.class) InlineTarget target) {
return new LazyWarningNodeGen.Inlined(target);
}
@GeneratedBy(LazyWarningNode.class)
@DenyReplace
private static final class Inlined extends LazyWarningNode implements UnadoptableNode {
/**
* State Info:
* 0: SpecializationActive {@link LazyWarningNode#doLazy}
*
*/
private final StateField state_0_;
private final ReferenceField warningNode_;
@SuppressWarnings("unchecked")
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(LazyWarningNode.class);
this.state_0_ = target.getState(0, 1);
this.warningNode_ = target.getReference(1, WarningNode.class);
}
@Override
protected WarningNode execute(Node arg0Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[LazyWarningNode.doLazy(WarningNode)] */) {
{
WarningNode warningNode__ = this.warningNode_.get(arg0Value);
if (warningNode__ != null) {
return LazyWarningNode.doLazy(warningNode__);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private WarningNode executeAndSpecialize(Node arg0Value) {
int state_0 = this.state_0_.get(arg0Value);
WarningNode warningNode__ = arg0Value.insert((WarningNode.create()));
Objects.requireNonNull(warningNode__, "A specialization cache returned a 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 the default value.");
VarHandle.storeStoreFence();
this.warningNode_.set(arg0Value, warningNode__);
state_0 = state_0 | 0b1 /* add SpecializationActive[LazyWarningNode.doLazy(WarningNode)] */;
this.state_0_.set(arg0Value, state_0);
return LazyWarningNode.doLazy(warningNode__);
}
}
}