Mercurial > hg > graal-jvmci-8
diff src/share/vm/classfile/classLoaderData.hpp @ 18009:f73af4455d7d
Merge
author | asaha |
---|---|
date | Thu, 29 May 2014 09:56:06 -0700 |
parents | 7384f6a12fc1 |
children | e4a6e7f1b90b |
line wrap: on
line diff
--- a/src/share/vm/classfile/classLoaderData.hpp Wed May 28 12:07:21 2014 -0700 +++ b/src/share/vm/classfile/classLoaderData.hpp Thu May 29 09:56:06 2014 -0700 @@ -66,6 +66,7 @@ static ClassLoaderData* _unloading; // CMS support. static ClassLoaderData* _saved_head; + static bool _should_purge; static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS); static void post_class_unload_events(void); @@ -86,12 +87,20 @@ static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); } static GrowableArray<ClassLoaderData*>* new_clds(); + static void set_should_purge(bool b) { _should_purge = b; } + static void purge_if_needed() { + // Only purge the CLDG for CMS if concurrent sweep is complete. + if (_should_purge) { + purge(); + // reset for next time. + set_should_purge(false); + } + } + static void dump_on(outputStream * const out) PRODUCT_RETURN; static void dump() { dump_on(tty); } static void verify(); - // expensive test for pointer in metaspace for debugging - static bool contains(const void* x); #ifndef PRODUCT static bool contains_loader_data(ClassLoaderData* loader_data); #endif