226 static InstanceKlass* find_builtin_class(Symbol* class_name);
227
228 static const RunTimeSharedClassInfo* find_record(RunTimeSharedDictionary* static_dict,
229 RunTimeSharedDictionary* dynamic_dict,
230 Symbol* name);
231
232 static bool has_platform_or_app_classes();
233
234 // Called by PLATFORM/APP loader only
235 static InstanceKlass* find_or_load_shared_class(Symbol* class_name,
236 Handle class_loader,
237 TRAPS);
238
239
240 static void allocate_shared_data_arrays(int size, TRAPS);
241
242 // Check if sharing is supported for the class loader.
243 static bool is_sharing_possible(ClassLoaderData* loader_data);
244
245 static bool add_unregistered_class(InstanceKlass* k, TRAPS);
246 static InstanceKlass* dump_time_resolve_super_or_fail(Symbol* child_name,
247 Symbol* class_name,
248 Handle class_loader,
249 Handle protection_domain,
250 bool is_superclass,
251 TRAPS);
252
253 static void init_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
254 static void remove_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
255
256 static Dictionary* boot_loader_dictionary() {
257 return ClassLoaderData::the_null_class_loader_data()->dictionary();
258 }
259
260 static void update_shared_entry(InstanceKlass* klass, int id);
261 static void set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs);
262
263 static InstanceKlass* lookup_from_stream(Symbol* class_name,
264 Handle class_loader,
265 Handle protection_domain,
288 Symbol* method_type,
289 Method* member_method,
290 Symbol* instantiated_method_type) NOT_CDS_RETURN;
291 static InstanceKlass* get_shared_lambda_proxy_class(InstanceKlass* caller_ik,
292 Symbol* invoked_name,
293 Symbol* invoked_type,
294 Symbol* method_type,
295 Method* member_method,
296 Symbol* instantiated_method_type) NOT_CDS_RETURN_(NULL);
297 static InstanceKlass* get_shared_nest_host(InstanceKlass* lambda_ik) NOT_CDS_RETURN_(NULL);
298 static InstanceKlass* prepare_shared_lambda_proxy_class(InstanceKlass* lambda_ik,
299 InstanceKlass* caller_ik,
300 bool initialize, TRAPS) NOT_CDS_RETURN_(NULL);
301 static bool check_linking_constraints(InstanceKlass* klass, TRAPS) NOT_CDS_RETURN_(false);
302 static void record_linking_constraint(Symbol* name, InstanceKlass* klass,
303 Handle loader1, Handle loader2, TRAPS) NOT_CDS_RETURN;
304 static bool is_builtin(InstanceKlass* k) {
305 return (k->shared_classpath_index() != UNREGISTERED_INDEX);
306 }
307 static void check_excluded_classes();
308 static void validate_before_archiving(InstanceKlass* k);
309 static bool is_excluded_class(InstanceKlass* k);
310 static void dumptime_classes_do(class MetaspaceClosure* it);
311 static size_t estimate_size_for_archive();
312 static void write_to_archive(bool is_static_archive = true);
313 static void adjust_lambda_proxy_class_dictionary();
314 static void serialize_dictionary_headers(class SerializeClosure* soc,
315 bool is_static_archive = true);
316 static void serialize_well_known_klasses(class SerializeClosure* soc);
317 static void print() { return print_on(tty); }
318 static void print_on(outputStream* st) NOT_CDS_RETURN;
319 static void print_table_statistics(outputStream* st) NOT_CDS_RETURN;
320 static bool empty_dumptime_table() NOT_CDS_RETURN_(true);
321
322 DEBUG_ONLY(static bool no_class_loading_should_happen() {return _no_class_loading_should_happen;})
323
324 #ifdef ASSERT
325 class NoClassLoadingMark: public StackObj {
326 public:
327 NoClassLoadingMark() {
|
226 static InstanceKlass* find_builtin_class(Symbol* class_name);
227
228 static const RunTimeSharedClassInfo* find_record(RunTimeSharedDictionary* static_dict,
229 RunTimeSharedDictionary* dynamic_dict,
230 Symbol* name);
231
232 static bool has_platform_or_app_classes();
233
234 // Called by PLATFORM/APP loader only
235 static InstanceKlass* find_or_load_shared_class(Symbol* class_name,
236 Handle class_loader,
237 TRAPS);
238
239
240 static void allocate_shared_data_arrays(int size, TRAPS);
241
242 // Check if sharing is supported for the class loader.
243 static bool is_sharing_possible(ClassLoaderData* loader_data);
244
245 static bool add_unregistered_class(InstanceKlass* k, TRAPS);
246 // Only after replaced the existed one.
247 static void add_replaced_class(InstanceKlass* k, TRAPS);
248 static InstanceKlass* dump_time_resolve_super_or_fail(Symbol* child_name,
249 Symbol* class_name,
250 Handle class_loader,
251 Handle protection_domain,
252 bool is_superclass,
253 TRAPS);
254
255 static void init_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
256 static void remove_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
257
258 static Dictionary* boot_loader_dictionary() {
259 return ClassLoaderData::the_null_class_loader_data()->dictionary();
260 }
261
262 static void update_shared_entry(InstanceKlass* klass, int id);
263 static void set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs);
264
265 static InstanceKlass* lookup_from_stream(Symbol* class_name,
266 Handle class_loader,
267 Handle protection_domain,
290 Symbol* method_type,
291 Method* member_method,
292 Symbol* instantiated_method_type) NOT_CDS_RETURN;
293 static InstanceKlass* get_shared_lambda_proxy_class(InstanceKlass* caller_ik,
294 Symbol* invoked_name,
295 Symbol* invoked_type,
296 Symbol* method_type,
297 Method* member_method,
298 Symbol* instantiated_method_type) NOT_CDS_RETURN_(NULL);
299 static InstanceKlass* get_shared_nest_host(InstanceKlass* lambda_ik) NOT_CDS_RETURN_(NULL);
300 static InstanceKlass* prepare_shared_lambda_proxy_class(InstanceKlass* lambda_ik,
301 InstanceKlass* caller_ik,
302 bool initialize, TRAPS) NOT_CDS_RETURN_(NULL);
303 static bool check_linking_constraints(InstanceKlass* klass, TRAPS) NOT_CDS_RETURN_(false);
304 static void record_linking_constraint(Symbol* name, InstanceKlass* klass,
305 Handle loader1, Handle loader2, TRAPS) NOT_CDS_RETURN;
306 static bool is_builtin(InstanceKlass* k) {
307 return (k->shared_classpath_index() != UNREGISTERED_INDEX);
308 }
309 static void check_excluded_classes();
310 static void set_excluded(InstanceKlass* k);
311 static void validate_before_archiving(InstanceKlass* k);
312 static bool is_excluded_class(InstanceKlass* k);
313 static void dumptime_classes_do(class MetaspaceClosure* it);
314 static size_t estimate_size_for_archive();
315 static void write_to_archive(bool is_static_archive = true);
316 static void adjust_lambda_proxy_class_dictionary();
317 static void serialize_dictionary_headers(class SerializeClosure* soc,
318 bool is_static_archive = true);
319 static void serialize_well_known_klasses(class SerializeClosure* soc);
320 static void print() { return print_on(tty); }
321 static void print_on(outputStream* st) NOT_CDS_RETURN;
322 static void print_table_statistics(outputStream* st) NOT_CDS_RETURN;
323 static bool empty_dumptime_table() NOT_CDS_RETURN_(true);
324
325 DEBUG_ONLY(static bool no_class_loading_should_happen() {return _no_class_loading_should_happen;})
326
327 #ifdef ASSERT
328 class NoClassLoadingMark: public StackObj {
329 public:
330 NoClassLoadingMark() {
|