< prev index next > src/hotspot/share/oops/arrayKlass.hpp
Print this page
#ifndef SHARE_OOPS_ARRAYKLASS_HPP
#define SHARE_OOPS_ARRAYKLASS_HPP
#include "oops/klass.hpp"
class fieldDescriptor;
class klassVtable;
class ObjArrayKlass;
// ArrayKlass is the abstract baseclass for all array classes
class ArrayKlass: public Klass {
friend class VMStructs;
private:
// If you add a new field that points to any metaspace object, you
// must add this field to ArrayKlass::metaspace_pointers_do().
int _dimension; // This is n'th-dimensional array.
ObjArrayKlass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
ArrayKlass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
protected:
// Constructors
// The constructor with the Symbol argument does the real array
// initialization, the other is a dummy
! ArrayKlass(Symbol* name, KlassKind kind);
ArrayKlass();
public:
// Testing operation
DEBUG_ONLY(bool is_array_klass_slow() const override { return true; })
// Returns the ObjArrayKlass for n'th dimension.
ArrayKlass* array_klass(int n, TRAPS) override;
#ifndef SHARE_OOPS_ARRAYKLASS_HPP
#define SHARE_OOPS_ARRAYKLASS_HPP
#include "oops/klass.hpp"
+ #include "oops/layoutKind.hpp"
class fieldDescriptor;
class klassVtable;
class ObjArrayKlass;
// ArrayKlass is the abstract baseclass for all array classes
class ArrayKlass: public Klass {
friend class VMStructs;
+
+ public:
+ enum ArrayProperties : uint32_t {
+ DEFAULT = 0, // NULLABLE and ATOMIC
+ NULL_RESTRICTED = 1 << 0,
+ NON_ATOMIC = 1 << 1,
+ // FINAL = 1 << 2,
+ // VOLATILE = 1 << 3
+ INVALID = 1 << 4,
+ DUMMY = 1 << 5 // Just to transition the code, to be removed ASAP
+ };
+
+ static bool is_null_restricted(ArrayProperties props) { return (props & NULL_RESTRICTED) != 0; }
+ static bool is_non_atomic(ArrayProperties props) { return (props & NON_ATOMIC) != 0; }
+
+ static ArrayProperties array_properties_from_layout(LayoutKind lk);
+ static const char* array_properties_as_string(ArrayProperties props);
+
private:
// If you add a new field that points to any metaspace object, you
// must add this field to ArrayKlass::metaspace_pointers_do().
int _dimension; // This is n'th-dimensional array.
+ ArrayProperties _properties;
ObjArrayKlass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
ArrayKlass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
protected:
// Constructors
// The constructor with the Symbol argument does the real array
// initialization, the other is a dummy
! ArrayKlass(Symbol* name, KlassKind kind, ArrayProperties props, markWord prototype_header = markWord::prototype());
ArrayKlass();
+ // Create array_name for element klass
+ static Symbol* create_element_klass_array_name(Klass* element_klass, TRAPS);
+
public:
+
// Testing operation
DEBUG_ONLY(bool is_array_klass_slow() const override { return true; })
// Returns the ObjArrayKlass for n'th dimension.
ArrayKlass* array_klass(int n, TRAPS) override;
// Instance variables
int dimension() const { return _dimension; }
void set_dimension(int dimension) { _dimension = dimension; }
+ ArrayProperties properties() const { return _properties; }
+ void set_properties(ArrayProperties props) { _properties = props; }
+ static ByteSize properties_offset() { return byte_offset_of(ArrayKlass, _properties); }
+
ObjArrayKlass* higher_dimension() const { return _higher_dimension; }
inline ObjArrayKlass* higher_dimension_acquire() const; // load with acquire semantics
void set_higher_dimension(ObjArrayKlass* k) { _higher_dimension = k; }
inline void release_set_higher_dimension(ObjArrayKlass* k); // store with release semantics
}
GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
Array<InstanceKlass*>* transitive_interfaces) override;
+ oop component_mirror() const;
+
// Sizing
static int static_size(int header_size);
void metaspace_pointers_do(MetaspaceClosure* iter) override;
void verify_on(outputStream* st) override;
void oop_verify_on(oop obj, outputStream* st) override;
};
+ class ArrayDescription : public StackObj {
+ public:
+ Klass::KlassKind _kind;
+ ArrayKlass::ArrayProperties _properties;
+ LayoutKind _layout_kind;
+ ArrayDescription(Klass::KlassKind k, ArrayKlass::ArrayProperties p, LayoutKind lk) {
+ _kind = k;
+ _layout_kind = lk;
+
+ if (lk == LayoutKind::REFERENCE || LayoutKindHelper::is_atomic_flat(lk)) {
+ p = (ArrayKlass::ArrayProperties) (p &~ ArrayKlass::NON_ATOMIC);
+ } else {
+ p = (ArrayKlass::ArrayProperties) (p | ArrayKlass::NON_ATOMIC);
+ }
+ _properties = p;
+ }
+ };
+
#endif // SHARE_OOPS_ARRAYKLASS_HPP
< prev index next >