com.oracle.truffle.js.nodes.access.RestObjectNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.access;
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.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.cast.JSToObjectNode;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.objects.JSDynamicObject;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link RestObjectNode#doNullOrUndefined}
* Activation probability: 0.48333
* With/without class size: 9/0 bytes
* Specialization {@link RestObjectNode#copyDataProperties}
* Activation probability: 0.33333
* With/without class size: 8/0 bytes
* Specialization {@link RestObjectNode#doOther}
* Activation probability: 0.18333
* With/without class size: 7/4 bytes
*
*/
@GeneratedBy(RestObjectNode.class)
@SuppressWarnings("javadoc")
public final class RestObjectNodeGen extends RestObjectNode {
/**
* State Info:
* 0: SpecializationActive {@link RestObjectNode#doNullOrUndefined}
* 1: SpecializationActive {@link RestObjectNode#copyDataProperties}
* 2: SpecializationActive {@link RestObjectNode#doOther}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link RestObjectNode#doOther}
* Parameter: {@link JSToObjectNode} toObjectNode
*/
@Child private JSToObjectNode other_toObjectNode_;
private RestObjectNodeGen(JSContext context, JavaScriptNode targetNode, JavaScriptNode sourceNode) {
super(context, targetNode, sourceNode);
}
@Override
public Object execute(VirtualFrame frameValue) {
int state_0 = this.state_0_;
Object targetNodeValue_ = super.targetNode.execute(frameValue);
Object sourceNodeValue_ = super.sourceNode.execute(frameValue);
if (state_0 != 0 /* is SpecializationActive[RestObjectNode.doNullOrUndefined(JSDynamicObject, Object)] || SpecializationActive[RestObjectNode.copyDataProperties(JSDynamicObject, JSObject)] || SpecializationActive[RestObjectNode.doOther(JSDynamicObject, Object, JSToObjectNode)] */ && targetNodeValue_ instanceof JSDynamicObject) {
JSDynamicObject targetNodeValue__ = (JSDynamicObject) targetNodeValue_;
if ((state_0 & 0b1) != 0 /* is SpecializationActive[RestObjectNode.doNullOrUndefined(JSDynamicObject, Object)] */) {
if ((JSGuards.isNullOrUndefined(sourceNodeValue_))) {
return RestObjectNode.doNullOrUndefined(targetNodeValue__, sourceNodeValue_);
}
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[RestObjectNode.copyDataProperties(JSDynamicObject, JSObject)] */ && sourceNodeValue_ instanceof JSObject) {
JSObject sourceNodeValue__ = (JSObject) sourceNodeValue_;
return copyDataProperties(targetNodeValue__, sourceNodeValue__);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[RestObjectNode.doOther(JSDynamicObject, Object, JSToObjectNode)] */) {
{
JSToObjectNode toObjectNode__ = this.other_toObjectNode_;
if (toObjectNode__ != null) {
if ((!(JSGuards.isJSDynamicObject(sourceNodeValue_)))) {
return doOther(targetNodeValue__, sourceNodeValue_, toObjectNode__);
}
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(targetNodeValue_, sourceNodeValue_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
execute(frameValue);
return;
}
private Object executeAndSpecialize(Object targetNodeValue, Object sourceNodeValue) {
int state_0 = this.state_0_;
if (targetNodeValue instanceof JSDynamicObject) {
JSDynamicObject targetNodeValue_ = (JSDynamicObject) targetNodeValue;
if ((JSGuards.isNullOrUndefined(sourceNodeValue))) {
state_0 = state_0 | 0b1 /* add SpecializationActive[RestObjectNode.doNullOrUndefined(JSDynamicObject, Object)] */;
this.state_0_ = state_0;
return RestObjectNode.doNullOrUndefined(targetNodeValue_, sourceNodeValue);
}
if (sourceNodeValue instanceof JSObject) {
JSObject sourceNodeValue_ = (JSObject) sourceNodeValue;
state_0 = state_0 | 0b10 /* add SpecializationActive[RestObjectNode.copyDataProperties(JSDynamicObject, JSObject)] */;
this.state_0_ = state_0;
return copyDataProperties(targetNodeValue_, sourceNodeValue_);
}
if ((!(JSGuards.isJSDynamicObject(sourceNodeValue)))) {
JSToObjectNode toObjectNode__ = this.insert((JSToObjectNode.create()));
Objects.requireNonNull(toObjectNode__, "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.other_toObjectNode_ = toObjectNode__;
state_0 = state_0 | 0b100 /* add SpecializationActive[RestObjectNode.doOther(JSDynamicObject, Object, JSToObjectNode)] */;
this.state_0_ = state_0;
return doOther(targetNodeValue_, sourceNodeValue, toObjectNode__);
}
}
throw new UnsupportedSpecializationException(this, new Node[] {super.targetNode, super.sourceNode}, targetNodeValue, sourceNodeValue);
}
@NeverDefault
public static RestObjectNode create(JSContext context, JavaScriptNode targetNode, JavaScriptNode sourceNode) {
return new RestObjectNodeGen(context, targetNode, sourceNode);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy