Mercurial > hg > graal-compiler
annotate src/share/vm/oops/objArrayKlass.hpp @ 7168:73e64867adb7
8003690: Example code in JVMTI GetStackTrace documentation is broken
Summary: Fixed to minor errors in example code
Reviewed-by: sspitsyn, dholmes
author | mikael |
---|---|
date | Wed, 21 Nov 2012 09:02:13 -0800 |
parents | 070d523b96a7 |
children | db9981fd3124 |
rev | line source |
---|---|
0 | 1 /* |
6008 | 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1311
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1311
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1311
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_OOPS_OBJARRAYKLASS_HPP |
26 #define SHARE_VM_OOPS_OBJARRAYKLASS_HPP | |
27 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
28 #include "classfile/classLoaderData.hpp" |
1972 | 29 #include "memory/specialized_oop_closures.hpp" |
30 #include "oops/arrayKlass.hpp" | |
31 | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
32 // ObjArrayKlass is the klass for objArrays |
0 | 33 |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
34 class ObjArrayKlass : public ArrayKlass { |
0 | 35 friend class VMStructs; |
36 private: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
37 Klass* _element_klass; // The klass of the elements of this array type |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
38 Klass* _bottom_klass; // The one-dimensional type (InstanceKlass or TypeArrayKlass) |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
39 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
40 // Constructor |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
41 ObjArrayKlass(int n, KlassHandle element_klass, Symbol* name); |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
42 static ObjArrayKlass* allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS); |
0 | 43 public: |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
44 // For dummy objects |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
45 ObjArrayKlass() {} |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
46 |
0 | 47 // Instance variables |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
48 Klass* element_klass() const { return _element_klass; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
49 void set_element_klass(Klass* k) { _element_klass = k; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
50 Klass** element_klass_addr() { return &_element_klass; } |
0 | 51 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
52 Klass* bottom_klass() const { return _bottom_klass; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
53 void set_bottom_klass(Klass* k) { _bottom_klass = k; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
54 Klass** bottom_klass_addr() { return &_bottom_klass; } |
0 | 55 |
56 // Compiler/Interpreter offset | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
57 static ByteSize element_klass_offset() { return in_ByteSize(offset_of(ObjArrayKlass, _element_klass)); } |
0 | 58 |
59 // Dispatched operation | |
60 bool can_be_primary_super_slow() const; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
61 GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
62 bool compute_is_subtype_of(Klass* k); |
0 | 63 bool oop_is_objArray_slow() const { return true; } |
64 int oop_size(oop obj) const; | |
65 | |
66 // Allocation | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
67 static Klass* allocate_objArray_klass(ClassLoaderData* loader_data, |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
68 int n, KlassHandle element_klass, TRAPS); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
69 |
0 | 70 objArrayOop allocate(int length, TRAPS); |
71 oop multi_allocate(int rank, jint* sizes, TRAPS); | |
72 | |
73 // Copying | |
74 void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); | |
75 | |
76 // Compute protection domain | |
6983 | 77 oop protection_domain() { return bottom_klass()->protection_domain(); } |
0 | 78 |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
79 private: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
80 // Either oop or narrowOop depending on UseCompressedOops. |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
81 // must be called from within ObjArrayKlass.cpp |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
82 template <class T> void do_copy(arrayOop s, T* src, arrayOop d, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
83 T* dst, int length, TRAPS); |
0 | 84 protected: |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
85 // Returns the ObjArrayKlass for n'th dimension. |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
86 virtual Klass* array_klass_impl(bool or_null, int n, TRAPS); |
0 | 87 |
88 // Returns the array class with this class as element type. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
89 virtual Klass* array_klass_impl(bool or_null, TRAPS); |
0 | 90 |
91 public: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
92 // Casting from Klass* |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
93 static ObjArrayKlass* cast(Klass* k) { |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
94 assert(k->oop_is_objArray(), "cast to ObjArrayKlass"); |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
95 return (ObjArrayKlass*) k; |
0 | 96 } |
97 | |
98 // Sizing | |
6831
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
99 static int header_size() { return sizeof(ObjArrayKlass)/HeapWordSize; } |
d8ce2825b193
8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents:
6725
diff
changeset
|
100 int size() const { return ArrayKlass::static_size(header_size()); } |
0 | 101 |
102 // Initialization (virtual from Klass) | |
103 void initialize(TRAPS); | |
104 | |
105 // Garbage collection | |
106 void oop_follow_contents(oop obj); | |
1311
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
107 inline void oop_follow_contents(oop obj, int index); |
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
108 template <class T> inline void objarray_follow_contents(oop obj, int index); |
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
109 |
0 | 110 int oop_adjust_pointers(oop obj); |
111 | |
112 // Parallel Scavenge and Parallel Old | |
113 PARALLEL_GC_DECLS | |
1311
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
114 #ifndef SERIALGC |
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
115 inline void oop_follow_contents(ParCompactionManager* cm, oop obj, int index); |
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
116 template <class T> inline void |
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
117 objarray_follow_contents(ParCompactionManager* cm, oop obj, int index); |
2a1472c30599
4396719: Mark Sweep stack overflow on deeply nested Object arrays
jcoomes
parents:
1155
diff
changeset
|
118 #endif // !SERIALGC |
0 | 119 |
120 // Iterators | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
121 int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { |
0 | 122 return oop_oop_iterate_v(obj, blk); |
123 } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
124 int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { |
0 | 125 return oop_oop_iterate_v_m(obj, blk, mr); |
126 } | |
127 #define ObjArrayKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ | |
128 int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ | |
129 int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \ | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
130 MemRegion mr); \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
131 int oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* blk, \ |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
132 int start, int end); |
0 | 133 |
134 ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DECL) | |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
135 ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DECL) |
0 | 136 |
137 // JVM support | |
138 jint compute_modifier_flags(TRAPS) const; | |
139 | |
140 public: | |
141 // Printing | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
142 void print_on(outputStream* st) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
143 void print_value_on(outputStream* st) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
144 |
1155
4e6abf09f540
6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents:
356
diff
changeset
|
145 void oop_print_value_on(oop obj, outputStream* st); |
4e6abf09f540
6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents:
356
diff
changeset
|
146 #ifndef PRODUCT |
0 | 147 void oop_print_on (oop obj, outputStream* st); |
1155
4e6abf09f540
6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents:
356
diff
changeset
|
148 #endif //PRODUCT |
0 | 149 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
150 const char* internal_name() const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
151 |
0 | 152 // Verification |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
153 void verify_on(outputStream* st); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
154 |
0 | 155 void oop_verify_on(oop obj, outputStream* st); |
156 }; | |
1972 | 157 |
158 #endif // SHARE_VM_OOPS_OBJARRAYKLASS_HPP |