27 |
27 |
28 #include "memory/iterator.hpp" |
28 #include "memory/iterator.hpp" |
29 #include "memory/memRegion.hpp" |
29 #include "memory/memRegion.hpp" |
30 #include "memory/specialized_oop_closures.hpp" |
30 #include "memory/specialized_oop_closures.hpp" |
31 #include "oops/metadata.hpp" |
31 #include "oops/metadata.hpp" |
|
32 #include "utilities/macros.hpp" |
32 #include "utilities/top.hpp" |
33 #include "utilities/top.hpp" |
33 |
34 |
34 // oopDesc is the top baseclass for objects classes. The {name}Desc classes describe |
35 // oopDesc is the top baseclass for objects classes. The {name}Desc classes describe |
35 // the format of Java objects so the fields can be accessed from C++. |
36 // the format of Java objects so the fields can be accessed from C++. |
36 // oopDesc is abstract. |
37 // oopDesc is abstract. |
296 bool is_gc_marked() const; |
297 bool is_gc_marked() const; |
297 // Apply "MarkSweep::mark_and_push" to (the address of) every non-NULL |
298 // Apply "MarkSweep::mark_and_push" to (the address of) every non-NULL |
298 // reference field in "this". |
299 // reference field in "this". |
299 void follow_contents(void); |
300 void follow_contents(void); |
300 |
301 |
301 #ifndef SERIALGC |
302 #if INCLUDE_ALL_GCS |
302 // Parallel Scavenge |
303 // Parallel Scavenge |
303 void push_contents(PSPromotionManager* pm); |
304 void push_contents(PSPromotionManager* pm); |
304 |
305 |
305 // Parallel Old |
306 // Parallel Old |
306 void update_contents(ParCompactionManager* cm); |
307 void update_contents(ParCompactionManager* cm); |
307 |
308 |
308 void follow_contents(ParCompactionManager* cm); |
309 void follow_contents(ParCompactionManager* cm); |
309 #endif // SERIALGC |
310 #endif // INCLUDE_ALL_GCS |
310 |
311 |
311 bool is_scavengable() const; |
312 bool is_scavengable() const; |
312 |
313 |
313 // Forward pointer operations for scavenge |
314 // Forward pointer operations for scavenge |
314 bool is_forwarded() const; |
315 bool is_forwarded() const; |
315 |
316 |
316 void forward_to(oop p); |
317 void forward_to(oop p); |
317 bool cas_forward_to(oop p, markOop compare); |
318 bool cas_forward_to(oop p, markOop compare); |
318 |
319 |
319 #ifndef SERIALGC |
320 #if INCLUDE_ALL_GCS |
320 // Like "forward_to", but inserts the forwarding pointer atomically. |
321 // Like "forward_to", but inserts the forwarding pointer atomically. |
321 // Exactly one thread succeeds in inserting the forwarding pointer, and |
322 // Exactly one thread succeeds in inserting the forwarding pointer, and |
322 // this call returns "NULL" for that thread; any other thread has the |
323 // this call returns "NULL" for that thread; any other thread has the |
323 // value of the forwarding pointer returned and does not modify "this". |
324 // value of the forwarding pointer returned and does not modify "this". |
324 oop forward_to_atomic(oop p); |
325 oop forward_to_atomic(oop p); |
325 #endif // SERIALGC |
326 #endif // INCLUDE_ALL_GCS |
326 |
327 |
327 oop forwardee() const; |
328 oop forwardee() const; |
328 |
329 |
329 // Age of object during scavenge |
330 // Age of object during scavenge |
330 uint age() const; |
331 uint age() const; |
332 |
333 |
333 // Adjust all pointers in this object to point at it's forwarded location and |
334 // Adjust all pointers in this object to point at it's forwarded location and |
334 // return the size of this oop. This is used by the MarkSweep collector. |
335 // return the size of this oop. This is used by the MarkSweep collector. |
335 int adjust_pointers(); |
336 int adjust_pointers(); |
336 |
337 |
337 #ifndef SERIALGC |
338 #if INCLUDE_ALL_GCS |
338 // Parallel old |
339 // Parallel old |
339 void update_header(ParCompactionManager* cm); |
340 void update_header(ParCompactionManager* cm); |
340 #endif // SERIALGC |
341 #endif // INCLUDE_ALL_GCS |
341 |
342 |
342 // mark-sweep support |
343 // mark-sweep support |
343 void follow_body(int begin, int end); |
344 void follow_body(int begin, int end); |
344 |
345 |
345 // Fast access to barrier set |
346 // Fast access to barrier set |
352 int oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. |
353 int oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. |
353 |
354 |
354 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL) |
355 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL) |
355 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL) |
356 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL) |
356 |
357 |
357 #ifndef SERIALGC |
358 #if INCLUDE_ALL_GCS |
358 |
359 |
359 #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ |
360 #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ |
360 int oop_iterate_backwards(OopClosureType* blk); |
361 int oop_iterate_backwards(OopClosureType* blk); |
361 |
362 |
362 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL) |
363 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL) |