# HG changeset patch # User Lukas Stadler # Date 1398329052 -7200 # Node ID bf5d4bec3f29ac27a852cf458a3993d1aad2276b # Parent c216071b1a00aa6203cee41f4217cb861ec12f6c fix ProfileCompiledMethods for OSR methods diff -r c216071b1a00 -r bf5d4bec3f29 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 10:44:12 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ProfileCompiledMethodsPhase.java Thu Apr 24 10:44:12 2014 +0200 @@ -72,7 +72,14 @@ addSectionCounters(loop.header.getBeginNode(), loop.blocks, loop.children, schedule, probabilities); } } - addSectionCounters(graph.start(), Arrays.asList(cfg.getBlocks()), cfg.getLoops(), schedule, probabilities); + // don't put the counter increase directly after the start (problems with OSR) + FixedWithNextNode current = graph.start(); + while (current.next() instanceof FixedWithNextNode) { + current = (FixedWithNextNode) current.next(); + } + if (graph.getEntryBCI() != -1) { + addSectionCounters(current, Arrays.asList(cfg.getBlocks()), cfg.getLoops(), schedule, probabilities); + } } private static void addSectionCounters(FixedWithNextNode start, Collection sectionBlocks, Collection> childLoops, SchedulePhase schedule, NodesToDoubles probabilities) {