Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/call/SLGenericDispatchNode.java @ 15093:5634b199c4da
Truffle: API-change: renamed CallNode to DirectCallNode and added IndirectCallNode.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 14 Apr 2014 20:32:25 +0200 |
parents | d3add9b82b71 |
children |
comparison
equal
deleted
inserted
replaced
15092:c73ce0dd3583 | 15093:5634b199c4da |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.truffle.sl.nodes.call; | 23 package com.oracle.truffle.sl.nodes.call; |
24 | 24 |
25 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; | 25 import com.oracle.truffle.api.*; |
26 import com.oracle.truffle.api.frame.*; | 26 import com.oracle.truffle.api.frame.*; |
27 import com.oracle.truffle.api.frame.FrameInstance.FrameAccess; | 27 import com.oracle.truffle.api.nodes.*; |
28 import com.oracle.truffle.api.impl.*; | |
29 import com.oracle.truffle.sl.runtime.*; | 28 import com.oracle.truffle.sl.runtime.*; |
30 | 29 |
31 /** | 30 /** |
32 * Slow-path code for a call, used when the polymorphic inline cache exceeded its maximum size. Such | 31 * Slow-path code for a call, used when the polymorphic inline cache exceeded its maximum size. Such |
33 * calls are not optimized any further, e.g., no method inlining is performed. | 32 * calls are not optimized any further, e.g., no method inlining is performed. |
34 */ | 33 */ |
35 final class SLGenericDispatchNode extends SLAbstractDispatchNode implements MaterializedFrameNotify { | 34 final class SLGenericDispatchNode extends SLAbstractDispatchNode { |
36 | 35 |
37 @CompilationFinal private FrameAccess outsideFrameAccess = FrameAccess.NONE; | 36 /** |
37 * {@link IndirectCallNode} is part of the Truffle API and handles all the steps necessary for | |
38 * calling a megamorphic call-site. The Graal specific version of this node performs additional | |
39 * optimizations for the fast access of the SimpleLanguage stack trace. | |
40 */ | |
41 @Child private IndirectCallNode callNode = Truffle.getRuntime().createIndirectCallNode(); | |
38 | 42 |
39 @Override | 43 @Override |
40 protected Object executeDispatch(VirtualFrame frame, SLFunction function, Object[] arguments) { | 44 protected Object executeDispatch(VirtualFrame frame, SLFunction function, Object[] arguments) { |
41 /* | 45 /* |
42 * SL has a quite simple call lookup: just ask the function for the current call target, and | 46 * SL has a quite simple call lookup: just ask the function for the current call target, and |
43 * call it. | 47 * call it. |
44 */ | 48 */ |
45 return function.getCallTarget().call(arguments); | 49 return callNode.call(frame, function.getCallTarget(), arguments); |
46 } | 50 } |
47 | 51 |
48 public FrameAccess getOutsideFrameAccess() { | |
49 return outsideFrameAccess; | |
50 } | |
51 | |
52 public void setOutsideFrameAccess(FrameAccess outsideFrameAccess) { | |
53 this.outsideFrameAccess = outsideFrameAccess; | |
54 } | |
55 } | 52 } |