当前位置: 首页>>代码示例>>Java>>正文


Java UnexpectedResultException类代码示例

本文整理汇总了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;
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:18,代码来源:ArraySetAllStrategy.java

示例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;
  }
}
 
开发者ID:forax,项目名称:ninal,代码行数:18,代码来源:Interpreter.java

示例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;
  }
}
 
开发者ID:forax,项目名称:ninal,代码行数:18,代码来源:Interpreter.java

示例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));
  }
}
 
开发者ID:forax,项目名称:ninal,代码行数:20,代码来源:Interpreter.java

示例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());
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:10,代码来源:WhileInlinedLiteralsNode.java

示例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());
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:10,代码来源:BooleanInlinedLiteralNode.java

示例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());
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:10,代码来源:BooleanInlinedLiteralNode.java

示例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());
  }
}
 
开发者ID:smarr,项目名称:SOMns,代码行数:10,代码来源:IfTrueIfFalseInlinedLiteralsNode.java

示例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;
    }
}
 
开发者ID:cesquivias,项目名称:mumbler,代码行数:9,代码来源:IfNode.java

示例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);
    }
}
 
开发者ID:cesquivias,项目名称:mumbler,代码行数:9,代码来源:InvokeNode.java

示例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);
}
 
开发者ID:forax,项目名称:ninal,代码行数:16,代码来源:Interpreter.java

示例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));
}
 
开发者ID:forax,项目名称:ninal,代码行数:12,代码来源:Interpreter.java

示例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();
  }
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:9,代码来源:StorageLocation.java

示例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);
  }
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:10,代码来源:StorageLocation.java

示例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);
  }
}
 
开发者ID:smarr,项目名称:TruffleSOM,代码行数:10,代码来源:StorageLocation.java


注:本文中的com.oracle.truffle.api.nodes.UnexpectedResultException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。