All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.truffle.js.nodes.unary.IsIdenticalStringNodeGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.js.nodes.unary;

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.api.strings.TruffleString;
import com.oracle.truffle.api.strings.TruffleString.EqualNode;
import com.oracle.truffle.js.nodes.JSGuards;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link IsIdenticalStringNode#doString}
 *     Activation probability: 0.65000
 *     With/without class size: 17/4 bytes
 *   Specialization {@link IsIdenticalStringNode#doOther}
 *     Activation probability: 0.35000
 *     With/without class size: 8/0 bytes
 * 
*/ @GeneratedBy(IsIdenticalStringNode.class) @SuppressWarnings("javadoc") public final class IsIdenticalStringNodeGen extends IsIdenticalStringNode { /** * State Info:
     *   0: SpecializationActive {@link IsIdenticalStringNode#doString}
     *   1: SpecializationActive {@link IsIdenticalStringNode#doOther}
     * 
*/ @CompilationFinal private int state_0_; /** * Source Info:
     *   Specialization: {@link IsIdenticalStringNode#doString}
     *   Parameter: {@link EqualNode} equalsNode
*/ @Child private EqualNode string_equalsNode_; private IsIdenticalStringNodeGen(TruffleString string, JavaScriptNode operand, boolean leftConstant) { super(string, operand, leftConstant); } @Override public Object execute(VirtualFrame frameValue) { int state_0 = this.state_0_; Object operandNodeValue_ = super.operandNode.execute(frameValue); if (state_0 != 0 /* is SpecializationActive[IsIdenticalStringNode.doString(TruffleString, EqualNode)] || SpecializationActive[IsIdenticalStringNode.doOther(Object)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsIdenticalStringNode.doString(TruffleString, EqualNode)] */ && operandNodeValue_ instanceof TruffleString) { TruffleString operandNodeValue__ = (TruffleString) operandNodeValue_; { EqualNode equalsNode__ = this.string_equalsNode_; if (equalsNode__ != null) { return doString(operandNodeValue__, equalsNode__); } } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsIdenticalStringNode.doOther(Object)] */) { if ((!(JSGuards.isTruffleString(operandNodeValue_)))) { return doOther(operandNodeValue_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(operandNodeValue_); } @Override public boolean executeBoolean(VirtualFrame frameValue) { int state_0 = this.state_0_; Object operandNodeValue_ = super.operandNode.execute(frameValue); if (state_0 != 0 /* is SpecializationActive[IsIdenticalStringNode.doString(TruffleString, EqualNode)] || SpecializationActive[IsIdenticalStringNode.doOther(Object)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[IsIdenticalStringNode.doString(TruffleString, EqualNode)] */ && operandNodeValue_ instanceof TruffleString) { TruffleString operandNodeValue__ = (TruffleString) operandNodeValue_; { EqualNode equalsNode__ = this.string_equalsNode_; if (equalsNode__ != null) { return doString(operandNodeValue__, equalsNode__); } } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[IsIdenticalStringNode.doOther(Object)] */) { if ((!(JSGuards.isTruffleString(operandNodeValue_)))) { return doOther(operandNodeValue_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(operandNodeValue_); } @Override public void executeVoid(VirtualFrame frameValue) { executeBoolean(frameValue); return; } private boolean executeAndSpecialize(Object operandNodeValue) { int state_0 = this.state_0_; if (operandNodeValue instanceof TruffleString) { TruffleString operandNodeValue_ = (TruffleString) operandNodeValue; EqualNode equalsNode__ = this.insert((EqualNode.create())); Objects.requireNonNull(equalsNode__, "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.string_equalsNode_ = equalsNode__; state_0 = state_0 | 0b1 /* add SpecializationActive[IsIdenticalStringNode.doString(TruffleString, EqualNode)] */; this.state_0_ = state_0; return doString(operandNodeValue_, equalsNode__); } if ((!(JSGuards.isTruffleString(operandNodeValue)))) { state_0 = state_0 | 0b10 /* add SpecializationActive[IsIdenticalStringNode.doOther(Object)] */; this.state_0_ = state_0; return doOther(operandNodeValue); } throw new UnsupportedSpecializationException(this, new Node[] {super.operandNode}, operandNodeValue); } @NeverDefault public static IsIdenticalStringNode create(TruffleString string, JavaScriptNode operand, boolean leftConstant) { return new IsIdenticalStringNodeGen(string, operand, leftConstant); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy