453 // younger), allowing them to resize themselves as appropriate. 454 virtual void compute_new_size() = 0; 455 456 // Printing 457 virtual const char* name() const = 0; 458 virtual const char* short_name() const = 0; 459 460 // Reference Processing accessor 461 ReferenceProcessor* const ref_processor() { return _ref_processor; } 462 463 // Iteration. 464 465 // Iterate over all the ref-containing fields of all objects in the 466 // generation, calling "cl.do_oop" on each. 467 virtual void oop_iterate(OopIterateClosure* cl); 468 469 // Iterate over all objects in the generation, calling "cl.do_object" on 470 // each. 471 virtual void object_iterate(ObjectClosure* cl); 472 473 // Iterate over all safe objects in the generation, calling "cl.do_object" on 474 // each. An object is safe if its references point to other objects in 475 // the heap. This defaults to object_iterate() unless overridden. 476 virtual void safe_object_iterate(ObjectClosure* cl); 477 478 // Apply "cl->do_oop" to (the address of) all and only all the ref fields 479 // in the current generation that contain pointers to objects in younger 480 // generations. Objects allocated since the last "save_marks" call are 481 // excluded. 482 virtual void younger_refs_iterate(OopsInGenClosure* cl, uint n_threads) = 0; 483 484 // Inform a generation that it longer contains references to objects 485 // in any younger generation. [e.g. Because younger gens are empty, 486 // clear the card table.] 487 virtual void clear_remembered_set() { } 488 489 // Inform a generation that some of its objects have moved. [e.g. The 490 // generation's spaces were compacted, invalidating the card table.] 491 virtual void invalidate_remembered_set() { } 492 493 // Block abstraction. 494 495 // Returns the address of the start of the "block" that contains the 496 // address "addr". We say "blocks" instead of "object" since some heaps 497 // may not pack objects densely; a chunk may either be an object or a | 453 // younger), allowing them to resize themselves as appropriate. 454 virtual void compute_new_size() = 0; 455 456 // Printing 457 virtual const char* name() const = 0; 458 virtual const char* short_name() const = 0; 459 460 // Reference Processing accessor 461 ReferenceProcessor* const ref_processor() { return _ref_processor; } 462 463 // Iteration. 464 465 // Iterate over all the ref-containing fields of all objects in the 466 // generation, calling "cl.do_oop" on each. 467 virtual void oop_iterate(OopIterateClosure* cl); 468 469 // Iterate over all objects in the generation, calling "cl.do_object" on 470 // each. 471 virtual void object_iterate(ObjectClosure* cl); 472 473 // Apply "cl->do_oop" to (the address of) all and only all the ref fields 474 // in the current generation that contain pointers to objects in younger 475 // generations. Objects allocated since the last "save_marks" call are 476 // excluded. 477 virtual void younger_refs_iterate(OopsInGenClosure* cl, uint n_threads) = 0; 478 479 // Inform a generation that it longer contains references to objects 480 // in any younger generation. [e.g. Because younger gens are empty, 481 // clear the card table.] 482 virtual void clear_remembered_set() { } 483 484 // Inform a generation that some of its objects have moved. [e.g. The 485 // generation's spaces were compacted, invalidating the card table.] 486 virtual void invalidate_remembered_set() { } 487 488 // Block abstraction. 489 490 // Returns the address of the start of the "block" that contains the 491 // address "addr". We say "blocks" instead of "object" since some heaps 492 // may not pack objects densely; a chunk may either be an object or a |