comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/call/SLUninitializedDispatchNode.java @ 13943:89ac75425681

SL: small cleanups
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 12 Feb 2014 10:30:42 -0800
parents 64c77f0577bb
children 96bd95f62d92
comparison
equal deleted inserted replaced
13942:1ee27cd07ed0 13943:89ac75425681
52 int depth = 0; 52 int depth = 0;
53 while (cur.getParent() instanceof SLAbstractDispatchNode) { 53 while (cur.getParent() instanceof SLAbstractDispatchNode) {
54 cur = cur.getParent(); 54 cur = cur.getParent();
55 depth++; 55 depth++;
56 } 56 }
57 SLCallNode callNode = (SLCallNode) cur.getParent(); 57 SLInvokeNode invokeNode = (SLInvokeNode) cur.getParent();
58 58
59 SLAbstractDispatchNode specialized; 59 SLAbstractDispatchNode specialized;
60 if (function.getCallTarget() == null) { 60 if (function.getCallTarget() == null) {
61 /* Corner case: the function is not defined, so report an error to the user. */ 61 /* Corner case: the function is not defined, so report an error to the user. */
62 throw new SLException("Call of undefined function: " + function.getName()); 62 throw new SLException("Call of undefined function: " + function.getName());
70 70
71 } else { 71 } else {
72 /* Cache size exceeded, fall back to a single generic dispatch node. */ 72 /* Cache size exceeded, fall back to a single generic dispatch node. */
73 SLAbstractDispatchNode generic = new SLGenericDispatchNode(); 73 SLAbstractDispatchNode generic = new SLGenericDispatchNode();
74 /* Replace the whole chain, not just ourself, with the new generic node. */ 74 /* Replace the whole chain, not just ourself, with the new generic node. */
75 specialized = callNode.dispatchNode.replace(generic); 75 specialized = invokeNode.dispatchNode.replace(generic);
76 } 76 }
77 77
78 /* 78 /*
79 * Execute the newly created node perform the actual dispatch. That saves us from 79 * Execute the newly created node perform the actual dispatch. That saves us from
80 * duplicating the actual call logic here. 80 * duplicating the actual call logic here.