1 /*
2 * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
131
132 static void update_header_for_buffered_addr(address buffered_addr, oop src_obj, Klass* src_klass);
133
134 static void populate_archive_heap_info(ArchiveStreamedHeapInfo* info);
135
136 public:
137 static void init() NOT_CDS_JAVA_HEAP_RETURN;
138
139 static void delete_tables_with_raw_oops();
140 static void add_source_obj(oop src_obj);
141 static void write(GrowableArrayCHeap<oop, mtClassShared>*, ArchiveStreamedHeapInfo* heap_info);
142 static address buffered_heap_roots_addr() {
143 return offset_to_buffered_address<address>(_roots_offset);
144 }
145
146 static size_t buffered_addr_to_buffered_offset(address buffered_addr) {
147 assert(buffered_addr != nullptr, "should not be null");
148 return size_t(buffered_addr) - size_t(buffer_bottom());
149 }
150
151 static bool is_dumped_interned_string(oop obj);
152
153 static size_t source_obj_to_buffered_offset(oop src_obj);
154 static address source_obj_to_buffered_addr(oop src_obj);
155
156 static oop buffered_offset_to_source_obj(size_t buffered_offset);
157 static oop buffered_addr_to_source_obj(address buffered_addr);
158
159 static AOTMapLogger::OopDataIterator* oop_iterator(ArchiveStreamedHeapInfo* heap_info);
160 };
161 #endif // INCLUDE_CDS_JAVA_HEAP
162 #endif // SHARE_CDS_AOTSTREAMEDHEAPWRITER_HPP
|
1 /*
2 * Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
131
132 static void update_header_for_buffered_addr(address buffered_addr, oop src_obj, Klass* src_klass);
133
134 static void populate_archive_heap_info(ArchiveStreamedHeapInfo* info);
135
136 public:
137 static void init() NOT_CDS_JAVA_HEAP_RETURN;
138
139 static void delete_tables_with_raw_oops();
140 static void add_source_obj(oop src_obj);
141 static void write(GrowableArrayCHeap<oop, mtClassShared>*, ArchiveStreamedHeapInfo* heap_info);
142 static address buffered_heap_roots_addr() {
143 return offset_to_buffered_address<address>(_roots_offset);
144 }
145
146 static size_t buffered_addr_to_buffered_offset(address buffered_addr) {
147 assert(buffered_addr != nullptr, "should not be null");
148 return size_t(buffered_addr) - size_t(buffer_bottom());
149 }
150
151 static size_t source_obj_to_buffered_offset(oop src_obj);
152 static address source_obj_to_buffered_addr(oop src_obj);
153
154 static oop buffered_offset_to_source_obj(size_t buffered_offset);
155 static oop buffered_addr_to_source_obj(address buffered_addr);
156
157 static AOTMapLogger::OopDataIterator* oop_iterator(ArchiveStreamedHeapInfo* heap_info);
158 };
159 #endif // INCLUDE_CDS_JAVA_HEAP
160 #endif // SHARE_CDS_AOTSTREAMEDHEAPWRITER_HPP
|