334 // If both functions return non-null, they must return the same value. 335 // Also, the unchecked version may sometimes be non-null where the 336 // checked version is null. This can occur in several ways: 337 // 1. No query has yet been made to the class loader. 338 // 2. The class loader was queried, but chose not to delegate. 339 // 3. ClassLoader.checkPackageAccess rejected a proposed protection domain. 340 // 4. Loading was attempted, but there was a linkage error of some sort. 341 // In all of these cases, the loader constraints on this type are 342 // satisfied, and it is safe for classes in the given class loader 343 // to manipulate strongly-typed values of the found class, subject 344 // to local linkage and access checks. 345 static Klass* find_constrained_instance_or_array_klass(Symbol* class_name, 346 Handle class_loader, 347 TRAPS); 348 349 // Iterate over all klasses in dictionary 350 // Just the classes from defining class loaders 351 static void classes_do(void f(Klass*)); 352 // Added for initialize_itable_for_klass to handle exceptions 353 static void classes_do(void f(Klass*, TRAPS), TRAPS); 354 // All classes, and their class loaders 355 static void classes_do(void f(Klass*, ClassLoaderData*)); 356 357 static void placeholders_do(void f(Symbol*)); 358 359 // Iterate over all methods in all klasses in dictionary 360 static void methods_do(void f(Method*)); 361 362 // Garbage collection support 363 364 // This method applies "blk->do_oop" to all the pointers to "system" 365 // classes and loaders. 366 static void always_strong_oops_do(OopClosure* blk); 367 static void always_strong_classes_do(KlassClosure* closure); 368 369 // Unload (that is, break root links to) all unmarked classes and 370 // loaders. Returns "true" iff something was unloaded. 371 static bool do_unloading(BoolObjectClosure* is_alive, 372 bool clean_previous_versions = true); 373 374 // Used by DumpSharedSpaces only to remove classes that failed verification 375 static void remove_classes_in_error_state(); 376 377 static int calculate_systemdictionary_size(int loadedclasses); 378 379 // Applies "f->do_oop" to all root oops in the system dictionary. 380 static void oops_do(OopClosure* f); 381 static void roots_oops_do(OopClosure* strong, OopClosure* weak); 382 383 // System loader lock 384 static oop system_loader_lock() { return _system_loader_lock_obj; } 385 386 protected: 387 // Extended Redefine classes support (tbi) 388 static void preloaded_classes_do(KlassClosure* f); 389 static void lazily_loaded_classes_do(KlassClosure* f); 390 public: 391 // Sharing support. 392 static void reorder_dictionary(); 393 static void copy_buckets(char** top, char* end); 394 static void copy_table(char** top, char* end); 395 static void reverse(); 396 static void set_shared_dictionary(HashtableBucket<mtClass>* t, int length, 397 int number_of_entries); 398 // Printing 399 static void print(bool details = true); 400 static void print_shared(bool details = true); 401 402 // Number of contained klasses 403 // This is both fully loaded classes and classes in the process 404 // of being loaded 405 static int number_of_classes(); 406 407 // Monotonically increasing counter which grows as classes are 408 // loaded or modifications such as hot-swapping or setting/removing 409 // of breakpoints are performed | 334 // If both functions return non-null, they must return the same value. 335 // Also, the unchecked version may sometimes be non-null where the 336 // checked version is null. This can occur in several ways: 337 // 1. No query has yet been made to the class loader. 338 // 2. The class loader was queried, but chose not to delegate. 339 // 3. ClassLoader.checkPackageAccess rejected a proposed protection domain. 340 // 4. Loading was attempted, but there was a linkage error of some sort. 341 // In all of these cases, the loader constraints on this type are 342 // satisfied, and it is safe for classes in the given class loader 343 // to manipulate strongly-typed values of the found class, subject 344 // to local linkage and access checks. 345 static Klass* find_constrained_instance_or_array_klass(Symbol* class_name, 346 Handle class_loader, 347 TRAPS); 348 349 // Iterate over all klasses in dictionary 350 // Just the classes from defining class loaders 351 static void classes_do(void f(Klass*)); 352 // Added for initialize_itable_for_klass to handle exceptions 353 static void classes_do(void f(Klass*, TRAPS), TRAPS); 354 // All classes, and their class loaders, including initiating class loaders 355 static void classes_do(void f(Klass*, ClassLoaderData*)); 356 357 // Iterate over all methods in all klasses 358 static void methods_do(void f(Method*)); 359 360 // Garbage collection support 361 362 // This method applies "blk->do_oop" to all the pointers to "system" 363 // classes and loaders. 364 static void always_strong_oops_do(OopClosure* blk); 365 366 // Unload (that is, break root links to) all unmarked classes and 367 // loaders. Returns "true" iff something was unloaded. 368 static bool do_unloading(BoolObjectClosure* is_alive, 369 bool clean_previous_versions = true); 370 371 // Used by DumpSharedSpaces only to remove classes that failed verification 372 static void remove_classes_in_error_state(); 373 374 static int calculate_systemdictionary_size(int loadedclasses); 375 376 // Applies "f->do_oop" to all root oops in the system dictionary. 377 static void oops_do(OopClosure* f); 378 static void roots_oops_do(OopClosure* strong, OopClosure* weak); 379 380 // System loader lock 381 static oop system_loader_lock() { return _system_loader_lock_obj; } 382 383 public: 384 // Sharing support. 385 static void reorder_dictionary(); 386 static void copy_buckets(char** top, char* end); 387 static void copy_table(char** top, char* end); 388 static void reverse(); 389 static void set_shared_dictionary(HashtableBucket<mtClass>* t, int length, 390 int number_of_entries); 391 // Printing 392 static void print(bool details = true); 393 static void print_shared(bool details = true); 394 395 // Number of contained klasses 396 // This is both fully loaded classes and classes in the process 397 // of being loaded 398 static int number_of_classes(); 399 400 // Monotonically increasing counter which grows as classes are 401 // loaded or modifications such as hot-swapping or setting/removing 402 // of breakpoints are performed |