Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java @ 13803:e076c87ab175
Truffle: refactored inlining interfaces to a more compact CallNode.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 24 Jan 2014 15:55:41 +0100 |
parents | 4281521dc39a |
children | 739194d1e813 |
comparison
equal
deleted
inserted
replaced
13750:a03cb658e68e | 13803:e076c87ab175 |
---|---|
259 continue; | 259 continue; |
260 } | 260 } |
261 | 261 |
262 int notInlinedCallSiteCount = TruffleInliningImpl.getInlinableCallSites(callTarget).size(); | 262 int notInlinedCallSiteCount = TruffleInliningImpl.getInlinableCallSites(callTarget).size(); |
263 int nodeCount = NodeUtil.countNodes(callTarget.rootNode); | 263 int nodeCount = NodeUtil.countNodes(callTarget.rootNode); |
264 int inlinedCallSiteCount = NodeUtil.countNodes(callTarget.rootNode, InlinedCallSite.class); | 264 int inlinedCallSiteCount = countInlinedNodes(callTarget.rootNode); |
265 String comment = callTarget.installedCode == null ? " int" : ""; | 265 String comment = callTarget.installedCode == null ? " int" : ""; |
266 comment += callTarget.compilationEnabled ? "" : " fail"; | 266 comment += callTarget.compilationEnabled ? "" : " fail"; |
267 OUT.printf("%-50s | %10d | %15d | %15d | %10d | %3d%s\n", callTarget.getRootNode(), callTarget.callCount, inlinedCallSiteCount, notInlinedCallSiteCount, nodeCount, | 267 OUT.printf("%-50s | %10d | %15d | %15d | %10d | %3d%s\n", callTarget.getRootNode(), callTarget.callCount, inlinedCallSiteCount, notInlinedCallSiteCount, nodeCount, |
268 callTarget.getCompilationProfile().getInvalidationCount(), comment); | 268 callTarget.getCompilationProfile().getInvalidationCount(), comment); |
269 | 269 |
274 totalInvalidationCount += callTarget.getCompilationProfile().getInvalidationCount(); | 274 totalInvalidationCount += callTarget.getCompilationProfile().getInvalidationCount(); |
275 } | 275 } |
276 OUT.printf("%-50s | %10d | %15d | %15d | %10d | %3d\n", "Total", totalCallCount, totalInlinedCallSiteCount, totalNotInlinedCallSiteCount, totalNodeCount, totalInvalidationCount); | 276 OUT.printf("%-50s | %10d | %15d | %15d | %10d | %3d\n", "Total", totalCallCount, totalInlinedCallSiteCount, totalNotInlinedCallSiteCount, totalNodeCount, totalInvalidationCount); |
277 } | 277 } |
278 | 278 |
279 private static int countInlinedNodes(Node rootNode) { | |
280 List<CallNode> callers = NodeUtil.findAllNodeInstances(rootNode, CallNode.class); | |
281 int count = 0; | |
282 for (CallNode callNode : callers) { | |
283 if (callNode.isInlined()) { | |
284 count++; | |
285 } | |
286 } | |
287 return count; | |
288 } | |
289 | |
279 private static void registerCallTarget(OptimizedCallTarget callTarget) { | 290 private static void registerCallTarget(OptimizedCallTarget callTarget) { |
280 callTargets.put(callTarget, 0); | 291 callTargets.put(callTarget, 0); |
281 } | 292 } |
282 | 293 |
283 private static Map<OptimizedCallTarget, Integer> callTargets; | 294 private static Map<OptimizedCallTarget, Integer> callTargets; |