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