55 { Bottom, T_VOID, "top", false, 0, relocInfo::none }, // Top |
55 { Bottom, T_VOID, "top", false, 0, relocInfo::none }, // Top |
56 { Bad, T_INT, "int:", false, Op_RegI, relocInfo::none }, // Int |
56 { Bad, T_INT, "int:", false, Op_RegI, relocInfo::none }, // Int |
57 { Bad, T_LONG, "long:", false, Op_RegL, relocInfo::none }, // Long |
57 { Bad, T_LONG, "long:", false, Op_RegL, relocInfo::none }, // Long |
58 { Half, T_VOID, "half", false, 0, relocInfo::none }, // Half |
58 { Half, T_VOID, "half", false, 0, relocInfo::none }, // Half |
59 { Bad, T_NARROWOOP, "narrowoop:", false, Op_RegN, relocInfo::none }, // NarrowOop |
59 { Bad, T_NARROWOOP, "narrowoop:", false, Op_RegN, relocInfo::none }, // NarrowOop |
|
60 { Bad, T_NARROWKLASS,"narrowklass:", false, Op_RegN, relocInfo::none }, // NarrowKlass |
60 { Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple |
61 { Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple |
61 { Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array |
62 { Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array |
62 |
63 |
63 #if defined(IA32) || defined(AMD64) |
64 #if defined(IA32) || defined(AMD64) |
64 { Bad, T_ILLEGAL, "vectors:", false, Op_VecS, relocInfo::none }, // VectorS |
65 { Bad, T_ILLEGAL, "vectors:", false, Op_VecS, relocInfo::none }, // VectorS |
330 TypeMetadataPtr::BOTTOM = TypeMetadataPtr::make(TypePtr::BotPTR, NULL, OffsetBot); |
331 TypeMetadataPtr::BOTTOM = TypeMetadataPtr::make(TypePtr::BotPTR, NULL, OffsetBot); |
331 |
332 |
332 TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR ); |
333 TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR ); |
333 TypeNarrowOop::BOTTOM = TypeNarrowOop::make( TypeInstPtr::BOTTOM ); |
334 TypeNarrowOop::BOTTOM = TypeNarrowOop::make( TypeInstPtr::BOTTOM ); |
334 |
335 |
|
336 TypeNarrowKlass::NULL_PTR = TypeNarrowKlass::make( TypePtr::NULL_PTR ); |
|
337 |
335 mreg2type[Op_Node] = Type::BOTTOM; |
338 mreg2type[Op_Node] = Type::BOTTOM; |
336 mreg2type[Op_Set ] = 0; |
339 mreg2type[Op_Set ] = 0; |
337 mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM; |
340 mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM; |
338 mreg2type[Op_RegI] = TypeInt::INT; |
341 mreg2type[Op_RegI] = TypeInt::INT; |
339 mreg2type[Op_RegP] = TypePtr::BOTTOM; |
342 mreg2type[Op_RegP] = TypePtr::BOTTOM; |
393 const Type **longpair = TypeTuple::fields(2); |
396 const Type **longpair = TypeTuple::fields(2); |
394 longpair[0] = TypeLong::LONG; |
397 longpair[0] = TypeLong::LONG; |
395 longpair[1] = TypeLong::LONG; |
398 longpair[1] = TypeLong::LONG; |
396 TypeTuple::LONG_PAIR = TypeTuple::make(2, longpair); |
399 TypeTuple::LONG_PAIR = TypeTuple::make(2, longpair); |
397 |
400 |
398 _const_basic_type[T_NARROWOOP] = TypeNarrowOop::BOTTOM; |
401 _const_basic_type[T_NARROWOOP] = TypeNarrowOop::BOTTOM; |
399 _const_basic_type[T_BOOLEAN] = TypeInt::BOOL; |
402 _const_basic_type[T_NARROWKLASS] = Type::BOTTOM; |
400 _const_basic_type[T_CHAR] = TypeInt::CHAR; |
403 _const_basic_type[T_BOOLEAN] = TypeInt::BOOL; |
401 _const_basic_type[T_BYTE] = TypeInt::BYTE; |
404 _const_basic_type[T_CHAR] = TypeInt::CHAR; |
402 _const_basic_type[T_SHORT] = TypeInt::SHORT; |
405 _const_basic_type[T_BYTE] = TypeInt::BYTE; |
403 _const_basic_type[T_INT] = TypeInt::INT; |
406 _const_basic_type[T_SHORT] = TypeInt::SHORT; |
404 _const_basic_type[T_LONG] = TypeLong::LONG; |
407 _const_basic_type[T_INT] = TypeInt::INT; |
405 _const_basic_type[T_FLOAT] = Type::FLOAT; |
408 _const_basic_type[T_LONG] = TypeLong::LONG; |
406 _const_basic_type[T_DOUBLE] = Type::DOUBLE; |
409 _const_basic_type[T_FLOAT] = Type::FLOAT; |
407 _const_basic_type[T_OBJECT] = TypeInstPtr::BOTTOM; |
410 _const_basic_type[T_DOUBLE] = Type::DOUBLE; |
408 _const_basic_type[T_ARRAY] = TypeInstPtr::BOTTOM; // there is no separate bottom for arrays |
411 _const_basic_type[T_OBJECT] = TypeInstPtr::BOTTOM; |
409 _const_basic_type[T_VOID] = TypePtr::NULL_PTR; // reflection represents void this way |
412 _const_basic_type[T_ARRAY] = TypeInstPtr::BOTTOM; // there is no separate bottom for arrays |
410 _const_basic_type[T_ADDRESS] = TypeRawPtr::BOTTOM; // both interpreter return addresses & random raw ptrs |
413 _const_basic_type[T_VOID] = TypePtr::NULL_PTR; // reflection represents void this way |
411 _const_basic_type[T_CONFLICT]= Type::BOTTOM; // why not? |
414 _const_basic_type[T_ADDRESS] = TypeRawPtr::BOTTOM; // both interpreter return addresses & random raw ptrs |
412 |
415 _const_basic_type[T_CONFLICT] = Type::BOTTOM; // why not? |
413 _zero_type[T_NARROWOOP] = TypeNarrowOop::NULL_PTR; |
416 |
414 _zero_type[T_BOOLEAN] = TypeInt::ZERO; // false == 0 |
417 _zero_type[T_NARROWOOP] = TypeNarrowOop::NULL_PTR; |
415 _zero_type[T_CHAR] = TypeInt::ZERO; // '\0' == 0 |
418 _zero_type[T_NARROWKLASS] = TypeNarrowKlass::NULL_PTR; |
416 _zero_type[T_BYTE] = TypeInt::ZERO; // 0x00 == 0 |
419 _zero_type[T_BOOLEAN] = TypeInt::ZERO; // false == 0 |
417 _zero_type[T_SHORT] = TypeInt::ZERO; // 0x0000 == 0 |
420 _zero_type[T_CHAR] = TypeInt::ZERO; // '\0' == 0 |
418 _zero_type[T_INT] = TypeInt::ZERO; |
421 _zero_type[T_BYTE] = TypeInt::ZERO; // 0x00 == 0 |
419 _zero_type[T_LONG] = TypeLong::ZERO; |
422 _zero_type[T_SHORT] = TypeInt::ZERO; // 0x0000 == 0 |
420 _zero_type[T_FLOAT] = TypeF::ZERO; |
423 _zero_type[T_INT] = TypeInt::ZERO; |
421 _zero_type[T_DOUBLE] = TypeD::ZERO; |
424 _zero_type[T_LONG] = TypeLong::ZERO; |
422 _zero_type[T_OBJECT] = TypePtr::NULL_PTR; |
425 _zero_type[T_FLOAT] = TypeF::ZERO; |
423 _zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop |
426 _zero_type[T_DOUBLE] = TypeD::ZERO; |
424 _zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null |
427 _zero_type[T_OBJECT] = TypePtr::NULL_PTR; |
425 _zero_type[T_VOID] = Type::TOP; // the only void value is no value at all |
428 _zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop |
|
429 _zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null |
|
430 _zero_type[T_VOID] = Type::TOP; // the only void value is no value at all |
426 |
431 |
427 // get_zero_type() should not happen for T_CONFLICT |
432 // get_zero_type() should not happen for T_CONFLICT |
428 _zero_type[T_CONFLICT]= NULL; |
433 _zero_type[T_CONFLICT]= NULL; |
429 |
434 |
430 // Vector predefined types, it needs initialized _const_basic_type[]. |
435 // Vector predefined types, it needs initialized _const_basic_type[]. |
561 const Type *Type::meet( const Type *t ) const { |
566 const Type *Type::meet( const Type *t ) const { |
562 if (isa_narrowoop() && t->isa_narrowoop()) { |
567 if (isa_narrowoop() && t->isa_narrowoop()) { |
563 const Type* result = make_ptr()->meet(t->make_ptr()); |
568 const Type* result = make_ptr()->meet(t->make_ptr()); |
564 return result->make_narrowoop(); |
569 return result->make_narrowoop(); |
565 } |
570 } |
|
571 if (isa_narrowklass() && t->isa_narrowklass()) { |
|
572 const Type* result = make_ptr()->meet(t->make_ptr()); |
|
573 return result->make_narrowklass(); |
|
574 } |
566 |
575 |
567 const Type *mt = xmeet(t); |
576 const Type *mt = xmeet(t); |
568 if (isa_narrowoop() || t->isa_narrowoop()) return mt; |
577 if (isa_narrowoop() || t->isa_narrowoop()) return mt; |
|
578 if (isa_narrowklass() || t->isa_narrowklass()) return mt; |
569 #ifdef ASSERT |
579 #ifdef ASSERT |
570 assert( mt == t->xmeet(this), "meet not commutative" ); |
580 assert( mt == t->xmeet(this), "meet not commutative" ); |
571 const Type* dual_join = mt->_dual; |
581 const Type* dual_join = mt->_dual; |
572 const Type *t2t = dual_join->xmeet(t->_dual); |
582 const Type *t2t = dual_join->xmeet(t->_dual); |
573 const Type *t2this = dual_join->xmeet( _dual); |
583 const Type *t2this = dual_join->xmeet( _dual); |
691 Bottom, // Top |
704 Bottom, // Top |
692 Bad, // Int - handled in v-call |
705 Bad, // Int - handled in v-call |
693 Bad, // Long - handled in v-call |
706 Bad, // Long - handled in v-call |
694 Half, // Half |
707 Half, // Half |
695 Bad, // NarrowOop - handled in v-call |
708 Bad, // NarrowOop - handled in v-call |
|
709 Bad, // NarrowKlass - handled in v-call |
696 |
710 |
697 Bad, // Tuple - handled in v-call |
711 Bad, // Tuple - handled in v-call |
698 Bad, // Array - handled in v-call |
712 Bad, // Array - handled in v-call |
699 Bad, // VectorS - handled in v-call |
713 Bad, // VectorS - handled in v-call |
700 Bad, // VectorD - handled in v-call |
714 Bad, // VectorD - handled in v-call |
2348 TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ) |
2369 TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ) |
2349 : TypePtr(t, ptr, offset), |
2370 : TypePtr(t, ptr, offset), |
2350 _const_oop(o), _klass(k), |
2371 _const_oop(o), _klass(k), |
2351 _klass_is_exact(xk), |
2372 _klass_is_exact(xk), |
2352 _is_ptr_to_narrowoop(false), |
2373 _is_ptr_to_narrowoop(false), |
|
2374 _is_ptr_to_narrowklass(false), |
2353 _instance_id(instance_id) { |
2375 _instance_id(instance_id) { |
2354 #ifdef _LP64 |
2376 #ifdef _LP64 |
2355 if (UseCompressedOops && _offset != 0) { |
2377 if (_offset != 0) { |
2356 if (_offset == oopDesc::klass_offset_in_bytes()) { |
2378 if (_offset == oopDesc::klass_offset_in_bytes()) { |
2357 _is_ptr_to_narrowoop = UseCompressedKlassPointers; |
2379 _is_ptr_to_narrowklass = UseCompressedKlassPointers; |
2358 } else if (klass() == NULL) { |
2380 } else if (klass() == NULL) { |
2359 // Array with unknown body type |
2381 // Array with unknown body type |
2360 assert(this->isa_aryptr(), "only arrays without klass"); |
2382 assert(this->isa_aryptr(), "only arrays without klass"); |
2361 _is_ptr_to_narrowoop = true; |
2383 _is_ptr_to_narrowoop = UseCompressedOops; |
2362 } else if (this->isa_aryptr()) { |
2384 } else if (this->isa_aryptr()) { |
2363 _is_ptr_to_narrowoop = (klass()->is_obj_array_klass() && |
2385 _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() && |
2364 _offset != arrayOopDesc::length_offset_in_bytes()); |
2386 _offset != arrayOopDesc::length_offset_in_bytes()); |
2365 } else if (klass()->is_instance_klass()) { |
2387 } else if (klass()->is_instance_klass()) { |
2366 ciInstanceKlass* ik = klass()->as_instance_klass(); |
2388 ciInstanceKlass* ik = klass()->as_instance_klass(); |
2367 ciField* field = NULL; |
2389 ciField* field = NULL; |
2368 if (this->isa_klassptr()) { |
2390 if (this->isa_klassptr()) { |
2369 // Perm objects don't use compressed references |
2391 // Perm objects don't use compressed references |
2370 } else if (_offset == OffsetBot || _offset == OffsetTop) { |
2392 } else if (_offset == OffsetBot || _offset == OffsetTop) { |
2371 // unsafe access |
2393 // unsafe access |
2372 _is_ptr_to_narrowoop = true; |
2394 _is_ptr_to_narrowoop = UseCompressedOops; |
2373 } else { // exclude unsafe ops |
2395 } else { // exclude unsafe ops |
2374 assert(this->isa_instptr(), "must be an instance ptr."); |
2396 assert(this->isa_instptr(), "must be an instance ptr."); |
2375 |
2397 |
2376 if (klass() == ciEnv::current()->Class_klass() && |
2398 if (klass() == ciEnv::current()->Class_klass() && |
2377 (_offset == java_lang_Class::klass_offset_in_bytes() || |
2399 (_offset == java_lang_Class::klass_offset_in_bytes() || |
2385 assert(o != NULL, "must be constant"); |
2407 assert(o != NULL, "must be constant"); |
2386 ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass(); |
2408 ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass(); |
2387 ciField* field = k->get_field_by_offset(_offset, true); |
2409 ciField* field = k->get_field_by_offset(_offset, true); |
2388 assert(field != NULL, "missing field"); |
2410 assert(field != NULL, "missing field"); |
2389 BasicType basic_elem_type = field->layout_type(); |
2411 BasicType basic_elem_type = field->layout_type(); |
2390 _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT || |
2412 _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT || |
2391 basic_elem_type == T_ARRAY); |
2413 basic_elem_type == T_ARRAY); |
2392 } else { |
2414 } else { |
2393 // Instance fields which contains a compressed oop references. |
2415 // Instance fields which contains a compressed oop references. |
2394 field = ik->get_field_by_offset(_offset, false); |
2416 field = ik->get_field_by_offset(_offset, false); |
2395 if (field != NULL) { |
2417 if (field != NULL) { |
2396 BasicType basic_elem_type = field->layout_type(); |
2418 BasicType basic_elem_type = field->layout_type(); |
2397 _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT || |
2419 _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT || |
2398 basic_elem_type == T_ARRAY); |
2420 basic_elem_type == T_ARRAY); |
2399 } else if (klass()->equals(ciEnv::current()->Object_klass())) { |
2421 } else if (klass()->equals(ciEnv::current()->Object_klass())) { |
2400 // Compile::find_alias_type() cast exactness on all types to verify |
2422 // Compile::find_alias_type() cast exactness on all types to verify |
2401 // that it does not affect alias type. |
2423 // that it does not affect alias type. |
2402 _is_ptr_to_narrowoop = true; |
2424 _is_ptr_to_narrowoop = UseCompressedOops; |
2403 } else { |
2425 } else { |
2404 // Type for the copy start in LibraryCallKit::inline_native_clone(). |
2426 // Type for the copy start in LibraryCallKit::inline_native_clone(). |
2405 _is_ptr_to_narrowoop = true; |
2427 _is_ptr_to_narrowoop = UseCompressedOops; |
2406 } |
2428 } |
2407 } |
2429 } |
2408 } |
2430 } |
2409 } |
2431 } |
2410 } |
2432 } |
3669 return make( _ptr, _const_oop, _ary, _klass, _klass_is_exact, xadd_offset(offset), _instance_id ); |
3695 return make( _ptr, _const_oop, _ary, _klass, _klass_is_exact, xadd_offset(offset), _instance_id ); |
3670 } |
3696 } |
3671 |
3697 |
3672 |
3698 |
3673 //============================================================================= |
3699 //============================================================================= |
3674 const TypeNarrowOop *TypeNarrowOop::BOTTOM; |
|
3675 const TypeNarrowOop *TypeNarrowOop::NULL_PTR; |
|
3676 |
|
3677 |
|
3678 const TypeNarrowOop* TypeNarrowOop::make(const TypePtr* type) { |
|
3679 return (const TypeNarrowOop*)(new TypeNarrowOop(type))->hashcons(); |
|
3680 } |
|
3681 |
3700 |
3682 //------------------------------hash------------------------------------------- |
3701 //------------------------------hash------------------------------------------- |
3683 // Type-specific hashing function. |
3702 // Type-specific hashing function. |
3684 int TypeNarrowOop::hash(void) const { |
3703 int TypeNarrowPtr::hash(void) const { |
3685 return _ptrtype->hash() + 7; |
3704 return _ptrtype->hash() + 7; |
3686 } |
3705 } |
3687 |
3706 |
3688 |
3707 bool TypeNarrowPtr::singleton(void) const { // TRUE if type is a singleton |
3689 bool TypeNarrowOop::eq( const Type *t ) const { |
3708 return _ptrtype->singleton(); |
3690 const TypeNarrowOop* tc = t->isa_narrowoop(); |
3709 } |
|
3710 |
|
3711 bool TypeNarrowPtr::empty(void) const { |
|
3712 return _ptrtype->empty(); |
|
3713 } |
|
3714 |
|
3715 intptr_t TypeNarrowPtr::get_con() const { |
|
3716 return _ptrtype->get_con(); |
|
3717 } |
|
3718 |
|
3719 bool TypeNarrowPtr::eq( const Type *t ) const { |
|
3720 const TypeNarrowPtr* tc = isa_same_narrowptr(t); |
3691 if (tc != NULL) { |
3721 if (tc != NULL) { |
3692 if (_ptrtype->base() != tc->_ptrtype->base()) { |
3722 if (_ptrtype->base() != tc->_ptrtype->base()) { |
3693 return false; |
3723 return false; |
3694 } |
3724 } |
3695 return tc->_ptrtype->eq(_ptrtype); |
3725 return tc->_ptrtype->eq(_ptrtype); |
3696 } |
3726 } |
3697 return false; |
3727 return false; |
3698 } |
3728 } |
3699 |
3729 |
3700 bool TypeNarrowOop::singleton(void) const { // TRUE if type is a singleton |
3730 const Type *TypeNarrowPtr::xdual() const { // Compute dual right now. |
3701 return _ptrtype->singleton(); |
3731 const TypePtr* odual = _ptrtype->dual()->is_ptr(); |
3702 } |
3732 return make_same_narrowptr(odual); |
3703 |
3733 } |
3704 bool TypeNarrowOop::empty(void) const { |
3734 |
3705 return _ptrtype->empty(); |
3735 |
|
3736 const Type *TypeNarrowPtr::filter( const Type *kills ) const { |
|
3737 if (isa_same_narrowptr(kills)) { |
|
3738 const Type* ft =_ptrtype->filter(is_same_narrowptr(kills)->_ptrtype); |
|
3739 if (ft->empty()) |
|
3740 return Type::TOP; // Canonical empty value |
|
3741 if (ft->isa_ptr()) { |
|
3742 return make_hash_same_narrowptr(ft->isa_ptr()); |
|
3743 } |
|
3744 return ft; |
|
3745 } else if (kills->isa_ptr()) { |
|
3746 const Type* ft = _ptrtype->join(kills); |
|
3747 if (ft->empty()) |
|
3748 return Type::TOP; // Canonical empty value |
|
3749 return ft; |
|
3750 } else { |
|
3751 return Type::TOP; |
|
3752 } |
3706 } |
3753 } |
3707 |
3754 |
3708 //------------------------------xmeet------------------------------------------ |
3755 //------------------------------xmeet------------------------------------------ |
3709 // Compute the MEET of two types. It returns a new Type object. |
3756 // Compute the MEET of two types. It returns a new Type object. |
3710 const Type *TypeNarrowOop::xmeet( const Type *t ) const { |
3757 const Type *TypeNarrowPtr::xmeet( const Type *t ) const { |
3711 // Perform a fast test for common case; meeting the same types together. |
3758 // Perform a fast test for common case; meeting the same types together. |
3712 if( this == t ) return this; // Meeting same type-rep? |
3759 if( this == t ) return this; // Meeting same type-rep? |
3713 |
3760 |
3714 |
3761 if (t->base() == base()) { |
3715 // Current "this->_base" is OopPtr |
3762 const Type* result = _ptrtype->xmeet(t->make_ptr()); |
|
3763 if (result->isa_ptr()) { |
|
3764 return make_hash_same_narrowptr(result->is_ptr()); |
|
3765 } |
|
3766 return result; |
|
3767 } |
|
3768 |
|
3769 // Current "this->_base" is NarrowKlass or NarrowOop |
3716 switch (t->base()) { // switch on original type |
3770 switch (t->base()) { // switch on original type |
3717 |
3771 |
3718 case Int: // Mixing ints & oops happens when javac |
3772 case Int: // Mixing ints & oops happens when javac |
3719 case Long: // reuses local variables |
3773 case Long: // reuses local variables |
3720 case FloatTop: |
3774 case FloatTop: |
3728 case OopPtr: |
3782 case OopPtr: |
3729 case InstPtr: |
3783 case InstPtr: |
3730 case AryPtr: |
3784 case AryPtr: |
3731 case MetadataPtr: |
3785 case MetadataPtr: |
3732 case KlassPtr: |
3786 case KlassPtr: |
|
3787 case NarrowOop: |
|
3788 case NarrowKlass: |
3733 |
3789 |
3734 case Bottom: // Ye Olde Default |
3790 case Bottom: // Ye Olde Default |
3735 return Type::BOTTOM; |
3791 return Type::BOTTOM; |
3736 case Top: |
3792 case Top: |
3737 return this; |
3793 return this; |
3738 |
3794 |
3739 case NarrowOop: { |
|
3740 const Type* result = _ptrtype->xmeet(t->make_ptr()); |
|
3741 if (result->isa_ptr()) { |
|
3742 return TypeNarrowOop::make(result->is_ptr()); |
|
3743 } |
|
3744 return result; |
|
3745 } |
|
3746 |
|
3747 default: // All else is a mistake |
3795 default: // All else is a mistake |
3748 typerr(t); |
3796 typerr(t); |
3749 |
3797 |
3750 } // End of switch |
3798 } // End of switch |
3751 |
3799 |
3752 return this; |
3800 return this; |
3753 } |
3801 } |
3754 |
3802 |
3755 const Type *TypeNarrowOop::xdual() const { // Compute dual right now. |
3803 #ifndef PRODUCT |
3756 const TypePtr* odual = _ptrtype->dual()->is_ptr(); |
3804 void TypeNarrowPtr::dump2( Dict & d, uint depth, outputStream *st ) const { |
3757 return new TypeNarrowOop(odual); |
3805 _ptrtype->dump2(d, depth, st); |
3758 } |
3806 } |
3759 |
3807 #endif |
3760 const Type *TypeNarrowOop::filter( const Type *kills ) const { |
3808 |
3761 if (kills->isa_narrowoop()) { |
3809 const TypeNarrowOop *TypeNarrowOop::BOTTOM; |
3762 const Type* ft =_ptrtype->filter(kills->is_narrowoop()->_ptrtype); |
3810 const TypeNarrowOop *TypeNarrowOop::NULL_PTR; |
3763 if (ft->empty()) |
3811 |
3764 return Type::TOP; // Canonical empty value |
3812 |
3765 if (ft->isa_ptr()) { |
3813 const TypeNarrowOop* TypeNarrowOop::make(const TypePtr* type) { |
3766 return make(ft->isa_ptr()); |
3814 return (const TypeNarrowOop*)(new TypeNarrowOop(type))->hashcons(); |
3767 } |
3815 } |
3768 return ft; |
3816 |
3769 } else if (kills->isa_ptr()) { |
|
3770 const Type* ft = _ptrtype->join(kills); |
|
3771 if (ft->empty()) |
|
3772 return Type::TOP; // Canonical empty value |
|
3773 return ft; |
|
3774 } else { |
|
3775 return Type::TOP; |
|
3776 } |
|
3777 } |
|
3778 |
|
3779 |
|
3780 intptr_t TypeNarrowOop::get_con() const { |
|
3781 return _ptrtype->get_con(); |
|
3782 } |
|
3783 |
3817 |
3784 #ifndef PRODUCT |
3818 #ifndef PRODUCT |
3785 void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const { |
3819 void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const { |
3786 st->print("narrowoop: "); |
3820 st->print("narrowoop: "); |
3787 _ptrtype->dump2(d, depth, st); |
3821 TypeNarrowPtr::dump2(d, depth, st); |
3788 } |
3822 } |
3789 #endif |
3823 #endif |
3790 |
3824 |
|
3825 const TypeNarrowKlass *TypeNarrowKlass::NULL_PTR; |
|
3826 |
|
3827 const TypeNarrowKlass* TypeNarrowKlass::make(const TypePtr* type) { |
|
3828 return (const TypeNarrowKlass*)(new TypeNarrowKlass(type))->hashcons(); |
|
3829 } |
|
3830 |
|
3831 #ifndef PRODUCT |
|
3832 void TypeNarrowKlass::dump2( Dict & d, uint depth, outputStream *st ) const { |
|
3833 st->print("narrowklass: "); |
|
3834 TypeNarrowPtr::dump2(d, depth, st); |
|
3835 } |
|
3836 #endif |
3791 |
3837 |
3792 |
3838 |
3793 //------------------------------eq--------------------------------------------- |
3839 //------------------------------eq--------------------------------------------- |
3794 // Structural equality check for Type representations |
3840 // Structural equality check for Type representations |
3795 bool TypeMetadataPtr::eq( const Type *t ) const { |
3841 bool TypeMetadataPtr::eq( const Type *t ) const { |