296 297 template <typename OopClosureType> 298 inline int oop_iterate_size(OopClosureType* cl, MemRegion mr); 299 300 template <typename OopClosureType> 301 inline void oop_iterate_backwards(OopClosureType* cl); 302 303 inline static bool is_instanceof_or_null(oop obj, Klass* klass); 304 305 // identity hash; returns the identity hash key (computes it if necessary) 306 // NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a 307 // safepoint if called on a biased object. Calling code must be aware of that. 308 inline intptr_t identity_hash(); 309 intptr_t slow_identity_hash(); 310 311 // marks are forwarded to stack when object is locked 312 inline bool has_displaced_mark_raw() const; 313 inline markWord displaced_mark_raw() const; 314 inline void set_displaced_mark_raw(markWord m); 315 316 static bool has_klass_gap(); 317 318 // for code generation 319 static int mark_offset_in_bytes() { return offset_of(oopDesc, _mark); } 320 static int klass_offset_in_bytes() { return offset_of(oopDesc, _metadata._klass); } 321 static int klass_gap_offset_in_bytes() { 322 assert(has_klass_gap(), "only applicable to compressed klass pointers"); 323 return klass_offset_in_bytes() + sizeof(narrowKlass); 324 } 325 326 // for error reporting 327 static void* load_klass_raw(oop obj); 328 static void* load_oop_raw(oop obj, int offset); 329 static bool is_valid(oop obj); 330 static oop oop_or_null(address addr); 331 }; 332 333 #endif // SHARE_OOPS_OOP_HPP | 296 297 template <typename OopClosureType> 298 inline int oop_iterate_size(OopClosureType* cl, MemRegion mr); 299 300 template <typename OopClosureType> 301 inline void oop_iterate_backwards(OopClosureType* cl); 302 303 inline static bool is_instanceof_or_null(oop obj, Klass* klass); 304 305 // identity hash; returns the identity hash key (computes it if necessary) 306 // NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a 307 // safepoint if called on a biased object. Calling code must be aware of that. 308 inline intptr_t identity_hash(); 309 intptr_t slow_identity_hash(); 310 311 // marks are forwarded to stack when object is locked 312 inline bool has_displaced_mark_raw() const; 313 inline markWord displaced_mark_raw() const; 314 inline void set_displaced_mark_raw(markWord m); 315 316 // Checks if the mark word needs to be preserved 317 inline bool mark_must_be_preserved(markWord m) const; 318 inline bool mark_must_be_preserved_for_promotion_failure(markWord m) const; 319 320 static bool has_klass_gap(); 321 322 // for code generation 323 static int mark_offset_in_bytes() { return offset_of(oopDesc, _mark); } 324 static int klass_offset_in_bytes() { return offset_of(oopDesc, _metadata._klass); } 325 static int klass_gap_offset_in_bytes() { 326 assert(has_klass_gap(), "only applicable to compressed klass pointers"); 327 return klass_offset_in_bytes() + sizeof(narrowKlass); 328 } 329 330 // for error reporting 331 static void* load_klass_raw(oop obj); 332 static void* load_oop_raw(oop obj, int offset); 333 static bool is_valid(oop obj); 334 static oop oop_or_null(address addr); 335 }; 336 337 #endif // SHARE_OOPS_OOP_HPP |