src/share/vm/opto/loopPredicate.cpp

changeset 5981
3213ba4d3dff
parent 5110
6f3fd5150b67
child 6198
55fb97c4c58d
     1.1 --- a/src/share/vm/opto/loopPredicate.cpp	Fri Oct 18 12:15:32 2013 -0700
     1.2 +++ b/src/share/vm/opto/loopPredicate.cpp	Sat Oct 19 12:16:43 2013 +0200
     1.3 @@ -41,63 +41,6 @@
     1.4   * checks (such as null checks).
     1.5  */
     1.6  
     1.7 -//-------------------------------is_uncommon_trap_proj----------------------------
     1.8 -// Return true if proj is the form of "proj->[region->..]call_uct"
     1.9 -bool PhaseIdealLoop::is_uncommon_trap_proj(ProjNode* proj, Deoptimization::DeoptReason reason) {
    1.10 -  int path_limit = 10;
    1.11 -  assert(proj, "invalid argument");
    1.12 -  Node* out = proj;
    1.13 -  for (int ct = 0; ct < path_limit; ct++) {
    1.14 -    out = out->unique_ctrl_out();
    1.15 -    if (out == NULL)
    1.16 -      return false;
    1.17 -    if (out->is_CallStaticJava()) {
    1.18 -      int req = out->as_CallStaticJava()->uncommon_trap_request();
    1.19 -      if (req != 0) {
    1.20 -        Deoptimization::DeoptReason trap_reason = Deoptimization::trap_request_reason(req);
    1.21 -        if (trap_reason == reason || reason == Deoptimization::Reason_none) {
    1.22 -           return true;
    1.23 -        }
    1.24 -      }
    1.25 -      return false; // don't do further after call
    1.26 -    }
    1.27 -    if (out->Opcode() != Op_Region)
    1.28 -      return false;
    1.29 -  }
    1.30 -  return false;
    1.31 -}
    1.32 -
    1.33 -//-------------------------------is_uncommon_trap_if_pattern-------------------------
    1.34 -// Return true  for "if(test)-> proj -> ...
    1.35 -//                          |
    1.36 -//                          V
    1.37 -//                      other_proj->[region->..]call_uct"
    1.38 -//
    1.39 -// "must_reason_predicate" means the uct reason must be Reason_predicate
    1.40 -bool PhaseIdealLoop::is_uncommon_trap_if_pattern(ProjNode *proj, Deoptimization::DeoptReason reason) {
    1.41 -  Node *in0 = proj->in(0);
    1.42 -  if (!in0->is_If()) return false;
    1.43 -  // Variation of a dead If node.
    1.44 -  if (in0->outcnt() < 2)  return false;
    1.45 -  IfNode* iff = in0->as_If();
    1.46 -
    1.47 -  // we need "If(Conv2B(Opaque1(...)))" pattern for reason_predicate
    1.48 -  if (reason != Deoptimization::Reason_none) {
    1.49 -    if (iff->in(1)->Opcode() != Op_Conv2B ||
    1.50 -       iff->in(1)->in(1)->Opcode() != Op_Opaque1) {
    1.51 -      return false;
    1.52 -    }
    1.53 -  }
    1.54 -
    1.55 -  ProjNode* other_proj = iff->proj_out(1-proj->_con)->as_Proj();
    1.56 -  if (is_uncommon_trap_proj(other_proj, reason)) {
    1.57 -    assert(reason == Deoptimization::Reason_none ||
    1.58 -           Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list");
    1.59 -    return true;
    1.60 -  }
    1.61 -  return false;
    1.62 -}
    1.63 -
    1.64  //-------------------------------register_control-------------------------
    1.65  void PhaseIdealLoop::register_control(Node* n, IdealLoopTree *loop, Node* pred) {
    1.66    assert(n->is_CFG(), "must be control node");
    1.67 @@ -147,7 +90,7 @@
    1.68  // This code is also used to clone predicates to clonned loops.
    1.69  ProjNode* PhaseIdealLoop::create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry,
    1.70                                                        Deoptimization::DeoptReason reason) {
    1.71 -  assert(is_uncommon_trap_if_pattern(cont_proj, reason), "must be a uct if pattern!");
    1.72 +  assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!");
    1.73    IfNode* iff = cont_proj->in(0)->as_If();
    1.74  
    1.75    ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con);
    1.76 @@ -235,7 +178,7 @@
    1.77  ProjNode* PhaseIterGVN::create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry,
    1.78                                                      Deoptimization::DeoptReason reason) {
    1.79    assert(new_entry != 0, "only used for clone predicate");
    1.80 -  assert(PhaseIdealLoop::is_uncommon_trap_if_pattern(cont_proj, reason), "must be a uct if pattern!");
    1.81 +  assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!");
    1.82    IfNode* iff = cont_proj->in(0)->as_If();
    1.83  
    1.84    ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con);
    1.85 @@ -422,7 +365,7 @@
    1.86  ProjNode* PhaseIdealLoop::find_predicate_insertion_point(Node* start_c, Deoptimization::DeoptReason reason) {
    1.87    if (start_c == NULL || !start_c->is_Proj())
    1.88      return NULL;
    1.89 -  if (is_uncommon_trap_if_pattern(start_c->as_Proj(), reason)) {
    1.90 +  if (start_c->as_Proj()->is_uncommon_trap_if_pattern(reason)) {
    1.91      return start_c->as_Proj();
    1.92    }
    1.93    return NULL;
    1.94 @@ -773,7 +716,7 @@
    1.95      ProjNode* proj = if_proj_list.pop()->as_Proj();
    1.96      IfNode*   iff  = proj->in(0)->as_If();
    1.97  
    1.98 -    if (!is_uncommon_trap_if_pattern(proj, Deoptimization::Reason_none)) {
    1.99 +    if (!proj->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) {
   1.100        if (loop->is_loop_exit(iff)) {
   1.101          // stop processing the remaining projs in the list because the execution of them
   1.102          // depends on the condition of "iff" (iff->in(1)).

mercurial