Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultIndirectCallNode.java @ 16697:5f9c3335edd7
Truffle: fix stack trace for indirect calls with default runtime
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Tue, 05 Aug 2014 11:49:06 +0200 |
parents | 5634b199c4da |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultIndirectCallNode.java Tue Aug 05 12:34:55 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultIndirectCallNode.java Tue Aug 05 11:49:06 2014 +0200 @@ -32,10 +32,32 @@ * This is runtime specific API. Do not use in a guest language. */ final class DefaultIndirectCallNode extends IndirectCallNode { + @Override + public Object call(final VirtualFrame frame, final CallTarget target, Object[] arguments) { + DefaultTruffleRuntime truffleRuntime = (DefaultTruffleRuntime) Truffle.getRuntime(); + final CallTarget currentCallTarget = truffleRuntime.getCurrentFrame().getCallTarget(); + FrameInstance frameInstance = new FrameInstance() { + public Frame getFrame(FrameAccess access, boolean slowPath) { + return frame; + } - @Override - public Object call(VirtualFrame frame, CallTarget target, Object[] arguments) { - return target.call(arguments); + public boolean isVirtualFrame() { + return false; + } + + public Node getCallNode() { + return DefaultIndirectCallNode.this; + } + + public CallTarget getCallTarget() { + return currentCallTarget; + } + }; + truffleRuntime.pushFrame(frameInstance); + try { + return target.call(arguments); + } finally { + truffleRuntime.popFrame(); + } } - }