< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page
rev 52749 : Bootstrap method consolidation
* clean up and simplify JDK support code for BSM invocation
* simplify JVM bootstrap handshake: use BootstrapCallInfo only
* remove unused JVM paths and data fields
* move bootstrap argument processing from MethodHandleNatives to ConstantPool
* remove ConstantGroup; merge argument access into BootstrapCallInfo
* adjust BSM argument access: remove copyArguments, add argumentRef API
* add metadata-free BSM modes, including symbolic arguments from CP


 545             break;
 546           }
 547           default: {
 548             classfile_parse_error(
 549               "Bad method handle kind at constant pool index %u in class file %s",
 550               index, CHECK);
 551           }
 552         } // switch(refkind)
 553         // Keep the ref_index unchanged.  It will be indirected at link-time.
 554         break;
 555       } // case MethodHandle
 556       case JVM_CONSTANT_MethodType: {
 557         const int ref_index = cp->method_type_index_at(index);
 558         check_property(valid_symbol_at(ref_index),
 559           "Invalid constant pool index %u in class file %s",
 560           ref_index, CHECK);
 561         break;
 562       }
 563       case JVM_CONSTANT_Dynamic: {
 564         const int name_and_type_ref_index =
 565           cp->invoke_dynamic_name_and_type_ref_index_at(index);
 566 
 567         check_property(valid_cp_range(name_and_type_ref_index, length) &&
 568           cp->tag_at(name_and_type_ref_index).is_name_and_type(),
 569           "Invalid constant pool index %u in class file %s",
 570           name_and_type_ref_index, CHECK);
 571         // bootstrap specifier index must be checked later,
 572         // when BootstrapMethods attr is available
 573 
 574         // Mark the constant pool as having a CONSTANT_Dynamic_info structure
 575         cp->set_has_dynamic_constant();
 576         break;
 577       }
 578       case JVM_CONSTANT_InvokeDynamic: {
 579         const int name_and_type_ref_index =
 580           cp->invoke_dynamic_name_and_type_ref_index_at(index);
 581 
 582         check_property(valid_cp_range(name_and_type_ref_index, length) &&
 583           cp->tag_at(name_and_type_ref_index).is_name_and_type(),
 584           "Invalid constant pool index %u in class file %s",
 585           name_and_type_ref_index, CHECK);
 586         // bootstrap specifier index must be checked later,
 587         // when BootstrapMethods attr is available
 588         break;
 589       }
 590       default: {
 591         fatal("bad constant pool tag value %u", cp->tag_at(index).value());
 592         ShouldNotReachHere();
 593         break;
 594       }
 595     } // switch(tag)
 596   } // end of for
 597 
 598   _first_patched_klass_resolved_index = num_klasses;
 599   cp->allocate_resolved_klasses(_loader_data, num_klasses + _max_num_patched_klasses, CHECK);
 600 




 545             break;
 546           }
 547           default: {
 548             classfile_parse_error(
 549               "Bad method handle kind at constant pool index %u in class file %s",
 550               index, CHECK);
 551           }
 552         } // switch(refkind)
 553         // Keep the ref_index unchanged.  It will be indirected at link-time.
 554         break;
 555       } // case MethodHandle
 556       case JVM_CONSTANT_MethodType: {
 557         const int ref_index = cp->method_type_index_at(index);
 558         check_property(valid_symbol_at(ref_index),
 559           "Invalid constant pool index %u in class file %s",
 560           ref_index, CHECK);
 561         break;
 562       }
 563       case JVM_CONSTANT_Dynamic: {
 564         const int name_and_type_ref_index =
 565           cp->bootstrap_name_and_type_ref_index_at(index);
 566 
 567         check_property(valid_cp_range(name_and_type_ref_index, length) &&
 568           cp->tag_at(name_and_type_ref_index).is_name_and_type(),
 569           "Invalid constant pool index %u in class file %s",
 570           name_and_type_ref_index, CHECK);
 571         // bootstrap specifier index must be checked later,
 572         // when BootstrapMethods attr is available
 573 
 574         // Mark the constant pool as having a CONSTANT_Dynamic_info structure
 575         cp->set_has_dynamic_constant();
 576         break;
 577       }
 578       case JVM_CONSTANT_InvokeDynamic: {
 579         const int name_and_type_ref_index =
 580           cp->bootstrap_name_and_type_ref_index_at(index);
 581 
 582         check_property(valid_cp_range(name_and_type_ref_index, length) &&
 583           cp->tag_at(name_and_type_ref_index).is_name_and_type(),
 584           "Invalid constant pool index %u in class file %s",
 585           name_and_type_ref_index, CHECK);
 586         // bootstrap specifier index must be checked later,
 587         // when BootstrapMethods attr is available
 588         break;
 589       }
 590       default: {
 591         fatal("bad constant pool tag value %u", cp->tag_at(index).value());
 592         ShouldNotReachHere();
 593         break;
 594       }
 595     } // switch(tag)
 596   } // end of for
 597 
 598   _first_patched_klass_resolved_index = num_klasses;
 599   cp->allocate_resolved_klasses(_loader_data, num_klasses + _max_num_patched_klasses, CHECK);
 600 


< prev index next >