216 static bool is_too_large_to_archive(size_t size);
217 static bool is_too_large_to_archive(oop obj);
218 static bool is_string_too_large_to_archive(oop string);
219 static void write(GrowableArrayCHeap<oop, mtClassShared>*, ArchiveHeapInfo* heap_info);
220 static address requested_address(); // requested address of the lowest achived heap object
221 static oop heap_roots_requested_address(); // requested address of HeapShared::roots()
222 static address buffered_heap_roots_addr() {
223 return offset_to_buffered_address<address>(_heap_roots_offset);
224 }
225 static size_t heap_roots_word_size() {
226 return _heap_roots_word_size;
227 }
228 static size_t get_filler_size_at(address buffered_addr);
229
230 static void mark_native_pointer(oop src_obj, int offset);
231 static bool is_marked_as_native_pointer(ArchiveHeapInfo* heap_info, oop src_obj, int field_offset);
232 static oop source_obj_to_requested_obj(oop src_obj);
233 static oop buffered_addr_to_source_obj(address buffered_addr);
234 static address buffered_addr_to_requested_addr(address buffered_addr);
235
236 // Archived heap object headers carry pre-computed narrow Klass ids calculated with the
237 // following scheme:
238 // 1) the encoding base must be the mapping start address.
239 // 2) shift must be large enough to result in an encoding range that covers the runtime Klass range.
240 // That Klass range is defined by CDS archive size and runtime class space size. Luckily, the maximum
241 // size can be predicted: archive size is assumed to be <1G, class space size capped at 3G, and at
242 // runtime we put both regions adjacent to each other. Therefore, runtime Klass range size < 4G.
243 // Since nKlass itself is 32 bit, our encoding range len is 4G, and since we set the base directly
244 // at mapping start, these 4G are enough. Therefore, we don't need to shift at all (shift=0).
245 static constexpr int precomputed_narrow_klass_shift = 0;
246
247 };
248 #endif // INCLUDE_CDS_JAVA_HEAP
249 #endif // SHARE_CDS_ARCHIVEHEAPWRITER_HPP
|
216 static bool is_too_large_to_archive(size_t size);
217 static bool is_too_large_to_archive(oop obj);
218 static bool is_string_too_large_to_archive(oop string);
219 static void write(GrowableArrayCHeap<oop, mtClassShared>*, ArchiveHeapInfo* heap_info);
220 static address requested_address(); // requested address of the lowest achived heap object
221 static oop heap_roots_requested_address(); // requested address of HeapShared::roots()
222 static address buffered_heap_roots_addr() {
223 return offset_to_buffered_address<address>(_heap_roots_offset);
224 }
225 static size_t heap_roots_word_size() {
226 return _heap_roots_word_size;
227 }
228 static size_t get_filler_size_at(address buffered_addr);
229
230 static void mark_native_pointer(oop src_obj, int offset);
231 static bool is_marked_as_native_pointer(ArchiveHeapInfo* heap_info, oop src_obj, int field_offset);
232 static oop source_obj_to_requested_obj(oop src_obj);
233 static oop buffered_addr_to_source_obj(address buffered_addr);
234 static address buffered_addr_to_requested_addr(address buffered_addr);
235
236 };
237 #endif // INCLUDE_CDS_JAVA_HEAP
238 #endif // SHARE_CDS_ARCHIVEHEAPWRITER_HPP
|