< prev index next >

src/share/vm/oops/oop.cpp

Print this page




 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 VerifyOopClosure VerifyOopClosure::verify_oop;
 123 
 124 template <class T> void VerifyOopClosure::do_oop_work(T* p) {
 125   oop obj = oopDesc::load_decode_heap_oop(p);
 126   guarantee(obj->is_oop_or_null(), err_msg("invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj)));
 127 }
 128 
 129 void VerifyOopClosure::do_oop(oop* p)       { VerifyOopClosure::do_oop_work(p); }
 130 void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); }
 131 
 132 // type test operations that doesn't require inclusion of oop.inline.hpp.
 133 bool oopDesc::is_instance_noinline()          const { return is_instance();            }
 134 bool oopDesc::is_instanceMirror_noinline()    const { return is_instanceMirror();      }
 135 bool oopDesc::is_instanceClassLoader_noline() const { return is_instanceClassLoader(); }
 136 bool oopDesc::is_instanceRef_noline()         const { return is_instanceRef();         }
 137 bool oopDesc::is_array_noinline()             const { return is_array();               }
 138 bool oopDesc::is_objArray_noinline()          const { return is_objArray();            }
 139 bool oopDesc::is_typeArray_noinline()         const { return is_typeArray();           }
 140 
 141 bool oopDesc::has_klass_gap() {
 142   // Only has a klass gap when compressed class pointers are used.
 143   return UseCompressedClassPointers;
 144 }


 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 VerifyOopClosure VerifyOopClosure::verify_oop;
 123 
 124 template <class T> void VerifyOopClosure::do_oop_work(T* p) {
 125   oop obj = oopDesc::load_decode_heap_oop(p);
 126   guarantee(obj->is_oop_or_null(), "invalid oop: " INTPTR_FORMAT, p2i((oopDesc*) obj));
 127 }
 128 
 129 void VerifyOopClosure::do_oop(oop* p)       { VerifyOopClosure::do_oop_work(p); }
 130 void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); }
 131 
 132 // type test operations that doesn't require inclusion of oop.inline.hpp.
 133 bool oopDesc::is_instance_noinline()          const { return is_instance();            }
 134 bool oopDesc::is_instanceMirror_noinline()    const { return is_instanceMirror();      }
 135 bool oopDesc::is_instanceClassLoader_noline() const { return is_instanceClassLoader(); }
 136 bool oopDesc::is_instanceRef_noline()         const { return is_instanceRef();         }
 137 bool oopDesc::is_array_noinline()             const { return is_array();               }
 138 bool oopDesc::is_objArray_noinline()          const { return is_objArray();            }
 139 bool oopDesc::is_typeArray_noinline()         const { return is_typeArray();           }
 140 
 141 bool oopDesc::has_klass_gap() {
 142   // Only has a klass gap when compressed class pointers are used.
 143   return UseCompressedClassPointers;
 144 }
< prev index next >