com.oracle.truffle.api.metadata.ArgsArrWriteNodeSubNodeGen 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.
// CheckStyle: start generated
package com.oracle.truffle.api.metadata;
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.metadata.DefaultScopeVariables.ArguentsArrayObject;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import java.util.concurrent.locks.Lock;
@GeneratedBy(ArgsArrWriteNodeSub.class)
final class ArgsArrWriteNodeSubNodeGen extends ArgsArrWriteNodeSub {
@CompilationFinal private int state_ = 1;
private ArgsArrWriteNodeSubNodeGen() {
}
@Override
public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value, Object arg1Value, Object arg2Value) {
int state = state_;
if ((state & 0b10) != 0 /* is-active accessWithTarget(ArguentsArrayObject, int, Object) */ && arg0Value instanceof ArguentsArrayObject) {
ArguentsArrayObject arg0Value_ = (ArguentsArrayObject) arg0Value;
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
return accessWithTarget(arg0Value_, arg1Value_, arg2Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
return executeAndSpecialize(arg0Value, arg1Value, arg2Value);
}
private Object executeAndSpecialize(Object arg0Value, Object arg1Value, Object arg2Value) {
Lock lock = getLock();
boolean hasLock = true;
lock.lock();
try {
int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
if (arg0Value instanceof ArguentsArrayObject) {
ArguentsArrayObject arg0Value_ = (ArguentsArrayObject) arg0Value;
if (arg1Value instanceof Integer) {
int arg1Value_ = (int) arg1Value;
this.state_ = state | 0b10 /* add-active accessWithTarget(ArguentsArrayObject, int, Object) */;
lock.unlock();
hasLock = false;
return accessWithTarget(arg0Value_, arg1Value_, arg2Value);
}
}
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new UnsupportedSpecializationException(this, new Node[] {null, null, null}, arg0Value, arg1Value, arg2Value);
} finally {
if (hasLock) {
lock.unlock();
}
}
}
@Override
public NodeCost getCost() {
int state = state_ & 0xfffffffe/* mask-active uninitialized*/;
if (state == 0b0) {
return NodeCost.UNINITIALIZED;
} else {
return NodeCost.MONOMORPHIC;
}
}
public static ArgsArrWriteNodeSub create() {
return new ArgsArrWriteNodeSubNodeGen();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy