# HG changeset patch # User Christos Kotselidis # Date 1373273802 -7200 # Node ID add96a4e79f701e442be64202d230496123a95e1 # Parent 2e82291febf498f9a3d6a3d2153fcbaffdb8f386# Parent 3c2a77f01e8932ba590d5ba277e3209e5ed925b5 Merge diff -r 2e82291febf4 -r add96a4e79f7 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Mon Jul 08 09:08:43 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Mon Jul 08 10:56:42 2013 +0200 @@ -40,8 +40,6 @@ import com.oracle.graal.nodes.spi.Lowerable.LoweringType; import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; -import com.oracle.graal.phases.common.InliningUtil.InlineInfo; -import com.oracle.graal.phases.common.InliningUtil.InliningPolicy; import com.oracle.graal.phases.tiers.*; /** @@ -206,7 +204,7 @@ public void run() { StructuredGraph graph = parse(snippet); HighTierContext context = new HighTierContext(runtime(), new Assumptions(false), replacements); - new InliningPhase(runtime(), replacements, context.getAssumptions(), null, getDefaultPhasePlan(), OptimisticOptimizations.ALL, new InlineAllPolicy()).apply(graph); + new InliningPhase(runtime(), replacements, context.getAssumptions(), null, getDefaultPhasePlan(), OptimisticOptimizations.ALL, new InliningPhase.InlineEverythingPolicy()).apply(graph); new LoweringPhase(LoweringType.BEFORE_GUARDS).apply(graph, context); new WriteBarrierAdditionPhase().apply(graph); Debug.dump(graph, "After Write Barrier Addition"); @@ -253,17 +251,4 @@ HotSpotInstalledCode code = getInstalledCode(snippet); code.execute(a, b, c); } - - final class InlineAllPolicy implements InliningPolicy { - - @Override - public boolean continueInlining(StructuredGraph graph) { - return true; - } - - @Override - public boolean isWorthInlining(InlineInfo info, int inliningDepth, double probability, double relevance, boolean fullyProcessed) { - return true; - } - } } diff -r 2e82291febf4 -r add96a4e79f7 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Mon Jul 08 09:08:43 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Mon Jul 08 10:56:42 2013 +0200 @@ -431,7 +431,7 @@ } } - private static class GreedyInliningPolicy extends AbstractInliningPolicy { + private static final class GreedyInliningPolicy extends AbstractInliningPolicy { public GreedyInliningPolicy(Replacements replacements, Map hints) { super(replacements, hints); @@ -488,6 +488,20 @@ } } + public static final class InlineEverythingPolicy implements InliningPolicy { + + public boolean continueInlining(StructuredGraph graph) { + if (graph.getNodeCount() >= MaximumDesiredSize.getValue()) { + throw new BailoutException("Inline all calls failed. The resulting graph is too large."); + } + return true; + } + + public boolean isWorthInlining(InlineInfo info, int inliningDepth, double probability, double relevance, boolean fullyProcessed) { + return true; + } + } + private static class InliningIterator { private final FixedNode start; diff -r 2e82291febf4 -r add96a4e79f7 src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Mon Jul 08 09:08:43 2013 +0200 +++ b/src/share/vm/code/nmethod.cpp Mon Jul 08 10:56:42 2013 +0200 @@ -518,7 +518,7 @@ code_buffer, frame_size, basic_lock_owner_sp_offset, basic_lock_sp_offset, oop_maps); - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); + if (nm != NULL) nmethod_stats.note_native_nmethod(nm); if (PrintAssembly && nm != NULL) { Disassembler::decode(nm); } @@ -554,7 +554,7 @@ nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); + if (nm != NULL) nmethod_stats.note_nmethod(nm); if (PrintAssembly && nm != NULL) { Disassembler::decode(nm); } @@ -639,7 +639,7 @@ InstanceKlass::cast(klass)->add_dependent_nmethod(nm); } } - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); + if (nm != NULL) nmethod_stats.note_nmethod(nm); if (PrintAssembly && nm != NULL) { Disassembler::decode(nm); } diff -r 2e82291febf4 -r add96a4e79f7 src/share/vm/runtime/globals.hpp