Mercurial > hg > truffle
comparison src/share/vm/classfile/verifier.cpp @ 12154:3a1df0dce3e5
8023872: Verification error in generated lambda classes
Summary: skip verification for generated lambda classes
Reviewed-by: kamg, dholmes
author | acorn |
---|---|
date | Fri, 30 Aug 2013 15:15:56 -0400 |
parents | 76482cbba706 |
children | c72075c2883e |
comparison
equal
deleted
inserted
replaced
12147:c636758ea616 | 12154:3a1df0dce3e5 |
---|---|
186 } | 186 } |
187 | 187 |
188 bool Verifier::is_eligible_for_verification(instanceKlassHandle klass, bool should_verify_class) { | 188 bool Verifier::is_eligible_for_verification(instanceKlassHandle klass, bool should_verify_class) { |
189 Symbol* name = klass->name(); | 189 Symbol* name = klass->name(); |
190 Klass* refl_magic_klass = SystemDictionary::reflect_MagicAccessorImpl_klass(); | 190 Klass* refl_magic_klass = SystemDictionary::reflect_MagicAccessorImpl_klass(); |
191 Klass* lambda_magic_klass = SystemDictionary::lambda_MagicLambdaImpl_klass(); | |
192 | |
193 bool is_reflect = refl_magic_klass != NULL && klass->is_subtype_of(refl_magic_klass); | |
194 bool is_lambda = lambda_magic_klass != NULL && klass->is_subtype_of(lambda_magic_klass); | |
191 | 195 |
192 return (should_verify_for(klass->class_loader(), should_verify_class) && | 196 return (should_verify_for(klass->class_loader(), should_verify_class) && |
193 // return if the class is a bootstrapping class | 197 // return if the class is a bootstrapping class |
194 // or defineClass specified not to verify by default (flags override passed arg) | 198 // or defineClass specified not to verify by default (flags override passed arg) |
195 // We need to skip the following four for bootstraping | 199 // We need to skip the following four for bootstraping |
208 // dynamically-generated bytecodes associated with the 1.4 | 212 // dynamically-generated bytecodes associated with the 1.4 |
209 // reflection implementation, not just those associated with | 213 // reflection implementation, not just those associated with |
210 // sun/reflect/SerializationConstructorAccessor. | 214 // sun/reflect/SerializationConstructorAccessor. |
211 // NOTE: this is called too early in the bootstrapping process to be | 215 // NOTE: this is called too early in the bootstrapping process to be |
212 // guarded by Universe::is_gte_jdk14x_version()/UseNewReflection. | 216 // guarded by Universe::is_gte_jdk14x_version()/UseNewReflection. |
213 (refl_magic_klass == NULL || | 217 // Also for lambda generated code, gte jdk8 |
214 !klass->is_subtype_of(refl_magic_klass) || | 218 (!is_reflect || VerifyReflectionBytecodes) && |
215 VerifyReflectionBytecodes) | 219 (!is_lambda || VerifyLambdaBytecodes) |
216 ); | 220 ); |
217 } | 221 } |
218 | 222 |
219 Symbol* Verifier::inference_verify( | 223 Symbol* Verifier::inference_verify( |
220 instanceKlassHandle klass, char* message, size_t message_len, TRAPS) { | 224 instanceKlassHandle klass, char* message, size_t message_len, TRAPS) { |