282 int i = which; |
282 int i = which; |
283 if (!uncached && cache() != NULL) { |
283 if (!uncached && cache() != NULL) { |
284 if (constantPoolCacheOopDesc::is_secondary_index(which)) { |
284 if (constantPoolCacheOopDesc::is_secondary_index(which)) { |
285 // Invokedynamic index. |
285 // Invokedynamic index. |
286 int pool_index = cache()->main_entry_at(which)->constant_pool_index(); |
286 int pool_index = cache()->main_entry_at(which)->constant_pool_index(); |
287 if (!AllowTransitionalJSR292 || tag_at(pool_index).is_invoke_dynamic()) |
287 pool_index = invoke_dynamic_name_and_type_ref_index_at(pool_index); |
288 pool_index = invoke_dynamic_name_and_type_ref_index_at(pool_index); |
|
289 assert(tag_at(pool_index).is_name_and_type(), ""); |
288 assert(tag_at(pool_index).is_name_and_type(), ""); |
290 return pool_index; |
289 return pool_index; |
291 } |
290 } |
292 // change byte-ordering and go via cache |
291 // change byte-ordering and go via cache |
293 i = remap_instruction_operand_from_cache(which); |
292 i = remap_instruction_operand_from_cache(which); |
294 } else { |
293 } else { |
295 if (AllowTransitionalJSR292 && tag_at(which).is_name_and_type()) |
|
296 // invokedynamic index is a simple name-and-type |
|
297 return which; |
|
298 if (tag_at(which).is_invoke_dynamic()) { |
294 if (tag_at(which).is_invoke_dynamic()) { |
299 int pool_index = invoke_dynamic_name_and_type_ref_index_at(which); |
295 int pool_index = invoke_dynamic_name_and_type_ref_index_at(which); |
300 assert(tag_at(pool_index).is_name_and_type(), ""); |
296 assert(tag_at(pool_index).is_name_and_type(), ""); |
301 return pool_index; |
297 return pool_index; |
302 } |
298 } |
951 } |
947 } |
952 } |
948 } |
953 } break; |
949 } break; |
954 |
950 |
955 case JVM_CONSTANT_InvokeDynamic: |
951 case JVM_CONSTANT_InvokeDynamic: |
956 case JVM_CONSTANT_InvokeDynamicTrans: |
|
957 { |
952 { |
958 int k1 = invoke_dynamic_bootstrap_method_ref_index_at(index1); |
953 int k1 = invoke_dynamic_bootstrap_method_ref_index_at(index1); |
959 int k2 = cp2->invoke_dynamic_bootstrap_method_ref_index_at(index2); |
954 int k2 = cp2->invoke_dynamic_bootstrap_method_ref_index_at(index2); |
960 bool match = compare_entry_to(k1, cp2, k2, CHECK_false); |
955 bool match = compare_entry_to(k1, cp2, k2, CHECK_false); |
961 if (!match) return false; |
956 if (!match) return false; |
1225 int k1 = from_cp->method_handle_ref_kind_at(from_i); |
1220 int k1 = from_cp->method_handle_ref_kind_at(from_i); |
1226 int k2 = from_cp->method_handle_index_at(from_i); |
1221 int k2 = from_cp->method_handle_index_at(from_i); |
1227 to_cp->method_handle_index_at_put(to_i, k1, k2); |
1222 to_cp->method_handle_index_at_put(to_i, k1, k2); |
1228 } break; |
1223 } break; |
1229 |
1224 |
1230 case JVM_CONSTANT_InvokeDynamicTrans: |
|
1231 { |
|
1232 int k1 = from_cp->invoke_dynamic_bootstrap_method_ref_index_at(from_i); |
|
1233 int k2 = from_cp->invoke_dynamic_name_and_type_ref_index_at(from_i); |
|
1234 to_cp->invoke_dynamic_trans_at_put(to_i, k1, k2); |
|
1235 } break; |
|
1236 |
|
1237 case JVM_CONSTANT_InvokeDynamic: |
1225 case JVM_CONSTANT_InvokeDynamic: |
1238 { |
1226 { |
1239 int k1 = from_cp->invoke_dynamic_bootstrap_specifier_index(from_i); |
1227 int k1 = from_cp->invoke_dynamic_bootstrap_specifier_index(from_i); |
1240 int k2 = from_cp->invoke_dynamic_name_and_type_ref_index_at(from_i); |
1228 int k2 = from_cp->invoke_dynamic_name_and_type_ref_index_at(from_i); |
1241 k1 += operand_array_length(to_cp->operands()); // to_cp might already have operands |
1229 k1 += operand_array_length(to_cp->operands()); // to_cp might already have operands |
1457 case JVM_CONSTANT_InterfaceMethodref: |
1445 case JVM_CONSTANT_InterfaceMethodref: |
1458 case JVM_CONSTANT_NameAndType: |
1446 case JVM_CONSTANT_NameAndType: |
1459 return 5; |
1447 return 5; |
1460 |
1448 |
1461 case JVM_CONSTANT_InvokeDynamic: |
1449 case JVM_CONSTANT_InvokeDynamic: |
1462 case JVM_CONSTANT_InvokeDynamicTrans: |
|
1463 // u1 tag, u2 bsm, u2 nt |
1450 // u1 tag, u2 bsm, u2 nt |
1464 return 5; |
1451 return 5; |
1465 |
1452 |
1466 case JVM_CONSTANT_Long: |
1453 case JVM_CONSTANT_Long: |
1467 case JVM_CONSTANT_Double: |
1454 case JVM_CONSTANT_Double: |
1672 idx1 = method_type_index_at(idx); |
1659 idx1 = method_type_index_at(idx); |
1673 Bytes::put_Java_u2((address) (bytes+1), idx1); |
1660 Bytes::put_Java_u2((address) (bytes+1), idx1); |
1674 DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1)); |
1661 DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1)); |
1675 break; |
1662 break; |
1676 } |
1663 } |
1677 case JVM_CONSTANT_InvokeDynamicTrans: |
|
1678 case JVM_CONSTANT_InvokeDynamic: { |
1664 case JVM_CONSTANT_InvokeDynamic: { |
1679 *bytes = tag; |
1665 *bytes = tag; |
1680 idx1 = extract_low_short_from_int(*int_at_addr(idx)); |
1666 idx1 = extract_low_short_from_int(*int_at_addr(idx)); |
1681 idx2 = extract_high_short_from_int(*int_at_addr(idx)); |
1667 idx2 = extract_high_short_from_int(*int_at_addr(idx)); |
1682 assert(idx2 == invoke_dynamic_name_and_type_ref_index_at(idx), "correct half of u4"); |
1668 assert(idx2 == invoke_dynamic_name_and_type_ref_index_at(idx), "correct half of u4"); |