src/hotspot/share/interpreter/rewriter.cpp
changeset 48826 c4d9d1b08e2e
parent 48794 ea0d0781c63c
child 49372 3bb8b00832d0
equal deleted inserted replaced
48825:ef8a98bc71f8 48826:c4d9d1b08e2e
    46       case JVM_CONSTANT_InterfaceMethodref:
    46       case JVM_CONSTANT_InterfaceMethodref:
    47       case JVM_CONSTANT_Fieldref          : // fall through
    47       case JVM_CONSTANT_Fieldref          : // fall through
    48       case JVM_CONSTANT_Methodref         : // fall through
    48       case JVM_CONSTANT_Methodref         : // fall through
    49         add_cp_cache_entry(i);
    49         add_cp_cache_entry(i);
    50         break;
    50         break;
    51       case JVM_CONSTANT_String:
    51       case JVM_CONSTANT_Dynamic:
       
    52         assert(_pool->has_dynamic_constant(), "constant pool's _has_dynamic_constant flag not set");
       
    53         add_resolved_references_entry(i);
       
    54         break;
       
    55       case JVM_CONSTANT_String            : // fall through
    52       case JVM_CONSTANT_MethodHandle      : // fall through
    56       case JVM_CONSTANT_MethodHandle      : // fall through
    53       case JVM_CONSTANT_MethodType        : // fall through
    57       case JVM_CONSTANT_MethodType        : // fall through
    54         add_resolved_references_entry(i);
    58         add_resolved_references_entry(i);
    55         break;
    59         break;
    56       case JVM_CONSTANT_Utf8:
    60       case JVM_CONSTANT_Utf8:
   319   if (!reverse) {
   323   if (!reverse) {
   320     assert((*bcp) == (is_wide ? Bytecodes::_ldc_w : Bytecodes::_ldc), "not ldc bytecode");
   324     assert((*bcp) == (is_wide ? Bytecodes::_ldc_w : Bytecodes::_ldc), "not ldc bytecode");
   321     address p = bcp + offset;
   325     address p = bcp + offset;
   322     int cp_index = is_wide ? Bytes::get_Java_u2(p) : (u1)(*p);
   326     int cp_index = is_wide ? Bytes::get_Java_u2(p) : (u1)(*p);
   323     constantTag tag = _pool->tag_at(cp_index).value();
   327     constantTag tag = _pool->tag_at(cp_index).value();
   324     if (tag.is_method_handle() || tag.is_method_type() || tag.is_string()) {
   328 
       
   329     if (tag.is_method_handle() ||
       
   330         tag.is_method_type() ||
       
   331         tag.is_string() ||
       
   332         (tag.is_dynamic_constant() &&
       
   333          // keep regular ldc interpreter logic for condy primitives
       
   334          is_reference_type(FieldType::basic_type(_pool->uncached_signature_ref_at(cp_index))))
       
   335         ) {
   325       int ref_index = cp_entry_to_resolved_references(cp_index);
   336       int ref_index = cp_entry_to_resolved_references(cp_index);
   326       if (is_wide) {
   337       if (is_wide) {
   327         (*bcp) = Bytecodes::_fast_aldc_w;
   338         (*bcp) = Bytecodes::_fast_aldc_w;
   328         assert(ref_index == (u2)ref_index, "index overflow");
   339         assert(ref_index == (u2)ref_index, "index overflow");
   329         Bytes::put_native_u2(p, ref_index);
   340         Bytes::put_native_u2(p, ref_index);