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 cms_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 void full_process_roots(StrongRootsScope* scope,
414 bool only_strong_roots,
415 ScanningOption so,
416 bool is_adjust_phase,
417 OopsInGenClosure* root_closure,
418 CLDClosure* cld_closure);
419
420 // Apply "root_closure" to all the weak roots of the system.
421 // These include JNI weak roots, string table,
422 // and referents of reachable weak refs.
423 void gen_process_weak_roots(OopClosure* root_closure);
424
425 // Set the saved marks of generations, if that makes sense.
426 // In particular, if any generation might iterate over the oops
427 // in other generations, it should call this method.
428 void save_marks();
429
430 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
431 // allocated since the last call to save_marks in generations at or above
432 // "level". The "cur" closure is
433 // applied to references in the generation at "level", and the "older"
434 // closure to older generations.
435 #define GCH_SINCE_SAVE_MARKS_ITERATE_DECL(OopClosureType, nv_suffix) \
436 void oop_since_save_marks_iterate(GenerationType start_gen, \
|
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 void process_string_table_roots(StrongRootsScope* scope,
396 OopClosure* root_closure);
397
398 public:
399 void young_process_roots(StrongRootsScope* scope,
400 OopsInGenClosure* root_closure,
401 OopsInGenClosure* old_gen_closure,
402 CLDClosure* cld_closure);
403
404 // If "young_gen_as_roots" is false, younger generations are
405 // not scanned as roots; in this case, the caller must be arranging to
406 // scan the younger generations itself. (For example, a generation might
407 // explicitly mark reachable objects in younger generations, to avoid
408 // excess storage retention.)
409 void cms_process_roots(StrongRootsScope* scope,
410 bool young_gen_as_roots,
411 ScanningOption so,
412 bool only_strong_roots,
413 OopsInGenClosure* root_closure,
414 CLDClosure* cld_closure);
415
416 void full_process_roots(StrongRootsScope* scope,
417 bool is_adjust_phase,
418 ScanningOption so,
419 bool only_strong_roots,
420 OopsInGenClosure* root_closure,
421 CLDClosure* cld_closure);
422
423 // Apply "root_closure" to all the weak roots of the system.
424 // These include JNI weak roots, string table,
425 // and referents of reachable weak refs.
426 void gen_process_weak_roots(OopClosure* root_closure);
427
428 // Set the saved marks of generations, if that makes sense.
429 // In particular, if any generation might iterate over the oops
430 // in other generations, it should call this method.
431 void save_marks();
432
433 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
434 // allocated since the last call to save_marks in generations at or above
435 // "level". The "cur" closure is
436 // applied to references in the generation at "level", and the "older"
437 // closure to older generations.
438 #define GCH_SINCE_SAVE_MARKS_ITERATE_DECL(OopClosureType, nv_suffix) \
439 void oop_since_save_marks_iterate(GenerationType start_gen, \
|