Mercurial > hg > truffle
comparison src/share/vm/memory/universe.hpp @ 12056:740e263c80c6
8003424: Enable Class Data Sharing for CompressedOops
8016729: ObjectAlignmentInBytes=16 now forces the use of heap based compressed oops
8005933: The -Xshare:auto option is ignored for -server
Summary: Move klass metaspace above the heap and support CDS with compressed klass ptrs.
Reviewed-by: coleenp, kvn, mgerdin, tschatzl, stefank
author | hseigel |
---|---|
date | Thu, 15 Aug 2013 20:04:10 -0400 |
parents | 85147f28faba |
children | 4c84d351cca9 |
comparison
equal
deleted
inserted
replaced
12055:d96f52012aaa | 12056:740e263c80c6 |
---|---|
73 f->do_ptr((void**)&_klass); | 73 f->do_ptr((void**)&_klass); |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
77 | 77 |
78 // For UseCompressedOops and UseCompressedKlassPointers. | 78 // For UseCompressedOops. |
79 struct NarrowPtrStruct { | 79 struct NarrowPtrStruct { |
80 // Base address for oop/klass-within-java-object materialization. | 80 // Base address for oop-within-java-object materialization. |
81 // NULL if using wide oops/klasses or zero based narrow oops/klasses. | 81 // NULL if using wide oops or zero based narrow oops. |
82 address _base; | 82 address _base; |
83 // Number of shift bits for encoding/decoding narrow ptrs. | 83 // Number of shift bits for encoding/decoding narrow ptrs. |
84 // 0 if using wide ptrs or zero based unscaled narrow ptrs, | 84 // 0 if using wide ptrs or zero based unscaled narrow ptrs, |
85 // LogMinObjAlignmentInBytes/LogKlassAlignmentInBytes otherwise. | 85 // LogMinObjAlignmentInBytes/LogKlassAlignmentInBytes otherwise. |
86 int _shift; | 86 int _shift; |
104 friend class ClassLoader; | 104 friend class ClassLoader; |
105 friend class Arguments; | 105 friend class Arguments; |
106 friend class SystemDictionary; | 106 friend class SystemDictionary; |
107 friend class VMStructs; | 107 friend class VMStructs; |
108 friend class VM_PopulateDumpSharedSpace; | 108 friend class VM_PopulateDumpSharedSpace; |
109 friend class Metaspace; | |
109 | 110 |
110 friend jint universe_init(); | 111 friend jint universe_init(); |
111 friend void universe2_init(); | 112 friend void universe2_init(); |
112 friend bool universe_post_init(); | 113 friend bool universe_post_init(); |
113 | 114 |
182 static struct NarrowPtrStruct _narrow_oop; | 183 static struct NarrowPtrStruct _narrow_oop; |
183 // For UseCompressedKlassPointers. | 184 // For UseCompressedKlassPointers. |
184 static struct NarrowPtrStruct _narrow_klass; | 185 static struct NarrowPtrStruct _narrow_klass; |
185 static address _narrow_ptrs_base; | 186 static address _narrow_ptrs_base; |
186 | 187 |
187 // Aligned size of the metaspace. | |
188 static size_t _class_metaspace_size; | |
189 | |
190 // array of dummy objects used with +FullGCAlot | 188 // array of dummy objects used with +FullGCAlot |
191 debug_only(static objArrayOop _fullgc_alot_dummy_array;) | 189 debug_only(static objArrayOop _fullgc_alot_dummy_array;) |
192 // index of next entry to clear | 190 // index of next entry to clear |
193 debug_only(static int _fullgc_alot_dummy_next;) | 191 debug_only(static int _fullgc_alot_dummy_next;) |
194 | 192 |
235 _narrow_klass._base = base; | 233 _narrow_klass._base = base; |
236 } | 234 } |
237 static void set_narrow_oop_use_implicit_null_checks(bool use) { | 235 static void set_narrow_oop_use_implicit_null_checks(bool use) { |
238 assert(UseCompressedOops, "no compressed ptrs?"); | 236 assert(UseCompressedOops, "no compressed ptrs?"); |
239 _narrow_oop._use_implicit_null_checks = use; | 237 _narrow_oop._use_implicit_null_checks = use; |
240 } | |
241 static bool reserve_metaspace_helper(bool with_base = false); | |
242 static ReservedHeapSpace reserve_heap_metaspace(size_t heap_size, size_t alignment, bool& contiguous); | |
243 | |
244 static size_t class_metaspace_size() { | |
245 return _class_metaspace_size; | |
246 } | |
247 static void set_class_metaspace_size(size_t metaspace_size) { | |
248 _class_metaspace_size = metaspace_size; | |
249 } | 238 } |
250 | 239 |
251 // Debugging | 240 // Debugging |
252 static int _verify_count; // number of verifies done | 241 static int _verify_count; // number of verifies done |
253 // True during call to verify(). Should only be set/cleared in verify(). | 242 // True during call to verify(). Should only be set/cleared in verify(). |