sharedHeap.cpp revision 3008
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "code/codeCache.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/sharedHeap.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "services/management.hpp"
#include "utilities/workgroup.hpp"
// The set of potentially parallel tasks in strong root scanning.
// Leave this one last.
};
{
vm_exit_during_initialization("Failed necessary allocation.");
}
_sh = this; // ch is static, should be set only once.
if ((UseParNewGC ||
UseG1GC) &&
ParallelGCThreads > 0) {
/* are_GC_task_threads */true,
/* are_ConcurrentGC_threads */false);
vm_exit_during_initialization("Failed necessary allocation.");
} else {
}
}
}
int SharedHeap::n_termination() {
return _process_strong_tasks->n_threads();
}
void SharedHeap::set_n_termination(int t) {
}
bool SharedHeap::heap_lock_held_for_gc() {
return Heap_lock->owned_by_self()
|| ( (t->is_GC_task_thread() || t->is_VM_thread())
}
_n_par_threads = t;
}
class AssertIsPermClosure: public OopClosure {
public:
}
};
#ifdef ASSERT
class AssertNonScavengableClosure: public OopClosure {
public:
"Referent should not be scavengable."); }
};
#endif
void SharedHeap::change_strong_roots_parity() {
// Also set the new collection parity.
"Not in range.");
"Not in range.");
}
{
if (_active) {
}
}
// nothing particular
}
bool collecting_perm_gen,
// General strong roots.
// _n_termination for _process_strong_tasks should be set up stream
// in a method not running in a GC worker. Otherwise the GC worker
// could be trying to change the termination condition while the task
// is executing in another GC worker.
// Consider perm-gen discovered lists to be strong.
}
// Global (strong) JNI handles
// All threads execute this; the individual threads are task groups.
if (ParallelGCThreads > 0) {
} else {
}
if (so & SO_AllClasses) {
} else if (so & SO_SystemClasses) {
}
}
}
if (JavaObjectsInPerm) {
// Verify the string table contents are in the perm gen
}
}
if (so & SO_CodeCache) {
// (Currently, CMSCollector uses this to do intermediate-strength collections.)
if (code_roots != NULL) {
}
if (!collecting_perm_gen) {
// If we are collecting from class statics, but we are not going to
// visit all of the CodeCache, collect from the non-perm roots if any.
// This makes the code cache function temporarily as a source of strong
// roots for oops, until the next major collection.
//
// If collecting_perm_gen is true, we require that this phase will call
// CodeCache::do_unloading. This will kill off nmethods with expired
// weak references, such as stale invokedynamic targets.
}
}
// Verify that the code cache contents are not subject to
// movement by a scavenging collection.
DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, /*do_marking=*/ false));
}
if (!collecting_perm_gen) {
// All threads perform this; coordination is handled internally.
}
}
class AlwaysTrueClosure: public BoolObjectClosure {
public:
bool do_object_b(oop p) { return true; }
};
static AlwaysTrueClosure always_true;
class SkipAdjustingSharedStrings: public OopClosure {
public:
oop o = (*p);
if (!o->is_shared_readwrite()) {
}
}
};
// Unmarked shared Strings in the StringTable (which got there due to
// being in the constant pools of as-yet unloaded shared classes) were
// not marked and therefore did not have their mark words preserved.
// These entries are also deliberately not purged from the string
// table during unloading of unmarked strings. If an identity hash
// code was computed for any of these objects, it will not have been
// cleared to zero during the forwarding process or by the
// RecursiveAdjustSharedObjectClosure, and will be confused by the
// adjusting process as a forwarding pointer. We need to skip
// forwarding StringTable entries which contain unmarked shared
// Strings. Actually, since shared strings won't be moving, we can
// just skip adjusting any shared entries in the string table.
// Global (weak) JNI handles
if (UseSharedSpaces && !DumpSharedSpaces) {
} else {
}
}
_barrier_set = bs;
// Cached barrier set for fast access in oops
}
void SharedHeap::post_initialize() {
}
void SharedHeap::ref_processing_init() {
perm_gen()->ref_processor_init();
}
// Some utilities.
}