Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/oop.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | b632e80fc9dc |
children | f34d701e952e |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
21 * questions. | 21 * questions. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "classfile/altHashing.hpp" | |
26 #include "classfile/javaClasses.hpp" | 27 #include "classfile/javaClasses.hpp" |
27 #include "oops/oop.inline.hpp" | 28 #include "oops/oop.inline.hpp" |
28 #include "runtime/handles.inline.hpp" | 29 #include "runtime/handles.inline.hpp" |
29 #include "utilities/copy.hpp" | 30 #include "utilities/copy.hpp" |
30 #ifdef TARGET_OS_FAMILY_linux | 31 #ifdef TARGET_OS_FAMILY_linux |
46 | 47 |
47 void oopDesc::print_on(outputStream* st) const { | 48 void oopDesc::print_on(outputStream* st) const { |
48 if (this == NULL) { | 49 if (this == NULL) { |
49 st->print_cr("NULL"); | 50 st->print_cr("NULL"); |
50 } else { | 51 } else { |
51 blueprint()->oop_print_on(oop(this), st); | 52 klass()->oop_print_on(oop(this), st); |
52 } | 53 } |
53 } | 54 } |
54 | 55 |
55 void oopDesc::print_address_on(outputStream* st) const { | 56 void oopDesc::print_address_on(outputStream* st) const { |
56 if (PrintOopAddress) { | 57 if (PrintOopAddress) { |
84 if (this == NULL) { | 85 if (this == NULL) { |
85 st->print("NULL"); | 86 st->print("NULL"); |
86 } else if (java_lang_String::is_instance(obj)) { | 87 } else if (java_lang_String::is_instance(obj)) { |
87 java_lang_String::print(obj, st); | 88 java_lang_String::print(obj, st); |
88 if (PrintOopAddress) print_address_on(st); | 89 if (PrintOopAddress) print_address_on(st); |
89 #ifdef ASSERT | |
90 } else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) { | |
91 st->print("### BAD OOP %p ###", (address)obj); | |
92 #endif //ASSERT | |
93 } else { | 90 } else { |
94 blueprint()->oop_print_value_on(obj, st); | 91 klass()->oop_print_value_on(obj, st); |
95 } | 92 } |
96 } | 93 } |
97 | 94 |
98 | 95 |
99 void oopDesc::verify_on(outputStream* st) { | 96 void oopDesc::verify_on(outputStream* st) { |
100 if (this != NULL) { | 97 if (this != NULL) { |
101 blueprint()->oop_verify_on(this, st); | 98 klass()->oop_verify_on(this, st); |
102 } | 99 } |
103 } | 100 } |
104 | 101 |
105 | 102 |
106 void oopDesc::verify() { | 103 void oopDesc::verify() { |
107 verify_on(tty); | 104 verify_on(tty); |
108 } | 105 } |
109 | 106 |
110 bool oopDesc::partially_loaded() { | |
111 return blueprint()->oop_partially_loaded(this); | |
112 } | |
113 | |
114 | |
115 void oopDesc::set_partially_loaded() { | |
116 blueprint()->oop_set_partially_loaded(this); | |
117 } | |
118 | |
119 | |
120 intptr_t oopDesc::slow_identity_hash() { | 107 intptr_t oopDesc::slow_identity_hash() { |
121 // slow case; we have to acquire the micro lock in order to locate the header | 108 // slow case; we have to acquire the micro lock in order to locate the header |
122 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY | 109 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY |
123 HandleMark hm; | 110 HandleMark hm; |
124 Handle object((oop)this); | 111 Handle object(this); |
125 assert(!is_shared_readonly(), "using identity hash on readonly object?"); | |
126 return ObjectSynchronizer::identity_hash_value_for(object); | 112 return ObjectSynchronizer::identity_hash_value_for(object); |
113 } | |
114 | |
115 // When String table needs to rehash | |
116 unsigned int oopDesc::new_hash(jint seed) { | |
117 ResourceMark rm; | |
118 int length; | |
119 jchar* chars = java_lang_String::as_unicode_string(this, length); | |
120 // Use alternate hashing algorithm on the string | |
121 return AltHashing::murmur3_32(seed, chars, length); | |
127 } | 122 } |
128 | 123 |
129 VerifyOopClosure VerifyOopClosure::verify_oop; | 124 VerifyOopClosure VerifyOopClosure::verify_oop; |
130 | 125 |
131 void VerifyOopClosure::do_oop(oop* p) { VerifyOopClosure::do_oop_work(p); } | 126 void VerifyOopClosure::do_oop(oop* p) { VerifyOopClosure::do_oop_work(p); } |