863 } 864 865 // Allocation (return NULL if full) 866 virtual HeapWord* allocate(size_t word_size); 867 virtual HeapWord* par_allocate(size_t word_size); 868 869 virtual bool obj_allocated_since_save_marks(const oop obj) const { 870 return (HeapWord*)obj >= saved_mark_word(); 871 } 872 873 // Iteration 874 void oop_iterate(OopClosure* cl); 875 void oop_iterate(MemRegion mr, OopClosure* cl); 876 void object_iterate(ObjectClosure* blk); 877 // For contiguous spaces this method will iterate safely over objects 878 // in the space (i.e., between bottom and top) when at a safepoint. 879 void safe_object_iterate(ObjectClosure* blk); 880 void object_iterate_mem(MemRegion mr, UpwardsObjectClosure* cl); 881 // iterates on objects up to the safe limit 882 HeapWord* object_iterate_careful(ObjectClosureCareful* cl); 883 inline HeapWord* concurrent_iteration_safe_limit(); 884 // changes the safe limit, all objects from bottom() to the new 885 // limit should be properly initialized 886 inline void set_concurrent_iteration_safe_limit(HeapWord* new_limit); 887 888 #ifndef SERIALGC 889 // In support of parallel oop_iterate. 890 #define ContigSpace_PAR_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ 891 void par_oop_iterate(MemRegion mr, OopClosureType* blk); 892 893 ALL_PAR_OOP_ITERATE_CLOSURES(ContigSpace_PAR_OOP_ITERATE_DECL) 894 #undef ContigSpace_PAR_OOP_ITERATE_DECL 895 #endif // SERIALGC 896 897 // Compaction support 898 virtual void reset_after_compaction() { 899 assert(compaction_top() >= bottom() && compaction_top() <= end(), "should point inside space"); 900 set_top(compaction_top()); 901 // set new iteration safe limit 902 set_concurrent_iteration_safe_limit(compaction_top()); 903 } 904 virtual size_t minimum_free_block_size() const { return 0; } 905 906 // Override. | 863 } 864 865 // Allocation (return NULL if full) 866 virtual HeapWord* allocate(size_t word_size); 867 virtual HeapWord* par_allocate(size_t word_size); 868 869 virtual bool obj_allocated_since_save_marks(const oop obj) const { 870 return (HeapWord*)obj >= saved_mark_word(); 871 } 872 873 // Iteration 874 void oop_iterate(OopClosure* cl); 875 void oop_iterate(MemRegion mr, OopClosure* cl); 876 void object_iterate(ObjectClosure* blk); 877 // For contiguous spaces this method will iterate safely over objects 878 // in the space (i.e., between bottom and top) when at a safepoint. 879 void safe_object_iterate(ObjectClosure* blk); 880 void object_iterate_mem(MemRegion mr, UpwardsObjectClosure* cl); 881 // iterates on objects up to the safe limit 882 HeapWord* object_iterate_careful(ObjectClosureCareful* cl); 883 HeapWord* concurrent_iteration_safe_limit() { 884 assert(_concurrent_iteration_safe_limit <= top(), 885 "_concurrent_iteration_safe_limit update missed"); 886 return _concurrent_iteration_safe_limit; 887 } 888 // changes the safe limit, all objects from bottom() to the new 889 // limit should be properly initialized 890 void set_concurrent_iteration_safe_limit(HeapWord* new_limit) { 891 assert(new_limit <= top(), "uninitialized objects in the safe range"); 892 _concurrent_iteration_safe_limit = new_limit; 893 } 894 895 #ifndef SERIALGC 896 // In support of parallel oop_iterate. 897 #define ContigSpace_PAR_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ 898 void par_oop_iterate(MemRegion mr, OopClosureType* blk); 899 900 ALL_PAR_OOP_ITERATE_CLOSURES(ContigSpace_PAR_OOP_ITERATE_DECL) 901 #undef ContigSpace_PAR_OOP_ITERATE_DECL 902 #endif // SERIALGC 903 904 // Compaction support 905 virtual void reset_after_compaction() { 906 assert(compaction_top() >= bottom() && compaction_top() <= end(), "should point inside space"); 907 set_top(compaction_top()); 908 // set new iteration safe limit 909 set_concurrent_iteration_safe_limit(compaction_top()); 910 } 911 virtual size_t minimum_free_block_size() const { return 0; } 912 913 // Override. |