com.oracle.truffle.polyglot.VariableNamesMessageResolutionForeignFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truffle-api Show documentation
Show all versions of truffle-api Show documentation
Truffle is a multi-language framework for executing dynamic languages
that achieves high performance when combined with Graal.
The newest version!
// CheckStyle: start generated
package com.oracle.truffle.polyglot;
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.UnsupportedSpecializationException;
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.polyglot.DefaultScope.VariableNamesObject;
import com.oracle.truffle.polyglot.VariableNamesMessageResolutionForeign.VarNamesGetSizeSubNode;
import com.oracle.truffle.polyglot.VariableNamesMessageResolutionForeign.VarNamesHasSizeSubNode;
import com.oracle.truffle.polyglot.VariableNamesMessageResolutionForeign.VarNamesReadSubNode;
import java.util.concurrent.locks.Lock;
@GeneratedBy(VariableNamesMessageResolutionForeign.class)
final class VariableNamesMessageResolutionForeignFactory {
@GeneratedBy(VarNamesReadSubNode.class)
static final class VarNamesReadSubNodeGen extends VarNamesReadSubNode {
@CompilationFinal private int state_;
private VarNamesReadSubNodeGen() {
}
@Override
public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value, Object arg1Value) {
int state = state_;
if (state != 0 /* is-active accessWithTarget(VariableNamesObject, int) */ && arg0Value instanceof VariableNamesObject) {
VariableNamesObject arg0Value_ = (VariableNamesObject) arg0Value;
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return accessWithTarget(arg0Value_, arg1Value_);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value);
}
private Object executeAndSpecialize(Object arg0Value, Object arg1Value) {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
int state = state_;
try {
if (arg0Value instanceof VariableNamesObject) {
VariableNamesObject arg0Value_ = (VariableNamesObject) arg0Value;
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
this.state_ = state = state | 0b1 /* add-active accessWithTarget(VariableNamesObject, int) */;
lock.unlock();
hasLock = false;
return accessWithTarget(arg0Value_, arg1Value_);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedSpecializationException(this, new Node[] {null, null}, arg0Value, arg1Value);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state = state_;
if (state == 0b0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
public static VarNamesReadSubNode create() {
return new VarNamesReadSubNodeGen();
}
}
@GeneratedBy(VarNamesGetSizeSubNode.class)
static final class VarNamesGetSizeSubNodeGen extends VarNamesGetSizeSubNode {
@CompilationFinal private int state_;
private VarNamesGetSizeSubNodeGen() {
}
@Override
public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value) {
int state = state_;
if (state != 0 /* is-active accessWithTarget(VariableNamesObject) */ && arg0Value instanceof VariableNamesObject) {
VariableNamesObject arg0Value_ = (VariableNamesObject) arg0Value;
return accessWithTarget(arg0Value_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private Object executeAndSpecialize(Object arg0Value) {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
int state = state_;
try {
if (arg0Value instanceof VariableNamesObject) {
VariableNamesObject arg0Value_ = (VariableNamesObject) arg0Value;
this.state_ = state = state | 0b1 /* add-active accessWithTarget(VariableNamesObject) */;
lock.unlock();
hasLock = false;
return accessWithTarget(arg0Value_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedSpecializationException(this, new Node[] {null}, arg0Value);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state = state_;
if (state == 0b0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
public static VarNamesGetSizeSubNode create() {
return new VarNamesGetSizeSubNodeGen();
}
}
@GeneratedBy(VarNamesHasSizeSubNode.class)
static final class VarNamesHasSizeSubNodeGen extends VarNamesHasSizeSubNode {
@CompilationFinal private int state_;
private VarNamesHasSizeSubNodeGen() {
}
@Override
public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value) {
int state = state_;
if (state != 0 /* is-active accessWithTarget(VariableNamesObject) */ && arg0Value instanceof VariableNamesObject) {
VariableNamesObject arg0Value_ = (VariableNamesObject) arg0Value;
return accessWithTarget(arg0Value_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value);
}
private Object executeAndSpecialize(Object arg0Value) {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
int state = state_;
try {
if (arg0Value instanceof VariableNamesObject) {
VariableNamesObject arg0Value_ = (VariableNamesObject) arg0Value;
this.state_ = state = state | 0b1 /* add-active accessWithTarget(VariableNamesObject) */;
lock.unlock();
hasLock = false;
return accessWithTarget(arg0Value_);
}
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedSpecializationException(this, new Node[] {null}, arg0Value);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state = state_;
if (state == 0b0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
public static VarNamesHasSizeSubNode create() {
return new VarNamesHasSizeSubNodeGen();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy