Mercurial > hg > truffle
comparison src/share/vm/memory/serialize.cpp @ 0:a61af66fc99e jdk7-b24
Initial load
author | duke |
---|---|
date | Sat, 01 Dec 2007 00:00:00 +0000 |
parents | |
children | ba764ed4b6f2 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a61af66fc99e |
---|---|
1 /* | |
2 * Copyright 2003-2007 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | |
21 * have any questions. | |
22 * | |
23 */ | |
24 | |
25 # include "incls/_precompiled.incl" | |
26 # include "incls/_serialize.cpp.incl" | |
27 | |
28 | |
29 // Serialize out the block offset shared array for the shared spaces. | |
30 | |
31 void CompactingPermGenGen::serialize_bts(SerializeOopClosure* soc) { | |
32 _ro_bts->serialize(soc, readonly_bottom, readonly_end); | |
33 _rw_bts->serialize(soc, readwrite_bottom, readwrite_end); | |
34 } | |
35 | |
36 | |
37 // Read/write a data stream for restoring/preserving oop pointers and | |
38 // miscellaneous data from/to the shared archive file. | |
39 | |
40 void CompactingPermGenGen::serialize_oops(SerializeOopClosure* soc) { | |
41 int tag = 0; | |
42 soc->do_tag(--tag); | |
43 | |
44 // Verify the sizes of various oops in the system. | |
45 soc->do_tag(sizeof(oopDesc)); | |
46 soc->do_tag(sizeof(instanceOopDesc)); | |
47 soc->do_tag(sizeof(methodOopDesc)); | |
48 soc->do_tag(sizeof(constMethodOopDesc)); | |
49 soc->do_tag(sizeof(methodDataOopDesc)); | |
50 soc->do_tag(sizeof(arrayOopDesc)); | |
51 soc->do_tag(sizeof(constantPoolOopDesc)); | |
52 soc->do_tag(sizeof(constantPoolCacheOopDesc)); | |
53 soc->do_tag(sizeof(objArrayOopDesc)); | |
54 soc->do_tag(sizeof(typeArrayOopDesc)); | |
55 soc->do_tag(sizeof(symbolOopDesc)); | |
56 soc->do_tag(sizeof(klassOopDesc)); | |
57 soc->do_tag(sizeof(markOopDesc)); | |
58 soc->do_tag(sizeof(compiledICHolderOopDesc)); | |
59 | |
60 // Dump the block offset table entries. | |
61 GenCollectedHeap* gch = GenCollectedHeap::heap(); | |
62 CompactingPermGenGen* pg = (CompactingPermGenGen*)gch->perm_gen(); | |
63 pg->serialize_bts(soc); | |
64 soc->do_tag(--tag); | |
65 pg->ro_space()->serialize_block_offset_array_offsets(soc); | |
66 soc->do_tag(--tag); | |
67 pg->rw_space()->serialize_block_offset_array_offsets(soc); | |
68 soc->do_tag(--tag); | |
69 | |
70 // Special case - this oop needed in oop->is_oop() assertions. | |
71 soc->do_ptr((void**)&Universe::_klassKlassObj); | |
72 soc->do_tag(--tag); | |
73 | |
74 // Dump/restore miscellaneous oops. | |
75 Universe::oops_do(soc, true); | |
76 soc->do_tag(--tag); | |
77 | |
78 vmSymbols::oops_do(soc, true); soc->do_tag(--tag); | |
79 CodeCache::oops_do(soc); soc->do_tag(--tag); | |
80 soc->do_tag(666); | |
81 } |