hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 9172 a4e13ccafc44
parent 9117 30d757743e56
child 10009 9fa7d67d09fe
equal deleted inserted replaced
9171:16f9b07adedb 9172:a4e13ccafc44
  2194                                               objArrayHandle methods_parameter_annotations,
  2194                                               objArrayHandle methods_parameter_annotations,
  2195                                               objArrayHandle methods_default_annotations,
  2195                                               objArrayHandle methods_default_annotations,
  2196                                               TRAPS) {
  2196                                               TRAPS) {
  2197   typeArrayHandle nullHandle;
  2197   typeArrayHandle nullHandle;
  2198   int length = methods()->length();
  2198   int length = methods()->length();
  2199   // If JVMTI original method ordering is enabled we have to
  2199   // If JVMTI original method ordering or sharing is enabled we have to
  2200   // remember the original class file ordering.
  2200   // remember the original class file ordering.
  2201   // We temporarily use the vtable_index field in the methodOop to store the
  2201   // We temporarily use the vtable_index field in the methodOop to store the
  2202   // class file index, so we can read in after calling qsort.
  2202   // class file index, so we can read in after calling qsort.
  2203   if (JvmtiExport::can_maintain_original_method_order()) {
  2203   // Put the method ordering in the shared archive.
       
  2204   if (JvmtiExport::can_maintain_original_method_order() || DumpSharedSpaces) {
  2204     for (int index = 0; index < length; index++) {
  2205     for (int index = 0; index < length; index++) {
  2205       methodOop m = methodOop(methods->obj_at(index));
  2206       methodOop m = methodOop(methods->obj_at(index));
  2206       assert(!m->valid_vtable_index(), "vtable index should not be set");
  2207       assert(!m->valid_vtable_index(), "vtable index should not be set");
  2207       m->set_vtable_index(index);
  2208       m->set_vtable_index(index);
  2208     }
  2209     }
  2212   methodOopDesc::sort_methods(methods(),
  2213   methodOopDesc::sort_methods(methods(),
  2213                               methods_annotations(),
  2214                               methods_annotations(),
  2214                               methods_parameter_annotations(),
  2215                               methods_parameter_annotations(),
  2215                               methods_default_annotations());
  2216                               methods_default_annotations());
  2216 
  2217 
  2217   // If JVMTI original method ordering is enabled construct int array remembering the original ordering
  2218   // If JVMTI original method ordering or sharing is enabled construct int
  2218   if (JvmtiExport::can_maintain_original_method_order()) {
  2219   // array remembering the original ordering
       
  2220   if (JvmtiExport::can_maintain_original_method_order() || DumpSharedSpaces) {
  2219     typeArrayOop new_ordering = oopFactory::new_permanent_intArray(length, CHECK_(nullHandle));
  2221     typeArrayOop new_ordering = oopFactory::new_permanent_intArray(length, CHECK_(nullHandle));
  2220     typeArrayHandle method_ordering(THREAD, new_ordering);
  2222     typeArrayHandle method_ordering(THREAD, new_ordering);
  2221     for (int index = 0; index < length; index++) {
  2223     for (int index = 0; index < length; index++) {
  2222       methodOop m = methodOop(methods->obj_at(index));
  2224       methodOop m = methodOop(methods->obj_at(index));
  2223       int old_index = m->vtable_index();
  2225       int old_index = m->vtable_index();