84 // CodeHeaps of the cache
85 static GrowableArray<CodeHeap*>* _heaps;
86 static GrowableArray<CodeHeap*>* _compiled_heaps;
87 static GrowableArray<CodeHeap*>* _nmethod_heaps;
88
89 static address _low_bound; // Lower bound of CodeHeap addresses
90 static address _high_bound; // Upper bound of CodeHeap addresses
91 static int _number_of_nmethods_with_dependencies; // Total number of nmethods with dependencies
92 static bool _needs_cache_clean; // True if inline caches of the nmethods needs to be flushed
93 static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link()
94
95 static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
96 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
97
98 // CodeHeap management
99 static void initialize_heaps(); // Initializes the CodeHeaps
100 // Check the code heap sizes set by the user via command line
101 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);
102 // Creates a new heap with the given name and size, containing CodeBlobs of the given type
103 static void add_heap(ReservedSpace rs, const char* name, int code_blob_type);
104 static CodeHeap* get_code_heap(const CodeBlob* cb); // Returns the CodeHeap for the given CodeBlob
105 static CodeHeap* get_code_heap(int code_blob_type); // Returns the CodeHeap for the given CodeBlobType
106 // Returns the name of the VM option to set the size of the corresponding CodeHeap
107 static const char* get_code_heap_flag_name(int code_blob_type);
108 static size_t heap_alignment(); // Returns the alignment of the CodeHeaps in bytes
109 static ReservedCodeSpace reserve_heap_memory(size_t size); // Reserves one continuous chunk of memory for the CodeHeaps
110
111 // Iteration
112 static CodeBlob* first_blob(CodeHeap* heap); // Returns the first CodeBlob on the given CodeHeap
113 static CodeBlob* first_blob(int code_blob_type); // Returns the first CodeBlob of the given type
114 static CodeBlob* next_blob(CodeHeap* heap, CodeBlob* cb); // Returns the next CodeBlob on the given CodeHeap
115
116 static size_t bytes_allocated_in_freelists();
117 static int allocated_segments();
118 static size_t freelists_length();
119
120 static void set_scavenge_root_nmethods(nmethod* nm) { _scavenge_root_nmethods = nm; }
121 static void prune_scavenge_root_nmethods();
122 static void unlink_scavenge_root_nmethod(nmethod* nm, nmethod* prev);
123
|
84 // CodeHeaps of the cache
85 static GrowableArray<CodeHeap*>* _heaps;
86 static GrowableArray<CodeHeap*>* _compiled_heaps;
87 static GrowableArray<CodeHeap*>* _nmethod_heaps;
88
89 static address _low_bound; // Lower bound of CodeHeap addresses
90 static address _high_bound; // Upper bound of CodeHeap addresses
91 static int _number_of_nmethods_with_dependencies; // Total number of nmethods with dependencies
92 static bool _needs_cache_clean; // True if inline caches of the nmethods needs to be flushed
93 static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link()
94
95 static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
96 static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
97
98 // CodeHeap management
99 static void initialize_heaps(); // Initializes the CodeHeaps
100 // Check the code heap sizes set by the user via command line
101 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);
102 // Creates a new heap with the given name and size, containing CodeBlobs of the given type
103 static void add_heap(ReservedSpace rs, const char* name, int code_blob_type);
104 static CodeHeap* get_code_heap_containing(void* p); // Returns the CodeHeap containing the given pointer, or NULL
105 static CodeHeap* get_code_heap(const CodeBlob* cb); // Returns the CodeHeap for the given CodeBlob
106 static CodeHeap* get_code_heap(int code_blob_type); // Returns the CodeHeap for the given CodeBlobType
107 // Returns the name of the VM option to set the size of the corresponding CodeHeap
108 static const char* get_code_heap_flag_name(int code_blob_type);
109 static size_t heap_alignment(); // Returns the alignment of the CodeHeaps in bytes
110 static ReservedCodeSpace reserve_heap_memory(size_t size); // Reserves one continuous chunk of memory for the CodeHeaps
111
112 // Iteration
113 static CodeBlob* first_blob(CodeHeap* heap); // Returns the first CodeBlob on the given CodeHeap
114 static CodeBlob* first_blob(int code_blob_type); // Returns the first CodeBlob of the given type
115 static CodeBlob* next_blob(CodeHeap* heap, CodeBlob* cb); // Returns the next CodeBlob on the given CodeHeap
116
117 static size_t bytes_allocated_in_freelists();
118 static int allocated_segments();
119 static size_t freelists_length();
120
121 static void set_scavenge_root_nmethods(nmethod* nm) { _scavenge_root_nmethods = nm; }
122 static void prune_scavenge_root_nmethods();
123 static void unlink_scavenge_root_nmethod(nmethod* nm, nmethod* prev);
124
|