28 #include "memory/universe.hpp"
29 #include "oops/klass.hpp"
30
31 class klassVtable;
32
33 // ArrayKlass is the abstract baseclass for all array classes
34
35 class ArrayKlass: public Klass {
36 friend class VMStructs;
37 private:
38 int _dimension; // This is n'th-dimensional array.
39 Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
40 Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
41 int _vtable_len; // size of vtable for this klass
42 oop _component_mirror; // component type, as a java/lang/Class
43
44 protected:
45 // Constructors
46 // The constructor with the Symbol argument does the real array
47 // initialization, the other is a dummy
48 ArrayKlass(Symbol* name);
49 ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
50
51 public:
52 // Testing operation
53 bool oop_is_array_slow() const { return true; }
54
55 // Instance variables
56 int dimension() const { return _dimension; }
57 void set_dimension(int dimension) { _dimension = dimension; }
58
59 Klass* higher_dimension() const { return _higher_dimension; }
60 void set_higher_dimension(Klass* k) { _higher_dimension = k; }
61 Klass** adr_higher_dimension() { return (Klass**)&this->_higher_dimension;}
62
63 Klass* lower_dimension() const { return _lower_dimension; }
64 void set_lower_dimension(Klass* k) { _lower_dimension = k; }
65 Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;}
66
67 // offset of first element, including any padding for the sake of alignment
68 int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); }
69 int log2_element_size() const { return layout_helper_log2_element_size(layout_helper()); }
|
28 #include "memory/universe.hpp"
29 #include "oops/klass.hpp"
30
31 class klassVtable;
32
33 // ArrayKlass is the abstract baseclass for all array classes
34
35 class ArrayKlass: public Klass {
36 friend class VMStructs;
37 private:
38 int _dimension; // This is n'th-dimensional array.
39 Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
40 Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
41 int _vtable_len; // size of vtable for this klass
42 oop _component_mirror; // component type, as a java/lang/Class
43
44 protected:
45 // Constructors
46 // The constructor with the Symbol argument does the real array
47 // initialization, the other is a dummy
48 ArrayKlass(Symbol* name, DispatchTag tag);
49 ArrayKlass(DispatchTag tag) : Klass(tag, true) { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
50
51 public:
52 // Testing operation
53 bool oop_is_array_slow() const { return true; }
54
55 // Instance variables
56 int dimension() const { return _dimension; }
57 void set_dimension(int dimension) { _dimension = dimension; }
58
59 Klass* higher_dimension() const { return _higher_dimension; }
60 void set_higher_dimension(Klass* k) { _higher_dimension = k; }
61 Klass** adr_higher_dimension() { return (Klass**)&this->_higher_dimension;}
62
63 Klass* lower_dimension() const { return _lower_dimension; }
64 void set_lower_dimension(Klass* k) { _lower_dimension = k; }
65 Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;}
66
67 // offset of first element, including any padding for the sake of alignment
68 int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); }
69 int log2_element_size() const { return layout_helper_log2_element_size(layout_helper()); }
|