comparison src/share/vm/runtime/handles.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents d2a62e0f25eb
children bdb5f8c9978b
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp" 26 #include "memory/allocation.inline.hpp"
27 #include "oops/constantPool.hpp"
27 #include "oops/oop.inline.hpp" 28 #include "oops/oop.inline.hpp"
28 #include "runtime/handles.inline.hpp" 29 #include "runtime/handles.inline.hpp"
29 #ifdef TARGET_OS_FAMILY_linux 30 #ifdef TARGET_OS_FAMILY_linux
30 # include "os_linux.inline.hpp" 31 # include "os_linux.inline.hpp"
31 # include "thread_linux.inline.hpp" 32 # include "thread_linux.inline.hpp"
68 uintx handles_visited = top - bottom; 69 uintx handles_visited = top - bottom;
69 assert(top >= bottom && top <= (oop*) chunk->top(), "just checking"); 70 assert(top >= bottom && top <= (oop*) chunk->top(), "just checking");
70 // during GC phase 3, a handle may be a forward pointer that 71 // during GC phase 3, a handle may be a forward pointer that
71 // is not yet valid, so loosen the assertion 72 // is not yet valid, so loosen the assertion
72 while (bottom < top) { 73 while (bottom < top) {
73 // assert((*bottom)->is_oop(), "handle should point to oop"); 74 // This test can be moved up but for now check every oop.
74 assert(Universe::heap()->is_in(*bottom), "handle should be valid heap address"); 75
76 assert((*bottom)->is_oop(), "handle should point to oop");
77
75 f->do_oop(bottom++); 78 f->do_oop(bottom++);
76 } 79 }
77 return handles_visited; 80 return handles_visited;
78 } 81 }
79 82
146 handles /= sizeof(void *); // Adjust for size of a handle 149 handles /= sizeof(void *); // Adjust for size of a handle
147 if (handles > HandleAllocationLimit) { 150 if (handles > HandleAllocationLimit) {
148 // Note: _nof_handlemarks is only set in debug mode 151 // Note: _nof_handlemarks is only set in debug mode
149 warning("%d: Allocated in HandleMark : %d", _nof_handlemarks, handles); 152 warning("%d: Allocated in HandleMark : %d", _nof_handlemarks, handles);
150 } 153 }
154
155 tty->print_cr("Handles %d", handles);
151 } 156 }
152 #endif 157 #endif
153 158
154 // Delete later chunks 159 // Delete later chunks
155 if( _chunk->next() ) { 160 if( _chunk->next() ) {