< prev index next >
src/hotspot/share/opto/type.hpp
Print this page
@@ -64,11 +64,10 @@
class TypePtr;
class TypeRawPtr;
class TypeOopPtr;
class TypeInstPtr;
class TypeAryPtr;
-class TypeValueTypePtr;
class TypeKlassPtr;
class TypeMetadataPtr;
//------------------------------Type-------------------------------------------
// Basic Type object, represents a set of primitive Values.
@@ -301,13 +300,10 @@
// Returns true if this pointer points at memory which contains a
// compressed oop references.
bool is_ptr_to_narrowoop() const;
bool is_ptr_to_narrowklass() const;
- bool is_ptr_to_boxing_obj() const;
-
-
// Convenience access
float getf() const;
double getd() const;
const TypeInt *is_int() const;
@@ -338,32 +334,29 @@
const TypeInstPtr *is_instptr() const; // Instance
const TypeAryPtr *isa_aryptr() const; // Returns NULL if not AryPtr
const TypeAryPtr *is_aryptr() const; // Array oop
const TypeValueType* isa_valuetype() const; // Returns NULL if not Value Type
const TypeValueType* is_valuetype() const; // Value Type
- const TypeValueTypePtr* isa_valuetypeptr() const; // Value Type Pointer
- const TypeValueTypePtr* is_valuetypeptr() const; // Returns NULL if not Value Type Pointer
const TypeMetadataPtr *isa_metadataptr() const; // Returns NULL if not oop ptr type
const TypeMetadataPtr *is_metadataptr() const; // Java-style GC'd pointer
const TypeKlassPtr *isa_klassptr() const; // Returns NULL if not KlassPtr
const TypeKlassPtr *is_klassptr() const; // assert if not KlassPtr
virtual bool is_finite() const; // Has a finite value
virtual bool is_nan() const; // Is not a number (NaN)
+ bool is_valuetypeptr() const;
+ ciValueKlass* value_klass() const;
+
// Returns this ptr type or the equivalent ptr type for this compressed pointer.
const TypePtr* make_ptr() const;
// Returns this oopptr type or the equivalent oopptr type for this compressed pointer.
// Asserts if the underlying type is not an oopptr or narrowoop.
const TypeOopPtr* make_oopptr() const;
- // Returns this valuetypeptr type or the equivalent valuetypeptr type for this compressed pointer.
- // Asserts if the underlying type is not a valuetypeptr or narrow valuetypeptr.
- const TypeValueTypePtr* make_valuetypeptr() const;
-
// Returns this compressed pointer or the equivalent compressed version
// of this pointer type.
const TypeNarrowOop* make_narrowoop() const;
// Returns this compressed klass pointer or the equivalent
@@ -1089,11 +1082,11 @@
bool is_ptr_to_boxed_value() const { return _is_ptr_to_boxed_value; }
bool is_known_instance() const { return _instance_id > 0; }
int instance_id() const { return _instance_id; }
bool is_known_instance_field() const { return is_known_instance() && _offset.get() >= 0; }
- bool can_be_value_type() const { return EnableValhalla && (_base == ValueTypePtr || _klass->is_java_lang_Object() || _klass->is_interface()); }
+ bool can_be_value_type() const { return EnableValhalla && (_klass->is_valuetype() || _klass->is_java_lang_Object() || _klass->is_interface()); }
virtual intptr_t get_con() const;
virtual const Type *cast_to_ptr_type(PTR ptr) const;
@@ -1325,45 +1318,10 @@
#ifndef PRODUCT
virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
#endif
};
-//------------------------------TypeValueTypePtr-------------------------------------
-// Class of value type pointers
-class TypeValueTypePtr : public TypeOopPtr {
- TypeValueTypePtr(PTR ptr, ciValueKlass* vk, ciObject* o, Offset offset, int instance_id, const TypePtr* speculative, int inline_depth)
- : TypeOopPtr(ValueTypePtr, ptr, vk, true, o, offset, Offset::bottom, instance_id, speculative, inline_depth) {
- }
-
-public:
- // Make a pointer to a value type
- static const TypeValueTypePtr* make(PTR ptr, ciValueKlass* vk, ciObject* o = NULL, Offset offset = Offset(0),
- int instance_id = InstanceBot, const TypePtr* speculative = NULL, int inline_depth = InlineDepthBottom);
- // Make a pointer to a constant value type
- static const TypeValueTypePtr* make(ciObject* o) { return make(TypePtr::Constant, o->klass()->as_value_klass(), o); }
-
- ciValueKlass* value_klass() const { return klass()->as_value_klass(); }
-
- virtual const TypePtr* add_offset(intptr_t offset) const;
-
- virtual const Type* cast_to_ptr_type(PTR ptr) const;
- virtual const TypeOopPtr* cast_to_instance_id(int instance_id) const;
-
- virtual bool eq(const Type* t) const;
- virtual int hash() const; // Type specific hashing
- bool is__Value() const;
-
- virtual const Type* xmeet_helper(const Type* t) const;
- virtual const Type* xdual() const;
-
- static const TypeValueTypePtr* NOTNULL;
-
-#ifndef PRODUCT
- virtual void dump2(Dict &d, uint depth, outputStream* st) const; // Specialized per-Type dumping
-#endif
-};
-
//------------------------------TypeMetadataPtr-------------------------------------
// Some kind of metadata, either Method*, MethodData* or CPCacheOop
class TypeMetadataPtr : public TypePtr {
protected:
TypeMetadataPtr(PTR ptr, ciMetadata* metadata, Offset offset);
@@ -1786,19 +1744,10 @@
inline const TypeValueType* Type::is_valuetype() const {
assert(_base == ValueType, "Not a value type");
return (TypeValueType*)this;
}
-inline const TypeValueTypePtr* Type::isa_valuetypeptr() const {
- return (_base == ValueTypePtr) ? (TypeValueTypePtr*)this : NULL;
-}
-
-inline const TypeValueTypePtr* Type::is_valuetypeptr() const {
- assert(_base == ValueTypePtr, "Not a value type pointer");
- return (TypeValueTypePtr*)this;
-}
-
inline const TypeNarrowOop *Type::is_narrowoop() const {
// OopPtr is the first and KlassPtr the last, with no non-oops between.
assert(_base == NarrowOop, "Not a narrow oop" ) ;
return (TypeNarrowOop*)this;
}
@@ -1844,14 +1793,10 @@
inline const TypeOopPtr* Type::make_oopptr() const {
return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype()->isa_oopptr() : isa_oopptr();
}
-inline const TypeValueTypePtr* Type::make_valuetypeptr() const {
- return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype()->isa_valuetypeptr() : isa_valuetypeptr();
-}
-
inline const TypeNarrowOop* Type::make_narrowoop() const {
return (_base == NarrowOop) ? is_narrowoop() :
(isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL);
}
@@ -1865,15 +1810,18 @@
(_base == DoubleCon) || (_base == DoubleBot) )
return true;
return false;
}
-inline bool Type::is_ptr_to_boxing_obj() const {
- const TypeInstPtr* tp = isa_instptr();
- return (tp != NULL) && (tp->offset() == 0) &&
- tp->klass()->is_instance_klass() &&
- tp->klass()->as_instance_klass()->is_box_klass();
+inline bool Type::is_valuetypeptr() const {
+ return isa_instptr() != NULL && is_instptr()->klass()->is_valuetype();
+}
+
+
+inline ciValueKlass* Type::value_klass() const {
+ assert(is_valuetypeptr(), "must be a value type ptr");
+ return is_instptr()->klass()->as_value_klass();
}
// ===============================================================
// Things that need to be 64-bits in the 64-bit build but
< prev index next >