< prev index next >

src/hotspot/share/code/codeCache.hpp

Print this page
rev 47398 : 8166317: InterpreterCodeSize should be computed
Reviewed-by: kvn, coleenp


 126   // Make private to prevent unsafe calls.  Not all CodeBlob*'s are embedded in a CodeHeap.
 127   static bool contains(CodeBlob *p) { fatal("don't call me!"); return false; }
 128 
 129  public:
 130   // Initialization
 131   static void initialize();
 132 
 133   static int code_heap_compare(CodeHeap* const &lhs, CodeHeap* const &rhs);
 134 
 135   static void add_heap(CodeHeap* heap);
 136   static const GrowableArray<CodeHeap*>* heaps() { return _heaps; }
 137   static const GrowableArray<CodeHeap*>* compiled_heaps() { return _compiled_heaps; }
 138   static const GrowableArray<CodeHeap*>* nmethod_heaps() { return _nmethod_heaps; }
 139 
 140   // Allocation/administration
 141   static CodeBlob* allocate(int size, int code_blob_type, int orig_code_blob_type = CodeBlobType::All); // allocates a new CodeBlob
 142   static void commit(CodeBlob* cb);                        // called when the allocated CodeBlob has been filled
 143   static int  alignment_unit();                            // guaranteed alignment of all CodeBlobs
 144   static int  alignment_offset();                          // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
 145   static void free(CodeBlob* cb);                          // frees a CodeBlob

 146   static bool contains(void *p);                           // returns whether p is included
 147   static bool contains(nmethod* nm);                       // returns whether nm is included
 148   static void blobs_do(void f(CodeBlob* cb));              // iterates over all CodeBlobs
 149   static void blobs_do(CodeBlobClosure* f);                // iterates over all CodeBlobs
 150   static void nmethods_do(void f(nmethod* nm));            // iterates over all nmethods
 151   static void metadata_do(void f(Metadata* m));            // iterates over metadata in alive nmethods
 152 
 153   // Lookup
 154   static CodeBlob* find_blob(void* start);              // Returns the CodeBlob containing the given address
 155   static CodeBlob* find_blob_unsafe(void* start);       // Same as find_blob but does not fail if looking up a zombie method
 156   static nmethod*  find_nmethod(void* start);           // Returns the nmethod containing the given address
 157   static CompiledMethod* find_compiled(void* start);
 158 
 159   static int       blob_count();                        // Returns the total number of CodeBlobs in the cache
 160   static int       blob_count(int code_blob_type);
 161   static int       adapter_count();                     // Returns the total number of Adapters in the cache
 162   static int       adapter_count(int code_blob_type);
 163   static int       nmethod_count();                     // Returns the total number of nmethods in the cache
 164   static int       nmethod_count(int code_blob_type);
 165 




 126   // Make private to prevent unsafe calls.  Not all CodeBlob*'s are embedded in a CodeHeap.
 127   static bool contains(CodeBlob *p) { fatal("don't call me!"); return false; }
 128 
 129  public:
 130   // Initialization
 131   static void initialize();
 132 
 133   static int code_heap_compare(CodeHeap* const &lhs, CodeHeap* const &rhs);
 134 
 135   static void add_heap(CodeHeap* heap);
 136   static const GrowableArray<CodeHeap*>* heaps() { return _heaps; }
 137   static const GrowableArray<CodeHeap*>* compiled_heaps() { return _compiled_heaps; }
 138   static const GrowableArray<CodeHeap*>* nmethod_heaps() { return _nmethod_heaps; }
 139 
 140   // Allocation/administration
 141   static CodeBlob* allocate(int size, int code_blob_type, int orig_code_blob_type = CodeBlobType::All); // allocates a new CodeBlob
 142   static void commit(CodeBlob* cb);                        // called when the allocated CodeBlob has been filled
 143   static int  alignment_unit();                            // guaranteed alignment of all CodeBlobs
 144   static int  alignment_offset();                          // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
 145   static void free(CodeBlob* cb);                          // frees a CodeBlob
 146   static void free_unused_tail(CodeBlob* cb, size_t used); // frees the unused tail of a CodeBlob (only used by TemplateInterpreter::initialize())
 147   static bool contains(void *p);                           // returns whether p is included
 148   static bool contains(nmethod* nm);                       // returns whether nm is included
 149   static void blobs_do(void f(CodeBlob* cb));              // iterates over all CodeBlobs
 150   static void blobs_do(CodeBlobClosure* f);                // iterates over all CodeBlobs
 151   static void nmethods_do(void f(nmethod* nm));            // iterates over all nmethods
 152   static void metadata_do(void f(Metadata* m));            // iterates over metadata in alive nmethods
 153 
 154   // Lookup
 155   static CodeBlob* find_blob(void* start);              // Returns the CodeBlob containing the given address
 156   static CodeBlob* find_blob_unsafe(void* start);       // Same as find_blob but does not fail if looking up a zombie method
 157   static nmethod*  find_nmethod(void* start);           // Returns the nmethod containing the given address
 158   static CompiledMethod* find_compiled(void* start);
 159 
 160   static int       blob_count();                        // Returns the total number of CodeBlobs in the cache
 161   static int       blob_count(int code_blob_type);
 162   static int       adapter_count();                     // Returns the total number of Adapters in the cache
 163   static int       adapter_count(int code_blob_type);
 164   static int       nmethod_count();                     // Returns the total number of nmethods in the cache
 165   static int       nmethod_count(int code_blob_type);
 166 


< prev index next >