< prev index next >

src/share/vm/oops/constantPool.cpp

Print this page




 392       int pool_index = invokedynamic_cp_cache_entry_at(which)->constant_pool_index();
 393       pool_index = invoke_dynamic_name_and_type_ref_index_at(pool_index);
 394       assert(tag_at(pool_index).is_name_and_type(), "");
 395       return pool_index;
 396     }
 397     // change byte-ordering and go via cache
 398     i = remap_instruction_operand_from_cache(which);
 399   } else {
 400     if (tag_at(which).is_invoke_dynamic()) {
 401       int pool_index = invoke_dynamic_name_and_type_ref_index_at(which);
 402       assert(tag_at(pool_index).is_name_and_type(), "");
 403       return pool_index;
 404     }
 405   }
 406   assert(tag_at(i).is_field_or_method(), "Corrupted constant pool");
 407   assert(!tag_at(i).is_invoke_dynamic(), "Must be handled above");
 408   jint ref_index = *int_at_addr(i);
 409   return extract_high_short_from_int(ref_index);
 410 }
 411 













 412 
 413 int ConstantPool::impl_klass_ref_index_at(int which, bool uncached) {
 414   guarantee(!ConstantPool::is_invokedynamic_index(which),
 415             "an invokedynamic instruction does not have a klass");
 416   int i = which;
 417   if (!uncached && cache() != NULL) {
 418     // change byte-ordering and go via cache
 419     i = remap_instruction_operand_from_cache(which);
 420   }
 421   assert(tag_at(i).is_field_or_method(), "Corrupted constant pool");
 422   jint ref_index = *int_at_addr(i);
 423   return extract_low_short_from_int(ref_index);
 424 }
 425 
 426 
 427 
 428 int ConstantPool::remap_instruction_operand_from_cache(int operand) {
 429   int cpc_index = operand;
 430   DEBUG_ONLY(cpc_index -= CPCACHE_INDEX_TAG);
 431   assert((int)(u2)cpc_index == cpc_index, "clean u2");




 392       int pool_index = invokedynamic_cp_cache_entry_at(which)->constant_pool_index();
 393       pool_index = invoke_dynamic_name_and_type_ref_index_at(pool_index);
 394       assert(tag_at(pool_index).is_name_and_type(), "");
 395       return pool_index;
 396     }
 397     // change byte-ordering and go via cache
 398     i = remap_instruction_operand_from_cache(which);
 399   } else {
 400     if (tag_at(which).is_invoke_dynamic()) {
 401       int pool_index = invoke_dynamic_name_and_type_ref_index_at(which);
 402       assert(tag_at(pool_index).is_name_and_type(), "");
 403       return pool_index;
 404     }
 405   }
 406   assert(tag_at(i).is_field_or_method(), "Corrupted constant pool");
 407   assert(!tag_at(i).is_invoke_dynamic(), "Must be handled above");
 408   jint ref_index = *int_at_addr(i);
 409   return extract_high_short_from_int(ref_index);
 410 }
 411 
 412 constantTag ConstantPool::impl_tag_ref_at(int which, bool uncached) {
 413   int pool_index = which;
 414   if (!uncached && cache() != NULL) {
 415     if (ConstantPool::is_invokedynamic_index(which)) {
 416       // Invokedynamic index is index into resolved_references
 417       pool_index = invokedynamic_cp_cache_entry_at(which)->constant_pool_index();
 418     } else {
 419       // change byte-ordering and go via cache
 420       pool_index = remap_instruction_operand_from_cache(which);
 421     }
 422   }
 423   return tag_at(pool_index);
 424 }
 425 
 426 int ConstantPool::impl_klass_ref_index_at(int which, bool uncached) {
 427   guarantee(!ConstantPool::is_invokedynamic_index(which),
 428             "an invokedynamic instruction does not have a klass");
 429   int i = which;
 430   if (!uncached && cache() != NULL) {
 431     // change byte-ordering and go via cache
 432     i = remap_instruction_operand_from_cache(which);
 433   }
 434   assert(tag_at(i).is_field_or_method(), "Corrupted constant pool");
 435   jint ref_index = *int_at_addr(i);
 436   return extract_low_short_from_int(ref_index);
 437 }
 438 
 439 
 440 
 441 int ConstantPool::remap_instruction_operand_from_cache(int operand) {
 442   int cpc_index = operand;
 443   DEBUG_ONLY(cpc_index -= CPCACHE_INDEX_TAG);
 444   assert((int)(u2)cpc_index == cpc_index, "clean u2");


< prev index next >