From 80280245045730b176f39799fb7e8b675638d3e7 Mon Sep 17 00:00:00 2001 From: rbackman Date: Mon, 23 Jun 2014 13:33:23 +0200 Subject: [PATCH] 8046289: compiler/6340864/TestLongVect.java timeout with Reviewed-by: iveresov, vlivanov --- src/share/vm/opto/parse.hpp | 5 +++-- src/share/vm/opto/parse2.cpp | 14 +++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/share/vm/opto/parse.hpp b/src/share/vm/opto/parse.hpp index a83fcefad..49154e6f5 100644 --- a/src/share/vm/opto/parse.hpp +++ b/src/share/vm/opto/parse.hpp @@ -551,8 +551,9 @@ class Parse : public GraphKit { float dynamic_branch_prediction(float &cnt); float branch_prediction(float &cnt, BoolTest::mask btest, int target_bci); - bool seems_never_taken(float prob); - bool seems_stable_comparison(BoolTest::mask btest, Node* c); + bool seems_never_taken(float prob) const; + bool path_is_suitable_for_uncommon_trap(float prob) const; + bool seems_stable_comparison() const; void do_ifnull(BoolTest::mask btest, Node* c); void do_if(BoolTest::mask btest, Node* c); diff --git a/src/share/vm/opto/parse2.cpp b/src/share/vm/opto/parse2.cpp index d84f5398a..453ee34d2 100644 --- a/src/share/vm/opto/parse2.cpp +++ b/src/share/vm/opto/parse2.cpp @@ -884,7 +884,7 @@ float Parse::branch_prediction(float& cnt, // some branches (e.g., _213_javac.Assembler.eliminate) validly produce // very small but nonzero probabilities, which if confused with zero // counts would keep the program recompiling indefinitely. -bool Parse::seems_never_taken(float prob) { +bool Parse::seems_never_taken(float prob) const { return prob < PROB_MIN; } @@ -896,7 +896,7 @@ bool Parse::seems_never_taken(float prob) { // already acting in a stable fashion. If the comparison // seems stable, we will put an expensive uncommon trap // on the untaken path. -bool Parse::seems_stable_comparison(BoolTest::mask btest, Node* cmp) { +bool Parse::seems_stable_comparison() const { if (C->too_many_traps(method(), bci(), Deoptimization::Reason_unstable_if)) { return false; } @@ -1125,6 +1125,14 @@ void Parse::do_if(BoolTest::mask btest, Node* c) { } } +bool Parse::path_is_suitable_for_uncommon_trap(float prob) const { + // Don't want to speculate on uncommon traps when running with -Xcomp + if (!UseInterpreter) { + return false; + } + return (seems_never_taken(prob) && seems_stable_comparison()); +} + //----------------------------adjust_map_after_if------------------------------ // Adjust the JVM state to reflect the result of taking this path. // Basically, it means inspecting the CmpNode controlling this @@ -1138,7 +1146,7 @@ void Parse::adjust_map_after_if(BoolTest::mask btest, Node* c, float prob, bool is_fallthrough = (path == successor_for_bci(iter().next_bci())); - if (seems_never_taken(prob) && seems_stable_comparison(btest, c)) { + if (path_is_suitable_for_uncommon_trap(prob)) { repush_if_args(); uncommon_trap(Deoptimization::Reason_unstable_if, Deoptimization::Action_reinterpret, -- GitLab