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

com.oracle.truffle.js.builtins.math.PowNodeGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.js.builtins.math;

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.InlineSupport.InlineTarget;
import com.oracle.truffle.api.dsl.InlineSupport.StateField;
import com.oracle.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.SlowPathException;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.profiles.InlinedConditionProfile;
import com.oracle.truffle.js.nodes.JSTypes;
import com.oracle.truffle.js.nodes.JSTypesGen;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.function.JSBuiltin;
import com.oracle.truffle.js.runtime.JSContext;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.Objects;

/**
 * Debug Info: 
 *   Specialization {@link PowNode#pow(double, double)}
 *     Activation probability: 0.38500
 *     With/without class size: 8/0 bytes
 *   Specialization {@link PowNode#pow2}
 *     Activation probability: 0.29500
 *     With/without class size: 7/0 bytes
 *   Specialization {@link PowNode#pow3}
 *     Activation probability: 0.20500
 *     With/without class size: 8/1 bytes
 *   Specialization {@link PowNode#pow(Object, Object, PowNode)}
 *     Activation probability: 0.11500
 *     With/without class size: 6/4 bytes
 * 
*/ @GeneratedBy(PowNode.class) @SuppressWarnings("javadoc") public final class PowNodeGen extends PowNode { private static final StateField STATE_0_PowNode_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_"); /** * Source Info:
     *   Specialization: {@link PowNode#pow3}
     *   Parameter: {@link InlinedConditionProfile} branch1
     *   Inline method: {@link InlinedConditionProfile#inline}
*/ private static final InlinedConditionProfile INLINED_POW3_BRANCH1_ = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, STATE_0_PowNode_UPDATER.subUpdater(12, 2))); /** * Source Info:
     *   Specialization: {@link PowNode#pow3}
     *   Parameter: {@link InlinedConditionProfile} branch2
     *   Inline method: {@link InlinedConditionProfile#inline}
*/ private static final InlinedConditionProfile INLINED_POW3_BRANCH2_ = InlinedConditionProfile.inline(InlineTarget.create(InlinedConditionProfile.class, STATE_0_PowNode_UPDATER.subUpdater(14, 2))); @Child private JavaScriptNode arguments0_; @Child private JavaScriptNode arguments1_; /** * State Info:
     *   0: SpecializationActive {@link PowNode#pow(double, double)}
     *   1: SpecializationExcluded {@link PowNode#pow(double, double)}
     *   2: SpecializationActive {@link PowNode#pow2}
     *   3: SpecializationExcluded {@link PowNode#pow2}
     *   4: SpecializationActive {@link PowNode#pow3}
     *   5: SpecializationActive {@link PowNode#pow(Object, Object, PowNode)}
     *   6-8: ImplicitCast[type=double, index=0]
     *   9-11: ImplicitCast[type=double, index=1]
     *   12-13: InlinedCache
     *        Specialization: {@link PowNode#pow3}
     *        Parameter: {@link InlinedConditionProfile} branch1
     *        Inline method: {@link InlinedConditionProfile#inline}
     *   14-15: InlinedCache
     *        Specialization: {@link PowNode#pow3}
     *        Parameter: {@link InlinedConditionProfile} branch2
     *        Inline method: {@link InlinedConditionProfile#inline}
     * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; /** * Source Info:
     *   Specialization: {@link PowNode#pow(Object, Object, PowNode)}
     *   Parameter: {@link PowNode} powNode
*/ @Child private PowNode pow1_powNode_; private PowNodeGen(JSContext context, JSBuiltin builtin, JavaScriptNode[] arguments) { super(context, builtin); this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null; this.arguments1_ = arguments != null && 1 < arguments.length ? arguments[1] : null; } @Override public JavaScriptNode[] getArguments() { return new JavaScriptNode[] {this.arguments0_, this.arguments1_}; } @Override public Object execute(VirtualFrame frameValue) { int state_0 = this.state_0_; if ((state_0 & 0b100000) == 0 /* only-active SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */)) { return execute_double_double0(state_0, frameValue); } else { return execute_generic1(state_0, frameValue); } } private Object execute_double_double0(int state_0__, VirtualFrame frameValue) { int state_0 = state_0__; int arguments0Value_int = 0; double arguments0Value_; try { if ((state_0 & 0b110000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */)) { arguments0Value_ = this.arguments0_.executeDouble(frameValue); } else if ((state_0 & 0b101000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */)) { arguments0Value_int = this.arguments0_.executeInt(frameValue); arguments0Value_ = JSTypes.intToDouble(arguments0Value_int); } else { Object arguments0Value__ = this.arguments0_.execute(frameValue); arguments0Value_ = JSTypesGen.expectImplicitDouble((state_0 & 0b111000000) >>> 6 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value__); } } catch (UnexpectedResultException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); Object arguments1Value = this.arguments1_.execute(frameValue); return executeAndSpecialize(ex.getResult(), arguments1Value); } int arguments1Value_int = 0; double arguments1Value_; try { if ((state_0 & 0b110000000000) == 0 /* only-active ImplicitCast[type=double, index=1] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */)) { arguments1Value_ = this.arguments1_.executeDouble(frameValue); } else if ((state_0 & 0b101000000000) == 0 /* only-active ImplicitCast[type=double, index=1] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */)) { arguments1Value_int = this.arguments1_.executeInt(frameValue); arguments1Value_ = JSTypes.intToDouble(arguments1Value_int); } else { Object arguments1Value__ = this.arguments1_.execute(frameValue); arguments1Value_ = JSTypesGen.expectImplicitDouble((state_0 & 0b111000000000) >>> 9 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value__); } } catch (UnexpectedResultException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(((state_0 & 0b101000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */) ? (Object) arguments0Value_int : (Object) arguments0Value_), ex.getResult()); } if ((state_0 & 0b10101) != 0 /* is SpecializationActive[PowNode.pow(double, double)] || SpecializationActive[PowNode.pow2(double, double)] || SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[PowNode.pow(double, double)] */) { try { return pow(arguments0Value_, arguments1Value_); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PowNode.pow(double, double)] */; state_0 = state_0 | 0b10 /* add SpecializationExcluded */; this.state_0_ = state_0; return executeAndSpecialize(arguments0Value_, arguments1Value_); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PowNode.pow2(double, double)] */) { try { return pow2(arguments0Value_, arguments1Value_); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffb /* remove SpecializationActive[PowNode.pow2(double, double)] */; state_0 = state_0 | 0b1000 /* add SpecializationExcluded */; this.state_0_ = state_0; return executeAndSpecialize(arguments0Value_, arguments1Value_); } } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */) { return pow3(arguments0Value_, arguments1Value_, INLINED_POW3_BRANCH1_, INLINED_POW3_BRANCH2_); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(((state_0 & 0b101000000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */) ? (Object) arguments0Value_int : (Object) arguments0Value_), ((state_0 & 0b101000000000) == 0 /* only-active ImplicitCast[type=double, index=1] */ && ((state_0 & 0b110101) != 0 /* is-not SpecializationActive[PowNode.pow(double, double)] && SpecializationActive[PowNode.pow2(double, double)] && SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] && SpecializationActive[PowNode.pow(Object, Object, PowNode)] */) ? (Object) arguments1Value_int : (Object) arguments1Value_)); } private Object execute_generic1(int state_0__, VirtualFrame frameValue) { int state_0 = state_0__; Object arguments0Value_ = this.arguments0_.execute(frameValue); Object arguments1Value_ = this.arguments1_.execute(frameValue); if ((state_0 & 0b110101) != 0 /* is SpecializationActive[PowNode.pow(double, double)] || SpecializationActive[PowNode.pow2(double, double)] || SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] || SpecializationActive[PowNode.pow(Object, Object, PowNode)] */) { if ((state_0 & 0b10101) != 0 /* is SpecializationActive[PowNode.pow(double, double)] || SpecializationActive[PowNode.pow2(double, double)] || SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b111000000) >>> 6 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value_)) { double arguments0Value__ = JSTypesGen.asImplicitDouble((state_0 & 0b111000000) >>> 6 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value_); if (JSTypesGen.isImplicitDouble((state_0 & 0b111000000000) >>> 9 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value_)) { double arguments1Value__ = JSTypesGen.asImplicitDouble((state_0 & 0b111000000000) >>> 9 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value_); if ((state_0 & 0b1) != 0 /* is SpecializationActive[PowNode.pow(double, double)] */) { try { return pow(arguments0Value__, arguments1Value__); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PowNode.pow(double, double)] */; state_0 = state_0 | 0b10 /* add SpecializationExcluded */; this.state_0_ = state_0; return executeAndSpecialize(arguments0Value__, arguments1Value__); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PowNode.pow2(double, double)] */) { try { return pow2(arguments0Value__, arguments1Value__); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffb /* remove SpecializationActive[PowNode.pow2(double, double)] */; state_0 = state_0 | 0b1000 /* add SpecializationExcluded */; this.state_0_ = state_0; return executeAndSpecialize(arguments0Value__, arguments1Value__); } } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */) { return pow3(arguments0Value__, arguments1Value__, INLINED_POW3_BRANCH1_, INLINED_POW3_BRANCH2_); } } } if ((state_0 & 0b100000) != 0 /* is SpecializationActive[PowNode.pow(Object, Object, PowNode)] */) { { PowNode powNode__ = this.pow1_powNode_; if (powNode__ != null) { return pow(arguments0Value_, arguments1Value_, powNode__); } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arguments0Value_, arguments1Value_); } @Override public double execute(Object arguments0Value, Object arguments1Value) { int state_0 = this.state_0_; if ((state_0 & 0b10101) != 0 /* is SpecializationActive[PowNode.pow(double, double)] || SpecializationActive[PowNode.pow2(double, double)] || SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b111000000) >>> 6 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value)) { double arguments0Value_ = JSTypesGen.asImplicitDouble((state_0 & 0b111000000) >>> 6 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value); if (JSTypesGen.isImplicitDouble((state_0 & 0b111000000000) >>> 9 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value)) { double arguments1Value_ = JSTypesGen.asImplicitDouble((state_0 & 0b111000000000) >>> 9 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value); if ((state_0 & 0b1) != 0 /* is SpecializationActive[PowNode.pow(double, double)] */) { try { return pow(arguments0Value_, arguments1Value_); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PowNode.pow(double, double)] */; state_0 = state_0 | 0b10 /* add SpecializationExcluded */; this.state_0_ = state_0; return (double) executeAndSpecialize(arguments0Value_, arguments1Value_); } } if ((state_0 & 0b100) != 0 /* is SpecializationActive[PowNode.pow2(double, double)] */) { try { return pow2(arguments0Value_, arguments1Value_); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffb /* remove SpecializationActive[PowNode.pow2(double, double)] */; state_0 = state_0 | 0b1000 /* add SpecializationExcluded */; this.state_0_ = state_0; return (double) executeAndSpecialize(arguments0Value_, arguments1Value_); } } if ((state_0 & 0b10000) != 0 /* is SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */) { return pow3(arguments0Value_, arguments1Value_, INLINED_POW3_BRANCH1_, INLINED_POW3_BRANCH2_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return (double) executeAndSpecialize(arguments0Value, arguments1Value); } private Object executeAndSpecialize(Object arguments0Value, Object arguments1Value) { int state_0 = this.state_0_; { int doubleCast0; if ((doubleCast0 = JSTypesGen.specializeImplicitDouble(arguments0Value)) != 0) { double arguments0Value_ = JSTypesGen.asImplicitDouble(doubleCast0, arguments0Value); int doubleCast1; if ((doubleCast1 = JSTypesGen.specializeImplicitDouble(arguments1Value)) != 0) { double arguments1Value_ = JSTypesGen.asImplicitDouble(doubleCast1, arguments1Value); if (((state_0 & 0b10)) == 0 /* is-not SpecializationExcluded */) { state_0 = (state_0 | (doubleCast0 << 6) /* set-int ImplicitCast[type=double, index=0] */); state_0 = (state_0 | (doubleCast1 << 9) /* set-int ImplicitCast[type=double, index=1] */); state_0 = state_0 | 0b1 /* add SpecializationActive[PowNode.pow(double, double)] */; this.state_0_ = state_0; try { return pow(arguments0Value_, arguments1Value_); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffe /* remove SpecializationActive[PowNode.pow(double, double)] */; state_0 = state_0 | 0b10 /* add SpecializationExcluded */; this.state_0_ = state_0; return executeAndSpecialize(arguments0Value_, arguments1Value_); } } if (((state_0 & 0b1000)) == 0 /* is-not SpecializationExcluded */) { state_0 = (state_0 | (doubleCast0 << 6) /* set-int ImplicitCast[type=double, index=0] */); state_0 = (state_0 | (doubleCast1 << 9) /* set-int ImplicitCast[type=double, index=1] */); state_0 = state_0 | 0b100 /* add SpecializationActive[PowNode.pow2(double, double)] */; this.state_0_ = state_0; try { return pow2(arguments0Value_, arguments1Value_); } catch (SlowPathException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); state_0 = this.state_0_; state_0 = state_0 & 0xfffffffb /* remove SpecializationActive[PowNode.pow2(double, double)] */; state_0 = state_0 | 0b1000 /* add SpecializationExcluded */; this.state_0_ = state_0; return executeAndSpecialize(arguments0Value_, arguments1Value_); } } state_0 = (state_0 | (doubleCast0 << 6) /* set-int ImplicitCast[type=double, index=0] */); state_0 = (state_0 | (doubleCast1 << 9) /* set-int ImplicitCast[type=double, index=1] */); state_0 = state_0 | 0b10000 /* add SpecializationActive[PowNode.pow3(double, double, InlinedConditionProfile, InlinedConditionProfile)] */; this.state_0_ = state_0; return pow3(arguments0Value_, arguments1Value_, INLINED_POW3_BRANCH1_, INLINED_POW3_BRANCH2_); } } } PowNode powNode__ = this.insert((create(getContext()))); Objects.requireNonNull(powNode__, "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.pow1_powNode_ = powNode__; state_0 = state_0 | 0b100000 /* add SpecializationActive[PowNode.pow(Object, Object, PowNode)] */; this.state_0_ = state_0; return pow(arguments0Value, arguments1Value, powNode__); } @NeverDefault public static PowNode create(JSContext context, JSBuiltin builtin, JavaScriptNode[] arguments) { return new PowNodeGen(context, builtin, arguments); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy