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


Java FrameSlotTypeException类代码示例

本文整理汇总了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;
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:19,代码来源:OptimizedOSRLoopNodeTest.java

示例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());
}
 
开发者ID:ragnard,项目名称:shen-truffle,代码行数:11,代码来源:ReadLexicalClosureVariableNode.java

示例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;
}
 
开发者ID:ragnard,项目名称:shen-truffle,代码行数:10,代码来源:ReadLexicalClosureVariableNode.java

示例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");
}
 
开发者ID:ragnard,项目名称:shen-truffle,代码行数:28,代码来源:Open.java

示例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);
    }
}
 
开发者ID:ragnard,项目名称:shen-truffle,代码行数:14,代码来源:Value.java

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

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

示例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);
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:8,代码来源:BytecodeInterpreterPartialEvaluationTest.java

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

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

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

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

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

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

示例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;
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:10,代码来源:FrameWithoutBoxing.java


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