本文整理汇总了Java中com.oracle.truffle.api.nodes.UnexpectedResultException类的典型用法代码示例。如果您正苦于以下问题:Java UnexpectedResultException类的具体用法?Java UnexpectedResultException怎么用?Java UnexpectedResultException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnexpectedResultException类属于com.oracle.truffle.api.nodes包,在下文中一共展示了UnexpectedResultException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evalForRemaining
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@ExplodeLoop
public static Object evalForRemaining(final VirtualFrame frame,
final ExpressionNode[] exprs, final long[] storage, final int next) {
for (int i = next; i < exprs.length; i++) {
try {
storage[i] = exprs[i].executeLong(frame);
} catch (UnexpectedResultException e) {
Object[] newStorage = new Object[exprs.length];
for (int j = 0; j < i; j += 1) {
newStorage[j] = storage[j];
}
newStorage[i] = e.getResult();
return evalForRemaining(frame, exprs, newStorage, i + 1);
}
}
return storage;
}
示例2: evalBoolean
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@Override
boolean evalBoolean(VirtualFrame frame) throws UnexpectedResultException {
if (nodes.length == 0) {
setTypeState(TYPE_STATE_OBJECT);
throw new UnexpectedResultException(List.empty());
}
for(int i = 0; i < nodes.length - 1; i++) {
nodes[i].eval(frame);
}
Node last = nodes[nodes.length - 1];
try {
return last.evalBoolean(frame);
} catch(UnexpectedResultException e) {
setTypeState(TYPE_STATE_OBJECT);
throw e;
}
}
示例3: evalInt
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@Override
int evalInt(VirtualFrame frame) throws UnexpectedResultException {
if (nodes.length == 0) {
setTypeState(TYPE_STATE_OBJECT);
throw new UnexpectedResultException(List.empty());
}
for(int i = 0; i < nodes.length - 1; i++) {
nodes[i].eval(frame);
}
Node last = nodes[nodes.length - 1];
try {
return last.evalInt(frame);
} catch(UnexpectedResultException e) {
setTypeState(TYPE_STATE_OBJECT);
throw e;
}
}
示例4: doSmallOp
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
private int doSmallOp(int left, int right) throws UnexpectedResultException {
try {
if (binOp == BinOp.ADD) {
return ExactMath.addExact(left, right);
}
if (binOp == BinOp.SUB) {
return ExactMath.subtractExact(left, right);
}
if (binOp == BinOp.MUL) {
return ExactMath.multiplyExact(left, right);
}
if (binOp == BinOp.DIV) {
return left / right;
}
throw should_not_reach_here();
} catch(ArithmeticException e) {
throw new UnexpectedResultException(slowPath(left, right));
}
}
示例5: evaluateCondition
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
private boolean evaluateCondition(final VirtualFrame frame) {
try {
return conditionNode.executeBoolean(frame);
} catch (UnexpectedResultException e) {
// TODO: should rewrite to a node that does a proper message send...
throw new UnsupportedSpecializationException(this,
new Node[] {conditionNode}, e.getResult());
}
}
示例6: evaluateReceiver
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
protected final boolean evaluateReceiver(final VirtualFrame frame) {
try {
return profile.profile(receiverNode.executeBoolean(frame));
} catch (UnexpectedResultException e) {
// TODO: should rewrite to a node that does a proper message send...
throw new UnsupportedSpecializationException(this,
new Node[] {receiverNode}, e.getResult());
}
}
示例7: evaluateArgument
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
protected final boolean evaluateArgument(final VirtualFrame frame) {
try {
return argumentNode.executeBoolean(frame);
} catch (UnexpectedResultException e) {
// TODO: should rewrite to a node that does a proper message send...
throw new UnsupportedSpecializationException(this,
new Node[] {argumentNode}, e.getResult());
}
}
示例8: evaluateCondition
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
private boolean evaluateCondition(final VirtualFrame frame) {
try {
return condProf.profile(conditionNode.executeBoolean(frame));
} catch (UnexpectedResultException e) {
// TODO: should rewrite to a node that does a proper message send...
throw new UnsupportedSpecializationException(this,
new Node[] {conditionNode}, e.getResult());
}
}
示例9: testResult
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
private boolean testResult(VirtualFrame virtualFrame) {
try {
return this.testNode.executeBoolean(virtualFrame);
} catch (UnexpectedResultException e) {
Object result = this.testNode.execute(virtualFrame);
return result != MumblerList.EMPTY;
}
}
示例10: evaluateFunction
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
private MumblerFunction evaluateFunction(VirtualFrame virtualFrame) {
try {
return this.functionNode.executeMumblerFunction(virtualFrame);
} catch (UnexpectedResultException e) {
throw new UnsupportedSpecializationException(this,
new Node[] {this.functionNode}, e);
}
}
示例11: evalObject
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@Override
Object evalObject(VirtualFrame frame) {
Object leftValue = leftNode.evalObject(frame);
Object rightValue = rightNode.evalObject(frame);
if (leftValue instanceof Integer && rightValue instanceof Integer) {
int left = (Integer)leftValue;
int right = (Integer)rightValue;
try {
return doSmallOp(left, right);
} catch (UnexpectedResultException e) {
return e.getResult();
}
}
return slowPath(leftValue, rightValue);
}
示例12: slowPathInt
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@SlowPath
private UnexpectedResultException slowPathInt(Object leftValue, int left, Object rightValue, int right) throws UnexpectedResultException {
setTypeState(TYPE_STATE_OBJECT);
if (leftValue == null) {
leftValue = left;
}
if (rightValue == null) {
rightValue = right;
}
throw new UnexpectedResultException(slowPath(leftValue, rightValue));
}
示例13: read
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@Override
public Object read(final SObject obj) {
try {
return readDouble(obj);
} catch (UnexpectedResultException e) {
return e.getResult();
}
}
示例14: readDouble
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@Override
public double readDouble(final SObject obj) throws UnexpectedResultException {
if (isSet(obj)) {
return unsafe.getDouble(obj, offset);
} else {
TruffleCompiler.transferToInterpreterAndInvalidate("unstabelized read node");
throw new UnexpectedResultException(Nil.nilObject);
}
}
示例15: readLong
import com.oracle.truffle.api.nodes.UnexpectedResultException; //导入依赖的package包/类
@Override
public long readLong(final SObject obj) throws UnexpectedResultException {
if (isSet(obj)) {
return unsafe.getLong(obj, offset);
} else {
TruffleCompiler.transferToInterpreter("unstabelized read node");
throw new UnexpectedResultException(Nil.nilObject);
}
}