< prev index next >

src/share/vm/opto/type.cpp

Print this page




3951   // Print the name of the klass.
3952   klass()->print_name_on(st);
3953 
3954   switch( _ptr ) {
3955   case Constant:
3956     // TO DO: Make CI print the hex address of the underlying oop.
3957     if (WizardMode || Verbose) {
3958       const_oop()->print_oop(st);
3959     }
3960   case BotPTR:
3961     if (!WizardMode && !Verbose) {
3962       if( _klass_is_exact ) st->print(":exact");
3963       break;
3964     }
3965   case TopPTR:
3966   case AnyNull:
3967   case NotNull:
3968     st->print(":%s", ptr_msg[_ptr]);
3969     if( _klass_is_exact ) st->print(":exact");
3970     break;


3971   }
3972 
3973   if( _offset ) {               // Dump offset, if any
3974     if( _offset == OffsetBot )      st->print("+any");
3975     else if( _offset == OffsetTop ) st->print("+unknown");
3976     else st->print("+%d", _offset);
3977   }
3978 
3979   st->print(" *");
3980   if (_instance_id == InstanceTop)
3981     st->print(",iid=top");
3982   else if (_instance_id != InstanceBot)
3983     st->print(",iid=%d",_instance_id);
3984 
3985   dump_inline_depth(st);
3986   dump_speculative(st);
3987 }
3988 #endif
3989 
3990 //------------------------------add_offset-------------------------------------


4420 
4421 //------------------------------dump2------------------------------------------
4422 #ifndef PRODUCT
4423 void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
4424   _ary->dump2(d,depth,st);
4425   switch( _ptr ) {
4426   case Constant:
4427     const_oop()->print(st);
4428     break;
4429   case BotPTR:
4430     if (!WizardMode && !Verbose) {
4431       if( _klass_is_exact ) st->print(":exact");
4432       break;
4433     }
4434   case TopPTR:
4435   case AnyNull:
4436   case NotNull:
4437     st->print(":%s", ptr_msg[_ptr]);
4438     if( _klass_is_exact ) st->print(":exact");
4439     break;


4440   }
4441 
4442   if( _offset != 0 ) {
4443     int header_size = objArrayOopDesc::header_size() * wordSize;
4444     if( _offset == OffsetTop )       st->print("+undefined");
4445     else if( _offset == OffsetBot )  st->print("+any");
4446     else if( _offset < header_size ) st->print("+%d", _offset);
4447     else {
4448       BasicType basic_elem_type = elem()->basic_type();
4449       int array_base = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
4450       int elem_size = type2aelembytes(basic_elem_type);
4451       st->print("[%d]", (_offset - array_base)/elem_size);
4452     }
4453   }
4454   st->print(" *");
4455   if (_instance_id == InstanceTop)
4456     st->print(",iid=top");
4457   else if (_instance_id != InstanceBot)
4458     st->print(",iid=%d",_instance_id);
4459 


5185 void TypeKlassPtr::dump2( Dict & d, uint depth, outputStream *st ) const {
5186   switch( _ptr ) {
5187   case Constant:
5188     st->print("precise ");
5189   case NotNull:
5190     {
5191       const char *name = klass()->name()->as_utf8();
5192       if( name ) {
5193         st->print("klass %s: " INTPTR_FORMAT, name, p2i(klass()));
5194       } else {
5195         ShouldNotReachHere();
5196       }
5197     }
5198   case BotPTR:
5199     if( !WizardMode && !Verbose && !_klass_is_exact ) break;
5200   case TopPTR:
5201   case AnyNull:
5202     st->print(":%s", ptr_msg[_ptr]);
5203     if( _klass_is_exact ) st->print(":exact");
5204     break;


5205   }
5206 
5207   if( _offset ) {               // Dump offset, if any
5208     if( _offset == OffsetBot )      { st->print("+any"); }
5209     else if( _offset == OffsetTop ) { st->print("+unknown"); }
5210     else                            { st->print("+%d", _offset); }
5211   }
5212 
5213   st->print(" *");
5214 }
5215 #endif
5216 
5217 
5218 
5219 //=============================================================================
5220 // Convenience common pre-built types.
5221 
5222 //------------------------------make-------------------------------------------
5223 const TypeFunc *TypeFunc::make( const TypeTuple *domain, const TypeTuple *range ) {
5224   return (TypeFunc*)(new TypeFunc(domain,range))->hashcons();




3951   // Print the name of the klass.
3952   klass()->print_name_on(st);
3953 
3954   switch( _ptr ) {
3955   case Constant:
3956     // TO DO: Make CI print the hex address of the underlying oop.
3957     if (WizardMode || Verbose) {
3958       const_oop()->print_oop(st);
3959     }
3960   case BotPTR:
3961     if (!WizardMode && !Verbose) {
3962       if( _klass_is_exact ) st->print(":exact");
3963       break;
3964     }
3965   case TopPTR:
3966   case AnyNull:
3967   case NotNull:
3968     st->print(":%s", ptr_msg[_ptr]);
3969     if( _klass_is_exact ) st->print(":exact");
3970     break;
3971   default:
3972     break;
3973   }
3974 
3975   if( _offset ) {               // Dump offset, if any
3976     if( _offset == OffsetBot )      st->print("+any");
3977     else if( _offset == OffsetTop ) st->print("+unknown");
3978     else st->print("+%d", _offset);
3979   }
3980 
3981   st->print(" *");
3982   if (_instance_id == InstanceTop)
3983     st->print(",iid=top");
3984   else if (_instance_id != InstanceBot)
3985     st->print(",iid=%d",_instance_id);
3986 
3987   dump_inline_depth(st);
3988   dump_speculative(st);
3989 }
3990 #endif
3991 
3992 //------------------------------add_offset-------------------------------------


