comparison src/share/vm/classfile/classFileParser.cpp @ 7187:5fafdef522c6

Merge
author johnc
date Fri, 30 Nov 2012 12:01:34 -0800
parents b2dbd323c668 90273fc0a981
children 35431a769282
comparison
equal deleted inserted replaced
7184:5505fbbae3d3 7187:5fafdef522c6
2947 } 2947 }
2948 #endif // ndef PRODUCT 2948 #endif // ndef PRODUCT
2949 2949
2950 2950
2951 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, 2951 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
2952 Handle class_loader, 2952 ClassLoaderData* loader_data,
2953 Handle protection_domain, 2953 Handle protection_domain,
2954 KlassHandle host_klass, 2954 KlassHandle host_klass,
2955 GrowableArray<Handle>* cp_patches, 2955 GrowableArray<Handle>* cp_patches,
2956 TempNewSymbol& parsed_name, 2956 TempNewSymbol& parsed_name,
2957 bool verify, 2957 bool verify,
2961 // If RedefineClasses() was used before the retransformable 2961 // If RedefineClasses() was used before the retransformable
2962 // agent attached, then the cached class bytes may not be the 2962 // agent attached, then the cached class bytes may not be the
2963 // original class bytes. 2963 // original class bytes.
2964 unsigned char *cached_class_file_bytes = NULL; 2964 unsigned char *cached_class_file_bytes = NULL;
2965 jint cached_class_file_length; 2965 jint cached_class_file_length;
2966 ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader()); 2966 Handle class_loader(THREAD, loader_data->class_loader());
2967 bool has_default_methods = false; 2967 bool has_default_methods = false;
2968 ResourceMark rm(THREAD); 2968 ResourceMark rm(THREAD);
2969 2969
2970 ClassFileStream* cfs = stream(); 2970 ClassFileStream* cfs = stream();
2971 // Timing 2971 // Timing
3002 } 3002 }
3003 3003
3004 unsigned char* ptr = cfs->buffer(); 3004 unsigned char* ptr = cfs->buffer();
3005 unsigned char* end_ptr = cfs->buffer() + cfs->length(); 3005 unsigned char* end_ptr = cfs->buffer() + cfs->length();
3006 3006
3007 JvmtiExport::post_class_file_load_hook(name, class_loader, protection_domain, 3007 JvmtiExport::post_class_file_load_hook(name, class_loader(), protection_domain,
3008 &ptr, &end_ptr, 3008 &ptr, &end_ptr,
3009 &cached_class_file_bytes, 3009 &cached_class_file_bytes,
3010 &cached_class_file_length); 3010 &cached_class_file_length);
3011 3011
3012 if (ptr != cfs->buffer()) { 3012 if (ptr != cfs->buffer()) {
4001 // If it cannot be fast-path allocated, set a bit in the layout helper. 4001 // If it cannot be fast-path allocated, set a bit in the layout helper.
4002 // See documentation of InstanceKlass::can_be_fastpath_allocated(). 4002 // See documentation of InstanceKlass::can_be_fastpath_allocated().
4003 assert(k->size_helper() > 0, "layout_helper is initialized"); 4003 assert(k->size_helper() > 0, "layout_helper is initialized");
4004 if ((!RegisterFinalizersAtInit && k->has_finalizer()) 4004 if ((!RegisterFinalizersAtInit && k->has_finalizer())
4005 || k->is_abstract() || k->is_interface() 4005 || k->is_abstract() || k->is_interface()
4006 || (k->name() == vmSymbols::java_lang_Class() 4006 || (k->name() == vmSymbols::java_lang_Class() && k->class_loader() == NULL)
4007 && k->class_loader_data()->is_the_null_class_loader_data())
4008 || k->size_helper() >= FastAllocateSizeLimit) { 4007 || k->size_helper() >= FastAllocateSizeLimit) {
4009 // Forbid fast-path allocation. 4008 // Forbid fast-path allocation.
4010 jint lh = Klass::instance_layout_helper(k->size_helper(), true); 4009 jint lh = Klass::instance_layout_helper(k->size_helper(), true);
4011 k->set_layout_helper(lh); 4010 k->set_layout_helper(lh);
4012 } 4011 }