Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/classFileParser.cpp @ 973:ad6585fd4087
6830542: Performance: JVM_DefineClass already verified.
Reviewed-by: kamg, phh
author | acorn |
---|---|
date | Fri, 04 Sep 2009 12:53:02 -0400 |
parents | 494244ae0171 |
children | 26b774d693aa |
comparison
equal
deleted
inserted
replaced
967:6918603297f7 | 973:ad6585fd4087 |
---|---|
2545 Handle class_loader, | 2545 Handle class_loader, |
2546 Handle protection_domain, | 2546 Handle protection_domain, |
2547 KlassHandle host_klass, | 2547 KlassHandle host_klass, |
2548 GrowableArray<Handle>* cp_patches, | 2548 GrowableArray<Handle>* cp_patches, |
2549 symbolHandle& parsed_name, | 2549 symbolHandle& parsed_name, |
2550 bool verify, | |
2550 TRAPS) { | 2551 TRAPS) { |
2551 // So that JVMTI can cache class file in the state before retransformable agents | 2552 // So that JVMTI can cache class file in the state before retransformable agents |
2552 // have modified it | 2553 // have modified it |
2553 unsigned char *cached_class_file_bytes = NULL; | 2554 unsigned char *cached_class_file_bytes = NULL; |
2554 jint cached_class_file_length; | 2555 jint cached_class_file_length; |
2589 _cp_patches = cp_patches; | 2590 _cp_patches = cp_patches; |
2590 | 2591 |
2591 instanceKlassHandle nullHandle; | 2592 instanceKlassHandle nullHandle; |
2592 | 2593 |
2593 // Figure out whether we can skip format checking (matching classic VM behavior) | 2594 // Figure out whether we can skip format checking (matching classic VM behavior) |
2594 _need_verify = Verifier::should_verify_for(class_loader()); | 2595 _need_verify = Verifier::should_verify_for(class_loader(), verify); |
2595 | 2596 |
2596 // Set the verify flag in stream | 2597 // Set the verify flag in stream |
2597 cfs->set_verify(_need_verify); | 2598 cfs->set_verify(_need_verify); |
2598 | 2599 |
2599 // Save the class file name for easier error message printing. | 2600 // Save the class file name for easier error message printing. |
3203 assert(this_klass->static_field_size() == static_field_size && | 3204 assert(this_klass->static_field_size() == static_field_size && |
3204 this_klass->nonstatic_oop_map_size() == nonstatic_oop_map_size, "sanity check"); | 3205 this_klass->nonstatic_oop_map_size() == nonstatic_oop_map_size, "sanity check"); |
3205 | 3206 |
3206 // Fill in information already parsed | 3207 // Fill in information already parsed |
3207 this_klass->set_access_flags(access_flags); | 3208 this_klass->set_access_flags(access_flags); |
3209 if (verify) { | |
3210 this_klass->set_should_verify_class(); | |
3211 } | |
3208 jint lh = Klass::instance_layout_helper(instance_size, false); | 3212 jint lh = Klass::instance_layout_helper(instance_size, false); |
3209 this_klass->set_layout_helper(lh); | 3213 this_klass->set_layout_helper(lh); |
3210 assert(this_klass->oop_is_instance(), "layout is correct"); | 3214 assert(this_klass->oop_is_instance(), "layout is correct"); |
3211 assert(this_klass->size_helper() == instance_size, "correct size_helper"); | 3215 assert(this_klass->size_helper() == instance_size, "correct size_helper"); |
3212 // Not yet: supers are done below to support the new subtype-checking fields | 3216 // Not yet: supers are done below to support the new subtype-checking fields |
3213 //this_klass->set_super(super_klass()); | 3217 //this_klass->set_super(super_klass()); |
3214 this_klass->set_class_loader(class_loader()); | 3218 this_klass->set_class_loader(class_loader()); |
3215 this_klass->set_nonstatic_field_size(nonstatic_field_size); | 3219 this_klass->set_nonstatic_field_size(nonstatic_field_size); |
3216 this_klass->set_has_nonstatic_fields(has_nonstatic_fields); | 3220 if (has_nonstatic_fields) { |
3221 this_klass->set_has_nonstatic_fields(); | |
3222 } | |
3217 this_klass->set_static_oop_field_size(fac.static_oop_count); | 3223 this_klass->set_static_oop_field_size(fac.static_oop_count); |
3218 cp->set_pool_holder(this_klass()); | 3224 cp->set_pool_holder(this_klass()); |
3219 this_klass->set_constants(cp()); | 3225 this_klass->set_constants(cp()); |
3220 this_klass->set_local_interfaces(local_interfaces()); | 3226 this_klass->set_local_interfaces(local_interfaces()); |
3221 this_klass->set_fields(fields()); | 3227 this_klass->set_fields(fields()); |