29 #include "oops/klass.hpp"
30
31 class fieldDescriptor;
32 class klassVtable;
33
34 // ArrayKlass is the abstract baseclass for all array classes
35
36 class ArrayKlass: public Klass {
37 friend class VMStructs;
38 private:
39 // If you add a new field that points to any metaspace object, you
40 // must add this field to ArrayKlass::metaspace_pointers_do().
41 int _dimension; // This is n'th-dimensional array.
42 Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
43 Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
44
45 protected:
46 // Constructors
47 // The constructor with the Symbol argument does the real array
48 // initialization, the other is a dummy
49 ArrayKlass(Symbol* name);
50 ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
51
52 public:
53 // Testing operation
54 DEBUG_ONLY(bool is_array_klass_slow() const { return true; })
55
56 // Instance variables
57 int dimension() const { return _dimension; }
58 void set_dimension(int dimension) { _dimension = dimension; }
59
60 Klass* higher_dimension() const { return _higher_dimension; }
61 inline Klass* higher_dimension_acquire() const; // load with acquire semantics
62 void set_higher_dimension(Klass* k) { _higher_dimension = k; }
63 inline void release_set_higher_dimension(Klass* k); // store with release semantics
64 Klass** adr_higher_dimension() { return (Klass**)&this->_higher_dimension;}
65
66 Klass* lower_dimension() const { return _lower_dimension; }
67 void set_lower_dimension(Klass* k) { _lower_dimension = k; }
68 Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;}
69
128
129 // JVMTI support
130 jint jvmti_class_status() const;
131
132 // CDS support - remove and restore oops from metadata. Oops are not shared.
133 virtual void remove_unshareable_info();
134 virtual void remove_java_mirror();
135 virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
136
137 // Printing
138 void print_on(outputStream* st) const;
139 void print_value_on(outputStream* st) const;
140
141 void oop_print_on(oop obj, outputStream* st);
142
143 // Verification
144 void verify_on(outputStream* st);
145
146 void oop_verify_on(oop obj, outputStream* st);
147 };
148
149 // Array oop iteration macros for declarations.
150 // Used to generate the declarations in the *ArrayKlass header files.
151
152 #define OOP_OOP_ITERATE_DECL_RANGE(OopClosureType, nv_suffix) \
153 void oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end);
154
155 #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
156 // Named NO_BACKWARDS because the definition used by *ArrayKlass isn't reversed, see below.
157 #define OOP_OOP_ITERATE_DECL_NO_BACKWARDS(OopClosureType, nv_suffix) \
158 void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure);
159 #endif
160
161
162 // Array oop iteration macros for definitions.
163 // Used to generate the definitions in the *ArrayKlass.inline.hpp files.
164
165 #define OOP_OOP_ITERATE_DEFN_RANGE(KlassType, OopClosureType, nv_suffix) \
166 \
167 void KlassType::oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end) { \
168 oop_oop_iterate_range<nvs_to_bool(nv_suffix)>(obj, closure, start, end); \
169 }
170
171 #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
172 #define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix) \
173 void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
174 /* No reverse implementation ATM. */ \
175 oop_oop_iterate<nvs_to_bool(nv_suffix)>(obj, closure); \
176 }
177 #else
178 #define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix)
179 #endif
180
181 #endif // SHARE_VM_OOPS_ARRAYKLASS_HPP
|
29 #include "oops/klass.hpp"
30
31 class fieldDescriptor;
32 class klassVtable;
33
34 // ArrayKlass is the abstract baseclass for all array classes
35
36 class ArrayKlass: public Klass {
37 friend class VMStructs;
38 private:
39 // If you add a new field that points to any metaspace object, you
40 // must add this field to ArrayKlass::metaspace_pointers_do().
41 int _dimension; // This is n'th-dimensional array.
42 Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present).
43 Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present).
44
45 protected:
46 // Constructors
47 // The constructor with the Symbol argument does the real array
48 // initialization, the other is a dummy
49 ArrayKlass(Symbol* name, int klass_id);
50 ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
51
52 public:
53 // Testing operation
54 DEBUG_ONLY(bool is_array_klass_slow() const { return true; })
55
56 // Instance variables
57 int dimension() const { return _dimension; }
58 void set_dimension(int dimension) { _dimension = dimension; }
59
60 Klass* higher_dimension() const { return _higher_dimension; }
61 inline Klass* higher_dimension_acquire() const; // load with acquire semantics
62 void set_higher_dimension(Klass* k) { _higher_dimension = k; }
63 inline void release_set_higher_dimension(Klass* k); // store with release semantics
64 Klass** adr_higher_dimension() { return (Klass**)&this->_higher_dimension;}
65
66 Klass* lower_dimension() const { return _lower_dimension; }
67 void set_lower_dimension(Klass* k) { _lower_dimension = k; }
68 Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;}
69
128
129 // JVMTI support
130 jint jvmti_class_status() const;
131
132 // CDS support - remove and restore oops from metadata. Oops are not shared.
133 virtual void remove_unshareable_info();
134 virtual void remove_java_mirror();
135 virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
136
137 // Printing
138 void print_on(outputStream* st) const;
139 void print_value_on(outputStream* st) const;
140
141 void oop_print_on(oop obj, outputStream* st);
142
143 // Verification
144 void verify_on(outputStream* st);
145
146 void oop_verify_on(oop obj, outputStream* st);
147 };
148
149 #endif // SHARE_VM_OOPS_ARRAYKLASS_HPP
|