comparison src/share/vm/opto/type.cpp @ 827:bf3489cc0aa0

6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer") Reviewed-by: kvn
author never
date Wed, 01 Jul 2009 12:22:23 -0700
parents 915cc9c5ebc6
children c7e94e8fff43
comparison
equal deleted inserted replaced
826:3f06f139ef53 827:bf3489cc0aa0
3482 } 3482 }
3483 3483
3484 //------------------------------hash------------------------------------------- 3484 //------------------------------hash-------------------------------------------
3485 // Type-specific hashing function. 3485 // Type-specific hashing function.
3486 int TypeNarrowOop::hash(void) const { 3486 int TypeNarrowOop::hash(void) const {
3487 return _ooptype->hash() + 7; 3487 return _ptrtype->hash() + 7;
3488 } 3488 }
3489 3489
3490 3490
3491 bool TypeNarrowOop::eq( const Type *t ) const { 3491 bool TypeNarrowOop::eq( const Type *t ) const {
3492 const TypeNarrowOop* tc = t->isa_narrowoop(); 3492 const TypeNarrowOop* tc = t->isa_narrowoop();
3493 if (tc != NULL) { 3493 if (tc != NULL) {
3494 if (_ooptype->base() != tc->_ooptype->base()) { 3494 if (_ptrtype->base() != tc->_ptrtype->base()) {
3495 return false; 3495 return false;
3496 } 3496 }
3497 return tc->_ooptype->eq(_ooptype); 3497 return tc->_ptrtype->eq(_ptrtype);
3498 } 3498 }
3499 return false; 3499 return false;
3500 } 3500 }
3501 3501
3502 bool TypeNarrowOop::singleton(void) const { // TRUE if type is a singleton 3502 bool TypeNarrowOop::singleton(void) const { // TRUE if type is a singleton
3503 return _ooptype->singleton(); 3503 return _ptrtype->singleton();
3504 } 3504 }
3505 3505
3506 bool TypeNarrowOop::empty(void) const { 3506 bool TypeNarrowOop::empty(void) const {
3507 return _ooptype->empty(); 3507 return _ptrtype->empty();
3508 } 3508 }
3509 3509
3510 //------------------------------xmeet------------------------------------------ 3510 //------------------------------xmeet------------------------------------------
3511 // Compute the MEET of two types. It returns a new Type object. 3511 // Compute the MEET of two types. It returns a new Type object.
3512 const Type *TypeNarrowOop::xmeet( const Type *t ) const { 3512 const Type *TypeNarrowOop::xmeet( const Type *t ) const {
3536 return Type::BOTTOM; 3536 return Type::BOTTOM;
3537 case Top: 3537 case Top:
3538 return this; 3538 return this;
3539 3539
3540 case NarrowOop: { 3540 case NarrowOop: {
3541 const Type* result = _ooptype->xmeet(t->make_ptr()); 3541 const Type* result = _ptrtype->xmeet(t->make_ptr());
3542 if (result->isa_ptr()) { 3542 if (result->isa_ptr()) {
3543 return TypeNarrowOop::make(result->is_ptr()); 3543 return TypeNarrowOop::make(result->is_ptr());
3544 } 3544 }
3545 return result; 3545 return result;
3546 } 3546 }
3552 3552
3553 return this; 3553 return this;
3554 } 3554 }
3555 3555
3556 const Type *TypeNarrowOop::xdual() const { // Compute dual right now. 3556 const Type *TypeNarrowOop::xdual() const { // Compute dual right now.
3557 const TypePtr* odual = _ooptype->dual()->is_ptr(); 3557 const TypePtr* odual = _ptrtype->dual()->is_ptr();
3558 return new TypeNarrowOop(odual); 3558 return new TypeNarrowOop(odual);
3559 } 3559 }
3560 3560
3561 const Type *TypeNarrowOop::filter( const Type *kills ) const { 3561 const Type *TypeNarrowOop::filter( const Type *kills ) const {
3562 if (kills->isa_narrowoop()) { 3562 if (kills->isa_narrowoop()) {
3563 const Type* ft =_ooptype->filter(kills->is_narrowoop()->_ooptype); 3563 const Type* ft =_ptrtype->filter(kills->is_narrowoop()->_ptrtype);
3564 if (ft->empty()) 3564 if (ft->empty())
3565 return Type::TOP; // Canonical empty value 3565 return Type::TOP; // Canonical empty value
3566 if (ft->isa_ptr()) { 3566 if (ft->isa_ptr()) {
3567 return make(ft->isa_ptr()); 3567 return make(ft->isa_ptr());
3568 } 3568 }
3569 return ft; 3569 return ft;
3570 } else if (kills->isa_ptr()) { 3570 } else if (kills->isa_ptr()) {
3571 const Type* ft = _ooptype->join(kills); 3571 const Type* ft = _ptrtype->join(kills);
3572 if (ft->empty()) 3572 if (ft->empty())
3573 return Type::TOP; // Canonical empty value 3573 return Type::TOP; // Canonical empty value
3574 return ft; 3574 return ft;
3575 } else { 3575 } else {
3576 return Type::TOP; 3576 return Type::TOP;
3577 } 3577 }
3578 } 3578 }
3579 3579
3580 3580
3581 intptr_t TypeNarrowOop::get_con() const { 3581 intptr_t TypeNarrowOop::get_con() const {
3582 return _ooptype->get_con(); 3582 return _ptrtype->get_con();
3583 } 3583 }
3584 3584
3585 #ifndef PRODUCT 3585 #ifndef PRODUCT
3586 void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const { 3586 void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const {
3587 st->print("narrowoop: "); 3587 st->print("narrowoop: ");
3588 _ooptype->dump2(d, depth, st); 3588 _ptrtype->dump2(d, depth, st);
3589 } 3589 }
3590 #endif 3590 #endif
3591 3591
3592 3592
3593 //============================================================================= 3593 //=============================================================================