1 #ifdef USE_PRAGMA_IDENT_HDR
2 #pragma ident "@(#)objArrayKlass.hpp 1.87 07/05/29 09:44:23 JVM"
3 #endif
4 /*
5 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
49 bool can_be_primary_super_slow() const;
50 objArrayOop compute_secondary_supers(int num_extra_slots, TRAPS);
51 bool compute_is_subtype_of(klassOop k);
52 bool oop_is_objArray_slow() const { return true; }
53 int oop_size(oop obj) const;
54 int klass_oop_size() const { return object_size(); }
55
56 // Allocation
57 DEFINE_ALLOCATE_PERMANENT(objArrayKlass);
58 objArrayOop allocate(int length, TRAPS);
59 oop multi_allocate(int rank, jint* sizes, TRAPS);
60
61 // Copying
62 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
63
64 // Compute protection domain
65 oop protection_domain() { return Klass::cast(bottom_klass())->protection_domain(); }
66 // Compute class loader
67 oop class_loader() const { return Klass::cast(bottom_klass())->class_loader(); }
68
69 protected:
70 // Returns the objArrayKlass for n'th dimension.
71 virtual klassOop array_klass_impl(bool or_null, int n, TRAPS);
72
73 // Returns the array class with this class as element type.
74 virtual klassOop array_klass_impl(bool or_null, TRAPS);
75
76 public:
77 // Casting from klassOop
78 static objArrayKlass* cast(klassOop k) {
79 assert(k->klass_part()->oop_is_objArray_slow(), "cast to objArrayKlass");
80 return (objArrayKlass*) k->klass_part();
81 }
82
83 // Sizing
84 static int header_size() { return oopDesc::header_size() + sizeof(objArrayKlass)/HeapWordSize; }
85 int object_size() const { return arrayKlass::object_size(header_size()); }
86
87 // Initialization (virtual from Klass)
88 void initialize(TRAPS);
89
90 // Garbage collection
91 void oop_follow_contents(oop obj);
92 int oop_adjust_pointers(oop obj);
93
94 // Parallel Scavenge and Parallel Old
95 PARALLEL_GC_DECLS
96
97 // Iterators
98 int oop_oop_iterate(oop obj, OopClosure* blk) {
99 return oop_oop_iterate_v(obj, blk);
100 }
101 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
102 return oop_oop_iterate_v_m(obj, blk, mr);
103 }
104 #define ObjArrayKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
105 int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \
106 int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \
107 MemRegion mr);
108
109 ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DECL)
110 ALL_OOP_OOP_ITERATE_CLOSURES_3(ObjArrayKlass_OOP_OOP_ITERATE_DECL)
111
112 // JVM support
113 jint compute_modifier_flags(TRAPS) const;
114
115 private:
116 static klassOop array_klass_impl (objArrayKlassHandle this_oop, bool or_null, int n, TRAPS);
117
118 #ifndef PRODUCT
119 public:
120 // Printing
121 void oop_print_on (oop obj, outputStream* st);
122 void oop_print_value_on(oop obj, outputStream* st);
123 #endif
124
125 public:
126 // Verification
127 const char* internal_name() const;
128 void oop_verify_on(oop obj, outputStream* st);
129 void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty);
130
131 };
132
|
1 #ifdef USE_PRAGMA_IDENT_HDR
2 #pragma ident "@(#)objArrayKlass.hpp 1.87 07/05/29 09:44:23 JVM"
3 #endif
4 /*
5 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
49 bool can_be_primary_super_slow() const;
50 objArrayOop compute_secondary_supers(int num_extra_slots, TRAPS);
51 bool compute_is_subtype_of(klassOop k);
52 bool oop_is_objArray_slow() const { return true; }
53 int oop_size(oop obj) const;
54 int klass_oop_size() const { return object_size(); }
55
56 // Allocation
57 DEFINE_ALLOCATE_PERMANENT(objArrayKlass);
58 objArrayOop allocate(int length, TRAPS);
59 oop multi_allocate(int rank, jint* sizes, TRAPS);
60
61 // Copying
62 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
63
64 // Compute protection domain
65 oop protection_domain() { return Klass::cast(bottom_klass())->protection_domain(); }
66 // Compute class loader
67 oop class_loader() const { return Klass::cast(bottom_klass())->class_loader(); }
68
69 private:
70 // Either oop or narrowOop depending on UseCompressedOops.
71 // must be called from within objArrayKlass.cpp
72 template <class T> void do_copy(arrayOop s, T* src, arrayOop d,
73 T* dst, int length, TRAPS);
74 protected:
75 // Returns the objArrayKlass for n'th dimension.
76 virtual klassOop array_klass_impl(bool or_null, int n, TRAPS);
77
78 // Returns the array class with this class as element type.
79 virtual klassOop array_klass_impl(bool or_null, TRAPS);
80
81 public:
82 // Casting from klassOop
83 static objArrayKlass* cast(klassOop k) {
84 assert(k->klass_part()->oop_is_objArray_slow(), "cast to objArrayKlass");
85 return (objArrayKlass*) k->klass_part();
86 }
87
88 // Sizing
89 static int header_size() { return oopDesc::header_size() + sizeof(objArrayKlass)/HeapWordSize; }
90 int object_size() const { return arrayKlass::object_size(header_size()); }
91
92 // Initialization (virtual from Klass)
93 void initialize(TRAPS);
94
95 // Garbage collection
96 void oop_follow_contents(oop obj);
97 int oop_adjust_pointers(oop obj);
98
99 // Parallel Scavenge and Parallel Old
100 PARALLEL_GC_DECLS
101
102 // Iterators
103 int oop_oop_iterate(oop obj, OopClosure* blk) {
104 return oop_oop_iterate_v(obj, blk);
105 }
106 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
107 return oop_oop_iterate_v_m(obj, blk, mr);
108 }
109 #define ObjArrayKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
110 int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \
111 int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \
112 MemRegion mr); \
113 int oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* blk, \
114 int start, int end);
115
116 ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DECL)
117 ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DECL)
118
119 // JVM support
120 jint compute_modifier_flags(TRAPS) const;
121
122 private:
123 static klassOop array_klass_impl (objArrayKlassHandle this_oop, bool or_null, int n, TRAPS);
124
125 #ifndef PRODUCT
126 public:
127 // Printing
128 void oop_print_on (oop obj, outputStream* st);
129 void oop_print_value_on(oop obj, outputStream* st);
130 #endif
131
132 public:
133 // Verification
134 const char* internal_name() const;
135 void oop_verify_on(oop obj, outputStream* st);
136 void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty);
137 void oop_verify_old_oop(oop obj, narrowOop* p, bool allow_dirty);
138
139 };
140
|