< prev index next >

src/hotspot/share/opto/type.cpp

Print this page

        

*** 2401,2412 **** } //==============================TypeValueType======================================= //------------------------------make------------------------------------------- ! const TypeValueType* TypeValueType::make(ciValueKlass* vk) { ! return (TypeValueType*)(new TypeValueType(vk))->hashcons(); } //------------------------------meet------------------------------------------- // Compute the MEET of two types. It returns a new Type object. const Type* TypeValueType::xmeet(const Type* t) const { --- 2401,2412 ---- } //==============================TypeValueType======================================= //------------------------------make------------------------------------------- ! const TypeValueType* TypeValueType::make(ciValueKlass* vk, bool larval) { ! return (TypeValueType*)(new TypeValueType(vk, larval))->hashcons(); } //------------------------------meet------------------------------------------- // Compute the MEET of two types. It returns a new Type object. const Type* TypeValueType::xmeet(const Type* t) const {
*** 2450,2459 **** --- 2450,2468 ---- return t->xmeet(this); } case ValueType: { // All value types inherit from Object + const TypeValueType* other = t->is_valuetype(); + if (_vk == other->_vk) { + if (_larval == other->_larval || + !_larval) { + return this; + } else { + return t; + } + } return TypeInstPtr::NOTNULL; } default: // All else is a mistake typerr(t);
*** 2469,2479 **** //------------------------------eq--------------------------------------------- // Structural equality check for Type representations bool TypeValueType::eq(const Type* t) const { const TypeValueType* vt = t->is_valuetype(); ! return (_vk == vt->value_klass()); } //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeValueType::hash(void) const { --- 2478,2488 ---- //------------------------------eq--------------------------------------------- // Structural equality check for Type representations bool TypeValueType::eq(const Type* t) const { const TypeValueType* vt = t->is_valuetype(); ! return (_vk == vt->value_klass() && _larval == vt->larval()); } //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeValueType::hash(void) const {
*** 2499,2509 **** st->print("valuetype[%d]:{", count); st->print("%s", count != 0 ? _vk->declared_nonstatic_field_at(0)->type()->name() : "empty"); for (int i = 1; i < count; ++i) { st->print(", %s", _vk->declared_nonstatic_field_at(i)->type()->name()); } ! st->print("}"); } #endif //==============================TypeVect======================================= // Convenience common pre-built types. --- 2508,2518 ---- st->print("valuetype[%d]:{", count); st->print("%s", count != 0 ? _vk->declared_nonstatic_field_at(0)->type()->name() : "empty"); for (int i = 1; i < count; ++i) { st->print(", %s", _vk->declared_nonstatic_field_at(i)->type()->name()); } ! st->print("}%s", _larval?":larval":""); } #endif //==============================TypeVect======================================= // Convenience common pre-built types.
< prev index next >