src/share/vm/opto/loopPredicate.cpp

changeset 2868
2e038ad0c1d0
parent 2727
08eb13460b3a
child 2877
bad7ecd0b6ed
     1.1 --- a/src/share/vm/opto/loopPredicate.cpp	Mon May 02 10:51:36 2011 -0700
     1.2 +++ b/src/share/vm/opto/loopPredicate.cpp	Mon May 02 18:53:37 2011 -0700
     1.3 @@ -700,32 +700,35 @@
     1.4                                         int scale, Node* offset,
     1.5                                         Node* init, Node* limit, Node* stride,
     1.6                                         Node* range, bool upper) {
     1.7 -  DEBUG_ONLY(ttyLocker ttyl);
     1.8 -  if (TraceLoopPredicate) tty->print("rc_predicate ");
     1.9 +  stringStream* predString = NULL;
    1.10 +  if (TraceLoopPredicate) {
    1.11 +    predString = new stringStream();
    1.12 +    predString->print("rc_predicate ");
    1.13 +  }
    1.14  
    1.15    Node* max_idx_expr  = init;
    1.16    int stride_con = stride->get_int();
    1.17    if ((stride_con > 0) == (scale > 0) == upper) {
    1.18      max_idx_expr = new (C, 3) SubINode(limit, stride);
    1.19      register_new_node(max_idx_expr, ctrl);
    1.20 -    if (TraceLoopPredicate) tty->print("(limit - stride) ");
    1.21 +    if (TraceLoopPredicate) predString->print("(limit - stride) ");
    1.22    } else {
    1.23 -    if (TraceLoopPredicate) tty->print("init ");
    1.24 +    if (TraceLoopPredicate) predString->print("init ");
    1.25    }
    1.26  
    1.27    if (scale != 1) {
    1.28      ConNode* con_scale = _igvn.intcon(scale);
    1.29      max_idx_expr = new (C, 3) MulINode(max_idx_expr, con_scale);
    1.30      register_new_node(max_idx_expr, ctrl);
    1.31 -    if (TraceLoopPredicate) tty->print("* %d ", scale);
    1.32 +    if (TraceLoopPredicate) predString->print("* %d ", scale);
    1.33    }
    1.34  
    1.35    if (offset && (!offset->is_Con() || offset->get_int() != 0)){
    1.36      max_idx_expr = new (C, 3) AddINode(max_idx_expr, offset);
    1.37      register_new_node(max_idx_expr, ctrl);
    1.38      if (TraceLoopPredicate)
    1.39 -      if (offset->is_Con()) tty->print("+ %d ", offset->get_int());
    1.40 -      else tty->print("+ offset ");
    1.41 +      if (offset->is_Con()) predString->print("+ %d ", offset->get_int());
    1.42 +      else predString->print("+ offset ");
    1.43    }
    1.44  
    1.45    CmpUNode* cmp = new (C, 3) CmpUNode(max_idx_expr, range);
    1.46 @@ -733,7 +736,10 @@
    1.47    BoolNode* bol = new (C, 2) BoolNode(cmp, BoolTest::lt);
    1.48    register_new_node(bol, ctrl);
    1.49  
    1.50 -  if (TraceLoopPredicate) tty->print_cr("<u range");
    1.51 +  if (TraceLoopPredicate) {
    1.52 +    predString->print_cr("<u range");
    1.53 +    tty->print(predString->as_string());
    1.54 +  }
    1.55    return bol;
    1.56  }
    1.57  
    1.58 @@ -957,4 +963,3 @@
    1.59  
    1.60    return hoisted;
    1.61  }
    1.62 -

mercurial