57 assert(scale == (1 << tak->log2_element_size()), "scale must check out");
58 return tak;
59 }
60
61 int oop_size(oop obj) const;
62
63 bool compute_is_subtype_of(Klass* k);
64
65 // Allocation
66 typeArrayOop allocate_common(int length, bool do_zero, TRAPS);
67 typeArrayOop allocate(int length, TRAPS) { return allocate_common(length, true, THREAD); }
68 oop multi_allocate(int rank, jint* sizes, TRAPS);
69
70 oop protection_domain() const { return NULL; }
71
72 // Copying
73 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
74
75 // GC specific object visitors
76 //
77 #if INCLUDE_ALL_GCS
78 // Parallel Scavenge
79 void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
80 // Parallel Compact
81 void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
82 void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
83 #endif
84
85 // Oop iterators. Since there are no oops in TypeArrayKlasses,
86 // these functions only return the size of the object.
87
88 private:
89 // The implementation used by all oop_oop_iterate functions in TypeArrayKlasses.
90 inline void oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure);
91
92 // Wraps oop_oop_iterate_impl to conform to macros.
93 template <bool nv, typename OopClosureType>
94 inline void oop_oop_iterate(oop obj, OopClosureType* closure);
95
96 // Wraps oop_oop_iterate_impl to conform to macros.
97 template <bool nv, typename OopClosureType>
98 inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);
99
100 public:
101
102 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
103 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
104 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE)
105 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE)
106
107 #if INCLUDE_ALL_GCS
108 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
109 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
110 #endif // INCLUDE_ALL_GCS
111
112
113 protected:
114 // Find n'th dimensional array
115 virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
116
117 // Returns the array class with this class as element type
118 virtual Klass* array_klass_impl(bool or_null, TRAPS);
119
120 public:
121 static TypeArrayKlass* cast(Klass* k) {
122 return const_cast<TypeArrayKlass*>(cast(const_cast<const Klass*>(k)));
123 }
124
125 static const TypeArrayKlass* cast(const Klass* k) {
126 assert(k->is_typeArray_klass(), "cast to TypeArrayKlass");
127 return static_cast<const TypeArrayKlass*>(k);
128 }
129
130 // Naming
|
57 assert(scale == (1 << tak->log2_element_size()), "scale must check out");
58 return tak;
59 }
60
61 int oop_size(oop obj) const;
62
63 bool compute_is_subtype_of(Klass* k);
64
65 // Allocation
66 typeArrayOop allocate_common(int length, bool do_zero, TRAPS);
67 typeArrayOop allocate(int length, TRAPS) { return allocate_common(length, true, THREAD); }
68 oop multi_allocate(int rank, jint* sizes, TRAPS);
69
70 oop protection_domain() const { return NULL; }
71
72 // Copying
73 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
74
75 // GC specific object visitors
76 //
77 #if INCLUDE_PARALLELGC
78 // Parallel Scavenge
79 void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
80 // Parallel Compact
81 void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
82 void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
83 #endif
84
85 // Oop iterators. Since there are no oops in TypeArrayKlasses,
86 // these functions only return the size of the object.
87
88 private:
89 // The implementation used by all oop_oop_iterate functions in TypeArrayKlasses.
90 inline void oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure);
91
92 // Wraps oop_oop_iterate_impl to conform to macros.
93 template <bool nv, typename OopClosureType>
94 inline void oop_oop_iterate(oop obj, OopClosureType* closure);
95
96 // Wraps oop_oop_iterate_impl to conform to macros.
97 template <bool nv, typename OopClosureType>
98 inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);
99
100 public:
101
102 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
103 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
104 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE)
105 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE)
106
107 #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
108 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
109 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
110 #endif
111
112
113 protected:
114 // Find n'th dimensional array
115 virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
116
117 // Returns the array class with this class as element type
118 virtual Klass* array_klass_impl(bool or_null, TRAPS);
119
120 public:
121 static TypeArrayKlass* cast(Klass* k) {
122 return const_cast<TypeArrayKlass*>(cast(const_cast<const Klass*>(k)));
123 }
124
125 static const TypeArrayKlass* cast(const Klass* k) {
126 assert(k->is_typeArray_klass(), "cast to TypeArrayKlass");
127 return static_cast<const TypeArrayKlass*>(k);
128 }
129
130 // Naming
|