4422 
4423 //------------------------------dump2------------------------------------------
4424 #ifndef PRODUCT
4425 void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
4426   _ary->dump2(d,depth,st);
4427   switch( _ptr ) {
4428   case Constant:
4429     const_oop()->print(st);
4430     break;
4431   case BotPTR:
4432     if (!WizardMode && !Verbose) {
4433       if( _klass_is_exact ) st->print(":exact");
4434       break;
4435     }
4436   case TopPTR:
4437   case AnyNull:
4438   case NotNull:
4439     st->print(":%s", ptr_msg[_ptr]);
4440     if( _klass_is_exact ) st->print(":exact");
4441     break;
4442   default:
4443     break;
4444   }
4445 
4446   if( _offset != 0 ) {
4447     int header_size = objArrayOopDesc::header_size() * wordSize;
4448     if( _offset == OffsetTop )       st->print("+undefined");
4449     else if( _offset == OffsetBot )  st->print("+any");
4450     else if( _offset < header_size ) st->print("+%d", _offset);
4451     else {
4452       BasicType basic_elem_type = elem()->basic_type();
4453       int array_base = arrayOopDesc::base_offset_in_bytes(basic_elem_type);
4454       int elem_size = type2aelembytes(basic_elem_type);
4455       st->print("[%d]", (_offset - array_base)/elem_size);
4456     }
4457   }
4458   st->print(" *");
4459   if (_instance_id == InstanceTop)
4460     st->print(",iid=top");
4461   else if (_instance_id != InstanceBot)
4462     st->print(",iid=%d",_instance_id);
4463 


5189 void TypeKlassPtr::dump2( Dict & d, uint depth, outputStream *st ) const {
5190   switch( _ptr ) {
5191   case Constant:
5192     st->print("precise ");
5193   case NotNull:
5194     {
5195       const char *name = klass()->name()->as_utf8();
5196       if( name ) {
5197         st->print("klass %s: " INTPTR_FORMAT, name, p2i(klass()));
5198       } else {
5199         ShouldNotReachHere();
5200       }
5201     }
5202   case BotPTR:
5203     if( !WizardMode && !Verbose && !_klass_is_exact ) break;
5204   case TopPTR:
5205   case AnyNull:
5206     st->print(":%s", ptr_msg[_ptr]);
5207     if( _klass_is_exact ) st->print(":exact");
5208     break;
5209   default:
5210     break;
5211   }
5212 
5213   if( _offset ) {               // Dump offset, if any
5214     if( _offset == OffsetBot )      { st->print("+any"); }
5215     else if( _offset == OffsetTop ) { st->print("+unknown"); }
5216     else                            { st->print("+%d", _offset); }
5217   }
5218 
5219   st->print(" *");
5220 }
5221 #endif
5222 
5223 
5224 
5225 //=============================================================================
5226 // Convenience common pre-built types.
5227 
5228 //------------------------------make-------------------------------------------
5229 const TypeFunc *TypeFunc::make( const TypeTuple *domain, const TypeTuple *range ) {
5230   return (TypeFunc*)(new TypeFunc(domain,range))->hashcons();


< prev index next >