com.oracle.truffle.js.builtins.DateFunctionBuiltinsFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cql-shaded Show documentation
Show all versions of driver-cql-shaded Show documentation
A Shaded CQL ActivityType driver for http://nosqlbench.io/
// CheckStyle: start generated
package com.oracle.truffle.js.builtins;
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.Introspection;
import com.oracle.truffle.api.dsl.UnsupportedSpecializationException;
import com.oracle.truffle.api.dsl.Introspection.Provider;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.js.builtins.DateFunctionBuiltins.DateNowNode;
import com.oracle.truffle.js.builtins.DateFunctionBuiltins.DateParseNode;
import com.oracle.truffle.js.builtins.DateFunctionBuiltins.DateUTCNode;
import com.oracle.truffle.js.nodes.JavaScriptNode;
import com.oracle.truffle.js.nodes.cast.JSToNumberNode;
import com.oracle.truffle.js.nodes.cast.JSToStringNode;
import com.oracle.truffle.js.nodes.function.JSBuiltin;
import com.oracle.truffle.js.runtime.JSContext;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.locks.Lock;
@GeneratedBy(DateFunctionBuiltins.class)
@SuppressWarnings("unused")
public final class DateFunctionBuiltinsFactory {
@GeneratedBy(DateParseNode.class)
public static final class DateParseNodeGen extends DateParseNode implements Provider {
@Child private JavaScriptNode arguments0_;
@CompilationFinal private volatile int state_;
@Child private JSToStringNode toStringNode_;
private DateParseNodeGen(JSContext context, JSBuiltin builtin, JavaScriptNode[] arguments) {
super(context, builtin);
this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
}
@Override
public JavaScriptNode[] getArguments() {
return new JavaScriptNode[] {this.arguments0_};
}
@Override
public Object execute(VirtualFrame frameValue) {
int state = state_;
Object arguments0Value_ = this.arguments0_.execute(frameValue);
if (state != 0 /* is-active parse(Object, JSToStringNode) */) {
return parse(arguments0Value_, this.toStringNode_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arguments0Value_);
}
@Override
public double executeDouble(VirtualFrame frameValue) {
int state = state_;
Object arguments0Value_ = this.arguments0_.execute(frameValue);
if (state != 0 /* is-active parse(Object, JSToStringNode) */) {
return parse(arguments0Value_, this.toStringNode_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arguments0Value_);
}
@Override
public void executeVoid(VirtualFrame frameValue) {
executeDouble(frameValue);
return;
}
private double executeAndSpecialize(Object arguments0Value) {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
int state = state_;
try {
this.toStringNode_ = super.insert((JSToStringNode.create()));
this.state_ = state = state | 0b1 /* add-active parse(Object, JSToStringNode) */;
lock.unlock();
hasLock = false;
return parse(arguments0Value, this.toStringNode_);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state = state_;
if (state == 0b0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
@Override
public Introspection getIntrospectionData() {
Object[] data = new Object[2];
Object[] s;
data[0] = 0;
int state = state_;
s = new Object[3];
s[0] = "parse";
if (state != 0 /* is-active parse(Object, JSToStringNode) */) {
s[1] = (byte)0b01 /* active */;
ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy