56 // ReservedCodeCacheSize, NonProfiledCodeHeapSize and ProfiledCodeHeapSize
57 // (see CodeCache::heap_available(..) and CodeCache::initialize_heaps(..)
58 // for details).
59 //
60 // Code cache segmentation is controlled by the flag SegmentedCodeCache.
61 // If turned off, all code types are stored in a single code heap. By default
62 // code cache segmentation is turned on if TieredCompilation is enabled and
63 // ReservedCodeCacheSize >= 240 MB.
64 //
65 // All methods of the CodeCache accepting a CodeBlobType only apply to
66 // CodeBlobs of the given type. For example, iteration over the
67 // CodeBlobs of a specific type can be done by using CodeCache::first_blob(..)
68 // and CodeCache::next_blob(..) and providing the corresponding CodeBlobType.
69 //
70 // IMPORTANT: If you add new CodeHeaps to the code cache or change the
71 // existing ones, make sure to adapt the dtrace scripts (jhelper.d) for
72 // Solaris and BSD.
73
74 class OopClosure;
75 class KlassDepChange;
76
77 class CodeCache : AllStatic {
78 friend class VMStructs;
79 friend class JVMCIVMStructs;
80 template <class T, class Filter> friend class CodeBlobIterator;
81 friend class WhiteBox;
82 friend class CodeCacheLoader;
83 private:
84 // CodeHeaps of the cache
85 static GrowableArray<CodeHeap*>* _heaps;
86 static GrowableArray<CodeHeap*>* _compiled_heaps;
87 static GrowableArray<CodeHeap*>* _nmethod_heaps;
88 static GrowableArray<CodeHeap*>* _allocable_heaps;
89
90 static address _low_bound; // Lower bound of CodeHeap addresses
91 static address _high_bound; // Upper bound of CodeHeap addresses
92 static int _number_of_nmethods_with_dependencies; // Total number of nmethods with dependencies
93 static bool _needs_cache_clean; // True if inline caches of the nmethods needs to be flushed
94 static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link()
95
96 static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
97 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
98
99 // CodeHeap management
100 static void initialize_heaps(); // Initializes the CodeHeaps
101 // Check the code heap sizes set by the user via command line
102 static void check_heap_sizes(size_t non_nmethod_size, size_t profiled_size, size_t non_profiled_size, size_t cache_size, bool all_set);
|
56 // ReservedCodeCacheSize, NonProfiledCodeHeapSize and ProfiledCodeHeapSize
57 // (see CodeCache::heap_available(..) and CodeCache::initialize_heaps(..)
58 // for details).
59 //
60 // Code cache segmentation is controlled by the flag SegmentedCodeCache.
61 // If turned off, all code types are stored in a single code heap. By default
62 // code cache segmentation is turned on if TieredCompilation is enabled and
63 // ReservedCodeCacheSize >= 240 MB.
64 //
65 // All methods of the CodeCache accepting a CodeBlobType only apply to
66 // CodeBlobs of the given type. For example, iteration over the
67 // CodeBlobs of a specific type can be done by using CodeCache::first_blob(..)
68 // and CodeCache::next_blob(..) and providing the corresponding CodeBlobType.
69 //
70 // IMPORTANT: If you add new CodeHeaps to the code cache or change the
71 // existing ones, make sure to adapt the dtrace scripts (jhelper.d) for
72 // Solaris and BSD.
73
74 class OopClosure;
75 class KlassDepChange;
76 class ShenandoahParallelCodeHeapIterator;
77
78 class CodeCache : AllStatic {
79 friend class VMStructs;
80 friend class JVMCIVMStructs;
81 template <class T, class Filter> friend class CodeBlobIterator;
82 friend class WhiteBox;
83 friend class CodeCacheLoader;
84 friend class ShenandoahParallelCodeHeapIterator;
85 private:
86 // CodeHeaps of the cache
87 static GrowableArray<CodeHeap*>* _heaps;
88 static GrowableArray<CodeHeap*>* _compiled_heaps;
89 static GrowableArray<CodeHeap*>* _nmethod_heaps;
90 static GrowableArray<CodeHeap*>* _allocable_heaps;
91
92 static address _low_bound; // Lower bound of CodeHeap addresses
93 static address _high_bound; // Upper bound of CodeHeap addresses
94 static int _number_of_nmethods_with_dependencies; // Total number of nmethods with dependencies
95 static bool _needs_cache_clean; // True if inline caches of the nmethods needs to be flushed
96 static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link()
97
98 static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
99 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
100
101 // CodeHeap management
102 static void initialize_heaps(); // Initializes the CodeHeaps
103 // Check the code heap sizes set by the user via command line
104 static void check_heap_sizes(size_t non_nmethod_size, size_t profiled_size, size_t non_profiled_size, size_t cache_size, bool all_set);
|