116 // The CI treats a klass as loaded if it is consistently defined in
117 // another loader, even if it hasn't yet been loaded in all loaders
118 // that could potentially see it via delegation.
119 ciKlass* get_klass_by_name(ciKlass* accessing_klass,
120 ciSymbol* klass_name,
121 bool require_local);
122
123 // Constant pool access.
124 ciKlass* get_klass_by_index(const constantPoolHandle& cpool,
125 int klass_index,
126 bool& is_accessible,
127 ciInstanceKlass* loading_klass);
128 ciConstant get_constant_by_index(const constantPoolHandle& cpool,
129 int pool_index, int cache_index,
130 ciInstanceKlass* accessor);
131 ciField* get_field_by_index(ciInstanceKlass* loading_klass,
132 int field_index);
133 ciMethod* get_method_by_index(const constantPoolHandle& cpool,
134 int method_index, Bytecodes::Code bc,
135 ciInstanceKlass* loading_klass);
136
137 // Implementation methods for loading and constant pool access.
138 ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass,
139 const constantPoolHandle& cpool,
140 ciSymbol* klass_name,
141 bool require_local);
142 ciKlass* get_klass_by_index_impl(const constantPoolHandle& cpool,
143 int klass_index,
144 bool& is_accessible,
145 ciInstanceKlass* loading_klass);
146 ciConstant get_constant_by_index_impl(const constantPoolHandle& cpool,
147 int pool_index, int cache_index,
148 ciInstanceKlass* loading_klass);
149 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
150 int field_index);
151 ciMethod* get_method_by_index_impl(const constantPoolHandle& cpool,
152 int method_index, Bytecodes::Code bc,
153 ciInstanceKlass* loading_klass);
154
155 // Helper methods
180 return _factory->get_symbol(o);
181 }
182 }
183
184 ciMetadata* get_metadata(Metadata* o) {
185 if (o == NULL) {
186 return NULL;
187 } else {
188 return _factory->get_metadata(o);
189 }
190 }
191
192 ciMetadata* cached_metadata(Metadata* o) {
193 return _factory->cached_metadata(o);
194 }
195
196 ciInstance* get_instance(oop o) {
197 if (o == NULL) return NULL;
198 return get_object(o)->as_instance();
199 }
200 ciObjArrayKlass* get_obj_array_klass(Klass* o) {
201 if (o == NULL) return NULL;
202 return get_metadata(o)->as_obj_array_klass();
203 }
204 ciTypeArrayKlass* get_type_array_klass(Klass* o) {
205 if (o == NULL) return NULL;
206 return get_metadata(o)->as_type_array_klass();
207 }
208 ciKlass* get_klass(Klass* o) {
209 if (o == NULL) return NULL;
210 return get_metadata(o)->as_klass();
211 }
212 ciInstanceKlass* get_instance_klass(Klass* o) {
213 if (o == NULL) return NULL;
214 return get_metadata(o)->as_instance_klass();
215 }
216 ciMethod* get_method(Method* o) {
217 if (o == NULL) return NULL;
218 return get_metadata(o)->as_method();
219 }
|
116 // The CI treats a klass as loaded if it is consistently defined in
117 // another loader, even if it hasn't yet been loaded in all loaders
118 // that could potentially see it via delegation.
119 ciKlass* get_klass_by_name(ciKlass* accessing_klass,
120 ciSymbol* klass_name,
121 bool require_local);
122
123 // Constant pool access.
124 ciKlass* get_klass_by_index(const constantPoolHandle& cpool,
125 int klass_index,
126 bool& is_accessible,
127 ciInstanceKlass* loading_klass);
128 ciConstant get_constant_by_index(const constantPoolHandle& cpool,
129 int pool_index, int cache_index,
130 ciInstanceKlass* accessor);
131 ciField* get_field_by_index(ciInstanceKlass* loading_klass,
132 int field_index);
133 ciMethod* get_method_by_index(const constantPoolHandle& cpool,
134 int method_index, Bytecodes::Code bc,
135 ciInstanceKlass* loading_klass);
136 bool is_inline_klass(const constantPoolHandle& cpool,
137 int klass_index);
138
139 // Implementation methods for loading and constant pool access.
140 ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass,
141 const constantPoolHandle& cpool,
142 ciSymbol* klass_name,
143 bool require_local);
144 ciKlass* get_klass_by_index_impl(const constantPoolHandle& cpool,
145 int klass_index,
146 bool& is_accessible,
147 ciInstanceKlass* loading_klass);
148 ciConstant get_constant_by_index_impl(const constantPoolHandle& cpool,
149 int pool_index, int cache_index,
150 ciInstanceKlass* loading_klass);
151 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
152 int field_index);
153 ciMethod* get_method_by_index_impl(const constantPoolHandle& cpool,
154 int method_index, Bytecodes::Code bc,
155 ciInstanceKlass* loading_klass);
156
157 // Helper methods
182 return _factory->get_symbol(o);
183 }
184 }
185
186 ciMetadata* get_metadata(Metadata* o) {
187 if (o == NULL) {
188 return NULL;
189 } else {
190 return _factory->get_metadata(o);
191 }
192 }
193
194 ciMetadata* cached_metadata(Metadata* o) {
195 return _factory->cached_metadata(o);
196 }
197
198 ciInstance* get_instance(oop o) {
199 if (o == NULL) return NULL;
200 return get_object(o)->as_instance();
201 }
202 ciFlatArrayKlass* get_flat_array_klass(Klass* o) {
203 if (o == NULL) return NULL;
204 return get_metadata(o)->as_flat_array_klass();
205 }
206 ciObjArrayKlass* get_obj_array_klass(Klass* o) {
207 if (o == NULL) return NULL;
208 return get_metadata(o)->as_obj_array_klass();
209 }
210 ciTypeArrayKlass* get_type_array_klass(Klass* o) {
211 if (o == NULL) return NULL;
212 return get_metadata(o)->as_type_array_klass();
213 }
214 ciKlass* get_klass(Klass* o) {
215 if (o == NULL) return NULL;
216 return get_metadata(o)->as_klass();
217 }
218 ciInstanceKlass* get_instance_klass(Klass* o) {
219 if (o == NULL) return NULL;
220 return get_metadata(o)->as_instance_klass();
221 }
222 ciMethod* get_method(Method* o) {
223 if (o == NULL) return NULL;
224 return get_metadata(o)->as_method();
225 }
|