本文整理汇总了Java中com.oracle.truffle.api.frame.FrameSlotTypeException类的典型用法代码示例。如果您正苦于以下问题:Java FrameSlotTypeException类的具体用法?Java FrameSlotTypeException怎么用?Java FrameSlotTypeException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FrameSlotTypeException类属于com.oracle.truffle.api.frame包,在下文中一共展示了FrameSlotTypeException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeRepeating
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public boolean executeRepeating(VirtualFrame frame) {
boolean next = super.executeRepeating(frame);
if (next) {
// its like beeing in body
try {
int count = frame.getInt(param2);
// imagine loop work with size count here
LoopNode.reportLoopCount(this, count);
} catch (FrameSlotTypeException e) {
throw new AssertionError();
}
}
return next;
}
示例2: readUpStack
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@ExplodeLoop
public <T> T readUpStack(FrameGet<T> getter, Frame frame)
throws FrameSlotTypeException {
Frame lookupFrame = frame;
for (int i = 0; i < this.getDepth(); i++) {
lookupFrame = getLexicalClosure(lookupFrame);
}
return getter.get(lookupFrame, this.getSlot());
}
示例3: read
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Specialization(contains = { "readLong", "readDouble", "readObject" })
protected Object read(VirtualFrame virtualFrame) {
try {
return this.readUpStack(Frame::getValue, virtualFrame);
} catch (FrameSlotTypeException e) {
// FrameSlotTypeException not thrown
}
return null;
}
示例4: open
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Specialization(rewriteOn = FrameSlotTypeException.class)
@CompilerDirectives.TruffleBoundary
public Closeable open(String path, Symbol direction) throws FrameSlotTypeException {
File file = new File(path);
if (!file.isAbsolute()) {
MaterializedFrame globals = this.getContext().getGlobalFrame();
FrameSlot homeDirectorySlot = globals.getFrameDescriptor().findFrameSlot("*home-directory*");
String homeDirectory = (String) globals.getObject(homeDirectorySlot);
file = new File(homeDirectory, path);
//throw new RuntimeException("not implemented");
}
//System.out.println(file.getAbsoluteFile());
try {
switch (direction.getName()) {
case "in":
return new BufferedInputStream(new FileInputStream(file));
case "out":
return new BufferedOutputStream(new FileOutputStream(file));
}
} catch (FileNotFoundException e) {
throw new RuntimeException("file not found:" + e);
}
throw new IllegalArgumentException("invalid direction");
}
示例5: value
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Specialization(guards = "symbol == cachedSymbol", limit = "2")
public Object value(Symbol symbol,
@Cached("symbol") Symbol cachedSymbol,
@Cached("lookupFrameSlot(cachedSymbol)") FrameSlot cachedFrameSlot) {
if (cachedFrameSlot == null) {
throw new RuntimeException("value: not set: " + symbol);
}
try {
return this.getContext().getGlobalFrame().getObject(cachedFrameSlot);
} catch (FrameSlotTypeException e) {
throw new RuntimeException("value: frame slot type", e);
}
}
示例6: valueSlow
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Specialization(replaces = "value")
public Object valueSlow(Symbol symbol) {
CompilerDirectives.transferToInterpreterAndInvalidate();
FrameSlot frameSlot = lookupFrameSlot(symbol);
if (frameSlot == null) {
throw new RuntimeException("value: not set: " + symbol);
}
try {
return this.getContext().getGlobalFrame().getObject(frameSlot);
} catch (FrameSlotTypeException e) {
throw new RuntimeException("value: frame slot type", e);
}
}
示例7: execute
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public int execute(VirtualFrame frame) {
try {
return frame.getInt(slot);
} catch (FrameSlotTypeException e) {
throw new IllegalStateException(e);
}
}
示例8: getInt
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
protected int getInt(VirtualFrame frame, int stackIndex) {
try {
return frame.getInt(stack[stackIndex]);
} catch (FrameSlotTypeException e) {
throw new IllegalStateException("Error accessing stack slot " + stackIndex);
}
}
示例9: getByte
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public byte getByte(FrameSlot slot) throws FrameSlotTypeException {
Object result = getObject(slot);
if (CompilerDirectives.inInterpreter() && !(result instanceof Byte)) {
throw new FrameSlotTypeException();
}
return (Byte) result;
}
示例10: getBoolean
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public boolean getBoolean(FrameSlot slot) throws FrameSlotTypeException {
Object result = getObject(slot);
if (CompilerDirectives.inInterpreter() && !(result instanceof Boolean)) {
throw new FrameSlotTypeException();
}
return (Boolean) result;
}
示例11: getFloat
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public float getFloat(FrameSlot slot) throws FrameSlotTypeException {
Object result = getObject(slot);
if (CompilerDirectives.inInterpreter() && !(result instanceof Float)) {
throw new FrameSlotTypeException();
}
return (Float) result;
}
示例12: getLong
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public long getLong(FrameSlot slot) throws FrameSlotTypeException {
Object result = getObject(slot);
if (CompilerDirectives.inInterpreter() && !(result instanceof Long)) {
throw new FrameSlotTypeException();
}
return (Long) result;
}
示例13: getInt
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public int getInt(FrameSlot slot) throws FrameSlotTypeException {
Object result = getObject(slot);
if (CompilerDirectives.inInterpreter() && !(result instanceof Integer)) {
throw new FrameSlotTypeException();
}
return (Integer) result;
}
示例14: getDouble
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
@Override
public double getDouble(FrameSlot slot) throws FrameSlotTypeException {
Object result = getObject(slot);
if (CompilerDirectives.inInterpreter() && !(result instanceof Double)) {
throw new FrameSlotTypeException();
}
return (Double) result;
}
示例15: verifyGet
import com.oracle.truffle.api.frame.FrameSlotTypeException; //导入依赖的package包/类
private boolean verifyGet(int slotIndex, byte tag) throws FrameSlotTypeException {
checkSlotIndex(slotIndex);
boolean condition = getTags()[slotIndex] == tag;
if (!condition) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new FrameSlotTypeException();
}
return condition;
}