< prev index next >

src/hotspot/share/code/codeCache.hpp

Print this page

130  private:
131   static size_t bytes_allocated_in_freelists();
132   static int    allocated_segments();
133   static size_t freelists_length();
134 
135   // Make private to prevent unsafe calls.  Not all CodeBlob*'s are embedded in a CodeHeap.
136   static bool contains(CodeBlob *p) { fatal("don't call me!"); return false; }
137 
138  public:
139   // Initialization
140   static void initialize();
141   static size_t page_size(bool aligned = true, size_t min_pages = 1); // Returns the page size used by the CodeCache
142 
143   static int code_heap_compare(CodeHeap* const &lhs, CodeHeap* const &rhs);
144 
145   static void add_heap(CodeHeap* heap);
146   static const GrowableArray<CodeHeap*>* heaps() { return _heaps; }
147   static const GrowableArray<CodeHeap*>* compiled_heaps() { return _compiled_heaps; }
148   static const GrowableArray<CodeHeap*>* nmethod_heaps() { return _nmethod_heaps; }
149 

150   // Allocation/administration
151   static CodeBlob* allocate(uint size, CodeBlobType code_blob_type, bool handle_alloc_failure = true, CodeBlobType orig_code_blob_type = CodeBlobType::All); // allocates a new CodeBlob
152   static void commit(CodeBlob* cb);                        // called when the allocated CodeBlob has been filled
153   static void free(CodeBlob* cb);                          // frees a CodeBlob
154   static void free_unused_tail(CodeBlob* cb, size_t used); // frees the unused tail of a CodeBlob (only used by TemplateInterpreter::initialize())
155   static bool contains(void *p);                           // returns whether p is included
156   static bool contains(nmethod* nm);                       // returns whether nm is included
157   static void blobs_do(void f(CodeBlob* cb));              // iterates over all CodeBlobs
158   static void blobs_do(CodeBlobClosure* f);                // iterates over all CodeBlobs
159   static void nmethods_do(void f(nmethod* nm));            // iterates over all nmethods
160   static void metadata_do(MetadataClosure* f);             // iterates over metadata in alive nmethods
161 
162   // Lookup
163   static CodeBlob* find_blob(void* start);              // Returns the CodeBlob containing the given address
164   static CodeBlob* find_blob_fast(void* start);         // Returns the CodeBlob containing the given address
165   static CodeBlob* find_blob_and_oopmap(void* start, int& slot);         // Returns the CodeBlob containing the given address
166   static int find_oopmap_slot_fast(void* start);        // Returns a fast oopmap slot if there is any; -1 otherwise
167   static nmethod*  find_nmethod(void* start);           // Returns the nmethod containing the given address
168   static CompiledMethod* find_compiled(void* start);
169 

205   // on-stack nmethods. It's used in two places:
206   // 1. Used before the start of concurrent marking so that oops inside
207   //    on-stack nmethods are visited.
208   // 2. Used at the end of (stw/concurrent) marking so that nmethod::_gc_epoch
209   //    is up-to-date, which provides more accurate estimate of
210   //    nmethod::is_cold.
211   static void arm_all_nmethods();
212 
213   static void maybe_restart_compiler(size_t freed_memory);
214   static void do_unloading(bool unloading_occurred);
215   static uint8_t unloading_cycle() { return _unloading_cycle; }
216 
217   static void increment_unloading_cycle();
218 
219   static void release_exception_cache(ExceptionCache* entry);
220   static void purge_exception_caches();
221 
222   // Printing/debugging
223   static void print();                           // prints summary
224   static void print_internals();

225   static void print_memory_overhead();
226   static void verify();                          // verifies the code cache
227   static void print_trace(const char* event, CodeBlob* cb, uint size = 0) PRODUCT_RETURN;
228   static void print_summary(outputStream* st, bool detailed = true); // Prints a summary of the code cache usage
229   static void log_state(outputStream* st);
230   LINUX_ONLY(static void write_perf_map(const char* filename = nullptr);)
231   static const char* get_code_heap_name(CodeBlobType code_blob_type)  { return (heap_available(code_blob_type) ? get_code_heap(code_blob_type)->name() : "Unused"); }
232   static void report_codemem_full(CodeBlobType code_blob_type, bool print);
233 


234   // Dcmd (Diagnostic commands)
235   static void print_codelist(outputStream* st);
236   static void print_layout(outputStream* st);
237 
238   // The full limits of the codeCache
239   static address low_bound()                          { return _low_bound; }
240   static address low_bound(CodeBlobType code_blob_type);
241   static address high_bound()                         { return _high_bound; }
242   static address high_bound(CodeBlobType code_blob_type);
243 
244   // Profiling
245   static size_t capacity();
246   static size_t unallocated_capacity(CodeBlobType code_blob_type);
247   static size_t unallocated_capacity();
248   static size_t max_capacity();
249 
250   static double reverse_free_ratio();
251 
252   static size_t max_distance_to_non_nmethod();
253   static bool is_non_nmethod(address addr);

