3933 const Type *TypeInstPtr::xdual() const { 3934 return new TypeInstPtr(dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id(), dual_speculative(), dual_inline_depth()); 3935 } 3936 3937 //------------------------------eq--------------------------------------------- 3938 // Structural equality check for Type representations 3939 bool TypeInstPtr::eq( const Type *t ) const { 3940 const TypeInstPtr *p = t->is_instptr(); 3941 return 3942 klass()->equals(p->klass()) && 3943 TypeOopPtr::eq(p); // Check sub-type stuff 3944 } 3945 3946 //------------------------------hash------------------------------------------- 3947 // Type-specific hashing function. 3948 int TypeInstPtr::hash(void) const { 3949 int hash = java_add((jint)klass()->hash(), (jint)TypeOopPtr::hash()); 3950 return hash; 3951 } 3952 3953 //------------------------------dump2------------------------------------------ 3954 // Dump oop Type 3955 #ifndef PRODUCT 3956 void TypeInstPtr::dump2( Dict &d, uint depth, outputStream *st ) const { 3957 // Print the name of the klass. 3958 klass()->print_name_on(st); 3959 3960 switch( _ptr ) { 3961 case Constant: 3962 // TO DO: Make CI print the hex address of the underlying oop. 3963 if (WizardMode || Verbose) { 3964 const_oop()->print_oop(st); 3965 } 3966 case BotPTR: 3967 if (!WizardMode && !Verbose) { 3968 if( _klass_is_exact ) st->print(":exact"); 3969 break; 3970 } 3971 case TopPTR: 3972 case AnyNull: | 3933 const Type *TypeInstPtr::xdual() const { 3934 return new TypeInstPtr(dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id(), dual_speculative(), dual_inline_depth()); 3935 } 3936 3937 //------------------------------eq--------------------------------------------- 3938 // Structural equality check for Type representations 3939 bool TypeInstPtr::eq( const Type *t ) const { 3940 const TypeInstPtr *p = t->is_instptr(); 3941 return 3942 klass()->equals(p->klass()) && 3943 TypeOopPtr::eq(p); // Check sub-type stuff 3944 } 3945 3946 //------------------------------hash------------------------------------------- 3947 // Type-specific hashing function. 3948 int TypeInstPtr::hash(void) const { 3949 int hash = java_add((jint)klass()->hash(), (jint)TypeOopPtr::hash()); 3950 return hash; 3951 } 3952 3953 const bool TypeInstPtr::is_value_based() const { 3954 return klass()->is_value_based(); 3955 } 3956 3957 const bool TypeInstPtr::can_be_value_based() const { 3958 return !is_zero_type() && (!klass()->is_loaded() || klass()->is_interface() || klass()->is_java_lang_Object() || klass()->is_value_based()); 3959 } 3960 3961 //------------------------------dump2------------------------------------------ 3962 // Dump oop Type 3963 #ifndef PRODUCT 3964 void TypeInstPtr::dump2( Dict &d, uint depth, outputStream *st ) const { 3965 // Print the name of the klass. 3966 klass()->print_name_on(st); 3967 3968 switch( _ptr ) { 3969 case Constant: 3970 // TO DO: Make CI print the hex address of the underlying oop. 3971 if (WizardMode || Verbose) { 3972 const_oop()->print_oop(st); 3973 } 3974 case BotPTR: 3975 if (!WizardMode && !Verbose) { 3976 if( _klass_is_exact ) st->print(":exact"); 3977 break; 3978 } 3979 case TopPTR: 3980 case AnyNull: |