Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java @ 18762:0ef23ff7d5a1
SL: make lookup of NodeInfo annotation more rebust.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:59 +0100 |
parents | e3c95cbbb50c |
children | cfb85e1f4ca5 |
comparison
equal
deleted
inserted
replaced
18761:a665483c3881 | 18762:0ef23ff7d5a1 |
---|---|
242 if (ss != null && !(ss instanceof NullSourceSection)) { | 242 if (ss != null && !(ss instanceof NullSourceSection)) { |
243 result.append(" at ").append(ss.getSource().getName()).append(" line ").append(ss.getStartLine()).append(" col ").append(ss.getStartColumn()); | 243 result.append(" at ").append(ss.getSource().getName()).append(" line ").append(ss.getStartLine()).append(" col ").append(ss.getStartColumn()); |
244 } | 244 } |
245 } | 245 } |
246 result.append(": operation"); | 246 result.append(": operation"); |
247 if (ex.getNode() != null && ex.getNode().getClass().getAnnotation(NodeInfo.class) != null) { | 247 if (ex.getNode() != null) { |
248 result.append(" \"").append(ex.getNode().getClass().getAnnotation(NodeInfo.class).shortName()).append("\""); | 248 NodeInfo nodeInfo = SLContext.lookupNodeInfo(ex.getNode().getClass()); |
249 if (nodeInfo != null) { | |
250 result.append(" \"").append(nodeInfo.shortName()).append("\""); | |
251 } | |
249 } | 252 } |
250 result.append(" not defined for"); | 253 result.append(" not defined for"); |
251 | 254 |
252 String sep = " "; | 255 String sep = " "; |
253 for (int i = 0; i < ex.getSuppliedValues().length; i++) { | 256 for (int i = 0; i < ex.getSuppliedValues().length; i++) { |