src/share/vm/opto/type.cpp

changeset 1255
915cc9c5ebc6
parent 1063
7bb995fbd3c0
child 1262
bf3489cc0aa0
     1.1 --- a/src/share/vm/opto/type.cpp	Wed Jun 10 12:19:48 2009 -0700
     1.2 +++ b/src/share/vm/opto/type.cpp	Tue Jun 23 17:52:29 2009 -0700
     1.3 @@ -487,6 +487,23 @@
     1.4    return false;
     1.5  }
     1.6  
     1.7 +//----------------------interface_vs_oop---------------------------------------
     1.8 +#ifdef ASSERT
     1.9 +bool Type::interface_vs_oop(const Type *t) const {
    1.10 +  bool result = false;
    1.11 +
    1.12 +  const TypeInstPtr* this_inst = this->isa_instptr();
    1.13 +  const TypeInstPtr*    t_inst =    t->isa_instptr();
    1.14 +  if( this_inst && this_inst->is_loaded() && t_inst && t_inst->is_loaded() ) {
    1.15 +    bool this_interface = this_inst->klass()->is_interface();
    1.16 +    bool    t_interface =    t_inst->klass()->is_interface();
    1.17 +    result = this_interface ^ t_interface;
    1.18 +  }
    1.19 +
    1.20 +  return result;
    1.21 +}
    1.22 +#endif
    1.23 +
    1.24  //------------------------------meet-------------------------------------------
    1.25  // Compute the MEET of two types.  NOT virtual.  It enforces that meet is
    1.26  // commutative and the lattice is symmetric.
    1.27 @@ -507,16 +524,8 @@
    1.28    // Interface meet Oop is Not Symmetric:
    1.29    // Interface:AnyNull meet Oop:AnyNull == Interface:AnyNull
    1.30    // Interface:NotNull meet Oop:NotNull == java/lang/Object:NotNull
    1.31 -  const TypeInstPtr* this_inst = this->isa_instptr();
    1.32 -  const TypeInstPtr*    t_inst =    t->isa_instptr();
    1.33 -  bool interface_vs_oop = false;
    1.34 -  if( this_inst && this_inst->is_loaded() && t_inst && t_inst->is_loaded() ) {
    1.35 -    bool this_interface = this_inst->klass()->is_interface();
    1.36 -    bool    t_interface =    t_inst->klass()->is_interface();
    1.37 -    interface_vs_oop = this_interface ^ t_interface;
    1.38 -  }
    1.39 -
    1.40 -  if( !interface_vs_oop && (t2t != t->_dual || t2this != _dual) ) {
    1.41 +
    1.42 +  if( !interface_vs_oop(t) && (t2t != t->_dual || t2this != _dual) ) {
    1.43      tty->print_cr("=== Meet Not Symmetric ===");
    1.44      tty->print("t   =                   ");         t->dump(); tty->cr();
    1.45      tty->print("this=                   ");            dump(); tty->cr();
    1.46 @@ -1800,6 +1809,17 @@
    1.47    return (intptr_t)_elem + (intptr_t)_size;
    1.48  }
    1.49  
    1.50 +//----------------------interface_vs_oop---------------------------------------
    1.51 +#ifdef ASSERT
    1.52 +bool TypeAry::interface_vs_oop(const Type *t) const {
    1.53 +  const TypeAry* t_ary = t->is_ary();
    1.54 +  if (t_ary) {
    1.55 +    return _elem->interface_vs_oop(t_ary->_elem);
    1.56 +  }
    1.57 +  return false;
    1.58 +}
    1.59 +#endif
    1.60 +
    1.61  //------------------------------dump2------------------------------------------
    1.62  #ifndef PRODUCT
    1.63  void TypeAry::dump2( Dict &d, uint depth, outputStream *st ) const {
    1.64 @@ -3389,6 +3409,17 @@
    1.65    return new TypeAryPtr( dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id() );
    1.66  }
    1.67  
    1.68 +//----------------------interface_vs_oop---------------------------------------
    1.69 +#ifdef ASSERT
    1.70 +bool TypeAryPtr::interface_vs_oop(const Type *t) const {
    1.71 +  const TypeAryPtr* t_aryptr = t->isa_aryptr();
    1.72 +  if (t_aryptr) {
    1.73 +    return _ary->interface_vs_oop(t_aryptr->_ary);
    1.74 +  }
    1.75 +  return false;
    1.76 +}
    1.77 +#endif
    1.78 +
    1.79  //------------------------------dump2------------------------------------------
    1.80  #ifndef PRODUCT
    1.81  void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {

mercurial