< prev index next >

src/hotspot/share/oops/oop.cpp

Print this page




  84 }
  85 
  86 
  87 void oopDesc::verify_on(outputStream* st) {
  88   if (this != NULL) {
  89     klass()->oop_verify_on(this, st);
  90   }
  91 }
  92 
  93 
  94 void oopDesc::verify() {
  95   verify_on(tty);
  96 }
  97 
  98 intptr_t oopDesc::slow_identity_hash() {
  99   // slow case; we have to acquire the micro lock in order to locate the header
 100   Thread* THREAD = Thread::current();
 101   ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
 102   HandleMark hm(THREAD);
 103   Handle object(THREAD, this);
 104   return ObjectSynchronizer::identity_hash_value_for(object);
 105 }
 106 
 107 // When String table needs to rehash
 108 unsigned int oopDesc::new_hash(juint seed) {
 109   EXCEPTION_MARK;
 110   ResourceMark rm;
 111   int length;
 112   jchar* chars = java_lang_String::as_unicode_string(this, length, THREAD);
 113   if (chars != NULL) {
 114     // Use alternate hashing algorithm on the string
 115     return AltHashing::murmur3_32(seed, chars, length);
 116   } else {
 117     vm_exit_out_of_memory(length, OOM_MALLOC_ERROR, "unable to create Unicode strings for String table rehash");
 118     return 0;
 119   }
 120 }
 121 
 122 // used only for asserts and guarantees
 123 bool oopDesc::is_oop(oop obj, bool ignore_mark_word) {
 124   if (!check_obj_alignment(obj)) return false;




  84 }
  85 
  86 
  87 void oopDesc::verify_on(outputStream* st) {
  88   if (this != NULL) {
  89     klass()->oop_verify_on(this, st);
  90   }
  91 }
  92 
  93 
  94 void oopDesc::verify() {
  95   verify_on(tty);
  96 }
  97 
  98 intptr_t oopDesc::slow_identity_hash() {
  99   // slow case; we have to acquire the micro lock in order to locate the header
 100   Thread* THREAD = Thread::current();
 101   ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
 102   HandleMark hm(THREAD);
 103   Handle object(THREAD, this);
 104   return ObjectSynchronizer::FastHashCode(THREAD, object());
 105 }
 106 
 107 // When String table needs to rehash
 108 unsigned int oopDesc::new_hash(juint seed) {
 109   EXCEPTION_MARK;
 110   ResourceMark rm;
 111   int length;
 112   jchar* chars = java_lang_String::as_unicode_string(this, length, THREAD);
 113   if (chars != NULL) {
 114     // Use alternate hashing algorithm on the string
 115     return AltHashing::murmur3_32(seed, chars, length);
 116   } else {
 117     vm_exit_out_of_memory(length, OOM_MALLOC_ERROR, "unable to create Unicode strings for String table rehash");
 118     return 0;
 119   }
 120 }
 121 
 122 // used only for asserts and guarantees
 123 bool oopDesc::is_oop(oop obj, bool ignore_mark_word) {
 124   if (!check_obj_alignment(obj)) return false;


< prev index next >