# HG changeset patch # User Lukas Stadler # Date 1398353448 -7200 # Node ID 24d4b669756e25f6391945011691f56034f130d7 # Parent 44dcd95a4bf6b4a5491952bb3370e8790d1549fd add option to explicitly count invokes to ProfileCompiledMethodsPhase diff -r 44dcd95a4bf6 -r 24d4b669756e graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java Thu Apr 24 17:30:48 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java Thu Apr 24 17:30:48 2014 +0200 @@ -55,8 +55,11 @@ private static final String GROUP_NAME = "~profiled weight"; private static final String GROUP_NAME_WITHOUT = "~profiled weight (invoke-free sections)"; + private static final String GROUP_NAME_INVOKES = "~profiled invokes"; private static final boolean WITH_SECTION_HEADER = false; + private static boolean WITH_INVOKE_FREE_SECTIONS = false; + private static boolean WITH_INVOKES = true; @Override protected void run(StructuredGraph graph) { @@ -78,6 +81,16 @@ current = (FixedWithNextNode) current.next(); } addSectionCounters(current, Arrays.asList(cfg.getBlocks()), cfg.getLoops(), schedule, probabilities); + + if (WITH_INVOKES) { + for (Node node : graph.getNodes()) { + if (node instanceof Invoke) { + Invoke invoke = (Invoke) node; + DynamicCounterNode.addCounterBefore(GROUP_NAME_INVOKES, invoke.callTarget().targetName(), 1, true, invoke.asNode()); + + } + } + } } private static void addSectionCounters(FixedWithNextNode start, Collection sectionBlocks, Collection> childLoops, SchedulePhase schedule, NodesToDoubles probabilities) { @@ -87,7 +100,7 @@ } double weight = getSectionWeight(schedule, probabilities, blocks) / probabilities.get(start); DynamicCounterNode.addCounterBefore(GROUP_NAME, sectionHead(start), (long) weight, true, start.next()); - if (!hasInvoke(blocks)) { + if (WITH_INVOKE_FREE_SECTIONS && !hasInvoke(blocks)) { DynamicCounterNode.addCounterBefore(GROUP_NAME_WITHOUT, sectionHead(start), (long) weight, true, start.next()); } }