File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
src/hotspot/share/classfile
test/hotspot/jtreg/runtime/cds/appcds Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -957,11 +957,17 @@ InstanceKlass* SystemDictionaryShared::get_shared_lambda_proxy_class(InstanceKla
957957 Symbol* method_type,
958958 Method* member_method,
959959 Symbol* instantiated_method_type) {
960+ assert (caller_ik != nullptr , " sanity" );
961+ assert (invoked_name != nullptr , " sanity" );
962+ assert (invoked_type != nullptr , " sanity" );
963+ assert (method_type != nullptr , " sanity" );
964+ assert (instantiated_method_type != nullptr , " sanity" );
965+
960966 if (!caller_ik->is_shared () ||
961967 !invoked_name->is_shared () ||
962968 !invoked_type->is_shared () ||
963969 !method_type->is_shared () ||
964- ! member_method->is_shared () ||
970+ (member_method != nullptr && ! member_method->is_shared () ) ||
965971 !instantiated_method_type->is_shared ()) {
966972 // These can't be represented as u4 offset, but we wouldn't have archived a lambda proxy in this case anyway.
967973 return nullptr ;
Original file line number Diff line number Diff line change @@ -61,13 +61,14 @@ public static void main(String[] args) throws Exception {
6161 .setArchiveName (archiveName );
6262 CDSTestUtils .createArchiveAndCheck (opts );
6363
64- // run with archive
64+ // run with archive; make sure the lambda is loaded from the archive
6565 CDSOptions runOpts = (new CDSOptions ())
66- .addPrefix ("-cp" , appJar )
66+ .addPrefix ("-cp" , appJar , "-Xlog:class+load" )
6767 .setArchiveName (archiveName )
6868 .setUseVersion (false )
6969 .addSuffix (mainClass );
7070 OutputAnalyzer output = CDSTestUtils .runWithArchive (runOpts );
71+ output .shouldMatch ("LambdaInvokeVirtualApp[$][$]Lambda/.*source: shared objects file" );
7172 output .shouldHaveExitValue (0 );
7273 }
7374}
You can’t perform that action at this time.
0 commit comments