< prev index next >

src/share/vm/opto/compile.cpp

Print this page




1578 //            tj->base() == Type::KlassPtr, "No constant oop addresses" );
1579 
1580   return tj;
1581 }
1582 
1583 void Compile::AliasType::Init(int i, const TypePtr* at) {
1584   _index = i;
1585   _adr_type = at;
1586   _field = NULL;
1587   _element = NULL;
1588   _is_rewritable = true; // default
1589   const TypeOopPtr *atoop = (at != NULL) ? at->isa_oopptr() : NULL;
1590   if (atoop != NULL && atoop->is_known_instance()) {
1591     const TypeOopPtr *gt = atoop->cast_to_instance_id(TypeOopPtr::InstanceBot);
1592     _general_index = Compile::current()->get_alias_index(gt);
1593   } else {
1594     _general_index = 0;
1595   }
1596 }
1597 











1598 //---------------------------------print_on------------------------------------
1599 #ifndef PRODUCT
1600 void Compile::AliasType::print_on(outputStream* st) {
1601   if (index() < 10)
1602         st->print("@ <%d> ", index());
1603   else  st->print("@ <%d>",  index());
1604   st->print(is_rewritable() ? "   " : " RO");
1605   int offset = adr_type()->offset();
1606   if (offset == Type::OffsetBot)
1607         st->print(" +any");
1608   else  st->print(" +%-3d", offset);
1609   st->print(" in ");
1610   adr_type()->dump_on(st);
1611   const TypeOopPtr* tjp = adr_type()->isa_oopptr();
1612   if (field() != NULL && tjp) {
1613     if (tjp->klass()  != field()->holder() ||
1614         tjp->offset() != field()->offset_in_bytes()) {
1615       st->print(" != ");
1616       field()->print();
1617       st->print(" ***");




1578 //            tj->base() == Type::KlassPtr, "No constant oop addresses" );
1579 
1580   return tj;
1581 }
1582 
1583 void Compile::AliasType::Init(int i, const TypePtr* at) {
1584   _index = i;
1585   _adr_type = at;
1586   _field = NULL;
1587   _element = NULL;
1588   _is_rewritable = true; // default
1589   const TypeOopPtr *atoop = (at != NULL) ? at->isa_oopptr() : NULL;
1590   if (atoop != NULL && atoop->is_known_instance()) {
1591     const TypeOopPtr *gt = atoop->cast_to_instance_id(TypeOopPtr::InstanceBot);
1592     _general_index = Compile::current()->get_alias_index(gt);
1593   } else {
1594     _general_index = 0;
1595   }
1596 }
1597 
1598 BasicType Compile::AliasType::basic_type() const {
1599   if (element() != NULL) {
1600     const Type* element = adr_type()->is_aryptr()->elem();
1601     return element->isa_narrowoop() ? T_OBJECT : element->array_element_basic_type();
1602   } if (field() != NULL) {
1603     return field()->layout_type();
1604   } else {
1605     return T_ILLEGAL; // unknown
1606   }
1607 }
1608 
1609 //---------------------------------print_on------------------------------------
1610 #ifndef PRODUCT
1611 void Compile::AliasType::print_on(outputStream* st) {
1612   if (index() < 10)
1613         st->print("@ <%d> ", index());
1614   else  st->print("@ <%d>",  index());
1615   st->print(is_rewritable() ? "   " : " RO");
1616   int offset = adr_type()->offset();
1617   if (offset == Type::OffsetBot)
1618         st->print(" +any");
1619   else  st->print(" +%-3d", offset);
1620   st->print(" in ");
1621   adr_type()->dump_on(st);
1622   const TypeOopPtr* tjp = adr_type()->isa_oopptr();
1623   if (field() != NULL && tjp) {
1624     if (tjp->klass()  != field()->holder() ||
1625         tjp->offset() != field()->offset_in_bytes()) {
1626       st->print(" != ");
1627       field()->print();
1628       st->print(" ***");


< prev index next >