com.oracle.truffle.js.builtins.helper.CanBeHeldWeaklyNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.builtins.helper;
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.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 com.oracle.truffle.js.runtime.Symbol;
import com.oracle.truffle.js.runtime.objects.JSObject;
/**
* Debug Info:
* Specialization {@link CanBeHeldWeaklyNode#doJSObject}
* Activation probability: 0.48333
* With/without class size: 9/0 bytes
* Specialization {@link CanBeHeldWeaklyNode#doSymbol}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link CanBeHeldWeaklyNode#doOther}
* Activation probability: 0.18333
* With/without class size: 6/0 bytes
*
*/
@GeneratedBy(CanBeHeldWeaklyNode.class)
@SuppressWarnings({"javadoc", "unused"})
public final class CanBeHeldWeaklyNodeGen {
/**
* Required Fields:
* - {@link Inlined#state_0_}
*
*/
@NeverDefault
public static CanBeHeldWeaklyNode inline(@RequiredField(bits = 3, value = StateField.class) InlineTarget target) {
return new CanBeHeldWeaklyNodeGen.Inlined(target);
}
@GeneratedBy(CanBeHeldWeaklyNode.class)
@DenyReplace
private static final class Inlined extends CanBeHeldWeaklyNode implements UnadoptableNode {
/**
* State Info:
* 0: SpecializationActive {@link CanBeHeldWeaklyNode#doJSObject}
* 1: SpecializationActive {@link CanBeHeldWeaklyNode#doSymbol}
* 2: SpecializationActive {@link CanBeHeldWeaklyNode#doOther}
*
*/
private final StateField state_0_;
private Inlined(InlineTarget target) {
assert target.getTargetClass().isAssignableFrom(CanBeHeldWeaklyNode.class);
this.state_0_ = target.getState(0, 3);
}
@SuppressWarnings("static-method")
private boolean fallbackGuard_(int state_0, Node arg0Value, Object arg1Value) {
if (!((state_0 & 0b1) != 0 /* is SpecializationActive[CanBeHeldWeaklyNode.doJSObject(JSObject)] */) && arg1Value instanceof JSObject) {
return false;
}
if (!((state_0 & 0b10) != 0 /* is SpecializationActive[CanBeHeldWeaklyNode.doSymbol(Node, Symbol)] */) && arg1Value instanceof Symbol) {
return false;
}
return true;
}
@Override
public boolean execute(Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (state_0 != 0 /* is SpecializationActive[CanBeHeldWeaklyNode.doJSObject(JSObject)] || SpecializationActive[CanBeHeldWeaklyNode.doSymbol(Node, Symbol)] || SpecializationActive[CanBeHeldWeaklyNode.doOther(Object)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[CanBeHeldWeaklyNode.doJSObject(JSObject)] */ && arg1Value instanceof JSObject) {
JSObject arg1Value_ = (JSObject) arg1Value;
return CanBeHeldWeaklyNode.doJSObject(arg1Value_);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[CanBeHeldWeaklyNode.doSymbol(Node, Symbol)] */ && arg1Value instanceof Symbol) {
Symbol arg1Value_ = (Symbol) arg1Value;
return CanBeHeldWeaklyNode.doSymbol(arg0Value, arg1Value_);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[CanBeHeldWeaklyNode.doOther(Object)] */) {
if (fallbackGuard_(state_0, arg0Value, arg1Value)) {
return CanBeHeldWeaklyNode.doOther(arg1Value);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value);
}
private boolean executeAndSpecialize(Node arg0Value, Object arg1Value) {
int state_0 = this.state_0_.get(arg0Value);
if (arg1Value instanceof JSObject) {
JSObject arg1Value_ = (JSObject) arg1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[CanBeHeldWeaklyNode.doJSObject(JSObject)] */;
this.state_0_.set(arg0Value, state_0);
return CanBeHeldWeaklyNode.doJSObject(arg1Value_);
}
if (arg1Value instanceof Symbol) {
Symbol arg1Value_ = (Symbol) arg1Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[CanBeHeldWeaklyNode.doSymbol(Node, Symbol)] */;
this.state_0_.set(arg0Value, state_0);
return CanBeHeldWeaklyNode.doSymbol(arg0Value, arg1Value_);
}
state_0 = state_0 | 0b100 /* add SpecializationActive[CanBeHeldWeaklyNode.doOther(Object)] */;
this.state_0_.set(arg0Value, state_0);
return CanBeHeldWeaklyNode.doOther(arg1Value);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy