82 class ResolutionErrorTable; |
82 class ResolutionErrorTable; |
83 class SymbolPropertyTable; |
83 class SymbolPropertyTable; |
84 class ProtectionDomainCacheTable; |
84 class ProtectionDomainCacheTable; |
85 class ProtectionDomainCacheEntry; |
85 class ProtectionDomainCacheEntry; |
86 class GCTimer; |
86 class GCTimer; |
87 class OopStorage; |
|
88 |
87 |
89 #define WK_KLASS_ENUM_NAME(kname) kname##_knum |
88 #define WK_KLASS_ENUM_NAME(kname) kname##_knum |
90 |
89 |
91 // Certain classes, such as java.lang.Object and java.lang.String, |
90 // Certain classes, such as java.lang.Object and java.lang.String, |
92 // are "well-known", in the sense that no class loader is allowed |
91 // are "well-known", in the sense that no class loader is allowed |
154 do_klass(reflect_ConstructorAccessorImpl_klass, reflect_ConstructorAccessorImpl ) \ |
153 do_klass(reflect_ConstructorAccessorImpl_klass, reflect_ConstructorAccessorImpl ) \ |
155 do_klass(reflect_DelegatingClassLoader_klass, reflect_DelegatingClassLoader ) \ |
154 do_klass(reflect_DelegatingClassLoader_klass, reflect_DelegatingClassLoader ) \ |
156 do_klass(reflect_ConstantPool_klass, reflect_ConstantPool ) \ |
155 do_klass(reflect_ConstantPool_klass, reflect_ConstantPool ) \ |
157 do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, reflect_UnsafeStaticFieldAccessorImpl ) \ |
156 do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, reflect_UnsafeStaticFieldAccessorImpl ) \ |
158 do_klass(reflect_CallerSensitive_klass, reflect_CallerSensitive ) \ |
157 do_klass(reflect_CallerSensitive_klass, reflect_CallerSensitive ) \ |
|
158 do_klass(reflect_NativeConstructorAccessorImpl_klass, reflect_NativeConstructorAccessorImpl ) \ |
159 \ |
159 \ |
160 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
160 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
161 do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle ) \ |
161 do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle ) \ |
162 do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle ) \ |
162 do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle ) \ |
163 do_klass(VarHandle_klass, java_lang_invoke_VarHandle ) \ |
163 do_klass(VarHandle_klass, java_lang_invoke_VarHandle ) \ |
211 do_klass(Double_klass, java_lang_Double ) \ |
211 do_klass(Double_klass, java_lang_Double ) \ |
212 do_klass(Byte_klass, java_lang_Byte ) \ |
212 do_klass(Byte_klass, java_lang_Byte ) \ |
213 do_klass(Short_klass, java_lang_Short ) \ |
213 do_klass(Short_klass, java_lang_Short ) \ |
214 do_klass(Integer_klass, java_lang_Integer ) \ |
214 do_klass(Integer_klass, java_lang_Integer ) \ |
215 do_klass(Long_klass, java_lang_Long ) \ |
215 do_klass(Long_klass, java_lang_Long ) \ |
|
216 \ |
|
217 /* force inline of iterators */ \ |
|
218 do_klass(Iterator_klass, java_util_Iterator ) \ |
216 \ |
219 \ |
217 /*end*/ |
220 /*end*/ |
218 |
221 |
219 |
222 |
220 class SystemDictionary : AllStatic { |
223 class SystemDictionary : AllStatic { |
343 // Unload (that is, break root links to) all unmarked classes and |
346 // Unload (that is, break root links to) all unmarked classes and |
344 // loaders. Returns "true" iff something was unloaded. |
347 // loaders. Returns "true" iff something was unloaded. |
345 static bool do_unloading(GCTimer* gc_timer); |
348 static bool do_unloading(GCTimer* gc_timer); |
346 |
349 |
347 // Applies "f->do_oop" to all root oops in the system dictionary. |
350 // Applies "f->do_oop" to all root oops in the system dictionary. |
348 static void oops_do(OopClosure* f); |
351 // If include_handles is true (the default), then the handles in the |
|
352 // vm_global OopStorage object are included. |
|
353 static void oops_do(OopClosure* f, bool include_handles = true); |
349 |
354 |
350 // System loader lock |
355 // System loader lock |
351 static oop system_loader_lock() { return _system_loader_lock_obj; } |
356 static oop system_loader_lock() { return _system_loader_lock_obj; } |
352 |
357 |
353 // Protection Domain Table |
358 // Protection Domain Table |
356 public: |
361 public: |
357 // Printing |
362 // Printing |
358 static void print(); |
363 static void print(); |
359 static void print_on(outputStream* st); |
364 static void print_on(outputStream* st); |
360 static void dump(outputStream* st, bool verbose); |
365 static void dump(outputStream* st, bool verbose); |
361 |
|
362 // Monotonically increasing counter which grows as classes are |
|
363 // loaded or modifications such as hot-swapping or setting/removing |
|
364 // of breakpoints are performed |
|
365 static inline int number_of_modifications() { assert_locked_or_safepoint(Compile_lock); return _number_of_modifications; } |
|
366 // Needed by evolution and breakpoint code |
|
367 static inline void notice_modification() { assert_locked_or_safepoint(Compile_lock); ++_number_of_modifications; } |
|
368 |
366 |
369 // Verification |
367 // Verification |
370 static void verify(); |
368 static void verify(); |
371 |
369 |
372 // Initialization |
370 // Initialization |
550 // Static tables owned by the SystemDictionary |
548 // Static tables owned by the SystemDictionary |
551 |
549 |
552 // Hashtable holding placeholders for classes being loaded. |
550 // Hashtable holding placeholders for classes being loaded. |
553 static PlaceholderTable* _placeholders; |
551 static PlaceholderTable* _placeholders; |
554 |
552 |
555 // Monotonically increasing counter which grows with |
|
556 // loading classes as well as hot-swapping and breakpoint setting |
|
557 // and removal. |
|
558 static int _number_of_modifications; |
|
559 |
|
560 // Lock object for system class loader |
553 // Lock object for system class loader |
561 static oop _system_loader_lock_obj; |
554 static oop _system_loader_lock_obj; |
562 |
555 |
563 // Constraints on class loaders |
556 // Constraints on class loaders |
564 static LoaderConstraintTable* _loader_constraints; |
557 static LoaderConstraintTable* _loader_constraints; |
569 // Invoke methods (JSR 292) |
562 // Invoke methods (JSR 292) |
570 static SymbolPropertyTable* _invoke_method_table; |
563 static SymbolPropertyTable* _invoke_method_table; |
571 |
564 |
572 // ProtectionDomain cache |
565 // ProtectionDomain cache |
573 static ProtectionDomainCacheTable* _pd_cache_table; |
566 static ProtectionDomainCacheTable* _pd_cache_table; |
574 |
|
575 // VM weak OopStorage object. |
|
576 static OopStorage* _vm_weak_oop_storage; |
|
577 |
567 |
578 protected: |
568 protected: |
579 static void validate_protection_domain(InstanceKlass* klass, |
569 static void validate_protection_domain(InstanceKlass* klass, |
580 Handle class_loader, |
570 Handle class_loader, |
581 Handle protection_domain, TRAPS); |
571 Handle protection_domain, TRAPS); |
627 static bool is_nonpublic_Object_method(Method* m) { |
617 static bool is_nonpublic_Object_method(Method* m) { |
628 assert(m != NULL, "Unexpected NULL Method*"); |
618 assert(m != NULL, "Unexpected NULL Method*"); |
629 return !m->is_public() && m->method_holder() == SystemDictionary::Object_klass(); |
619 return !m->is_public() && m->method_holder() == SystemDictionary::Object_klass(); |
630 } |
620 } |
631 |
621 |
632 static void initialize_oop_storage(); |
|
633 static OopStorage* vm_weak_oop_storage(); |
|
634 |
|
635 protected: |
622 protected: |
636 // Setup link to hierarchy |
623 // Setup link to hierarchy |
637 static void add_to_hierarchy(InstanceKlass* k, TRAPS); |
624 static void add_to_hierarchy(InstanceKlass* k, TRAPS); |
638 |
625 |
639 // Basic find on loaded classes |
626 // Basic find on loaded classes |