hotspot/src/share/vm/code/codeCache.hpp
changeset 3908 24b55ad4c228
parent 670 ddf3e9583f2f
child 4750 71fd601907dc
equal deleted inserted replaced
3906:6767b0c66883 3908:24b55ad4c228
    43   // 4422213 or 4436291 for details.
    43   // 4422213 or 4436291 for details.
    44   static CodeHeap * _heap;
    44   static CodeHeap * _heap;
    45   static int _number_of_blobs;
    45   static int _number_of_blobs;
    46   static int _number_of_nmethods_with_dependencies;
    46   static int _number_of_nmethods_with_dependencies;
    47   static bool _needs_cache_clean;
    47   static bool _needs_cache_clean;
       
    48   static nmethod* _scavenge_root_nmethods;  // linked via nm->scavenge_root_link()
    48 
    49 
    49   static void verify_if_often() PRODUCT_RETURN;
    50   static void verify_if_often() PRODUCT_RETURN;
       
    51 
       
    52   static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
       
    53   static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
       
    54 
    50  public:
    55  public:
    51 
    56 
    52   // Initialization
    57   // Initialization
    53   static void initialize();
    58   static void initialize();
    54 
    59 
    59   static int alignment_offset();                    // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
    64   static int alignment_offset();                    // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
    60   static void free(CodeBlob* cb);                   // frees a CodeBlob
    65   static void free(CodeBlob* cb);                   // frees a CodeBlob
    61   static void flush();                              // flushes all CodeBlobs
    66   static void flush();                              // flushes all CodeBlobs
    62   static bool contains(void *p);                    // returns whether p is included
    67   static bool contains(void *p);                    // returns whether p is included
    63   static void blobs_do(void f(CodeBlob* cb));       // iterates over all CodeBlobs
    68   static void blobs_do(void f(CodeBlob* cb));       // iterates over all CodeBlobs
       
    69   static void blobs_do(CodeBlobClosure* f);         // iterates over all CodeBlobs
    64   static void nmethods_do(void f(nmethod* nm));     // iterates over all nmethods
    70   static void nmethods_do(void f(nmethod* nm));     // iterates over all nmethods
    65 
    71 
    66   // Lookup
    72   // Lookup
    67   static CodeBlob* find_blob(void* start);
    73   static CodeBlob* find_blob(void* start);
    68   static nmethod*  find_nmethod(void* start);
    74   static nmethod*  find_nmethod(void* start);
   104   // to) any unmarked codeBlobs in the cache.  Sets "marked_for_unloading"
   110   // to) any unmarked codeBlobs in the cache.  Sets "marked_for_unloading"
   105   // to "true" iff some code got unloaded.
   111   // to "true" iff some code got unloaded.
   106   static void do_unloading(BoolObjectClosure* is_alive,
   112   static void do_unloading(BoolObjectClosure* is_alive,
   107                            OopClosure* keep_alive,
   113                            OopClosure* keep_alive,
   108                            bool unloading_occurred);
   114                            bool unloading_occurred);
   109   static void oops_do(OopClosure* f);
   115   static void oops_do(OopClosure* f) {
       
   116     CodeBlobToOopClosure oopc(f, /*do_marking=*/ false);
       
   117     blobs_do(&oopc);
       
   118   }
       
   119   static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN;
       
   120   static void scavenge_root_nmethods_do(CodeBlobClosure* f);
       
   121 
       
   122   static nmethod* scavenge_root_nmethods()          { return _scavenge_root_nmethods; }
       
   123   static void set_scavenge_root_nmethods(nmethod* nm) { _scavenge_root_nmethods = nm; }
       
   124   static void add_scavenge_root_nmethod(nmethod* nm);
       
   125   static void drop_scavenge_root_nmethod(nmethod* nm);
       
   126   static void prune_scavenge_root_nmethods();
   110 
   127 
   111   // Printing/debugging
   128   // Printing/debugging
   112   static void print()   PRODUCT_RETURN;          // prints summary
   129   static void print()   PRODUCT_RETURN;          // prints summary
   113   static void print_internals();
   130   static void print_internals();
   114   static void verify();                          // verifies the code cache
   131   static void verify();                          // verifies the code cache
       
   132   static void print_trace(const char* event, CodeBlob* cb, int size = 0) PRODUCT_RETURN;
   115 
   133 
   116   // The full limits of the codeCache
   134   // The full limits of the codeCache
   117   static address  low_bound()                    { return (address) _heap->low_boundary(); }
   135   static address  low_bound()                    { return (address) _heap->low_boundary(); }
   118   static address  high_bound()                   { return (address) _heap->high_boundary(); }
   136   static address  high_bound()                   { return (address) _heap->high_boundary(); }
   119 
   137