src/share/vm/opto/type.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7119644 Cdiff src/share/vm/opto/type.hpp

src/share/vm/opto/type.hpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 49,58 **** --- 49,63 ---- class TypeInt; class TypeLong; class TypeNarrowOop; class TypeAry; class TypeTuple; + class TypeVect; + class TypeVectS; + class TypeVectD; + class TypeVectX; + class TypeVectY; class TypePtr; class TypeRawPtr; class TypeOopPtr; class TypeInstPtr; class TypeAryPtr;
*** 76,85 **** --- 81,94 ---- Half, // Placeholder half of doubleword NarrowOop, // Compressed oop pointer Tuple, // Method signature or object layout Array, // Array types + VectorS, // 32bit Vector types + VectorD, // 64bit Vector types + VectorX, // 128bit Vector types + VectorY, // 256bit Vector types AnyPtr, // Any old raw, klass, inst, or array pointer RawPtr, // Raw (non-oop) pointers OopPtr, // Any and all Java heap entities InstPtr, // Instance pointers (non-array objects)
*** 220,229 **** --- 229,240 ---- const TypeD *isa_double_constant() const; // Returns NULL if not a DoubleCon const TypeF *is_float_constant() const; // Asserts it is a FloatCon const TypeF *isa_float_constant() const; // Returns NULL if not a FloatCon const TypeTuple *is_tuple() const; // Collection of fields, NOT a pointer const TypeAry *is_ary() const; // Array, NOT array pointer + const TypeVect *is_vect() const; // Vector + const TypeVect *isa_vect() const; // Returns NULL if not a Vector const TypePtr *is_ptr() const; // Asserts it is a ptr type const TypePtr *isa_ptr() const; // Returns NULL if not ptr type const TypeRawPtr *isa_rawptr() const; // NOT Java oop const TypeRawPtr *is_rawptr() const; // Asserts is rawptr const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer
*** 572,581 **** --- 583,655 ---- #ifndef PRODUCT virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping #endif }; + //------------------------------TypeVect--------------------------------------- + // Class of Vector Types + class TypeVect : public Type { + const Type* _elem; // Vector's element type + const uint _length; // Elements in vector (power of 2) + + protected: + TypeVect(TYPES t, const Type* elem, uint length) : Type(t), + _elem(elem), _length(length) {} + + public: + const Type* element_type() const { return _elem; } + BasicType element_basic_type() const { return _elem->array_element_basic_type(); } + uint length() const { return _length; } + uint length_in_bytes() const { + return _length * type2aelembytes(element_basic_type()); + } + + virtual bool eq(const Type *t) const; + virtual int hash() const; // Type specific hashing + virtual bool singleton(void) const; // TRUE if type is a singleton + virtual bool empty(void) const; // TRUE if type is vacuous + + static const TypeVect *make(const BasicType elem_bt, uint length) { + // Use bottom primitive type. + return make(get_const_basic_type(elem_bt), length); + } + // Used directly by Replicate nodes to construct singleton vector. + static const TypeVect *make(const Type* elem, uint length); + + virtual const Type *xmeet( const Type *t) const; + virtual const Type *xdual() const; // Compute dual right now. + + static const TypeVect *VECTS; + static const TypeVect *VECTD; + static const TypeVect *VECTX; + static const TypeVect *VECTY; + + #ifndef PRODUCT + virtual void dump2(Dict &d, uint, outputStream *st) const; // Specialized per-Type dumping + #endif + }; + + class TypeVectS : public TypeVect { + friend class TypeVect; + TypeVectS(const Type* elem, uint length) : TypeVect(VectorS, elem, length) {} + }; + + class TypeVectD : public TypeVect { + friend class TypeVect; + TypeVectD(const Type* elem, uint length) : TypeVect(VectorD, elem, length) {} + }; + + class TypeVectX : public TypeVect { + friend class TypeVect; + TypeVectX(const Type* elem, uint length) : TypeVect(VectorX, elem, length) {} + }; + + class TypeVectY : public TypeVect { + friend class TypeVect; + TypeVectY(const Type* elem, uint length) : TypeVect(VectorY, elem, length) {} + }; + //------------------------------TypePtr---------------------------------------- // Class of machine Pointer Types: raw data, instances or arrays. // If the _base enum is AnyPtr, then this refers to all of the above. // Otherwise the _base will indicate which subset of pointers is affected, // and the class will be inherited from.
*** 1111,1120 **** --- 1185,1203 ---- inline const TypeAry *Type::is_ary() const { assert( _base == Array , "Not an Array" ); return (TypeAry*)this; } + inline const TypeVect *Type::is_vect() const { + assert( _base >= VectorS && _base <= VectorY, "Not a Vector" ); + return (TypeVect*)this; + } + + inline const TypeVect *Type::isa_vect() const { + return (_base >= VectorS && _base <= VectorY) ? (TypeVect*)this : NULL; + } + inline const TypePtr *Type::is_ptr() const { // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. assert(_base >= AnyPtr && _base <= KlassPtr, "Not a pointer"); return (TypePtr*)this; }
src/share/vm/opto/type.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File