< prev index next >

src/hotspot/share/opto/type.cpp

Print this page

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

5092     }
5093   }
5094   return result;
5095 }
5096 
5097 
5098 //------------------------------xdual------------------------------------------
5099 // Dual: compute field-by-field dual
5100 const Type *TypeAryPtr::xdual() const {
5101   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());
5102 }
5103 
5104 //------------------------------dump2------------------------------------------
5105 #ifndef PRODUCT
5106 void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
5107   st->print("aryptr:");
5108   _ary->dump2(d, depth, st);
5109   _interfaces->dump(st);
5110 
5111   if (_ptr == Constant) {

5112     const_oop()->print(st);
5113   }
5114 
5115   st->print(":%s", ptr_msg[_ptr]);
5116   if (_klass_is_exact) {
5117     st->print(":exact");
5118   }
5119 
5120   if( _offset != 0 ) {
5121     BasicType basic_elem_type = elem()->basic_type();
5122     int header_size = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
5123     if( _offset == OffsetTop )       st->print("+undefined");
5124     else if( _offset == OffsetBot )  st->print("+any");
5125     else if( _offset < header_size ) st->print("+%d", _offset);
5126     else {
5127       if (basic_elem_type == T_ILLEGAL) {
5128         st->print("+any");
5129       } else {
5130         int elem_size = type2aelembytes(basic_elem_type);
5131         st->print("[%d]", (_offset - header_size)/elem_size);

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

5092     }
5093   }
5094   return result;
5095 }
5096 
5097 
5098 //------------------------------xdual------------------------------------------
5099 // Dual: compute field-by-field dual
5100 const Type *TypeAryPtr::xdual() const {
5101   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());
5102 }
5103 
5104 //------------------------------dump2------------------------------------------
5105 #ifndef PRODUCT
5106 void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
5107   st->print("aryptr:");
5108   _ary->dump2(d, depth, st);
5109   _interfaces->dump(st);
5110 
5111   if (_ptr == Constant) {
5112     st->print(" " INTPTR_FORMAT " ", p2i(const_oop()));
5113     const_oop()->print(st);
5114   }
5115 
5116   st->print(":%s", ptr_msg[_ptr]);
5117   if (_klass_is_exact) {
5118     st->print(":exact");
5119   }
5120 
5121   if( _offset != 0 ) {
5122     BasicType basic_elem_type = elem()->basic_type();
5123     int header_size = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
5124     if( _offset == OffsetTop )       st->print("+undefined");
5125     else if( _offset == OffsetBot )  st->print("+any");
5126     else if( _offset < header_size ) st->print("+%d", _offset);
5127     else {
5128       if (basic_elem_type == T_ILLEGAL) {
5129         st->print("+any");
5130       } else {
5131         int elem_size = type2aelembytes(basic_elem_type);
5132         st->print("[%d]", (_offset - header_size)/elem_size);
< prev index next >