< prev index next >

src/hotspot/share/opto/type.cpp

Print this page

4487 }
4488 
4489 bool TypeInstPtr::maybe_java_subtype_of_helper(const TypeOopPtr* other, bool this_exact, bool other_exact) const {
4490   return TypePtr::maybe_java_subtype_of_helper_for_instance(this, other, this_exact, other_exact);
4491 }
4492 
4493 
4494 //------------------------------dump2------------------------------------------
4495 // Dump oop Type
4496 #ifndef PRODUCT
4497 void TypeInstPtr::dump2(Dict &d, uint depth, outputStream* st) const {
4498   // Print the name of the klass.
4499   st->print("instptr:");
4500   klass()->print_name_on(st);
4501   _interfaces->dump(st);
4502 
4503   if (_ptr == Constant && (WizardMode || Verbose)) {
4504     ResourceMark rm;
4505     stringStream ss;
4506 
4507     st->print(" ");
4508     const_oop()->print_oop(&ss);
4509     // 'const_oop->print_oop()' may emit newlines('\n') into ss.
4510     // suppress newlines from it so -XX:+Verbose -XX:+PrintIdeal dumps one-liner for each node.
4511     char* buf = ss.as_string(/* c_heap= */false);
4512     StringUtils::replace_no_expand(buf, "\n", "");
4513     st->print_raw(buf);
4514   }
4515 
4516   st->print(":%s", ptr_msg[_ptr]);
4517   if (_klass_is_exact) {
4518     st->print(":exact");
4519   }
4520 
4521   dump_offset(st);
4522   dump_instance_id(st);
4523   dump_inline_depth(st);
4524   dump_speculative(st);
4525 }
4526 #endif
4527 

5100     }
5101   }
5102   return result;
5103 }
5104 
5105 
5106 //------------------------------xdual------------------------------------------
5107 // Dual: compute field-by-field dual
5108 const Type *TypeAryPtr::xdual() const {
5109   return new TypeAryPtr(dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id(), is_autobox_cache(), dual_speculative(), dual_inline_depth());
5110 }
5111 
5112 //------------------------------dump2------------------------------------------
5113 #ifndef PRODUCT
5114 void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
5115   st->print("aryptr:");
5116   _ary->dump2(d, depth, st);
5117   _interfaces->dump(st);
5118 
5119   if (_ptr == Constant) {

5120     const_oop()->print(st);
5121   }
5122 
5123   st->print(":%s", ptr_msg[_ptr]);
5124   if (_klass_is_exact) {
5125     st->print(":exact");
5126   }
5127 
5128   if( _offset != 0 ) {
5129     BasicType basic_elem_type = elem()->basic_type();
5130     int header_size = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
5131     if( _offset == OffsetTop )       st->print("+undefined");
5132     else if( _offset == OffsetBot )  st->print("+any");
5133     else if( _offset < header_size ) st->print("+%d", _offset);
5134     else {
5135       if (basic_elem_type == T_ILLEGAL) {
5136         st->print("+any");
5137       } else {
5138         int elem_size = type2aelembytes(basic_elem_type);
5139         st->print("[%d]", (_offset - header_size)/elem_size);

4487 }
4488 
4489 bool TypeInstPtr::maybe_java_subtype_of_helper(const TypeOopPtr* other, bool this_exact, bool other_exact) const {
4490   return TypePtr::maybe_java_subtype_of_helper_for_instance(this, other, this_exact, other_exact);
4491 }
4492 
4493 
4494 //------------------------------dump2------------------------------------------
4495 // Dump oop Type
4496 #ifndef PRODUCT
4497 void TypeInstPtr::dump2(Dict &d, uint depth, outputStream* st) const {
4498   // Print the name of the klass.
4499   st->print("instptr:");
4500   klass()->print_name_on(st);
4501   _interfaces->dump(st);
4502 
4503   if (_ptr == Constant && (WizardMode || Verbose)) {
4504     ResourceMark rm;
4505     stringStream ss;
4506 
4507     st->print(" " INTPTR_FORMAT, p2i(const_oop()));
4508     const_oop()->print_oop(&ss);
4509     // 'const_oop->print_oop()' may emit newlines('\n') into ss.
4510     // suppress newlines from it so -XX:+Verbose -XX:+PrintIdeal dumps one-liner for each node.
4511     char* buf = ss.as_string(/* c_heap= */false);
4512     StringUtils::replace_no_expand(buf, "\n", "");
4513     st->print_raw(buf);
4514   }
4515 
4516   st->print(":%s", ptr_msg[_ptr]);
4517   if (_klass_is_exact) {
4518     st->print(":exact");
4519   }
4520 
4521   dump_offset(st);
4522   dump_instance_id(st);
4523   dump_inline_depth(st);
4524   dump_speculative(st);
4525 }
4526 #endif
4527 

5100     }
5101   }
5102   return result;
5103 }
5104 
5105 
5106 //------------------------------xdual------------------------------------------
5107 // Dual: compute field-by-field dual
5108 const Type *TypeAryPtr::xdual() const {
5109   return new TypeAryPtr(dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id(), is_autobox_cache(), dual_speculative(), dual_inline_depth());
5110 }
5111 
5112 //------------------------------dump2------------------------------------------
5113 #ifndef PRODUCT
5114 void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
5115   st->print("aryptr:");
5116   _ary->dump2(d, depth, st);
5117   _interfaces->dump(st);
5118 
5119   if (_ptr == Constant) {
5120     st->print(" " INTPTR_FORMAT " ", p2i(const_oop()));
5121     const_oop()->print(st);
5122   }
5123 
5124   st->print(":%s", ptr_msg[_ptr]);
5125   if (_klass_is_exact) {
5126     st->print(":exact");
5127   }
5128 
5129   if( _offset != 0 ) {
5130     BasicType basic_elem_type = elem()->basic_type();
5131     int header_size = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
5132     if( _offset == OffsetTop )       st->print("+undefined");
5133     else if( _offset == OffsetBot )  st->print("+any");
5134     else if( _offset < header_size ) st->print("+%d", _offset);
5135     else {
5136       if (basic_elem_type == T_ILLEGAL) {
5137         st->print("+any");
5138       } else {
5139         int elem_size = type2aelembytes(basic_elem_type);
5140         st->print("[%d]", (_offset - header_size)/elem_size);
< prev index next >