123 }
124 }
125
126 // ik is a candidate for aot-linking; see if it can really work
127 // that way, and return success or failure. Not only must ik itself
128 // look like a class that can be aot-linked but its supers must also be
129 // aot-linkable.
130 bool AOTClassLinker::try_add_candidate(InstanceKlass* ik) {
131 assert(is_initialized(), "sanity");
132 assert(CDSConfig::is_dumping_aot_linked_classes(), "sanity");
133
134 if (!SystemDictionaryShared::is_builtin(ik)) {
135 // not loaded by a class loader which we know about
136 return false;
137 }
138
139 if (is_candidate(ik)) { // already checked.
140 return true;
141 }
142
143 if (ik->is_hidden()) {
144 assert(ik->shared_class_loader_type() != ClassLoader::OTHER, "must have been set");
145 if (!CDSConfig::is_dumping_invokedynamic()) {
146 return false;
147 }
148 if (HeapShared::is_lambda_proxy_klass(ik)) {
149 InstanceKlass* nest_host = ik->nest_host_not_null();
150 if (!try_add_candidate(nest_host)) {
151 ResourceMark rm;
152 log_warning(cds, aot, link)("%s cannot be aot-linked because it nest host is not aot-linked", ik->external_name());
153 return false;
154 }
155 }
156 }
157
158 InstanceKlass* s = ik->java_super();
159 if (s != nullptr && !try_add_candidate(s)) {
160 return false;
161 }
162
|
123 }
124 }
125
126 // ik is a candidate for aot-linking; see if it can really work
127 // that way, and return success or failure. Not only must ik itself
128 // look like a class that can be aot-linked but its supers must also be
129 // aot-linkable.
130 bool AOTClassLinker::try_add_candidate(InstanceKlass* ik) {
131 assert(is_initialized(), "sanity");
132 assert(CDSConfig::is_dumping_aot_linked_classes(), "sanity");
133
134 if (!SystemDictionaryShared::is_builtin(ik)) {
135 // not loaded by a class loader which we know about
136 return false;
137 }
138
139 if (is_candidate(ik)) { // already checked.
140 return true;
141 }
142
143 if (!ik->is_linked() && SystemDictionaryShared::has_class_failed_verification(ik)) {
144 return false;
145 }
146
147 if (ik->is_hidden()) {
148 assert(ik->shared_class_loader_type() != ClassLoader::OTHER, "must have been set");
149 if (!CDSConfig::is_dumping_invokedynamic()) {
150 return false;
151 }
152 if (HeapShared::is_lambda_proxy_klass(ik)) {
153 InstanceKlass* nest_host = ik->nest_host_not_null();
154 if (!try_add_candidate(nest_host)) {
155 ResourceMark rm;
156 log_warning(cds, aot, link)("%s cannot be aot-linked because it nest host is not aot-linked", ik->external_name());
157 return false;
158 }
159 }
160 }
161
162 InstanceKlass* s = ik->java_super();
163 if (s != nullptr && !try_add_candidate(s)) {
164 return false;
165 }
166
|