com.oracle.truffle.js.nodes.cast.JSStringToNumberNodeGen Maven / Gradle / Ivy
// CheckStyle: start generated
package com.oracle.truffle.js.nodes.cast;
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.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.UnadoptableNode;
import com.oracle.truffle.api.strings.TruffleString;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link JSStringToNumberNode#trimmedStringToNumber}
* Activation probability: 1.00000
* With/without class size: 28/8 bytes
*
*/
@GeneratedBy(JSStringToNumberNode.class)
@SuppressWarnings("javadoc")
public final class JSStringToNumberNodeGen extends JSStringToNumberNode {
private static final Uncached UNCACHED = new Uncached();
/**
* State Info:
* 0: SpecializationActive {@link JSStringToNumberNode#trimmedStringToNumber}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link JSStringToNumberNode#trimmedStringToNumber}
* Parameter: {@link JSTrimWhitespaceNode} trimWhitespaceNode
*/
@Child private JSTrimWhitespaceNode trimWhitespaceNode_;
/**
* Source Info:
* Specialization: {@link JSStringToNumberNode#trimmedStringToNumber}
* Parameter: {@link JSStringToNumberNoTrimNode} stringToNumberNode
*/
@Child private JSStringToNumberNoTrimNode stringToNumberNode_;
private JSStringToNumberNodeGen() {
}
@Override
public double execute(TruffleString arg0Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[JSStringToNumberNode.trimmedStringToNumber(TruffleString, JSTrimWhitespaceNode, JSStringToNumberNoTrimNode)] */) {
{
JSTrimWhitespaceNode trimWhitespaceNode__ = this.trimWhitespaceNode_;
if (trimWhitespaceNode__ != null) {
JSStringToNumberNoTrimNode stringToNumberNode__ = this.stringToNumberNode_;
if (stringToNumberNode__ != null) {
return JSStringToNumberNode.trimmedStringToNumber(arg0Value, trimWhitespaceNode__, stringToNumberNode__);
}
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private double executeAndSpecialize(TruffleString arg0Value) {
int state_0 = this.state_0_;
JSTrimWhitespaceNode trimWhitespaceNode__ = this.insert((JSTrimWhitespaceNode.create()));
Objects.requireNonNull(trimWhitespaceNode__, "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.trimWhitespaceNode_ = trimWhitespaceNode__;
JSStringToNumberNoTrimNode stringToNumberNode__ = this.insert((JSStringToNumberNoTrimNodeGen.create()));
Objects.requireNonNull(stringToNumberNode__, "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.stringToNumberNode_ = stringToNumberNode__;
state_0 = state_0 | 0b1 /* add SpecializationActive[JSStringToNumberNode.trimmedStringToNumber(TruffleString, JSTrimWhitespaceNode, JSStringToNumberNoTrimNode)] */;
this.state_0_ = state_0;
return JSStringToNumberNode.trimmedStringToNumber(arg0Value, trimWhitespaceNode__, stringToNumberNode__);
}
@NeverDefault
public static JSStringToNumberNode create() {
return new JSStringToNumberNodeGen();
}
@NeverDefault
public static JSStringToNumberNode getUncached() {
return JSStringToNumberNodeGen.UNCACHED;
}
@GeneratedBy(JSStringToNumberNode.class)
@DenyReplace
private static final class Uncached extends JSStringToNumberNode implements UnadoptableNode {
@TruffleBoundary
@Override
public double execute(TruffleString arg0Value) {
return JSStringToNumberNode.trimmedStringToNumber(arg0Value, (JSTrimWhitespaceNodeGen.getUncached()), (JSStringToNumberNoTrimNodeGen.getUncached()));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy