hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 14588 8ec26d2d9339
parent 14488 ab48109f7d1b
child 14590 7d6b69f12b36
equal deleted inserted replaced
14584:bd4290e6d0a5 14588:8ec26d2d9339
  2948 }
  2948 }
  2949 #endif // ndef PRODUCT
  2949 #endif // ndef PRODUCT
  2950 
  2950 
  2951 
  2951 
  2952 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
  2952 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
  2953                                                     Handle class_loader,
  2953                                                     ClassLoaderData* loader_data,
  2954                                                     Handle protection_domain,
  2954                                                     Handle protection_domain,
  2955                                                     KlassHandle host_klass,
  2955                                                     KlassHandle host_klass,
  2956                                                     GrowableArray<Handle>* cp_patches,
  2956                                                     GrowableArray<Handle>* cp_patches,
  2957                                                     TempNewSymbol& parsed_name,
  2957                                                     TempNewSymbol& parsed_name,
  2958                                                     bool verify,
  2958                                                     bool verify,
  2962   // If RedefineClasses() was used before the retransformable
  2962   // If RedefineClasses() was used before the retransformable
  2963   // agent attached, then the cached class bytes may not be the
  2963   // agent attached, then the cached class bytes may not be the
  2964   // original class bytes.
  2964   // original class bytes.
  2965   unsigned char *cached_class_file_bytes = NULL;
  2965   unsigned char *cached_class_file_bytes = NULL;
  2966   jint cached_class_file_length;
  2966   jint cached_class_file_length;
  2967   ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
  2967   Handle class_loader(THREAD, loader_data->class_loader());
  2968   bool has_default_methods = false;
  2968   bool has_default_methods = false;
  2969   ResourceMark rm(THREAD);
  2969   ResourceMark rm(THREAD);
  2970 
  2970 
  2971   ClassFileStream* cfs = stream();
  2971   ClassFileStream* cfs = stream();
  2972   // Timing
  2972   // Timing
  3003     }
  3003     }
  3004 
  3004 
  3005     unsigned char* ptr = cfs->buffer();
  3005     unsigned char* ptr = cfs->buffer();
  3006     unsigned char* end_ptr = cfs->buffer() + cfs->length();
  3006     unsigned char* end_ptr = cfs->buffer() + cfs->length();
  3007 
  3007 
  3008     JvmtiExport::post_class_file_load_hook(name, class_loader, protection_domain,
  3008     JvmtiExport::post_class_file_load_hook(name, class_loader(), protection_domain,
  3009                                            &ptr, &end_ptr,
  3009                                            &ptr, &end_ptr,
  3010                                            &cached_class_file_bytes,
  3010                                            &cached_class_file_bytes,
  3011                                            &cached_class_file_length);
  3011                                            &cached_class_file_length);
  3012 
  3012 
  3013     if (ptr != cfs->buffer()) {
  3013     if (ptr != cfs->buffer()) {
  4002   // If it cannot be fast-path allocated, set a bit in the layout helper.
  4002   // If it cannot be fast-path allocated, set a bit in the layout helper.
  4003   // See documentation of InstanceKlass::can_be_fastpath_allocated().
  4003   // See documentation of InstanceKlass::can_be_fastpath_allocated().
  4004   assert(k->size_helper() > 0, "layout_helper is initialized");
  4004   assert(k->size_helper() > 0, "layout_helper is initialized");
  4005   if ((!RegisterFinalizersAtInit && k->has_finalizer())
  4005   if ((!RegisterFinalizersAtInit && k->has_finalizer())
  4006       || k->is_abstract() || k->is_interface()
  4006       || k->is_abstract() || k->is_interface()
  4007       || (k->name() == vmSymbols::java_lang_Class()
  4007       || (k->name() == vmSymbols::java_lang_Class() && k->class_loader() == NULL)
  4008           && k->class_loader_data()->is_the_null_class_loader_data())
       
  4009       || k->size_helper() >= FastAllocateSizeLimit) {
  4008       || k->size_helper() >= FastAllocateSizeLimit) {
  4010     // Forbid fast-path allocation.
  4009     // Forbid fast-path allocation.
  4011     jint lh = Klass::instance_layout_helper(k->size_helper(), true);
  4010     jint lh = Klass::instance_layout_helper(k->size_helper(), true);
  4012     k->set_layout_helper(lh);
  4011     k->set_layout_helper(lh);
  4013   }
  4012   }