src/share/vm/oops/oop.hpp

Print this page
rev 6796 : [mq]: templateOopIterate
rev 6801 : imported patch defaultToTrue


 319   oop forward_to_atomic(oop p);
 320 #endif // INCLUDE_ALL_GCS
 321 
 322   oop forwardee() const;
 323 
 324   // Age of object during scavenge
 325   uint age() const;
 326   void incr_age();
 327 
 328   // Adjust all pointers in this object to point at it's forwarded location and
 329   // return the size of this oop.  This is used by the MarkSweep collector.
 330   int adjust_pointers();
 331 
 332   // mark-sweep support
 333   void follow_body(int begin, int end);
 334 
 335   // Fast access to barrier set
 336   static BarrierSet* bs()            { return _bs; }
 337   static void set_bs(BarrierSet* bs) { _bs = bs; }
 338 
 339   // iterators, returns size of object
 340 #define OOP_ITERATE_DECL(OopClosureType, nv_suffix)                      \
 341   int oop_iterate(OopClosureType* blk);                                  \
 342   int oop_iterate(OopClosureType* blk, MemRegion mr);  // Only in mr.
 343 
 344   ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL)
 345   ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL)





















 346 
 347 #if INCLUDE_ALL_GCS
 348 
 349 #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix)            \
 350   int oop_iterate_backwards(OopClosureType* blk);
 351 
 352   ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL)
 353   ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL)
 354 #endif
 355 
 356   int oop_iterate_no_header(OopClosure* bk);
 357   int oop_iterate_no_header(OopClosure* bk, MemRegion mr);
 358 
 359   // identity hash; returns the identity hash key (computes it if necessary)
 360   // NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a
 361   // safepoint if called on a biased object. Calling code must be aware of that.
 362   intptr_t identity_hash();
 363   intptr_t slow_identity_hash();
 364 
 365   // Alternate hashing code if string table is rehashed
 366   unsigned int new_hash(juint seed);
 367 
 368   // marks are forwarded to stack when object is locked
 369   bool     has_displaced_mark() const;
 370   markOop  displaced_mark() const;
 371   void     set_displaced_mark(markOop m);
 372 
 373   // for code generation
 374   static int mark_offset_in_bytes()    { return offset_of(oopDesc, _mark); }
 375   static int klass_offset_in_bytes()   { return offset_of(oopDesc, _metadata._klass); }
 376   static int klass_gap_offset_in_bytes();
 377 };












 378 
 379 #endif // SHARE_VM_OOPS_OOP_HPP


 319   oop forward_to_atomic(oop p);
 320 #endif // INCLUDE_ALL_GCS
 321 
 322   oop forwardee() const;
 323 
 324   // Age of object during scavenge
 325   uint age() const;
 326   void incr_age();
 327 
 328   // Adjust all pointers in this object to point at it's forwarded location and
 329   // return the size of this oop.  This is used by the MarkSweep collector.
 330   int adjust_pointers();
 331 
 332   // mark-sweep support
 333   void follow_body(int begin, int end);
 334 
 335   // Fast access to barrier set
 336   static BarrierSet* bs()            { return _bs; }
 337   static void set_bs(BarrierSet* bs) { _bs = bs; }
 338 
 339   // Oop iterators



 340 
 341   // The oop iterates applies an ExtendedOopClosure to all the oops
 342   // (and maybe also iterates over the metadata).
 343   // See the comments in ExtendedOopClosures.
 344   //
 345   // The oop iterators use templates to get rid of the virtual calls.
 346   // If 'nv' is set to true the call to the virtual OopClosure::do_oop,
 347   // will be replaced with a non-virtual call to OopClosureType::do_oop_nv.
 348 
 349   template <bool nv, typename OopClosureType>
 350   int oop_iterate(OopClosureType* blk);
 351 
 352   template <typename OopClosureType>
 353   int oop_iterate(OopClosureType* blk) {
 354     oop_iterate<true>(blk);
 355   }
 356 
 357   template <bool nv, typename OopClosureType>
 358   int oop_iterate(OopClosureType* blk, MemRegion mr);
 359 
 360   template <typename OopClosureType>
 361   int oop_iterate(OopClosureType* blk, MemRegion mr) {
 362     oop_iterate<true>(blk, mr);
 363   }
 364 
 365 #if INCLUDE_ALL_GCS
 366   template <bool nv, typename OopClosureType>

 367   int oop_iterate_backwards(OopClosureType* blk);



 368 #endif
 369 
 370   int oop_iterate_no_header(OopClosure* bk);
 371   int oop_iterate_no_header(OopClosure* bk, MemRegion mr);
 372 
 373   // identity hash; returns the identity hash key (computes it if necessary)
 374   // NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a
 375   // safepoint if called on a biased object. Calling code must be aware of that.
 376   intptr_t identity_hash();
 377   intptr_t slow_identity_hash();
 378 
 379   // Alternate hashing code if string table is rehashed
 380   unsigned int new_hash(juint seed);
 381 
 382   // marks are forwarded to stack when object is locked
 383   bool     has_displaced_mark() const;
 384   markOop  displaced_mark() const;
 385   void     set_displaced_mark(markOop m);
 386 
 387   // for code generation
 388   static int mark_offset_in_bytes()    { return offset_of(oopDesc, _mark); }
 389   static int klass_offset_in_bytes()   { return offset_of(oopDesc, _metadata._klass); }
 390   static int klass_gap_offset_in_bytes();
 391 };
 392 
 393 
 394 #ifdef ASSERT
 395 template <class T> void assert_is_in(T *p);
 396 template <class T> void assert_is_in_closed_subset(T *p);
 397 template <class T> void assert_is_in_reserved(T *p);
 398 #else
 399 template <class T> void assert_is_in(T *p) {}
 400 template <class T> void assert_is_in_closed_subset(T *p) {}
 401 template <class T> void assert_is_in_reserved(T *p) {}
 402 #endif // ASSERT
 403 template <class T> void assert_nothing(T *p) {}
 404 
 405 #endif // SHARE_VM_OOPS_OOP_HPP