245 int cp_to_object_index(int index);
246
247 void set_resolved_klasses(Array<Klass*>* rk) { _resolved_klasses = rk; }
248 Array<Klass*>* resolved_klasses() const { return _resolved_klasses; }
249 void allocate_resolved_klasses(ClassLoaderData* loader_data, int num_klasses, TRAPS);
250 void initialize_unresolved_klasses(ClassLoaderData* loader_data, TRAPS);
251
252 // Given the per-instruction index of an indy instruction, report the
253 // main constant pool entry for its bootstrap specifier.
254 // From there, uncached_name/signature_ref_at will get the name/type.
255 inline u2 invokedynamic_bootstrap_ref_index_at(int indy_index) const;
256
257 // Assembly code support
258 static ByteSize tags_offset() { return byte_offset_of(ConstantPool, _tags); }
259 static ByteSize cache_offset() { return byte_offset_of(ConstantPool, _cache); }
260 static ByteSize pool_holder_offset() { return byte_offset_of(ConstantPool, _pool_holder); }
261 static ByteSize resolved_klasses_offset() { return byte_offset_of(ConstantPool, _resolved_klasses); }
262
263 // Storing constants
264
265 // For temporary use while constructing constant pool
266 void klass_index_at_put(int cp_index, int name_index) {
267 tag_at_put(cp_index, JVM_CONSTANT_ClassIndex);
268 *int_at_addr(cp_index) = name_index;
269 }
270
271 // Hidden class support:
272 void klass_at_put(int class_index, Klass* k);
273
274 void unresolved_klass_at_put(int cp_index, int name_index, int resolved_klass_index) {
275 release_tag_at_put(cp_index, JVM_CONSTANT_UnresolvedClass);
276
277 assert((name_index & 0xffff0000) == 0, "must be");
278 assert((resolved_klass_index & 0xffff0000) == 0, "must be");
279 *int_at_addr(cp_index) =
280 build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
281 }
282
283 void method_handle_index_at_put(int cp_index, int ref_kind, int ref_index) {
284 tag_at_put(cp_index, JVM_CONSTANT_MethodHandle);
285 *int_at_addr(cp_index) = ((jint) ref_index<<16) | ref_kind;
|
245 int cp_to_object_index(int index);
246
247 void set_resolved_klasses(Array<Klass*>* rk) { _resolved_klasses = rk; }
248 Array<Klass*>* resolved_klasses() const { return _resolved_klasses; }
249 void allocate_resolved_klasses(ClassLoaderData* loader_data, int num_klasses, TRAPS);
250 void initialize_unresolved_klasses(ClassLoaderData* loader_data, TRAPS);
251
252 // Given the per-instruction index of an indy instruction, report the
253 // main constant pool entry for its bootstrap specifier.
254 // From there, uncached_name/signature_ref_at will get the name/type.
255 inline u2 invokedynamic_bootstrap_ref_index_at(int indy_index) const;
256
257 // Assembly code support
258 static ByteSize tags_offset() { return byte_offset_of(ConstantPool, _tags); }
259 static ByteSize cache_offset() { return byte_offset_of(ConstantPool, _cache); }
260 static ByteSize pool_holder_offset() { return byte_offset_of(ConstantPool, _pool_holder); }
261 static ByteSize resolved_klasses_offset() { return byte_offset_of(ConstantPool, _resolved_klasses); }
262
263 // Storing constants
264
265 // For temporary use while constructing constant pool. Used during a retransform/class redefinition as well.
266 void klass_index_at_put(int cp_index, int name_index) {
267 tag_at_put(cp_index, JVM_CONSTANT_ClassIndex);
268 *int_at_addr(cp_index) = name_index;
269 }
270
271 // Hidden class support:
272 void klass_at_put(int class_index, Klass* k);
273
274 void unresolved_klass_at_put(int cp_index, int name_index, int resolved_klass_index) {
275 release_tag_at_put(cp_index, JVM_CONSTANT_UnresolvedClass);
276
277 assert((name_index & 0xffff0000) == 0, "must be");
278 assert((resolved_klass_index & 0xffff0000) == 0, "must be");
279 *int_at_addr(cp_index) =
280 build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
281 }
282
283 void method_handle_index_at_put(int cp_index, int ref_kind, int ref_index) {
284 tag_at_put(cp_index, JVM_CONSTANT_MethodHandle);
285 *int_at_addr(cp_index) = ((jint) ref_index<<16) | ref_kind;
|