130  private:
131   static size_t bytes_allocated_in_freelists();
132   static int    allocated_segments();
133   static size_t freelists_length();
134 
135   // Make private to prevent unsafe calls.  Not all CodeBlob*'s are embedded in a CodeHeap.
136   static bool contains(CodeBlob *p) { fatal("don't call me!"); return false; }
137 
138  public:
139   // Initialization
140   static void initialize();
141   static size_t page_size(bool aligned = true, size_t min_pages = 1); // Returns the page size used by the CodeCache
142 
143   static int code_heap_compare(CodeHeap* const &lhs, CodeHeap* const &rhs);
144 
145   static void add_heap(CodeHeap* heap);
146   static const GrowableArray<CodeHeap*>* heaps() { return _heaps; }
147   static const GrowableArray<CodeHeap*>* compiled_heaps() { return _compiled_heaps; }
148   static const GrowableArray<CodeHeap*>* nmethod_heaps() { return _nmethod_heaps; }
149 
150   static void* map_cached_code();
151   // Allocation/administration
152   static CodeBlob* allocate(uint size, CodeBlobType code_blob_type, bool handle_alloc_failure = true, CodeBlobType orig_code_blob_type = CodeBlobType::All); // allocates a new CodeBlob
153   static void commit(CodeBlob* cb);                        // called when the allocated CodeBlob has been filled
154   static void free(CodeBlob* cb);                          // frees a CodeBlob
155   static void free_unused_tail(CodeBlob* cb, size_t used); // frees the unused tail of a CodeBlob (only used by TemplateInterpreter::initialize())
156   static bool contains(void *p);                           // returns whether p is included
157   static bool contains(nmethod* nm);                       // returns whether nm is included
158   static void blobs_do(void f(CodeBlob* cb));              // iterates over all CodeBlobs
159   static void blobs_do(CodeBlobClosure* f);                // iterates over all CodeBlobs
160   static void nmethods_do(void f(nmethod* nm));            // iterates over all nmethods
161   static void metadata_do(MetadataClosure* f);             // iterates over metadata in alive nmethods
162 
163   // Lookup
164   static CodeBlob* find_blob(void* start);              // Returns the CodeBlob containing the given address
165   static CodeBlob* find_blob_fast(void* start);         // Returns the CodeBlob containing the given address
166   static CodeBlob* find_blob_and_oopmap(void* start, int& slot);         // Returns the CodeBlob containing the given address
167   static int find_oopmap_slot_fast(void* start);        // Returns a fast oopmap slot if there is any; -1 otherwise
168   static nmethod*  find_nmethod(void* start);           // Returns the nmethod containing the given address
169   static CompiledMethod* find_compiled(void* start);
170 

206   // on-stack nmethods. It's used in two places:
207   // 1. Used before the start of concurrent marking so that oops inside
208   //    on-stack nmethods are visited.
209   // 2. Used at the end of (stw/concurrent) marking so that nmethod::_gc_epoch
210   //    is up-to-date, which provides more accurate estimate of
211   //    nmethod::is_cold.
212   static void arm_all_nmethods();
213 
214   static void maybe_restart_compiler(size_t freed_memory);
215   static void do_unloading(bool unloading_occurred);
216   static uint8_t unloading_cycle() { return _unloading_cycle; }
217 
218   static void increment_unloading_cycle();
219 
220   static void release_exception_cache(ExceptionCache* entry);
221   static void purge_exception_caches();
222 
223   // Printing/debugging
224   static void print();                           // prints summary
225   static void print_internals();
226   static void print_nmethods_on(outputStream* st);
227   static void print_memory_overhead();
228   static void verify();                          // verifies the code cache
229   static void print_trace(const char* event, CodeBlob* cb, uint size = 0) PRODUCT_RETURN;
230   static void print_summary(outputStream* st, bool detailed = true); // Prints a summary of the code cache usage
231   static void log_state(outputStream* st);
232   LINUX_ONLY(static void write_perf_map(const char* filename = nullptr);)
233   static const char* get_code_heap_name(CodeBlobType code_blob_type)  { return (heap_available(code_blob_type) ? get_code_heap(code_blob_type)->name() : "Unused"); }
234   static void report_codemem_full(CodeBlobType code_blob_type, bool print);
235 
236   static void print_nmethod_statistics_on(outputStream* st);
237 
238   // Dcmd (Diagnostic commands)
239   static void print_codelist(outputStream* st);
240   static void print_layout(outputStream* st);
241 
242   // The full limits of the codeCache
243   static address low_bound()                          { return _low_bound; }
244   static address low_bound(CodeBlobType code_blob_type);
245   static address high_bound()                         { return _high_bound; }
246   static address high_bound(CodeBlobType code_blob_type);
247 
248   // Profiling
249   static size_t capacity();
250   static size_t unallocated_capacity(CodeBlobType code_blob_type);
251   static size_t unallocated_capacity();
252   static size_t max_capacity();
253 
254   static double reverse_free_ratio();
255 
256   static size_t max_distance_to_non_nmethod();
257   static bool is_non_nmethod(address addr);
< prev index next >