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

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

The newest version!
// 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.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
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;

/**
 * Debug Info: 
 *   Specialization {@link Atan2Node#atan2Double}
 *     Activation probability: 0.65000
 *     With/without class size: 11/0 bytes
 *   Specialization {@link Atan2Node#atan2Generic}
 *     Activation probability: 0.35000
 *     With/without class size: 8/0 bytes
 * 
*/ @GeneratedBy(Atan2Node.class) @SuppressWarnings("javadoc") public final class Atan2NodeGen extends Atan2Node { @Child private JavaScriptNode arguments0_; @Child private JavaScriptNode arguments1_; /** * State Info:
     *   0: SpecializationActive {@link Atan2Node#atan2Double}
     *   1: SpecializationActive {@link Atan2Node#atan2Generic}
     *   2-4: ImplicitCast[type=double, index=0]
     *   5-7: ImplicitCast[type=double, index=1]
     * 
*/ @CompilationFinal private int state_0_; private Atan2NodeGen(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 & 0b10) == 0 /* only-active SpecializationActive[Atan2Node.atan2Double(double, double)] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[Atan2Node.atan2Double(double, double)] && SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */)) { 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 & 0b11000) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[Atan2Node.atan2Double(double, double)] && SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */)) { arguments0Value_ = this.arguments0_.executeDouble(frameValue); } else if ((state_0 & 0b10100) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[Atan2Node.atan2Double(double, double)] && SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */)) { arguments0Value_int = this.arguments0_.executeInt(frameValue); arguments0Value_ = JSTypes.intToDouble(arguments0Value_int); } else { Object arguments0Value__ = this.arguments0_.execute(frameValue); arguments0Value_ = JSTypesGen.expectImplicitDouble((state_0 & 0b11100) >>> 2 /* 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 & 0b11000000) == 0 /* only-active ImplicitCast[type=double, index=1] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[Atan2Node.atan2Double(double, double)] && SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */)) { arguments1Value_ = this.arguments1_.executeDouble(frameValue); } else if ((state_0 & 0b10100000) == 0 /* only-active ImplicitCast[type=double, index=1] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[Atan2Node.atan2Double(double, double)] && SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */)) { arguments1Value_int = this.arguments1_.executeInt(frameValue); arguments1Value_ = JSTypes.intToDouble(arguments1Value_int); } else { Object arguments1Value__ = this.arguments1_.execute(frameValue); arguments1Value_ = JSTypesGen.expectImplicitDouble((state_0 & 0b11100000) >>> 5 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value__); } } catch (UnexpectedResultException ex) { CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(((state_0 & 0b10100) == 0 /* only-active ImplicitCast[type=double, index=0] */ && ((state_0 & 0b11) != 0 /* is-not SpecializationActive[Atan2Node.atan2Double(double, double)] && SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */) ? (Object) arguments0Value_int : (Object) arguments0Value_), ex.getResult()); } assert (state_0 & 0b1) != 0 /* is SpecializationActive[Atan2Node.atan2Double(double, double)] */; return Atan2Node.atan2Double(arguments0Value_, 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 & 0b11) != 0 /* is SpecializationActive[Atan2Node.atan2Double(double, double)] || SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */) { if ((state_0 & 0b1) != 0 /* is SpecializationActive[Atan2Node.atan2Double(double, double)] */ && JSTypesGen.isImplicitDouble((state_0 & 0b11100) >>> 2 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value_)) { double arguments0Value__ = JSTypesGen.asImplicitDouble((state_0 & 0b11100) >>> 2 /* get-int ImplicitCast[type=double, index=0] */, arguments0Value_); if (JSTypesGen.isImplicitDouble((state_0 & 0b11100000) >>> 5 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value_)) { double arguments1Value__ = JSTypesGen.asImplicitDouble((state_0 & 0b11100000) >>> 5 /* get-int ImplicitCast[type=double, index=1] */, arguments1Value_); return Atan2Node.atan2Double(arguments0Value__, arguments1Value__); } } if ((state_0 & 0b10) != 0 /* is SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */) { return atan2Generic(arguments0Value_, arguments1Value_); } } CompilerDirectives.transferToInterpreterAndInvalidate(); return executeAndSpecialize(arguments0Value_, arguments1Value_); } private double 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); state_0 = (state_0 | (doubleCast0 << 2) /* set-int ImplicitCast[type=double, index=0] */); state_0 = (state_0 | (doubleCast1 << 5) /* set-int ImplicitCast[type=double, index=1] */); state_0 = state_0 | 0b1 /* add SpecializationActive[Atan2Node.atan2Double(double, double)] */; this.state_0_ = state_0; return Atan2Node.atan2Double(arguments0Value_, arguments1Value_); } } } state_0 = state_0 | 0b10 /* add SpecializationActive[Atan2Node.atan2Generic(Object, Object)] */; this.state_0_ = state_0; return atan2Generic(arguments0Value, arguments1Value); } @NeverDefault public static Atan2Node create(JSContext context, JSBuiltin builtin, JavaScriptNode[] arguments) { return new Atan2NodeGen(context, builtin, arguments); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy