< prev index next >

src/hotspot/share/gc/shared/collectedHeap.hpp

Print this page




 222   // (e.g., in the case of the young gen, one of the survivor
 223   // spaces).
 224   virtual size_t max_capacity() const = 0;
 225 
 226   // Returns "TRUE" if "p" points into the reserved area of the heap.
 227   bool is_in_reserved(const void* p) const {
 228     return _reserved.contains(p);
 229   }
 230 
 231   bool is_in_reserved_or_null(const void* p) const {
 232     return p == NULL || is_in_reserved(p);
 233   }
 234 
 235   // Returns "TRUE" iff "p" points into the committed areas of the heap.
 236   // This method can be expensive so avoid using it in performance critical
 237   // code.
 238   virtual bool is_in(const void* p) const = 0;
 239 
 240   DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
 241 
 242   // Let's define some terms: a "closed" subset of a heap is one that
 243   //
 244   // 1) contains all currently-allocated objects, and
 245   //
 246   // 2) is closed under reference: no object in the closed subset
 247   //    references one outside the closed subset.
 248   //
 249   // Membership in a heap's closed subset is useful for assertions.
 250   // Clearly, the entire heap is a closed subset, so the default
 251   // implementation is to use "is_in_reserved".  But this may not be too
 252   // liberal to perform useful checking.  Also, the "is_in" predicate
 253   // defines a closed subset, but may be too expensive, since "is_in"
 254   // verifies that its argument points to an object head.  The
 255   // "closed_subset" method allows a heap to define an intermediate
 256   // predicate, allowing more precise checking than "is_in_reserved" at
 257   // lower cost than "is_in."
 258 
 259   // One important case is a heap composed of disjoint contiguous spaces,
 260   // such as the Garbage-First collector.  Such heaps have a convenient
 261   // closed subset consisting of the allocated portions of those
 262   // contiguous spaces.
 263 
 264   // Return "TRUE" iff the given pointer points into the heap's defined
 265   // closed subset (which defaults to the entire heap).
 266   virtual bool is_in_closed_subset(const void* p) const {
 267     return is_in_reserved(p);
 268   }
 269 
 270   bool is_in_closed_subset_or_null(const void* p) const {
 271     return p == NULL || is_in_closed_subset(p);
 272   }
 273 
 274   void set_gc_cause(GCCause::Cause v) {
 275      if (UsePerfData) {
 276        _gc_lastcause = _gc_cause;
 277        _perf_gc_lastcause->set_value(GCCause::to_string(_gc_lastcause));
 278        _perf_gc_cause->set_value(GCCause::to_string(v));
 279      }
 280     _gc_cause = v;
 281   }
 282   GCCause::Cause gc_cause() { return _gc_cause; }
 283 
 284   virtual oop obj_allocate(Klass* klass, int size, TRAPS);
 285   virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS);
 286   virtual oop class_allocate(Klass* klass, int size, TRAPS);
 287 
 288   // Utilities for turning raw memory into filler objects.
 289   //
 290   // min_fill_size() is the smallest region that can be filled.
 291   // fill_with_objects() can fill arbitrary-sized regions of the heap using
 292   // multiple objects.  fill_with_object() is for regions known to be smaller
 293   // than the largest array of integers; it uses a single object to fill the




 222   // (e.g., in the case of the young gen, one of the survivor
 223   // spaces).
 224   virtual size_t max_capacity() const = 0;
 225 
 226   // Returns "TRUE" if "p" points into the reserved area of the heap.
 227   bool is_in_reserved(const void* p) const {
 228     return _reserved.contains(p);
 229   }
 230 
 231   bool is_in_reserved_or_null(const void* p) const {
 232     return p == NULL || is_in_reserved(p);
 233   }
 234 
 235   // Returns "TRUE" iff "p" points into the committed areas of the heap.
 236   // This method can be expensive so avoid using it in performance critical
 237   // code.
 238   virtual bool is_in(const void* p) const = 0;
 239 
 240   DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
 241 
































 242   void set_gc_cause(GCCause::Cause v) {
 243      if (UsePerfData) {
 244        _gc_lastcause = _gc_cause;
 245        _perf_gc_lastcause->set_value(GCCause::to_string(_gc_lastcause));
 246        _perf_gc_cause->set_value(GCCause::to_string(v));
 247      }
 248     _gc_cause = v;
 249   }
 250   GCCause::Cause gc_cause() { return _gc_cause; }
 251 
 252   virtual oop obj_allocate(Klass* klass, int size, TRAPS);
 253   virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS);
 254   virtual oop class_allocate(Klass* klass, int size, TRAPS);
 255 
 256   // Utilities for turning raw memory into filler objects.
 257   //
 258   // min_fill_size() is the smallest region that can be filled.
 259   // fill_with_objects() can fill arbitrary-sized regions of the heap using
 260   // multiple objects.  fill_with_object() is for regions known to be smaller
 261   // than the largest array of integers; it uses a single object to fill the


< prev index next >