Print this page
rev 1083 : [mq]: indy.compiler.inline.patch
Split |
Close |
Expand all |
Collapse all |
--- old/src/share/vm/ci/ciInstanceKlass.hpp
+++ new/src/share/vm/ci/ciInstanceKlass.hpp
1 1 /*
2 2 * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
19 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 21 * have any questions.
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
22 22 *
23 23 */
24 24
25 25 // ciInstanceKlass
26 26 //
27 27 // This class represents a klassOop in the HotSpot virtual machine
28 28 // whose Klass part is an instanceKlass. It may or may not
29 29 // be loaded.
30 30 class ciInstanceKlass : public ciKlass {
31 31 CI_PACKAGE_ACCESS
32 + friend class ciBytecodeStream;
32 33 friend class ciEnv;
34 + friend class ciExceptionHandler;
33 35 friend class ciMethod;
34 36 friend class ciField;
35 - friend class ciBytecodeStream;
36 37
37 38 private:
38 39 jobject _loader;
39 40 jobject _protection_domain;
40 41
41 42 bool _is_shared;
42 43 bool _is_initialized;
43 44 bool _is_linked;
44 45 bool _has_finalizer;
45 46 bool _has_subklass;
46 47 bool _has_nonstatic_fields;
47 48
48 49 ciFlags _flags;
49 50 jint _nonstatic_field_size;
50 51 jint _nonstatic_oop_map_size;
51 52
52 53 // Lazy fields get filled in only upon request.
53 54 ciInstanceKlass* _super;
54 55 ciInstance* _java_mirror;
55 56
56 57 ciConstantPoolCache* _field_cache; // cached map index->field
57 58 GrowableArray<ciField*>* _nonstatic_fields;
58 59
59 60 enum { implementors_limit = instanceKlass::implementors_limit };
60 61 ciInstanceKlass* _implementors[implementors_limit];
61 62 jint _nof_implementors;
62 63
63 64 GrowableArray<ciField*>* _non_static_fields;
64 65
65 66 protected:
66 67 ciInstanceKlass(KlassHandle h_k);
67 68 ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
68 69
69 70 instanceKlass* get_instanceKlass() const {
70 71 return (instanceKlass*)get_Klass();
71 72 }
72 73
73 74 oop loader();
74 75 jobject loader_handle();
75 76
76 77 oop protection_domain();
77 78 jobject protection_domain_handle();
78 79
79 80 const char* type_string() { return "ciInstanceKlass"; }
80 81
81 82 void print_impl(outputStream* st);
82 83
83 84 ciConstantPoolCache* field_cache();
84 85
85 86 bool is_shared() { return _is_shared; }
86 87
87 88 bool compute_shared_is_initialized();
88 89 bool compute_shared_is_linked();
89 90 bool compute_shared_has_subklass();
90 91 int compute_shared_nof_implementors();
91 92 int compute_nonstatic_fields();
92 93 GrowableArray<ciField*>* compute_nonstatic_fields_impl(GrowableArray<ciField*>* super_fields);
93 94
94 95 public:
95 96 // Has this klass been initialized?
96 97 bool is_initialized() {
97 98 if (_is_shared && !_is_initialized) {
98 99 return is_loaded() && compute_shared_is_initialized();
99 100 }
100 101 return _is_initialized;
101 102 }
102 103 // Has this klass been linked?
103 104 bool is_linked() {
104 105 if (_is_shared && !_is_linked) {
105 106 return is_loaded() && compute_shared_is_linked();
106 107 }
107 108 return _is_linked;
108 109 }
109 110
110 111 // General klass information.
111 112 ciFlags flags() {
112 113 assert(is_loaded(), "must be loaded");
113 114 return _flags;
114 115 }
115 116 bool has_finalizer() {
116 117 assert(is_loaded(), "must be loaded");
117 118 return _has_finalizer; }
118 119 bool has_subklass() {
119 120 assert(is_loaded(), "must be loaded");
120 121 if (_is_shared && !_has_subklass) {
121 122 if (flags().is_final()) {
122 123 return false;
123 124 } else {
124 125 return compute_shared_has_subklass();
125 126 }
126 127 }
127 128 return _has_subklass;
128 129 }
129 130 jint size_helper() {
130 131 return (Klass::layout_helper_size_in_bytes(layout_helper())
131 132 >> LogHeapWordSize);
132 133 }
133 134 jint nonstatic_field_size() {
134 135 assert(is_loaded(), "must be loaded");
135 136 return _nonstatic_field_size; }
136 137 jint has_nonstatic_fields() {
137 138 assert(is_loaded(), "must be loaded");
138 139 return _has_nonstatic_fields; }
139 140 jint nonstatic_oop_map_size() {
140 141 assert(is_loaded(), "must be loaded");
141 142 return _nonstatic_oop_map_size; }
142 143 ciInstanceKlass* super();
143 144 jint nof_implementors() {
144 145 assert(is_loaded(), "must be loaded");
145 146 if (_is_shared) return compute_shared_nof_implementors();
146 147 return _nof_implementors;
147 148 }
148 149
149 150 ciInstanceKlass* get_canonical_holder(int offset);
150 151 ciField* get_field_by_offset(int field_offset, bool is_static);
151 152 ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
152 153
153 154 GrowableArray<ciField*>* non_static_fields();
154 155
155 156 // total number of nonstatic fields (including inherited):
156 157 int nof_nonstatic_fields() {
157 158 if (_nonstatic_fields == NULL)
158 159 return compute_nonstatic_fields();
159 160 else
160 161 return _nonstatic_fields->length();
161 162 }
162 163 // nth nonstatic field (presented by ascending address)
163 164 ciField* nonstatic_field_at(int i) {
164 165 assert(_nonstatic_fields != NULL, "");
165 166 return _nonstatic_fields->at(i);
166 167 }
167 168
168 169 ciInstanceKlass* unique_concrete_subklass();
169 170 bool has_finalizable_subclass();
170 171
171 172 bool contains_field_offset(int offset) {
172 173 return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
173 174 }
174 175
175 176 // Get the instance of java.lang.Class corresponding to
176 177 // this klass. This instance is used for locking of
177 178 // synchronized static methods of this klass.
178 179 ciInstance* java_mirror();
179 180
180 181 // Java access flags
181 182 bool is_public () { return flags().is_public(); }
182 183 bool is_final () { return flags().is_final(); }
183 184 bool is_super () { return flags().is_super(); }
184 185 bool is_interface () { return flags().is_interface(); }
185 186 bool is_abstract () { return flags().is_abstract(); }
186 187
187 188 ciMethod* find_method(ciSymbol* name, ciSymbol* signature);
188 189 // Note: To find a method from name and type strings, use ciSymbol::make,
189 190 // but consider adding to vmSymbols.hpp instead.
190 191
191 192 bool is_leaf_type();
192 193 ciInstanceKlass* implementor(int n);
193 194
194 195 // Is the defining class loader of this class the default loader?
195 196 bool uses_default_loader();
196 197
197 198 bool is_java_lang_Object();
198 199
199 200 // What kind of ciObject is this?
200 201 bool is_instance_klass() { return true; }
201 202 bool is_java_klass() { return true; }
202 203 };
↓ open down ↓ |
157 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX