Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/classFileParser.cpp @ 7212:291ffc492eb6
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 14 Dec 2012 14:35:13 +0100 |
parents | 5fafdef522c6 |
children | 35431a769282 |
comparison
equal
deleted
inserted
replaced
7163:2ed8d74e5984 | 7212:291ffc492eb6 |
---|---|
2182 | 2182 |
2183 // All sizing information for a Method* is finally available, now create it | 2183 // All sizing information for a Method* is finally available, now create it |
2184 Method* m = Method::allocate( | 2184 Method* m = Method::allocate( |
2185 loader_data, code_length, access_flags, linenumber_table_length, | 2185 loader_data, code_length, access_flags, linenumber_table_length, |
2186 total_lvt_length, exception_table_length, checked_exceptions_length, | 2186 total_lvt_length, exception_table_length, checked_exceptions_length, |
2187 ConstMethod::NORMAL, CHECK_(nullHandle)); | 2187 generic_signature_index, ConstMethod::NORMAL, CHECK_(nullHandle)); |
2188 | 2188 |
2189 ClassLoadingService::add_class_method_size(m->size()*HeapWordSize); | 2189 ClassLoadingService::add_class_method_size(m->size()*HeapWordSize); |
2190 | 2190 |
2191 // Fill in information from fixed part (access_flags already set) | 2191 // Fill in information from fixed part (access_flags already set) |
2192 m->set_constants(cp()); | 2192 m->set_constants(cp()); |
2193 m->set_name_index(name_index); | 2193 m->set_name_index(name_index); |
2194 m->set_signature_index(signature_index); | 2194 m->set_signature_index(signature_index); |
2195 m->set_generic_signature_index(generic_signature_index); | |
2196 #ifdef CC_INTERP | 2195 #ifdef CC_INTERP |
2197 // hmm is there a gc issue here?? | 2196 // hmm is there a gc issue here?? |
2198 ResultTypeFinder rtf(cp->symbol_at(signature_index)); | 2197 ResultTypeFinder rtf(cp->symbol_at(signature_index)); |
2199 m->set_result_index(rtf.type()); | 2198 m->set_result_index(rtf.type()); |
2200 #endif | 2199 #endif |
2948 } | 2947 } |
2949 #endif // ndef PRODUCT | 2948 #endif // ndef PRODUCT |
2950 | 2949 |
2951 | 2950 |
2952 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, | 2951 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, |
2953 Handle class_loader, | 2952 ClassLoaderData* loader_data, |
2954 Handle protection_domain, | 2953 Handle protection_domain, |
2955 KlassHandle host_klass, | 2954 KlassHandle host_klass, |
2956 GrowableArray<Handle>* cp_patches, | 2955 GrowableArray<Handle>* cp_patches, |
2957 TempNewSymbol& parsed_name, | 2956 TempNewSymbol& parsed_name, |
2958 bool verify, | 2957 bool verify, |
2962 // If RedefineClasses() was used before the retransformable | 2961 // If RedefineClasses() was used before the retransformable |
2963 // agent attached, then the cached class bytes may not be the | 2962 // agent attached, then the cached class bytes may not be the |
2964 // original class bytes. | 2963 // original class bytes. |
2965 unsigned char *cached_class_file_bytes = NULL; | 2964 unsigned char *cached_class_file_bytes = NULL; |
2966 jint cached_class_file_length; | 2965 jint cached_class_file_length; |
2967 ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader()); | 2966 Handle class_loader(THREAD, loader_data->class_loader()); |
2968 bool has_default_methods = false; | 2967 bool has_default_methods = false; |
2969 ResourceMark rm(THREAD); | 2968 ResourceMark rm(THREAD); |
2970 | 2969 |
2971 ClassFileStream* cfs = stream(); | 2970 ClassFileStream* cfs = stream(); |
2972 // Timing | 2971 // Timing |
3003 } | 3002 } |
3004 | 3003 |
3005 unsigned char* ptr = cfs->buffer(); | 3004 unsigned char* ptr = cfs->buffer(); |
3006 unsigned char* end_ptr = cfs->buffer() + cfs->length(); | 3005 unsigned char* end_ptr = cfs->buffer() + cfs->length(); |
3007 | 3006 |
3008 JvmtiExport::post_class_file_load_hook(name, class_loader, protection_domain, | 3007 JvmtiExport::post_class_file_load_hook(name, class_loader(), protection_domain, |
3009 &ptr, &end_ptr, | 3008 &ptr, &end_ptr, |
3010 &cached_class_file_bytes, | 3009 &cached_class_file_bytes, |
3011 &cached_class_file_length); | 3010 &cached_class_file_length); |
3012 | 3011 |
3013 if (ptr != cfs->buffer()) { | 3012 if (ptr != cfs->buffer()) { |
4002 // 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. |
4003 // See documentation of InstanceKlass::can_be_fastpath_allocated(). | 4002 // See documentation of InstanceKlass::can_be_fastpath_allocated(). |
4004 assert(k->size_helper() > 0, "layout_helper is initialized"); | 4003 assert(k->size_helper() > 0, "layout_helper is initialized"); |
4005 if ((!RegisterFinalizersAtInit && k->has_finalizer()) | 4004 if ((!RegisterFinalizersAtInit && k->has_finalizer()) |
4006 || k->is_abstract() || k->is_interface() | 4005 || k->is_abstract() || k->is_interface() |
4007 || (k->name() == vmSymbols::java_lang_Class() | 4006 || (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) { | 4007 || k->size_helper() >= FastAllocateSizeLimit) { |
4010 // Forbid fast-path allocation. | 4008 // Forbid fast-path allocation. |
4011 jint lh = Klass::instance_layout_helper(k->size_helper(), true); | 4009 jint lh = Klass::instance_layout_helper(k->size_helper(), true); |
4012 k->set_layout_helper(lh); | 4010 k->set_layout_helper(lh); |
4013 } | 4011 } |