Java Code Examples for com.oracle.truffle.api.nodes.IndirectCallNode#call()
The following examples show how to use
com.oracle.truffle.api.nodes.IndirectCallNode#call() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HashemBebin.java From mr-hashemi with Universal Permissive License v1.0 | 5 votes |
/** * Slow-path code for a call, used when the polymorphic inline cache exceeded its maximum * size specified in <code>INLINE_CACHE_SIZE</code>. Such calls are not optimized any * further, e.g., no method inlining is performed. */ @Specialization(replaces = "doDirect") protected static Object doIndirect(HashemBebin function, Object[] arguments, @Cached IndirectCallNode callNode) { /* *Hashemi has a quite simple call lookup: just ask the function for the current call target, * and call it. */ return callNode.call(function.getCallTarget(), arguments); }
Example 2
Source File: DispatchEagerlyFromStackNode.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = "doesNotNeedSender(method, assumptionProfile)", replaces = {"doDirect", "doDirectWithSender"}, limit = "1") protected static final Object doIndirect(final VirtualFrame frame, final CompiledMethodObject method, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached("create(argumentCount)") final CreateFrameArgumentsNode argumentsNode, @SuppressWarnings("unused") @Shared("assumptionProfile") @Cached("createClassProfile()") final ValueProfile assumptionProfile, @Cached final IndirectCallNode callNode) { return callNode.call(method.getCallTarget(), argumentsNode.execute(frame, method, getContextOrMarkerNode.execute(frame))); }
Example 3
Source File: DispatchEagerlyFromStackNode.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = "!doesNotNeedSender(method, assumptionProfile)", replaces = {"doDirect", "doDirectWithSender"}, limit = "1") protected static final Object doIndirectWithSender(final VirtualFrame frame, final CompiledMethodObject method, @Cached("create(true)") final GetOrCreateContextNode getOrCreateContextNode, @Cached("create(argumentCount)") final CreateFrameArgumentsNode argumentsNode, @SuppressWarnings("unused") @Shared("assumptionProfile") @Cached("createClassProfile()") final ValueProfile assumptionProfile, @Cached final IndirectCallNode callNode) { return callNode.call(method.getCallTarget(), argumentsNode.execute(frame, method, getOrCreateContextNode.executeGet(frame))); }
Example 4
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"closure.getNumArgs() == 1"}, replaces = "doValueDirect") protected static final Object doValueIndirect(final VirtualFrame frame, final BlockClosureObject closure, final Object arg, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { final Object[] frameArguments = FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), 1); frameArguments[FrameAccess.getArgumentStartIndex()] = arg; return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), frameArguments); }
Example 5
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"closure.getNumArgs() == 2"}, replaces = "doValueDirect") protected static final Object doValueIndirect(final VirtualFrame frame, final BlockClosureObject closure, final Object arg1, final Object arg2, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { final Object[] frameArguments = FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), 2); frameArguments[FrameAccess.getArgumentStartIndex()] = arg1; frameArguments[FrameAccess.getArgumentStartIndex() + 1] = arg2; return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), frameArguments); }
Example 6
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"closure.getNumArgs() == 3"}, replaces = "doValueDirect") protected static final Object doValueIndirect(final VirtualFrame frame, final BlockClosureObject closure, final Object arg1, final Object arg2, final Object arg3, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { final Object[] frameArguments = FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), 3); frameArguments[FrameAccess.getArgumentStartIndex()] = arg1; frameArguments[FrameAccess.getArgumentStartIndex() + 1] = arg2; frameArguments[FrameAccess.getArgumentStartIndex() + 2] = arg3; return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), frameArguments); }
Example 7
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"closure.getNumArgs() == 4"}, replaces = "doValue4Direct") protected static final Object doValue4Indirect(final VirtualFrame frame, final BlockClosureObject closure, final Object arg1, final Object arg2, final Object arg3, final Object arg4, @SuppressWarnings("unused") final NotProvided arg5, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { final Object[] frameArguments = FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), 4); frameArguments[FrameAccess.getArgumentStartIndex()] = arg1; frameArguments[FrameAccess.getArgumentStartIndex() + 1] = arg2; frameArguments[FrameAccess.getArgumentStartIndex() + 2] = arg3; frameArguments[FrameAccess.getArgumentStartIndex() + 3] = arg4; return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), frameArguments); }
Example 8
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"!isNotProvided(arg5)", "closure.getNumArgs() == 5"}, replaces = "doValue5Direct") protected static final Object doValue5Indirect(final VirtualFrame frame, final BlockClosureObject closure, final Object arg1, final Object arg2, final Object arg3, final Object arg4, final Object arg5, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { final Object[] frameArguments = FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), 4); frameArguments[FrameAccess.getArgumentStartIndex()] = arg1; frameArguments[FrameAccess.getArgumentStartIndex() + 1] = arg2; frameArguments[FrameAccess.getArgumentStartIndex() + 2] = arg3; frameArguments[FrameAccess.getArgumentStartIndex() + 3] = arg4; frameArguments[FrameAccess.getArgumentStartIndex() + 4] = arg5; return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), frameArguments); }
Example 9
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 5 votes |
@Specialization(guards = {"closure.getNumArgs() == sizeNode.execute(argArray)"}, replaces = "doValueDirect", limit = "1") protected static final Object doValueIndirect(final VirtualFrame frame, final BlockClosureObject closure, final ArrayObject argArray, @SuppressWarnings("unused") @Cached final SqueakObjectSizeNode sizeNode, @Cached("createForFrameArguments()") final ArrayObjectCopyIntoObjectArrayNode copyIntoNode, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { final Object[] frameArguments = FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), sizeNode.execute(argArray)); copyIntoNode.execute(frameArguments, argArray); return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), frameArguments); }
Example 10
Source File: DispatchUneagerlyNode.java From trufflesqueak with MIT License | 4 votes |
@Specialization(replaces = "doDirect") protected static final Object doIndirect(final CompiledMethodObject method, final Object[] receiverAndArguments, final Object contextOrMarker, @Cached final IndirectCallNode callNode) { return callNode.call(method.getCallTarget(), FrameAccess.newWith(method, contextOrMarker, null, receiverAndArguments)); }
Example 11
Source File: BlockClosurePrimitives.java From trufflesqueak with MIT License | 4 votes |
@Specialization(guards = {"closure.getNumArgs() == 0"}, replaces = "doValueDirect") protected static final Object doValueIndirect(final VirtualFrame frame, final BlockClosureObject closure, @Cached final GetContextOrMarkerNode getContextOrMarkerNode, @Cached final IndirectCallNode indirectCallNode) { return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), FrameAccess.newClosureArgumentsTemplate(closure, getContextOrMarkerNode.execute(frame), 0)); }
Example 12
Source File: DispatchClosureNode.java From trufflesqueak with MIT License | 4 votes |
@Specialization(replaces = "doDirect") protected static final Object doIndirect(final BlockClosureObject closure, final Object[] arguments, @Cached final IndirectCallNode indirectCallNode) { return indirectCallNode.call(closure.getCompiledBlock().getCallTarget(), arguments); }
Example 13
Source File: DispatchEagerlyNode.java From trufflesqueak with MIT License | 4 votes |
private static Object callIndirect(final IndirectCallNode callNode, final CompiledMethodObject method, final Object contextOrMarker, final Object[] receiverAndArguments) { return callNode.call(method.getCallTarget(), FrameAccess.newWith(method, contextOrMarker, null, receiverAndArguments)); }