357 virtual void do_generation(Generation* gen) = 0;
358 };
359
360 // Apply "cl.do_generation" to all generations in the heap
361 // If "old_to_young" determines the order.
362 void generation_iterate(GenClosure* cl, bool old_to_young);
363
364 // Return "true" if all generations have reached the
365 // maximal committed limit that they can reach, without a garbage
366 // collection.
367 virtual bool is_maximal_no_gc() const;
368
369 // This function returns the CardTableRS object that allows us to scan
370 // generations in a fully generational heap.
371 CardTableRS* rem_set() { return _rem_set; }
372
373 // Convenience function to be used in situations where the heap type can be
374 // asserted to be this type.
375 static GenCollectedHeap* heap();
376
377 // Invoke the "do_oop" method of one of the closures "not_older_gens"
378 // or "older_gens" on root locations for the generations depending on
379 // the type. (The "older_gens" closure is used for scanning references
380 // from older generations; "not_older_gens" is used everywhere else.)
381 // If "younger_gens_as_roots" is false, younger generations are
382 // not scanned as roots; in this case, the caller must be arranging to
383 // scan the younger generations itself. (For example, a generation might
384 // explicitly mark reachable objects in younger generations, to avoid
385 // excess storage retention.)
386 // The "so" argument determines which of the roots
387 // the closure is applied to:
388 // "SO_None" does none;
389 enum ScanningOption {
390 SO_None = 0x0,
391 SO_AllCodeCache = 0x8,
392 SO_ScavengeCodeCache = 0x10
393 };
394
395 private:
396 void process_roots(StrongRootsScope* scope,
397 ScanningOption so,
398 OopClosure* strong_roots,
399 OopClosure* weak_roots,
400 CLDClosure* strong_cld_closure,
401 CLDClosure* weak_cld_closure,
402 CodeBlobToOopClosure* code_roots);
403
404 public:
405 void young_process_roots(StrongRootsScope* scope,
406 OopsInGenClosure* root_closure,
407 OopsInGenClosure* old_gen_closure,
408 CLDClosure* cld_closure);
409
410 void old_process_roots(StrongRootsScope* scope,
411 bool young_gen_as_roots,
412 ScanningOption so,
413 bool only_strong_roots,
414 OopsInGenClosure* root_closure,
415 CLDClosure* cld_closure);
416
417 // Apply "root_closure" to all the weak roots of the system.
418 // These include JNI weak roots, string table,
419 // and referents of reachable weak refs.
420 void gen_process_weak_roots(OopClosure* root_closure);
421
422 // Set the saved marks of generations, if that makes sense.
423 // In particular, if any generation might iterate over the oops
424 // in other generations, it should call this method.
425 void save_marks();
426
427 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
428 // allocated since the last call to save_marks in generations at or above
429 // "level". The "cur" closure is
|
357 virtual void do_generation(Generation* gen) = 0;
358 };
359
360 // Apply "cl.do_generation" to all generations in the heap
361 // If "old_to_young" determines the order.
362 void generation_iterate(GenClosure* cl, bool old_to_young);
363
364 // Return "true" if all generations have reached the
365 // maximal committed limit that they can reach, without a garbage
366 // collection.
367 virtual bool is_maximal_no_gc() const;
368
369 // This function returns the CardTableRS object that allows us to scan
370 // generations in a fully generational heap.
371 CardTableRS* rem_set() { return _rem_set; }
372
373 // Convenience function to be used in situations where the heap type can be
374 // asserted to be this type.
375 static GenCollectedHeap* heap();
376
377 // The ScanningOption determines which of the roots
378 // the closure is applied to:
379 // "SO_None" does none;
380 enum ScanningOption {
381 SO_None = 0x0,
382 SO_AllCodeCache = 0x8,
383 SO_ScavengeCodeCache = 0x10
384 };
385
386 private:
387 void process_roots(StrongRootsScope* scope,
388 ScanningOption so,
389 OopClosure* strong_roots,
390 OopClosure* weak_roots,
391 CLDClosure* strong_cld_closure,
392 CLDClosure* weak_cld_closure,
393 CodeBlobToOopClosure* code_roots);
394
395 public:
396 void young_process_roots(StrongRootsScope* scope,
397 OopsInGenClosure* root_closure,
398 OopsInGenClosure* old_gen_closure,
399 CLDClosure* cld_closure);
400
401 // If "young_gen_as_roots" is false, younger generations are
402 // not scanned as roots; in this case, the caller must be arranging to
403 // scan the younger generations itself. (For example, a generation might
404 // explicitly mark reachable objects in younger generations, to avoid
405 // excess storage retention.)
406 void old_process_roots(StrongRootsScope* scope,
407 bool young_gen_as_roots,
408 ScanningOption so,
409 bool only_strong_roots,
410 OopsInGenClosure* root_closure,
411 CLDClosure* cld_closure);
412
413 // Apply "root_closure" to all the weak roots of the system.
414 // These include JNI weak roots, string table,
415 // and referents of reachable weak refs.
416 void gen_process_weak_roots(OopClosure* root_closure);
417
418 // Set the saved marks of generations, if that makes sense.
419 // In particular, if any generation might iterate over the oops
420 // in other generations, it should call this method.
421 void save_marks();
422
423 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
424 // allocated since the last call to save_marks in generations at or above
425 // "level". The "cur" closure is
|