Mon, 23 Jun 2014 13:33:23 +0200
8046289: compiler/6340864/TestLongVect.java timeout with
Reviewed-by: iveresov, vlivanov
src/share/vm/opto/parse.hpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/parse2.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/parse.hpp Wed Sep 10 12:39:11 2014 +0200 1.2 +++ b/src/share/vm/opto/parse.hpp Mon Jun 23 13:33:23 2014 +0200 1.3 @@ -551,8 +551,9 @@ 1.4 1.5 float dynamic_branch_prediction(float &cnt); 1.6 float branch_prediction(float &cnt, BoolTest::mask btest, int target_bci); 1.7 - bool seems_never_taken(float prob); 1.8 - bool seems_stable_comparison(BoolTest::mask btest, Node* c); 1.9 + bool seems_never_taken(float prob) const; 1.10 + bool path_is_suitable_for_uncommon_trap(float prob) const; 1.11 + bool seems_stable_comparison() const; 1.12 1.13 void do_ifnull(BoolTest::mask btest, Node* c); 1.14 void do_if(BoolTest::mask btest, Node* c);
2.1 --- a/src/share/vm/opto/parse2.cpp Wed Sep 10 12:39:11 2014 +0200 2.2 +++ b/src/share/vm/opto/parse2.cpp Mon Jun 23 13:33:23 2014 +0200 2.3 @@ -884,7 +884,7 @@ 2.4 // some branches (e.g., _213_javac.Assembler.eliminate) validly produce 2.5 // very small but nonzero probabilities, which if confused with zero 2.6 // counts would keep the program recompiling indefinitely. 2.7 -bool Parse::seems_never_taken(float prob) { 2.8 +bool Parse::seems_never_taken(float prob) const { 2.9 return prob < PROB_MIN; 2.10 } 2.11 2.12 @@ -896,7 +896,7 @@ 2.13 // already acting in a stable fashion. If the comparison 2.14 // seems stable, we will put an expensive uncommon trap 2.15 // on the untaken path. 2.16 -bool Parse::seems_stable_comparison(BoolTest::mask btest, Node* cmp) { 2.17 +bool Parse::seems_stable_comparison() const { 2.18 if (C->too_many_traps(method(), bci(), Deoptimization::Reason_unstable_if)) { 2.19 return false; 2.20 } 2.21 @@ -1125,6 +1125,14 @@ 2.22 } 2.23 } 2.24 2.25 +bool Parse::path_is_suitable_for_uncommon_trap(float prob) const { 2.26 + // Don't want to speculate on uncommon traps when running with -Xcomp 2.27 + if (!UseInterpreter) { 2.28 + return false; 2.29 + } 2.30 + return (seems_never_taken(prob) && seems_stable_comparison()); 2.31 +} 2.32 + 2.33 //----------------------------adjust_map_after_if------------------------------ 2.34 // Adjust the JVM state to reflect the result of taking this path. 2.35 // Basically, it means inspecting the CmpNode controlling this 2.36 @@ -1138,7 +1146,7 @@ 2.37 2.38 bool is_fallthrough = (path == successor_for_bci(iter().next_bci())); 2.39 2.40 - if (seems_never_taken(prob) && seems_stable_comparison(btest, c)) { 2.41 + if (path_is_suitable_for_uncommon_trap(prob)) { 2.42 repush_if_args(); 2.43 uncommon_trap(Deoptimization::Reason_unstable_if, 2.44 Deoptimization::Action_reinterpret,