Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/call/SLDispatchNode.java @ 21493:99e3f4c5c853
SL: handle undefined functions gracefully.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 26 May 2015 20:04:07 +0200 |
parents | 2170de9acab0 |
children |
comparison
equal
deleted
inserted
replaced
21492:9e5947d24e63 | 21493:99e3f4c5c853 |
---|---|
31 public abstract class SLDispatchNode extends Node { | 31 public abstract class SLDispatchNode extends Node { |
32 | 32 |
33 protected static final int INLINE_CACHE_SIZE = 2; | 33 protected static final int INLINE_CACHE_SIZE = 2; |
34 | 34 |
35 public abstract Object executeDispatch(VirtualFrame frame, SLFunction function, Object[] arguments); | 35 public abstract Object executeDispatch(VirtualFrame frame, SLFunction function, Object[] arguments); |
36 | |
37 @Specialization(guards = "function.getCallTarget() == null") | |
38 protected Object doUndefinedFunction(SLFunction function, @SuppressWarnings("unused") Object[] arguments) { | |
39 throw new SLUndefinedFunctionException(function.getName()); | |
40 } | |
36 | 41 |
37 /** | 42 /** |
38 * Inline cached specialization of the dispatch. | 43 * Inline cached specialization of the dispatch. |
39 * | 44 * |
40 * <p> | 45 * <p> |