src/share/vm/opto/multnode.cpp

changeset 5110
6f3fd5150b67
parent 4037
da91efe96a93
child 5791
c9ccd7b85f20
     1.1 --- a/src/share/vm/opto/multnode.cpp	Mon May 06 19:49:23 2013 -0700
     1.2 +++ b/src/share/vm/opto/multnode.cpp	Wed May 08 15:08:01 2013 -0700
     1.3 @@ -23,6 +23,7 @@
     1.4   */
     1.5  
     1.6  #include "precompiled.hpp"
     1.7 +#include "opto/callnode.hpp"
     1.8  #include "opto/matcher.hpp"
     1.9  #include "opto/multnode.hpp"
    1.10  #include "opto/opcodes.hpp"
    1.11 @@ -73,13 +74,26 @@
    1.12    return (_con == TypeFunc::Control && def->is_CFG());
    1.13  }
    1.14  
    1.15 +const Type* ProjNode::proj_type(const Type* t) const {
    1.16 +  if (t == Type::TOP) {
    1.17 +    return Type::TOP;
    1.18 +  }
    1.19 +  if (t == Type::BOTTOM) {
    1.20 +    return Type::BOTTOM;
    1.21 +  }
    1.22 +  t = t->is_tuple()->field_at(_con);
    1.23 +  Node* n = in(0);
    1.24 +  if ((_con == TypeFunc::Parms) &&
    1.25 +      n->is_CallStaticJava() && n->as_CallStaticJava()->is_boxing_method()) {
    1.26 +    // The result of autoboxing is always non-null on normal path.
    1.27 +    t = t->join(TypePtr::NOTNULL);
    1.28 +  }
    1.29 +  return t;
    1.30 +}
    1.31 +
    1.32  const Type *ProjNode::bottom_type() const {
    1.33 -  if (in(0) == NULL)  return Type::TOP;
    1.34 -  const Type *tb = in(0)->bottom_type();
    1.35 -  if( tb == Type::TOP ) return Type::TOP;
    1.36 -  if( tb == Type::BOTTOM ) return Type::BOTTOM;
    1.37 -  const TypeTuple *t = tb->is_tuple();
    1.38 -  return t->field_at(_con);
    1.39 +  if (in(0) == NULL) return Type::TOP;
    1.40 +  return proj_type(in(0)->bottom_type());
    1.41  }
    1.42  
    1.43  const TypePtr *ProjNode::adr_type() const {
    1.44 @@ -115,11 +129,8 @@
    1.45  
    1.46  //------------------------------Value------------------------------------------
    1.47  const Type *ProjNode::Value( PhaseTransform *phase ) const {
    1.48 -  if( !in(0) ) return Type::TOP;
    1.49 -  const Type *t = phase->type(in(0));
    1.50 -  if( t == Type::TOP ) return t;
    1.51 -  if( t == Type::BOTTOM ) return t;
    1.52 -  return t->is_tuple()->field_at(_con);
    1.53 +  if (in(0) == NULL) return Type::TOP;
    1.54 +  return proj_type(phase->type(in(0)));
    1.55  }
    1.56  
    1.57  //------------------------------out_RegMask------------------------------------

mercurial