@@ -4659,7 +4659,7 @@ const char* ClassFileParser::skip_over_field_signature(const char* signature,
4659
4659
4660
4660
// Checks if name is a legal class name.
4661
4661
void ClassFileParser::verify_legal_class_name (const Symbol* name, TRAPS) const {
4662
- if (!_need_verify || _relax_verify ) { return ; }
4662
+ if (!_need_verify) { return ; }
4663
4663
4664
4664
assert (name->refcount () > 0 , " symbol must be kept alive" );
4665
4665
char * bytes = (char *)name->bytes ();
@@ -4699,7 +4699,7 @@ void ClassFileParser::verify_legal_class_name(const Symbol* name, TRAPS) const {
4699
4699
4700
4700
// Checks if name is a legal field name.
4701
4701
void ClassFileParser::verify_legal_field_name (const Symbol* name, TRAPS) const {
4702
- if (!_need_verify || _relax_verify ) { return ; }
4702
+ if (!_need_verify) { return ; }
4703
4703
4704
4704
char * bytes = (char *)name->bytes ();
4705
4705
unsigned int length = name->utf8_length ();
@@ -4732,7 +4732,7 @@ void ClassFileParser::verify_legal_field_name(const Symbol* name, TRAPS) const {
4732
4732
4733
4733
// Checks if name is a legal method name.
4734
4734
void ClassFileParser::verify_legal_method_name (const Symbol* name, TRAPS) const {
4735
- if (!_need_verify || _relax_verify ) { return ; }
4735
+ if (!_need_verify) { return ; }
4736
4736
4737
4737
assert (name != nullptr , " method name is null" );
4738
4738
char * bytes = (char *)name->bytes ();
@@ -5236,17 +5236,6 @@ void ClassFileParser::update_class_name(Symbol* new_class_name) {
5236
5236
_class_name->increment_refcount ();
5237
5237
}
5238
5238
5239
- static bool relax_format_check_for (ClassLoaderData* loader_data) {
5240
- bool trusted = loader_data->is_boot_class_loader_data () ||
5241
- loader_data->is_platform_class_loader_data ();
5242
- bool need_verify =
5243
- // verifyAll
5244
- (BytecodeVerificationLocal && BytecodeVerificationRemote) ||
5245
- // verifyRemote
5246
- (!BytecodeVerificationLocal && BytecodeVerificationRemote && !trusted);
5247
- return !need_verify;
5248
- }
5249
-
5250
5239
ClassFileParser::ClassFileParser (ClassFileStream* stream,
5251
5240
Symbol* name,
5252
5241
ClassLoaderData* loader_data,
@@ -5303,7 +5292,6 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
5303
5292
_itfs_len(0 ),
5304
5293
_java_fields_count(0 ),
5305
5294
_need_verify(false ),
5306
- _relax_verify(false ),
5307
5295
_has_nonstatic_concrete_methods(false ),
5308
5296
_declares_nonstatic_concrete_methods(false ),
5309
5297
_has_localvariable_table(false ),
@@ -5324,24 +5312,10 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
5324
5312
assert (0 == _access_flags.as_int (), " invariant" );
5325
5313
5326
5314
// Figure out whether we can skip format checking (matching classic VM behavior)
5327
- if (CDSConfig::is_dumping_static_archive ()) {
5328
- // verify == true means it's a 'remote' class (i.e., non-boot class)
5329
- // Verification decision is based on BytecodeVerificationRemote flag
5330
- // for those classes.
5331
- _need_verify = (stream->need_verify ()) ? BytecodeVerificationRemote :
5332
- BytecodeVerificationLocal;
5333
- }
5334
- else {
5335
- _need_verify = Verifier::should_verify_for (_loader_data->class_loader (),
5336
- stream->need_verify ());
5337
- }
5338
-
5339
- // synch back verification state to stream
5340
- stream->set_verify (_need_verify);
5315
+ _need_verify = Verifier::should_verify_for (_loader_data->class_loader ());
5341
5316
5342
- // Check if verification needs to be relaxed for this class file
5343
- // Do not restrict it to jdk1.0 or jdk1.1 to maintain backward compatibility (4982376)
5344
- _relax_verify = relax_format_check_for (_loader_data);
5317
+ // synch back verification state to stream to check for truncation.
5318
+ stream->set_need_verify (_need_verify);
5345
5319
5346
5320
parse_stream (stream, CHECK);
5347
5321
0 commit comments