duke@435: /* trims@1907: * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. duke@435: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@435: * duke@435: * This code is free software; you can redistribute it and/or modify it duke@435: * under the terms of the GNU General Public License version 2 only, as duke@435: * published by the Free Software Foundation. duke@435: * duke@435: * This code is distributed in the hope that it will be useful, but WITHOUT duke@435: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@435: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@435: * version 2 for more details (a copy is included in the LICENSE file that duke@435: * accompanied this code). duke@435: * duke@435: * You should have received a copy of the GNU General Public License version duke@435: * 2 along with this work; if not, write to the Free Software Foundation, duke@435: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@435: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. duke@435: * duke@435: */ duke@435: duke@435: # include "incls/_precompiled.incl" duke@435: # include "incls/_serialize.cpp.incl" duke@435: duke@435: duke@435: // Serialize out the block offset shared array for the shared spaces. duke@435: duke@435: void CompactingPermGenGen::serialize_bts(SerializeOopClosure* soc) { duke@435: _ro_bts->serialize(soc, readonly_bottom, readonly_end); duke@435: _rw_bts->serialize(soc, readwrite_bottom, readwrite_end); duke@435: } duke@435: duke@435: duke@435: // Read/write a data stream for restoring/preserving oop pointers and duke@435: // miscellaneous data from/to the shared archive file. duke@435: duke@435: void CompactingPermGenGen::serialize_oops(SerializeOopClosure* soc) { duke@435: int tag = 0; duke@435: soc->do_tag(--tag); duke@435: coleenp@548: assert(!UseCompressedOops, "UseCompressedOops doesn't work with shared archive"); duke@435: // Verify the sizes of various oops in the system. duke@435: soc->do_tag(sizeof(oopDesc)); duke@435: soc->do_tag(sizeof(instanceOopDesc)); duke@435: soc->do_tag(sizeof(methodOopDesc)); duke@435: soc->do_tag(sizeof(constMethodOopDesc)); duke@435: soc->do_tag(sizeof(methodDataOopDesc)); coleenp@548: soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE)); duke@435: soc->do_tag(sizeof(constantPoolOopDesc)); duke@435: soc->do_tag(sizeof(constantPoolCacheOopDesc)); twisti@1330: soc->do_tag(objArrayOopDesc::base_offset_in_bytes()); coleenp@548: soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE)); duke@435: soc->do_tag(sizeof(symbolOopDesc)); duke@435: soc->do_tag(sizeof(klassOopDesc)); duke@435: soc->do_tag(sizeof(markOopDesc)); duke@435: soc->do_tag(sizeof(compiledICHolderOopDesc)); duke@435: duke@435: // Dump the block offset table entries. duke@435: GenCollectedHeap* gch = GenCollectedHeap::heap(); duke@435: CompactingPermGenGen* pg = (CompactingPermGenGen*)gch->perm_gen(); duke@435: pg->serialize_bts(soc); duke@435: soc->do_tag(--tag); duke@435: pg->ro_space()->serialize_block_offset_array_offsets(soc); duke@435: soc->do_tag(--tag); duke@435: pg->rw_space()->serialize_block_offset_array_offsets(soc); duke@435: soc->do_tag(--tag); duke@435: duke@435: // Special case - this oop needed in oop->is_oop() assertions. duke@435: soc->do_ptr((void**)&Universe::_klassKlassObj); duke@435: soc->do_tag(--tag); duke@435: duke@435: // Dump/restore miscellaneous oops. duke@435: Universe::oops_do(soc, true); duke@435: soc->do_tag(--tag); duke@435: duke@435: vmSymbols::oops_do(soc, true); soc->do_tag(--tag); duke@435: CodeCache::oops_do(soc); soc->do_tag(--tag); duke@435: soc->do_tag(666); duke@435: }