com.oracle.truffle.js.nodes.intl.InitializeLocaleNodeGen 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.strings.TruffleString;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.nodes.cast.JSToStringNode;
import com.oracle.truffle.js.runtime.JSContext;
import com.oracle.truffle.js.runtime.builtins.intl.JSLocaleObject;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;
/**
* Debug Info:
* Specialization {@link InitializeLocaleNode#initializeLocaleUsingString}
* Activation probability: 0.38500
* With/without class size: 8/0 bytes
* Specialization {@link InitializeLocaleNode#initializeLocaleUsingLocale}
* Activation probability: 0.29500
* With/without class size: 7/0 bytes
* Specialization {@link InitializeLocaleNode#initializeLocaleUsingObject}
* Activation probability: 0.20500
* With/without class size: 8/4 bytes
* Specialization {@link InitializeLocaleNode#initializeLocaleOther}
* Activation probability: 0.11500
* With/without class size: 5/0 bytes
*
*/
@GeneratedBy(InitializeLocaleNode.class)
@SuppressWarnings("javadoc")
public final class InitializeLocaleNodeGen extends InitializeLocaleNode {
/**
* State Info:
* 0: SpecializationActive {@link InitializeLocaleNode#initializeLocaleUsingString}
* 1: SpecializationActive {@link InitializeLocaleNode#initializeLocaleUsingLocale}
* 2: SpecializationActive {@link InitializeLocaleNode#initializeLocaleUsingObject}
* 3: SpecializationActive {@link InitializeLocaleNode#initializeLocaleOther}
*
*/
@CompilationFinal private int state_0_;
/**
* Source Info:
* Specialization: {@link InitializeLocaleNode#initializeLocaleUsingObject}
* Parameter: {@link JSToStringNode} toStringNode
*/
@Child private JSToStringNode initializeLocaleUsingObject_toStringNode_;
private InitializeLocaleNodeGen(JSContext context) {
super(context);
}
@Override
public JSLocaleObject executeInit(JSLocaleObject arg0Value, Object arg1Value, Object arg2Value) {
int state_0 = this.state_0_;
if (state_0 != 0 /* is SpecializationActive[InitializeLocaleNode.initializeLocaleUsingString(JSLocaleObject, TruffleString, Object)] || SpecializationActive[InitializeLocaleNode.initializeLocaleUsingLocale(JSLocaleObject, JSLocaleObject, Object)] || SpecializationActive[InitializeLocaleNode.initializeLocaleUsingObject(JSLocaleObject, JSObject, Object, JSToStringNode)] || SpecializationActive[InitializeLocaleNode.initializeLocaleOther(JSLocaleObject, Object, Object)] */) {
if ((state_0 & 0b1) != 0 /* is SpecializationActive[InitializeLocaleNode.initializeLocaleUsingString(JSLocaleObject, TruffleString, Object)] */ && arg1Value instanceof TruffleString) {
TruffleString arg1Value_ = (TruffleString) arg1Value;
return initializeLocaleUsingString(arg0Value, arg1Value_, arg2Value);
}
if ((state_0 & 0b10) != 0 /* is SpecializationActive[InitializeLocaleNode.initializeLocaleUsingLocale(JSLocaleObject, JSLocaleObject, Object)] */ && arg1Value instanceof JSLocaleObject) {
JSLocaleObject arg1Value_ = (JSLocaleObject) arg1Value;
return initializeLocaleUsingLocale(arg0Value, arg1Value_, arg2Value);
}
if ((state_0 & 0b100) != 0 /* is SpecializationActive[InitializeLocaleNode.initializeLocaleUsingObject(JSLocaleObject, JSObject, Object, JSToStringNode)] */ && arg1Value instanceof JSObject) {
JSObject arg1Value_ = (JSObject) arg1Value;
{
JSToStringNode toStringNode__ = this.initializeLocaleUsingObject_toStringNode_;
if (toStringNode__ != null) {
if ((!(JSGuards.isJSLocale(arg1Value_)))) {
return initializeLocaleUsingObject(arg0Value, arg1Value_, arg2Value, toStringNode__);
}
}
}
}
if ((state_0 & 0b1000) != 0 /* is SpecializationActive[InitializeLocaleNode.initializeLocaleOther(JSLocaleObject, Object, Object)] */) {
if ((!(JSGuards.isJSObject(arg1Value))) && (!(JSGuards.isString(arg1Value)))) {
return initializeLocaleOther(arg0Value, arg1Value, arg2Value);
}
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
private JSLocaleObject executeAndSpecialize(JSLocaleObject arg0Value, Object arg1Value, Object arg2Value) {
int state_0 = this.state_0_;
if (arg1Value instanceof TruffleString) {
TruffleString arg1Value_ = (TruffleString) arg1Value;
state_0 = state_0 | 0b1 /* add SpecializationActive[InitializeLocaleNode.initializeLocaleUsingString(JSLocaleObject, TruffleString, Object)] */;
this.state_0_ = state_0;
return initializeLocaleUsingString(arg0Value, arg1Value_, arg2Value);
}
if (arg1Value instanceof JSLocaleObject) {
JSLocaleObject arg1Value_ = (JSLocaleObject) arg1Value;
state_0 = state_0 | 0b10 /* add SpecializationActive[InitializeLocaleNode.initializeLocaleUsingLocale(JSLocaleObject, JSLocaleObject, Object)] */;
this.state_0_ = state_0;
return initializeLocaleUsingLocale(arg0Value, arg1Value_, arg2Value);
}
if (arg1Value instanceof JSObject) {
JSObject arg1Value_ = (JSObject) arg1Value;
if ((!(JSGuards.isJSLocale(arg1Value_)))) {
JSToStringNode toStringNode__ = this.insert((JSToStringNode.create()));
Objects.requireNonNull(toStringNode__, "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.initializeLocaleUsingObject_toStringNode_ = toStringNode__;
state_0 = state_0 | 0b100 /* add SpecializationActive[InitializeLocaleNode.initializeLocaleUsingObject(JSLocaleObject, JSObject, Object, JSToStringNode)] */;
this.state_0_ = state_0;
return initializeLocaleUsingObject(arg0Value, arg1Value_, arg2Value, toStringNode__);
}
}
if ((!(JSGuards.isJSObject(arg1Value))) && (!(JSGuards.isString(arg1Value)))) {
state_0 = state_0 | 0b1000 /* add SpecializationActive[InitializeLocaleNode.initializeLocaleOther(JSLocaleObject, Object, Object)] */;
this.state_0_ = state_0;
return initializeLocaleOther(arg0Value, arg1Value, arg2Value);
}
throw new UnsupportedSpecializationException(this, null, arg0Value, arg1Value, arg2Value);
}
@NeverDefault
public static InitializeLocaleNode create(JSContext context) {
return new InitializeLocaleNodeGen(context);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy