254 ConstantPoolCacheEntry* invokedynamic_cp_cache_entry_at(int indy_index) const {
255 // decode index that invokedynamic points to.
256 int cp_cache_index = invokedynamic_cp_cache_index(indy_index);
257 return cache()->entry_at(cp_cache_index);
258 }
259 // Given the per-instruction index of an indy instruction, report the
260 // main constant pool entry for its bootstrap specifier.
261 // From there, uncached_name/signature_ref_at will get the name/type.
262 int invokedynamic_bootstrap_ref_index_at(int indy_index) const {
263 return invokedynamic_cp_cache_entry_at(indy_index)->constant_pool_index();
264 }
265
266 // Assembly code support
267 static int tags_offset_in_bytes() { return offset_of(ConstantPool, _tags); }
268 static int cache_offset_in_bytes() { return offset_of(ConstantPool, _cache); }
269 static int pool_holder_offset_in_bytes() { return offset_of(ConstantPool, _pool_holder); }
270 static int resolved_klasses_offset_in_bytes() { return offset_of(ConstantPool, _resolved_klasses); }
271
272 // Storing constants
273
274 // For temporary use while constructing constant pool
275 void klass_index_at_put(int which, int name_index) {
276 tag_at_put(which, JVM_CONSTANT_ClassIndex);
277 *int_at_addr(which) = name_index;
278 }
279
280 // Unsafe anonymous class support:
281 void klass_at_put(int class_index, int name_index, int resolved_klass_index, Klass* k, Symbol* name);
282 void klass_at_put(int class_index, Klass* k);
283
284 void unresolved_klass_at_put(int which, int name_index, int resolved_klass_index) {
285 release_tag_at_put(which, JVM_CONSTANT_UnresolvedClass);
286
287 assert((name_index & 0xffff0000) == 0, "must be");
288 assert((resolved_klass_index & 0xffff0000) == 0, "must be");
289 *int_at_addr(which) =
290 build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
291 }
292
293 void method_handle_index_at_put(int which, int ref_kind, int ref_index) {
294 tag_at_put(which, JVM_CONSTANT_MethodHandle);
295 *int_at_addr(which) = ((jint) ref_index<<16) | ref_kind;
296 }
297
298 void method_type_index_at_put(int which, int ref_index) {
299 tag_at_put(which, JVM_CONSTANT_MethodType);
300 *int_at_addr(which) = ref_index;
301 }
302
|
254 ConstantPoolCacheEntry* invokedynamic_cp_cache_entry_at(int indy_index) const {
255 // decode index that invokedynamic points to.
256 int cp_cache_index = invokedynamic_cp_cache_index(indy_index);
257 return cache()->entry_at(cp_cache_index);
258 }
259 // Given the per-instruction index of an indy instruction, report the
260 // main constant pool entry for its bootstrap specifier.
261 // From there, uncached_name/signature_ref_at will get the name/type.
262 int invokedynamic_bootstrap_ref_index_at(int indy_index) const {
263 return invokedynamic_cp_cache_entry_at(indy_index)->constant_pool_index();
264 }
265
266 // Assembly code support
267 static int tags_offset_in_bytes() { return offset_of(ConstantPool, _tags); }
268 static int cache_offset_in_bytes() { return offset_of(ConstantPool, _cache); }
269 static int pool_holder_offset_in_bytes() { return offset_of(ConstantPool, _pool_holder); }
270 static int resolved_klasses_offset_in_bytes() { return offset_of(ConstantPool, _resolved_klasses); }
271
272 // Storing constants
273
274 // For temporary use while constructing constant pool. Used during a retransform/class redefinition as well.
275 void klass_index_at_put(int which, int name_index) {
276 tag_at_put(which, JVM_CONSTANT_ClassIndex);
277 *int_at_addr(which) = name_index;
278 }
279
280 // Unsafe anonymous class support:
281 void klass_at_put(int class_index, int name_index, int resolved_klass_index, Klass* k, Symbol* name);
282 void klass_at_put(int class_index, Klass* k);
283
284 void unresolved_qdescriptor_at_put(int which, int name_index, int resolved_klass_index) {
285 release_tag_at_put(which, JVM_CONSTANT_UnresolvedClass | (jbyte)JVM_CONSTANT_QDESC_BIT);
286
287 assert((name_index & 0xffff0000) == 0, "must be");
288 assert((resolved_klass_index & 0xffff0000) == 0, "must be");
289 *int_at_addr(which) =
290 build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
291 }
292
293 void unresolved_klass_at_put(int which, int name_index, int resolved_klass_index) {
294 release_tag_at_put(which, JVM_CONSTANT_UnresolvedClass);
295
296 assert((name_index & 0xffff0000) == 0, "must be");
297 assert((resolved_klass_index & 0xffff0000) == 0, "must be");
298 *int_at_addr(which) =
299 build_int_from_shorts((jushort)resolved_klass_index, (jushort)name_index);
300 }
301
302 void method_handle_index_at_put(int which, int ref_kind, int ref_index) {
303 tag_at_put(which, JVM_CONSTANT_MethodHandle);
304 *int_at_addr(which) = ((jint) ref_index<<16) | ref_kind;
305 }
306
307 void method_type_index_at_put(int which, int ref_index) {
308 tag_at_put(which, JVM_CONSTANT_MethodType);
309 *int_at_addr(which) = ref_index;
310 }
311
|