本文整理汇总了Java中com.oracle.truffle.api.frame.MaterializedFrame类的典型用法代码示例。如果您正苦于以下问题:Java MaterializedFrame类的具体用法?Java MaterializedFrame怎么用?Java MaterializedFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterializedFrame类属于com.oracle.truffle.api.frame包,在下文中一共展示了MaterializedFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createBindings
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@Specialization(guards = {"needsBindings()"})
public Bindings createBindings(
VirtualFrame frame,
@Cached("createGetBindingsNode()") GetBindingsNode getBindingsNode,
@Cached(value = "createFetchers()", dimensions = 1) Fetcher[] fetchers
) {
Bindings ownBindings = getBindingsNode.executeGetBindings(frame);
Bindings bindings = new Bindings();
if (fetchers.length > 0) {
MaterializedFrame materializedFrame = frame.materialize();
for (Fetcher fetcher : fetchers) {
String name = fetcher.getName();
Binding binding = fetcher.fetch(materializedFrame, ownBindings);
bindings.add(name, binding);
}
}
return bindings;
}
开发者ID:dirk,项目名称:hummingbird2,代码行数:19,代码来源:CreateBindingsNode.java
示例2: determineContext
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@ExplodeLoop
protected final MaterializedFrame determineContext(final Frame frame) {
SObjectWithContext self = (SObjectWithContext) SArguments.rcvr(frame);
int i = contextLevel - 1;
if (i > 0) {
boolean doBuildChain = determineContext == null;
if (doBuildChain) {
determineContext = buildChain(self, i);
}
self = determineContext.getOuterSelf(self);
}
// Graal needs help here to see that this is always a MaterializedFrame
// so, we record explicitly a class profile
return frameType.profile(outerType.profile(self).getContext());
}
开发者ID:smarr,项目名称:SOMns,代码行数:20,代码来源:ContextualNode.java
示例3: executeGeneric
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@Override
public Object executeGeneric(final VirtualFrame frame) {
Object result = expression.executeGeneric(frame);
MaterializedFrame ctx = determineContext(frame);
FrameOnStackMarker marker = getMarkerFromContext(ctx);
if (marker.isOnStack()) {
throw new ReturnException(result, marker);
} else {
CompilerDirectives.transferToInterpreter();
// TODO: this should never be a performance relevant path... do caching if necessary
SBlock block = (SBlock) SArguments.rcvr(frame);
Object self = SArguments.rcvr(ctx);
// Lookup the invokable
SInvokable invokable = (SInvokable) Types.getClassOf(self).lookupMessage(
escapedBlock, AccessModifier.PROTECTED);
return invokable.invoke(call, new Object[] {self, block});
}
}
开发者ID:smarr,项目名称:SOMns,代码行数:24,代码来源:ReturnNonLocalNode.java
示例4: executeGeneric
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@Override
public Object executeGeneric(final VirtualFrame frame) {
Object result = expression.executeGeneric(frame);
MaterializedFrame ctx = determineContext(frame);
FrameOnStackMarker marker = getMarkerFromContext(ctx);
if (marker.isOnStack()) {
throw new ReturnException(result, marker);
} else {
blockEscaped.enter();
SBlock block = (SBlock) SArguments.rcvr(frame);
Object self = SArguments.rcvr(ctx);
return SAbstractObject.sendEscapedBlock(self, block, universe);
}
}
开发者ID:smarr,项目名称:TruffleSOM,代码行数:17,代码来源:ReturnNonLocalNode.java
示例5: getLexicalClosure
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
protected static MaterializedFrame getLexicalClosure(Frame frame) {
Object[] args = frame.getArguments();
if (args.length > 0) {
return (MaterializedFrame) frame.getArguments()[0];
} else {
return null;
}
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:9,代码来源:ExpressionNode.java
示例6: open
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的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
示例7: setFast
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@Specialization(guards = "symbol == cachedSymbol", limit = "2")
public Object setFast(Symbol symbol, Object value,
@Cached("symbol") Symbol cachedSymbol,
@Cached("lookupFrameSlot(cachedSymbol)") FrameSlot cachedFrameSlot,
@Cached("getGlobalFrame()") MaterializedFrame cachedGlobalFrame) {
cachedGlobalFrame.setObject(cachedFrameSlot, value);
return value;
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:9,代码来源:Set.java
示例8: setLexicalClosure
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
public Function setLexicalClosure(MaterializedFrame lexicalScope) {
//this.lexicalScope = lexicalScope;
//return this;
Function x = new Function(this.callTarget, this.arity, this.curriedArgumentValues);
x.lexicalScope = lexicalScope;
x.form = this.form;
return x;
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:9,代码来源:Function.java
示例9: createMaterializedFrame
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@Override
public MaterializedFrame createMaterializedFrame(Object[] arguments, FrameDescriptor frameDescriptor) {
if (LazyFrameBoxingQuery.useFrameWithoutBoxing) {
return new FrameWithoutBoxing(frameDescriptor, arguments);
} else {
return new FrameWithBoxing(frameDescriptor, arguments);
}
}
开发者ID:graalvm,项目名称:graal-core,代码行数:9,代码来源:GraalTruffleRuntime.java
示例10: SClass
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
/**
* The constructor used for instantiating the SClass of an object literal.
*
* @param frame, the current activation.
*/
public SClass(final SObjectWithClass enclosing, final SClass clazz,
final MaterializedFrame frame) {
super(clazz, clazz.getInstanceFactory());
this.enclosingObject = enclosing;
this.context = frame;
}
开发者ID:smarr,项目名称:SOMns,代码行数:12,代码来源:SClass.java
示例11: instantiateClass
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@Specialization(guards = {"sameSuperAndMixins(superclassAndMixins, cachedSuperMixins)"})
public SClass instantiateClass(final SObjectWithClass outerObj,
final Object superclassAndMixins, final MaterializedFrame frame,
@Cached("superclassAndMixins") final Object cachedSuperMixins,
@Cached("createClassFactory(superclassAndMixins)") final ClassFactory factory) {
return instantiate(outerObj, factory, frame);
}
开发者ID:smarr,项目名称:SOMns,代码行数:8,代码来源:InstantiationNode.java
示例12: getLexicalScope
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
protected static MaterializedFrame getLexicalScope(Frame frame) {
Object[] args = frame.getArguments();
if (args.length > 0) {
return (MaterializedFrame) frame.getArguments()[0];
} else {
return null;
}
}
开发者ID:cesquivias,项目名称:mumbler,代码行数:9,代码来源:MumblerNode.java
示例13: determineContext
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
@ExplodeLoop
protected final MaterializedFrame determineContext(final VirtualFrame frame) {
SBlock self = (SBlock) SArguments.rcvr(frame);
int i = contextLevel - 1;
while (i > 0) {
self = (SBlock) self.getOuterSelf();
i--;
}
// Graal needs help here to see that this is always a MaterializedFrame
// so, we record explicitly a class profile
return frameType.profile(self.getContext());
}
开发者ID:smarr,项目名称:TruffleSOM,代码行数:15,代码来源:ContextualNode.java
示例14: getGlobalFrame
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
public MaterializedFrame getGlobalFrame() {
return this.globalFrame;
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:4,代码来源:Context.java
示例15: getGlobalFrame
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
protected MaterializedFrame getGlobalFrame() {
return this.getContext().getGlobalFrame();
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:4,代码来源:Set.java
示例16: lookupFrameSlot
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
protected FrameSlot lookupFrameSlot(Symbol symbol) {
MaterializedFrame globalFrame = this.getContext().getGlobalFrame();
return globalFrame.getFrameDescriptor().findOrAddFrameSlot(symbol.getName());
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:5,代码来源:Set.java
示例17: lookupFrameSlot
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
protected FrameSlot lookupFrameSlot(Symbol symbol) {
MaterializedFrame globalFrame = this.getContext().getGlobalFrame();
return globalFrame.getFrameDescriptor().findFrameSlot(symbol.getName());
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:5,代码来源:Value.java
示例18: getLexicalScope
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
public MaterializedFrame getLexicalScope() {
return lexicalScope;
}
开发者ID:ragnard,项目名称:shen-truffle,代码行数:4,代码来源:Function.java
示例19: fetch
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
public Binding fetch(MaterializedFrame frame, Bindings ownBindings) {
return ownBindings.get(this.name);
}
开发者ID:dirk,项目名称:hummingbird2,代码行数:4,代码来源:CreateBindingsNode.java
示例20: MaterializedBinding
import com.oracle.truffle.api.frame.MaterializedFrame; //导入依赖的package包/类
public MaterializedBinding(String name, MaterializedFrame frame) {
this.frame = frame;
this.name = name;
}
开发者ID:dirk,项目名称:hummingbird2,代码行数:5,代码来源:MaterializedBinding.java
注:本文中的com.oracle.truffle.api.frame.MaterializedFrame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论