com.oracle.truffle.js.nodes.intl.GetOptionsObjectNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.intl;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NeverDefault;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.dsl.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.nodes.access.IsObjectNode;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link GetOptionsObjectNode#fromUndefined}
* Activation probability: 0.48333
* With/without class size: 9/0 bytes
* Specialization {@link GetOptionsObjectNode#fromJSObject}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link GetOptionsObjectNode#fromOther}
* Activation probability: 0.18333
* With/without class size: 8/5 bytes
*
*/
@GeneratedBy(GetOptionsObjectNode.class)
@SuppressWarnings("javadoc")
public final class GetOptionsObjectNodeGen extends GetOptionsObjectNode {
private static final StateField STATE_0_GetOptionsObjectNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
/**
* Source Info:
* Specialization: {@link GetOptionsObjectNode#fromOther}
* Parameter: {@link InlinedBranchProfile} errorBranch
* Inline method: {@link InlinedBranchProfile#inline}
*/
private static final InlinedBranchProfile INLINED_FROM_OTHER_ERROR_BRANCH_ = InlinedBranchProfile.inline(InlineTarget.create(InlinedBranchProfile.class, STATE_0_GetOptionsObjectNode_UPDATER.subUpdater(3, 1)));
/**
* State Info:
* 0: SpecializationActive {@link GetOptionsObjectNode#fromUndefined}
* 1: SpecializationActive {@link GetOptionsObjectNode#fromJSObject}
* 2: SpecializationActive {@link GetOptionsObjectNode#fromOther}
* 3: InlinedCache
* Specialization: {@link GetOptionsObjectNode#fromOther}
* Parameter: {@link InlinedBranchProfile} errorBranch
* Inline method: {@link InlinedBranchProfile#inline}
*
*/
@CompilationFinal @UnsafeAccessedField private int state_0_;
/**
* Source Info:
* Specialization: {@link GetOptionsObjectNode#fromOther}
* Parameter: {@link IsObjectNode} isObjectNode
*/
@Child private IsObjectNode fromOther_isObjectNode_;
private GetOptionsObjectNodeGen(JSContext context) {
super(context);
}
@Override
public Object execute(Object arg0Value) {
int state_0 = this.state_0_;
if ((state_0 & 0b111) != 0 /* is SpecializationActive[GetOptionsObjectNode.fromUndefined(Object)] || SpecializationActive[GetOptionsObjectNode.fromJSObject(JSObject)] || SpecializationActive[GetOptionsObjectNode.fromOther(Object, IsObjectNode, InlinedBranchProfile)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[GetOptionsObjectNode.fromUndefined(Object)] */) {
if ((JSGuards.isUndefined(arg0Value))) {
return fromUndefined(arg0Value);
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[GetOptionsObjectNode.fromJSObject(JSObject)] */ && arg0Value instanceof JSObject) {
JSObject arg0Value_ = (JSObject) arg0Value;
return fromJSObject(arg0Value_);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[GetOptionsObjectNode.fromOther(Object, IsObjectNode, InlinedBranchProfile)] */) {
{
IsObjectNode isObjectNode__ = this.fromOther_isObjectNode_;
if (isObjectNode__ != null) {
if ((!(JSGuards.isUndefined(arg0Value)))) {
return fromOther(arg0Value, isObjectNode__, INLINED_FROM_OTHER_ERROR_BRANCH_);
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private Object executeAndSpecialize(Object arg0Value) {
int state_0 = this.state_0_;
if ((JSGuards.isUndefined(arg0Value))) {
state_0 = state_0 | 0b1 /* add SpecializationActive[GetOptionsObjectNode.fromUndefined(Object)] */;
this.state_0_ = state_0;
return fromUndefined(arg0Value);
}
if (((state_0 & 0b100)) == 0 /* is-not SpecializationActive[GetOptionsObjectNode.fromOther(Object, IsObjectNode, InlinedBranchProfile)] */ && arg0Value instanceof JSObject) {
JSObject arg0Value_ = (JSObject) arg0Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[GetOptionsObjectNode.fromJSObject(JSObject)] */;
this.state_0_ = state_0;
return fromJSObject(arg0Value_);
}
if ((!(JSGuards.isUndefined(arg0Value)))) {
IsObjectNode isObjectNode__ = this.insert((IsObjectNode.create()));
Objects.requireNonNull(isObjectNode__, "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.fromOther_isObjectNode_ = isObjectNode__;
state_0 = state_0 & 0xfffffffd /* remove SpecializationActive[GetOptionsObjectNode.fromJSObject(JSObject)] */;
state_0 = state_0 | 0b100 /* add SpecializationActive[GetOptionsObjectNode.fromOther(Object, IsObjectNode, InlinedBranchProfile)] */;
this.state_0_ = state_0;
return fromOther(arg0Value, isObjectNode__, INLINED_FROM_OTHER_ERROR_BRANCH_);
}
throw new UnsupportedSpecializationException(this, null, arg0Value);
}
@NeverDefault
public static GetOptionsObjectNode create(JSContext context) {
return new GetOptionsObjectNodeGen(context);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy