# HG changeset patch # User ehelin # Date 1392628408 -3600 # Node ID 7ab49a697539d0433ad6aa60eb948d90184da1eb # Parent e8ef156f0bc917df72878298efb5ee282ecb7d5a# Parent aa8fab3bed11d9ed0b07fd72cb7e832eefdcafef Merge diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -1704,8 +1704,8 @@ _dictionary->return_chunk(chunk); #ifndef PRODUCT if (CMSCollector::abstract_state() != CMSCollector::Sweeping) { - TreeChunk* tc = TreeChunk::as_TreeChunk(chunk); - TreeList* tl = tc->list(); + TreeChunk >* tc = TreeChunk >::as_TreeChunk(chunk); + TreeList >* tl = tc->list(); tl->verify_stats(); } #endif // PRODUCT @@ -2515,10 +2515,10 @@ #ifndef PRODUCT void CompactibleFreeListSpace::check_free_list_consistency() const { - assert((TreeChunk::min_size() <= IndexSetSize), + assert((TreeChunk >::min_size() <= IndexSetSize), "Some sizes can't be allocated without recourse to" " linear allocation buffers"); - assert((TreeChunk::min_size()*HeapWordSize == sizeof(TreeChunk)), + assert((TreeChunk >::min_size()*HeapWordSize == sizeof(TreeChunk >)), "else MIN_TREE_CHUNK_SIZE is wrong"); assert(IndexSetStart != 0, "IndexSetStart not initialized"); assert(IndexSetStride != 0, "IndexSetStride not initialized"); diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -3035,7 +3035,6 @@ true, // activate StrongRootsScope SharedHeap::ScanningOption(roots_scanning_options()), ¬Older, - true, // walk code active on stacks NULL, NULL); // SSS: Provide correct closure @@ -3102,7 +3101,6 @@ true, // activate StrongRootsScope SharedHeap::ScanningOption(roots_scanning_options()), ¬Older, - true, // walk code active on stacks NULL, &klass_closure); @@ -3680,12 +3678,6 @@ ResourceMark rm; HandleMark hm; - FalseClosure falseClosure; - // In the case of a synchronous collection, we will elide the - // remark step, so it's important to catch all the nmethod oops - // in this step. - // The final 'true' flag to gen_process_strong_roots will ensure this. - // If 'async' is true, we can relax the nmethod tracing. MarkRefsIntoClosure notOlder(_span, &_markBitMap); GenCollectedHeap* gch = GenCollectedHeap::heap(); @@ -3738,7 +3730,6 @@ true, // activate StrongRootsScope SharedHeap::ScanningOption(roots_scanning_options()), ¬Older, - true, // walk all of code cache if (so & SO_AllCodeCache) NULL, &klass_closure); } @@ -5237,7 +5228,6 @@ false, // this is parallel code SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()), &par_mri_cl, - true, // walk all of code cache if (so & SO_AllCodeCache) NULL, &klass_closure); assert(_collector->should_unload_classes() @@ -5373,7 +5363,6 @@ false, // this is parallel code SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()), &par_mrias_cl, - true, // walk all of code cache if (so & SO_AllCodeCache) NULL, NULL); // The dirty klasses will be handled below assert(_collector->should_unload_classes() @@ -5963,7 +5952,6 @@ false, // use the local StrongRootsScope SharedHeap::ScanningOption(roots_scanning_options()), &mrias_cl, - true, // walk code active on stacks NULL, NULL); // The dirty klasses will be handled below diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Mon Feb 17 10:13:28 2014 +0100 @@ -1383,13 +1383,6 @@ // Closures of various sorts used by CMS to accomplish its work // -// This closure is used to check that a certain set of oops is empty. -class FalseClosure: public OopClosure { - public: - void do_oop(oop* p) { guarantee(false, "Should be an empty set"); } - void do_oop(narrowOop* p) { guarantee(false, "Should be an empty set"); } -}; - // This closure is used to do concurrent marking from the roots // following the first checkpoint. class MarkFromRootsClosure: public BitMapClosure { diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -3394,13 +3394,12 @@ if (!silent) { gclog_or_tty->print("Roots "); } VerifyRootsClosure rootsCl(vo); - G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); - G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); VerifyKlassClosure klassCl(this, &rootsCl); // We apply the relevant closures to all the oops in the - // system dictionary, the string table and the code cache. - const int so = SO_AllClasses | SO_Strings | SO_AllCodeCache; + // system dictionary, class loader data graph and the string table. + // Don't verify the code cache here, since it's verified below. + const int so = SO_AllClasses | SO_Strings; // Need cleared claim bits for the strong roots processing ClassLoaderDataGraph::clear_claimed_marks(); @@ -3408,10 +3407,14 @@ process_strong_roots(true, // activate StrongRootsScope ScanningOption(so), // roots scanning options &rootsCl, - &blobsCl, &klassCl ); + // Verify the nmethods in the code cache. + G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); + G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); + CodeCache::blobs_do(&blobsCl); + bool failures = rootsCl.failures() || codeRootsCl.failures(); if (vo != VerifyOption_G1UseMarkWord) { @@ -5115,12 +5118,9 @@ BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); - CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */); - process_strong_roots(false, // no scoping; this is parallel code so, &buf_scan_non_heap_roots, - &scan_code_roots, scan_klasses ); @@ -5180,12 +5180,6 @@ _process_strong_tasks->all_tasks_completed(); } -void -G1CollectedHeap::g1_process_weak_roots(OopClosure* root_closure) { - CodeBlobToOopClosure roots_in_blobs(root_closure, /*do_marking=*/ false); - SharedHeap::process_weak_roots(root_closure, &roots_in_blobs); -} - class G1StringSymbolTableUnlinkTask : public AbstractGangTask { private: BoolObjectClosure* _is_alive; diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Mon Feb 17 10:13:28 2014 +0100 @@ -833,11 +833,6 @@ G1KlassScanClosure* scan_klasses, int worker_i); - // Apply "blk" to all the weak roots of the system. These include - // JNI weak roots, the code cache, system dictionary, symbol table, - // string table, and referents of reachable weak refs. - void g1_process_weak_roots(OopClosure* root_closure); - // Frees a non-humongous region by initializing its contents and // adding it to the free list that's passed as a parameter (this is // usually a local list which will be appended to the master free diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/g1/g1MarkSweep.cpp --- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -133,7 +133,6 @@ sh->process_strong_roots(true, // activate StrongRootsScope SharedHeap::SO_SystemClasses, &GenMarkSweep::follow_root_closure, - &GenMarkSweep::follow_code_root_closure, &GenMarkSweep::follow_klass_closure); // Process reference objects found during marking @@ -307,9 +306,8 @@ ClassLoaderDataGraph::clear_claimed_marks(); sh->process_strong_roots(true, // activate StrongRootsScope - SharedHeap::SO_AllClasses, + SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache, &GenMarkSweep::adjust_pointer_closure, - NULL, // do not touch code cache here &GenMarkSweep::adjust_klass_closure); assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity"); @@ -317,7 +315,7 @@ // Now adjust pointers in remaining weak roots. (All of which should // have been cleared if they pointed to non-surviving objects.) - g1h->g1_process_weak_roots(&GenMarkSweep::adjust_pointer_closure); + sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure); GenMarkSweep::adjust_marks(); diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/parNew/parNewGeneration.cpp --- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -621,7 +621,6 @@ false, // no scope; this is parallel code SharedHeap::ScanningOption(so), &par_scan_state.to_space_root_closure(), - true, // walk *all* scavengable nmethods &par_scan_state.older_gen_closure(), &klass_scan_closure); par_scan_state.end_strong_roots(); diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/shared/markSweep.cpp --- a/src/share/vm/gc_implementation/shared/markSweep.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/shared/markSweep.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -47,7 +47,6 @@ SerialOldTracer* MarkSweep::_gc_tracer = NULL; MarkSweep::FollowRootClosure MarkSweep::follow_root_closure; -CodeBlobToOopClosure MarkSweep::follow_code_root_closure(&MarkSweep::follow_root_closure, /*do_marking=*/ true); void MarkSweep::FollowRootClosure::do_oop(oop* p) { follow_root(p); } void MarkSweep::FollowRootClosure::do_oop(narrowOop* p) { follow_root(p); } diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/gc_implementation/shared/markSweep.hpp --- a/src/share/vm/gc_implementation/shared/markSweep.hpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/gc_implementation/shared/markSweep.hpp Mon Feb 17 10:13:28 2014 +0100 @@ -143,7 +143,6 @@ // Public closures static IsAliveClosure is_alive; static FollowRootClosure follow_root_closure; - static CodeBlobToOopClosure follow_code_root_closure; // => follow_root_closure static MarkAndPushClosure mark_and_push_closure; static FollowKlassClosure follow_klass_closure; static FollowStackClosure follow_stack_closure; diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/binaryTreeDictionary.cpp --- a/src/share/vm/memory/binaryTreeDictionary.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/binaryTreeDictionary.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -44,16 +44,16 @@ // This is currently used in the Concurrent Mark&Sweep implementation. //////////////////////////////////////////////////////////////////////////////// -template class FreeList_t> +template size_t TreeChunk::_min_tree_chunk_size = sizeof(TreeChunk)/HeapWordSize; -template class FreeList_t> +template TreeChunk* TreeChunk::as_TreeChunk(Chunk_t* fc) { // Do some assertion checking here. return (TreeChunk*) fc; } -template class FreeList_t> +template void TreeChunk::verify_tree_chunk_list() const { TreeChunk* nextTC = (TreeChunk*)next(); if (prev() != NULL) { // interior list node shouldn't have tree fields @@ -67,11 +67,11 @@ } } -template class FreeList_t> +template TreeList::TreeList() : _parent(NULL), _left(NULL), _right(NULL) {} -template class FreeList_t> +template TreeList* TreeList::as_TreeList(TreeChunk* tc) { // This first free chunk in the list will be the tree list. @@ -88,20 +88,7 @@ return tl; } - -template class FreeList_t> -TreeList* -get_chunk(size_t size, enum FreeBlockDictionary::Dither dither) { - FreeBlockDictionary::verify_par_locked(); - Chunk_t* res = get_chunk_from_tree(size, dither); - assert(res == NULL || res->is_free(), - "Should be returning a free chunk"); - assert(dither != FreeBlockDictionary::exactly || - res->size() == size, "Not correct size"); - return res; -} - -template class FreeList_t> +template TreeList* TreeList::as_TreeList(HeapWord* addr, size_t size) { TreeChunk* tc = (TreeChunk*) addr; @@ -125,17 +112,17 @@ // an over populated size. The general get_better_list() just returns // the current list. template <> -TreeList* -TreeList::get_better_list( - BinaryTreeDictionary* dictionary) { +TreeList >* +TreeList >::get_better_list( + BinaryTreeDictionary >* dictionary) { // A candidate chunk has been found. If it is already under // populated, get a chunk associated with the hint for this // chunk. - TreeList* curTL = this; + TreeList >* curTL = this; if (surplus() <= 0) { /* Use the hint to find a size with a surplus, and reset the hint. */ - TreeList* hintTL = this; + TreeList >* hintTL = this; while (hintTL->hint() != 0) { assert(hintTL->hint() > hintTL->size(), "hint points in the wrong direction"); @@ -163,14 +150,14 @@ } #endif // INCLUDE_ALL_GCS -template class FreeList_t> +template TreeList* TreeList::get_better_list( BinaryTreeDictionary* dictionary) { return this; } -template class FreeList_t> +template TreeList* TreeList::remove_chunk_replace_if_needed(TreeChunk* tc) { TreeList* retTL = this; @@ -286,7 +273,7 @@ return retTL; } -template class FreeList_t> +template void TreeList::return_chunk_at_tail(TreeChunk* chunk) { assert(chunk != NULL, "returning NULL chunk"); assert(chunk->list() == this, "list should be set for chunk"); @@ -301,7 +288,7 @@ this->link_tail(chunk); assert(!tail() || size() == tail()->size(), "Wrong sized chunk in list"); - FreeList_t::increment_count(); + FreeList_t::increment_count(); debug_only(this->increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) assert(head() == NULL || head()->prev() == NULL, "list invariant"); assert(tail() == NULL || tail()->next() == NULL, "list invariant"); @@ -311,7 +298,7 @@ // is defined to be after the chunk pointer to by head(). This is // because the TreeList is embedded in the first TreeChunk in the // list. See the definition of TreeChunk. -template class FreeList_t> +template void TreeList::return_chunk_at_head(TreeChunk* chunk) { assert(chunk->list() == this, "list should be set for chunk"); assert(head() != NULL, "The tree list is embedded in the first chunk"); @@ -329,13 +316,13 @@ } head()->link_after(chunk); assert(!head() || size() == head()->size(), "Wrong sized chunk in list"); - FreeList_t::increment_count(); + FreeList_t::increment_count(); debug_only(this->increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) assert(head() == NULL || head()->prev() == NULL, "list invariant"); assert(tail() == NULL || tail()->next() == NULL, "list invariant"); } -template class FreeList_t> +template void TreeChunk::assert_is_mangled() const { assert((ZapUnusedHeapArea && SpaceMangler::is_mangled((HeapWord*) Chunk_t::size_addr()) && @@ -345,14 +332,14 @@ "Space should be clear or mangled"); } -template class FreeList_t> +template TreeChunk* TreeList::head_as_TreeChunk() { assert(head() == NULL || (TreeChunk::as_TreeChunk(head())->list() == this), "Wrong type of chunk?"); return TreeChunk::as_TreeChunk(head()); } -template class FreeList_t> +template TreeChunk* TreeList::first_available() { assert(head() != NULL, "The head of the list cannot be NULL"); Chunk_t* fc = head()->next(); @@ -369,7 +356,7 @@ // Returns the block with the largest heap address amongst // those in the list for this size; potentially slow and expensive, // use with caution! -template class FreeList_t> +template TreeChunk* TreeList::largest_address() { assert(head() != NULL, "The head of the list cannot be NULL"); Chunk_t* fc = head()->next(); @@ -392,7 +379,7 @@ return retTC; } -template class FreeList_t> +template BinaryTreeDictionary::BinaryTreeDictionary(MemRegion mr) { assert((mr.byte_size() > min_size()), "minimum chunk size"); @@ -405,17 +392,17 @@ assert(total_free_blocks() == 1, "reset check failed"); } -template class FreeList_t> +template void BinaryTreeDictionary::inc_total_size(size_t inc) { _total_size = _total_size + inc; } -template class FreeList_t> +template void BinaryTreeDictionary::dec_total_size(size_t dec) { _total_size = _total_size - dec; } -template class FreeList_t> +template void BinaryTreeDictionary::reset(MemRegion mr) { assert((mr.byte_size() > min_size()), "minimum chunk size"); set_root(TreeList::as_TreeList(mr.start(), mr.word_size())); @@ -423,13 +410,13 @@ set_total_free_blocks(1); } -template class FreeList_t> +template void BinaryTreeDictionary::reset(HeapWord* addr, size_t byte_size) { MemRegion mr(addr, heap_word_size(byte_size)); reset(mr); } -template class FreeList_t> +template void BinaryTreeDictionary::reset() { set_root(NULL); set_total_size(0); @@ -437,7 +424,7 @@ } // Get a free block of size at least size from tree, or NULL. -template class FreeList_t> +template TreeChunk* BinaryTreeDictionary::get_chunk_from_tree( size_t size, @@ -496,7 +483,7 @@ return retTC; } -template class FreeList_t> +template TreeList* BinaryTreeDictionary::find_list(size_t size) const { TreeList* curTL; for (curTL = root(); curTL != NULL;) { @@ -515,7 +502,7 @@ } -template class FreeList_t> +template bool BinaryTreeDictionary::verify_chunk_in_free_list(Chunk_t* tc) const { size_t size = tc->size(); TreeList* tl = find_list(size); @@ -526,7 +513,7 @@ } } -template class FreeList_t> +template Chunk_t* BinaryTreeDictionary::find_largest_dict() const { TreeList *curTL = root(); if (curTL != NULL) { @@ -541,7 +528,7 @@ // chunk in a list on a tree node, just unlink it. // If it is the last chunk in the list (the next link is NULL), // remove the node and repair the tree. -template class FreeList_t> +template TreeChunk* BinaryTreeDictionary::remove_chunk_from_tree(TreeChunk* tc) { assert(tc != NULL, "Should not call with a NULL chunk"); @@ -682,7 +669,7 @@ // Remove the leftmost node (lm) in the tree and return it. // If lm has a right child, link it to the left node of // the parent of lm. -template class FreeList_t> +template TreeList* BinaryTreeDictionary::remove_tree_minimum(TreeList* tl) { assert(tl != NULL && tl->parent() != NULL, "really need a proper sub-tree"); // locate the subtree minimum by walking down left branches @@ -717,7 +704,7 @@ return curTL; } -template class FreeList_t> +template void BinaryTreeDictionary::insert_chunk_in_tree(Chunk_t* fc) { TreeList *curTL, *prevTL; size_t size = fc->size(); @@ -783,7 +770,7 @@ } } -template class FreeList_t> +template size_t BinaryTreeDictionary::max_chunk_size() const { FreeBlockDictionary::verify_par_locked(); TreeList* tc = root(); @@ -792,7 +779,7 @@ return tc->size(); } -template class FreeList_t> +template size_t BinaryTreeDictionary::total_list_length(TreeList* tl) const { size_t res; res = tl->count(); @@ -805,7 +792,7 @@ return res; } -template class FreeList_t> +template size_t BinaryTreeDictionary::total_size_in_tree(TreeList* tl) const { if (tl == NULL) return 0; @@ -814,7 +801,7 @@ total_size_in_tree(tl->right()); } -template class FreeList_t> +template double BinaryTreeDictionary::sum_of_squared_block_sizes(TreeList* const tl) const { if (tl == NULL) { return 0.0; @@ -826,7 +813,7 @@ return curr; } -template class FreeList_t> +template size_t BinaryTreeDictionary::total_free_blocks_in_tree(TreeList* tl) const { if (tl == NULL) return 0; @@ -835,14 +822,14 @@ total_free_blocks_in_tree(tl->right()); } -template class FreeList_t> +template size_t BinaryTreeDictionary::num_free_blocks() const { assert(total_free_blocks_in_tree(root()) == total_free_blocks(), "_total_free_blocks inconsistency"); return total_free_blocks(); } -template class FreeList_t> +template size_t BinaryTreeDictionary::tree_height_helper(TreeList* tl) const { if (tl == NULL) return 0; @@ -850,12 +837,12 @@ tree_height_helper(tl->right())); } -template class FreeList_t> +template size_t BinaryTreeDictionary::tree_height() const { return tree_height_helper(root()); } -template class FreeList_t> +template size_t BinaryTreeDictionary::total_nodes_helper(TreeList* tl) const { if (tl == NULL) { return 0; @@ -864,18 +851,18 @@ total_nodes_helper(tl->right()); } -template class FreeList_t> +template size_t BinaryTreeDictionary::total_nodes_in_tree(TreeList* tl) const { return total_nodes_helper(root()); } -template class FreeList_t> +template void BinaryTreeDictionary::dict_census_update(size_t size, bool split, bool birth){} #if INCLUDE_ALL_GCS template <> -void AFLBinaryTreeDictionary::dict_census_update(size_t size, bool split, bool birth){ - TreeList* nd = find_list(size); +void AFLBinaryTreeDictionary::dict_census_update(size_t size, bool split, bool birth) { + TreeList >* nd = find_list(size); if (nd) { if (split) { if (birth) { @@ -903,7 +890,7 @@ } #endif // INCLUDE_ALL_GCS -template class FreeList_t> +template bool BinaryTreeDictionary::coal_dict_over_populated(size_t size) { // For the general type of freelists, encourage coalescing by // returning true. @@ -915,7 +902,7 @@ bool AFLBinaryTreeDictionary::coal_dict_over_populated(size_t size) { if (FLSAlwaysCoalesceLarge) return true; - TreeList* list_of_size = find_list(size); + TreeList >* list_of_size = find_list(size); // None of requested size implies overpopulated. return list_of_size == NULL || list_of_size->coal_desired() <= 0 || list_of_size->count() > list_of_size->coal_desired(); @@ -928,15 +915,15 @@ // do_tree() walks the nodes in the binary tree applying do_list() // to each list at each node. -template class FreeList_t> +template class TreeCensusClosure : public StackObj { protected: - virtual void do_list(FreeList_t* fl) = 0; + virtual void do_list(FreeList_t* fl) = 0; public: virtual void do_tree(TreeList* tl) = 0; }; -template class FreeList_t> +template class AscendTreeCensusClosure : public TreeCensusClosure { public: void do_tree(TreeList* tl) { @@ -948,7 +935,7 @@ } }; -template class FreeList_t> +template class DescendTreeCensusClosure : public TreeCensusClosure { public: void do_tree(TreeList* tl) { @@ -962,7 +949,7 @@ // For each list in the tree, calculate the desired, desired // coalesce, count before sweep, and surplus before sweep. -template class FreeList_t> +template class BeginSweepClosure : public AscendTreeCensusClosure { double _percentage; float _inter_sweep_current; @@ -995,16 +982,16 @@ // Similar to TreeCensusClosure but searches the // tree and returns promptly when found. -template class FreeList_t> +template class TreeSearchClosure : public StackObj { protected: - virtual bool do_list(FreeList_t* fl) = 0; + virtual bool do_list(FreeList_t* fl) = 0; public: virtual bool do_tree(TreeList* tl) = 0; }; #if 0 // Don't need this yet but here for symmetry. -template class FreeList_t> +template class AscendTreeSearchClosure : public TreeSearchClosure { public: bool do_tree(TreeList* tl) { @@ -1018,7 +1005,7 @@ }; #endif -template class FreeList_t> +template class DescendTreeSearchClosure : public TreeSearchClosure { public: bool do_tree(TreeList* tl) { @@ -1033,14 +1020,14 @@ // Searches the tree for a chunk that ends at the // specified address. -template class FreeList_t> +template class EndTreeSearchClosure : public DescendTreeSearchClosure { HeapWord* _target; Chunk_t* _found; public: EndTreeSearchClosure(HeapWord* target) : _target(target), _found(NULL) {} - bool do_list(FreeList_t* fl) { + bool do_list(FreeList_t* fl) { Chunk_t* item = fl->head(); while (item != NULL) { if (item->end() == (uintptr_t*) _target) { @@ -1054,7 +1041,7 @@ Chunk_t* found() { return _found; } }; -template class FreeList_t> +template Chunk_t* BinaryTreeDictionary::find_chunk_ends_at(HeapWord* target) const { EndTreeSearchClosure etsc(target); bool found_target = etsc.do_tree(root()); @@ -1063,7 +1050,7 @@ return etsc.found(); } -template class FreeList_t> +template void BinaryTreeDictionary::begin_sweep_dict_census(double coalSurplusPercent, float inter_sweep_current, float inter_sweep_estimate, float intra_sweep_estimate) { BeginSweepClosure bsc(coalSurplusPercent, inter_sweep_current, @@ -1075,32 +1062,32 @@ // Closures and methods for calculating total bytes returned to the // free lists in the tree. #ifndef PRODUCT -template class FreeList_t> +template class InitializeDictReturnedBytesClosure : public AscendTreeCensusClosure { public: - void do_list(FreeList_t* fl) { + void do_list(FreeList_t* fl) { fl->set_returned_bytes(0); } }; -template class FreeList_t> +template void BinaryTreeDictionary::initialize_dict_returned_bytes() { InitializeDictReturnedBytesClosure idrb; idrb.do_tree(root()); } -template class FreeList_t> +template class ReturnedBytesClosure : public AscendTreeCensusClosure { size_t _dict_returned_bytes; public: ReturnedBytesClosure() { _dict_returned_bytes = 0; } - void do_list(FreeList_t* fl) { + void do_list(FreeList_t* fl) { _dict_returned_bytes += fl->returned_bytes(); } size_t dict_returned_bytes() { return _dict_returned_bytes; } }; -template class FreeList_t> +template size_t BinaryTreeDictionary::sum_dict_returned_bytes() { ReturnedBytesClosure rbc; rbc.do_tree(root()); @@ -1109,17 +1096,17 @@ } // Count the number of entries in the tree. -template class FreeList_t> +template class treeCountClosure : public DescendTreeCensusClosure { public: uint count; treeCountClosure(uint c) { count = c; } - void do_list(FreeList_t* fl) { + void do_list(FreeList_t* fl) { count++; } }; -template class FreeList_t> +template size_t BinaryTreeDictionary::total_count() { treeCountClosure ctc(0); ctc.do_tree(root()); @@ -1128,7 +1115,7 @@ #endif // PRODUCT // Calculate surpluses for the lists in the tree. -template class FreeList_t> +template class setTreeSurplusClosure : public AscendTreeCensusClosure { double percentage; public: @@ -1144,14 +1131,14 @@ #endif // INCLUDE_ALL_GCS }; -template class FreeList_t> +template void BinaryTreeDictionary::set_tree_surplus(double splitSurplusPercent) { setTreeSurplusClosure sts(splitSurplusPercent); sts.do_tree(root()); } // Set hints for the lists in the tree. -template class FreeList_t> +template class setTreeHintsClosure : public DescendTreeCensusClosure { size_t hint; public: @@ -1170,14 +1157,14 @@ #endif // INCLUDE_ALL_GCS }; -template class FreeList_t> +template void BinaryTreeDictionary::set_tree_hints(void) { setTreeHintsClosure sth(0); sth.do_tree(root()); } // Save count before previous sweep and splits and coalesces. -template class FreeList_t> +template class clearTreeCensusClosure : public AscendTreeCensusClosure { void do_list(FreeList* fl) {} @@ -1192,14 +1179,14 @@ #endif // INCLUDE_ALL_GCS }; -template class FreeList_t> +template void BinaryTreeDictionary::clear_tree_census(void) { clearTreeCensusClosure ctc; ctc.do_tree(root()); } // Do reporting and post sweep clean up. -template class FreeList_t> +template void BinaryTreeDictionary::end_sweep_dict_census(double splitSurplusPercent) { // Does walking the tree 3 times hurt? set_tree_surplus(splitSurplusPercent); @@ -1211,7 +1198,7 @@ } // Print summary statistics -template class FreeList_t> +template void BinaryTreeDictionary::report_statistics() const { FreeBlockDictionary::verify_par_locked(); gclog_or_tty->print("Statistics for BinaryTreeDictionary:\n" @@ -1230,22 +1217,22 @@ // Print census information - counts, births, deaths, etc. // for each list in the tree. Also print some summary // information. -template class FreeList_t> +template class PrintTreeCensusClosure : public AscendTreeCensusClosure { int _print_line; size_t _total_free; - FreeList_t _total; + FreeList_t _total; public: PrintTreeCensusClosure() { _print_line = 0; _total_free = 0; } - FreeList_t* total() { return &_total; } + FreeList_t* total() { return &_total; } size_t total_free() { return _total_free; } void do_list(FreeList* fl) { if (++_print_line >= 40) { - FreeList_t::print_labels_on(gclog_or_tty, "size"); + FreeList_t::print_labels_on(gclog_or_tty, "size"); _print_line = 0; } fl->print_on(gclog_or_tty); @@ -1256,7 +1243,7 @@ #if INCLUDE_ALL_GCS void do_list(AdaptiveFreeList* fl) { if (++_print_line >= 40) { - FreeList_t::print_labels_on(gclog_or_tty, "size"); + FreeList_t::print_labels_on(gclog_or_tty, "size"); _print_line = 0; } fl->print_on(gclog_or_tty); @@ -1275,16 +1262,16 @@ #endif // INCLUDE_ALL_GCS }; -template class FreeList_t> +template void BinaryTreeDictionary::print_dict_census(void) const { gclog_or_tty->print("\nBinaryTree\n"); - FreeList_t::print_labels_on(gclog_or_tty, "size"); + FreeList_t::print_labels_on(gclog_or_tty, "size"); PrintTreeCensusClosure ptc; ptc.do_tree(root()); - FreeList_t* total = ptc.total(); - FreeList_t::print_labels_on(gclog_or_tty, " "); + FreeList_t* total = ptc.total(); + FreeList_t::print_labels_on(gclog_or_tty, " "); } #if INCLUDE_ALL_GCS @@ -1293,7 +1280,7 @@ gclog_or_tty->print("\nBinaryTree\n"); AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); - PrintTreeCensusClosure ptc; + PrintTreeCensusClosure > ptc; ptc.do_tree(root()); AdaptiveFreeList* total = ptc.total(); @@ -1311,7 +1298,7 @@ } #endif // INCLUDE_ALL_GCS -template class FreeList_t> +template class PrintFreeListsClosure : public AscendTreeCensusClosure { outputStream* _st; int _print_line; @@ -1321,9 +1308,9 @@ _st = st; _print_line = 0; } - void do_list(FreeList_t* fl) { + void do_list(FreeList_t* fl) { if (++_print_line >= 40) { - FreeList_t::print_labels_on(_st, "size"); + FreeList_t::print_labels_on(_st, "size"); _print_line = 0; } fl->print_on(gclog_or_tty); @@ -1337,10 +1324,10 @@ } }; -template class FreeList_t> +template void BinaryTreeDictionary::print_free_lists(outputStream* st) const { - FreeList_t::print_labels_on(st, "size"); + FreeList_t::print_labels_on(st, "size"); PrintFreeListsClosure pflc(st); pflc.do_tree(root()); } @@ -1349,7 +1336,7 @@ // . _root has no parent // . parent and child point to each other // . each node's key correctly related to that of its child(ren) -template class FreeList_t> +template void BinaryTreeDictionary::verify_tree() const { guarantee(root() == NULL || total_free_blocks() == 0 || total_size() != 0, "_total_size shouldn't be 0?"); @@ -1357,7 +1344,7 @@ verify_tree_helper(root()); } -template class FreeList_t> +template size_t BinaryTreeDictionary::verify_prev_free_ptrs(TreeList* tl) { size_t ct = 0; for (Chunk_t* curFC = tl->head(); curFC != NULL; curFC = curFC->next()) { @@ -1371,7 +1358,7 @@ // Note: this helper is recursive rather than iterative, so use with // caution on very deep trees; and watch out for stack overflow errors; // In general, to be used only for debugging. -template class FreeList_t> +template void BinaryTreeDictionary::verify_tree_helper(TreeList* tl) const { if (tl == NULL) return; @@ -1400,25 +1387,25 @@ verify_tree_helper(tl->right()); } -template class FreeList_t> +template void BinaryTreeDictionary::verify() const { verify_tree(); guarantee(total_size() == total_size_in_tree(root()), "Total Size inconsistency"); } -template class TreeList; -template class BinaryTreeDictionary; -template class TreeChunk; +template class TreeList >; +template class BinaryTreeDictionary >; +template class TreeChunk >; -template class TreeList; -template class BinaryTreeDictionary; -template class TreeChunk; +template class TreeList >; +template class BinaryTreeDictionary >; +template class TreeChunk >; #if INCLUDE_ALL_GCS // Explicitly instantiate these types for FreeChunk. -template class TreeList; -template class BinaryTreeDictionary; -template class TreeChunk; +template class TreeList >; +template class BinaryTreeDictionary >; +template class TreeChunk >; #endif // INCLUDE_ALL_GCS diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/binaryTreeDictionary.hpp --- a/src/share/vm/memory/binaryTreeDictionary.hpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/binaryTreeDictionary.hpp Mon Feb 17 10:13:28 2014 +0100 @@ -37,18 +37,18 @@ // A TreeList is a FreeList which can be used to maintain a // binary tree of free lists. -template class FreeList_t> class TreeChunk; -template class FreeList_t> class BinaryTreeDictionary; -template class FreeList_t> class AscendTreeCensusClosure; -template class FreeList_t> class DescendTreeCensusClosure; -template class FreeList_t> class DescendTreeSearchClosure; +template class TreeChunk; +template class BinaryTreeDictionary; +template class AscendTreeCensusClosure; +template class DescendTreeCensusClosure; +template class DescendTreeSearchClosure; class FreeChunk; template class AdaptiveFreeList; -typedef BinaryTreeDictionary AFLBinaryTreeDictionary; +typedef BinaryTreeDictionary > AFLBinaryTreeDictionary; -template class FreeList_t> -class TreeList : public FreeList_t { +template +class TreeList : public FreeList_t { friend class TreeChunk; friend class BinaryTreeDictionary; friend class AscendTreeCensusClosure; @@ -66,12 +66,12 @@ TreeList* right() const { return _right; } // Wrapper on call to base class, to get the template to compile. - Chunk_t* head() const { return FreeList_t::head(); } - Chunk_t* tail() const { return FreeList_t::tail(); } - void set_head(Chunk_t* head) { FreeList_t::set_head(head); } - void set_tail(Chunk_t* tail) { FreeList_t::set_tail(tail); } + Chunk_t* head() const { return FreeList_t::head(); } + Chunk_t* tail() const { return FreeList_t::tail(); } + void set_head(Chunk_t* head) { FreeList_t::set_head(head); } + void set_tail(Chunk_t* tail) { FreeList_t::set_tail(tail); } - size_t size() const { return FreeList_t::size(); } + size_t size() const { return FreeList_t::size(); } // Accessors for links in tree. @@ -90,7 +90,7 @@ void clear_left() { _left = NULL; } void clear_right() { _right = NULL; } void clear_parent() { _parent = NULL; } - void initialize() { clear_left(); clear_right(), clear_parent(); FreeList_t::initialize(); } + void initialize() { clear_left(); clear_right(), clear_parent(); FreeList_t::initialize(); } // For constructing a TreeList from a Tree chunk or // address and size. @@ -139,7 +139,7 @@ // on the free list for a node in the tree and is only removed if // it is the last chunk on the free list. -template class FreeList_t> +template class TreeChunk : public Chunk_t { friend class TreeList; TreeList* _list; @@ -173,7 +173,7 @@ }; -template class FreeList_t> +template class BinaryTreeDictionary: public FreeBlockDictionary { friend class VMStructs; size_t _total_size; diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/defNewGeneration.cpp --- a/src/share/vm/memory/defNewGeneration.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/defNewGeneration.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -626,7 +626,6 @@ true, // activate StrongRootsScope SharedHeap::ScanningOption(so), &fsc_with_no_gc_barrier, - true, // walk *all* scavengable nmethods &fsc_with_gc_barrier, &klass_scan_closure); diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/genCollectedHeap.cpp --- a/src/share/vm/memory/genCollectedHeap.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/genCollectedHeap.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -594,20 +594,12 @@ bool activate_scope, SharedHeap::ScanningOption so, OopsInGenClosure* not_older_gens, - bool do_code_roots, OopsInGenClosure* older_gens, KlassClosure* klass_closure) { // General strong roots. - if (!do_code_roots) { - SharedHeap::process_strong_roots(activate_scope, so, - not_older_gens, NULL, klass_closure); - } else { - bool do_code_marking = (activate_scope || nmethod::oops_do_marking_is_active()); - CodeBlobToOopClosure code_roots(not_older_gens, /*do_marking=*/ do_code_marking); - SharedHeap::process_strong_roots(activate_scope, so, - not_older_gens, &code_roots, klass_closure); - } + SharedHeap::process_strong_roots(activate_scope, so, + not_older_gens, klass_closure); if (younger_gens_as_roots) { if (!_gen_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) { @@ -629,9 +621,8 @@ _gen_process_strong_tasks->all_tasks_completed(); } -void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure, - CodeBlobClosure* code_roots) { - SharedHeap::process_weak_roots(root_closure, code_roots); +void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) { + SharedHeap::process_weak_roots(root_closure); // "Local" "weak" refs for (int i = 0; i < _n_gens; i++) { _gens[i]->ref_processor()->weak_oops_do(root_closure); diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/genCollectedHeap.hpp --- a/src/share/vm/memory/genCollectedHeap.hpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/genCollectedHeap.hpp Mon Feb 17 10:13:28 2014 +0100 @@ -414,15 +414,13 @@ bool activate_scope, SharedHeap::ScanningOption so, OopsInGenClosure* not_older_gens, - bool do_code_roots, OopsInGenClosure* older_gens, KlassClosure* klass_closure); - // Apply "blk" to all the weak roots of the system. These include - // JNI weak roots, the code cache, system dictionary, symbol table, - // string table, and referents of reachable weak refs. - void gen_process_weak_roots(OopClosure* root_closure, - CodeBlobClosure* code_roots); + // Apply "root_closure" to all the weak roots of the system. + // These include JNI weak roots, string table, + // and referents of reachable weak refs. + void gen_process_weak_roots(OopClosure* root_closure); // Set the saved marks of generations, if that makes sense. // In particular, if any generation might iterate over the oops diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/genMarkSweep.cpp --- a/src/share/vm/memory/genMarkSweep.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/genMarkSweep.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -212,7 +212,6 @@ true, // activate StrongRootsScope SharedHeap::SO_SystemClasses, &follow_root_closure, - true, // walk code active on stacks &follow_root_closure, &follow_klass_closure); @@ -295,18 +294,12 @@ gch->gen_process_strong_roots(level, false, // Younger gens are not roots. true, // activate StrongRootsScope - SharedHeap::SO_AllClasses, + SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache, &adjust_pointer_closure, - false, // do not walk code &adjust_pointer_closure, &adjust_klass_closure); - // Now adjust pointers in remaining weak roots. (All of which should - // have been cleared if they pointed to non-surviving objects.) - CodeBlobToOopClosure adjust_code_pointer_closure(&adjust_pointer_closure, - /*do_marking=*/ false); - gch->gen_process_weak_roots(&adjust_pointer_closure, - &adjust_code_pointer_closure); + gch->gen_process_weak_roots(&adjust_pointer_closure); adjust_marks(); GenAdjustPointersClosure blk; diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/metaspace.cpp --- a/src/share/vm/memory/metaspace.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/metaspace.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -46,8 +46,8 @@ #include "utilities/copy.hpp" #include "utilities/debug.hpp" -typedef BinaryTreeDictionary BlockTreeDictionary; -typedef BinaryTreeDictionary ChunkTreeDictionary; +typedef BinaryTreeDictionary > BlockTreeDictionary; +typedef BinaryTreeDictionary > ChunkTreeDictionary; // Set this constant to enable slow integrity checking of the free chunk lists const bool metaspace_slow_verify = false; @@ -790,7 +790,7 @@ return NULL; } - if (word_size < TreeChunk::min_size()) { + if (word_size < TreeChunk >::min_size()) { // Dark matter. Too small for dictionary. return NULL; } @@ -810,7 +810,7 @@ MetaWord* new_block = (MetaWord*)free_block; assert(block_size >= word_size, "Incorrect size of block from freelist"); const size_t unused = block_size - word_size; - if (unused >= TreeChunk::min_size()) { + if (unused >= TreeChunk >::min_size()) { return_block(new_block + word_size, unused); } @@ -2240,7 +2240,7 @@ void SpaceManager::deallocate(MetaWord* p, size_t word_size) { assert_lock_strong(_lock); size_t raw_word_size = get_raw_word_size(word_size); - size_t min_size = TreeChunk::min_size(); + size_t min_size = TreeChunk >::min_size(); assert(raw_word_size >= min_size, err_msg("Should not deallocate dark matter " SIZE_FORMAT "<" SIZE_FORMAT, word_size, min_size)); block_freelists()->return_block(p, raw_word_size); @@ -2296,7 +2296,7 @@ void SpaceManager::retire_current_chunk() { if (current_chunk() != NULL) { size_t remaining_words = current_chunk()->free_word_size(); - if (remaining_words >= TreeChunk::min_size()) { + if (remaining_words >= TreeChunk >::min_size()) { block_freelists()->return_block(current_chunk()->allocate(remaining_words), remaining_words); inc_used_metrics(remaining_words); } @@ -3279,7 +3279,7 @@ assert(Thread::current()->is_VM_thread(), "should be the VM thread"); // Don't take Heap_lock MutexLockerEx ml(vsm()->lock(), Mutex::_no_safepoint_check_flag); - if (word_size < TreeChunk::min_size()) { + if (word_size < TreeChunk >::min_size()) { // Dark matter. Too small for dictionary. #ifdef ASSERT Copy::fill_to_words((HeapWord*)ptr, word_size, 0xf5f5f5f5); @@ -3294,7 +3294,7 @@ } else { MutexLockerEx ml(vsm()->lock(), Mutex::_no_safepoint_check_flag); - if (word_size < TreeChunk::min_size()) { + if (word_size < TreeChunk >::min_size()) { // Dark matter. Too small for dictionary. #ifdef ASSERT Copy::fill_to_words((HeapWord*)ptr, word_size, 0xf5f5f5f5); diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/sharedHeap.cpp --- a/src/share/vm/memory/sharedHeap.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/sharedHeap.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -139,7 +139,6 @@ void SharedHeap::process_strong_roots(bool activate_scope, ScanningOption so, OopClosure* roots, - CodeBlobClosure* code_roots, KlassClosure* klass_closure) { StrongRootsScope srs(this, activate_scope); @@ -156,15 +155,17 @@ if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do)) JNIHandles::oops_do(roots); + CodeBlobToOopClosure code_roots(roots, true); + CLDToOopClosure roots_from_clds(roots); // If we limit class scanning to SO_SystemClasses we need to apply a CLD closure to // CLDs which are strongly reachable from the thread stacks. CLDToOopClosure* roots_from_clds_p = ((so & SO_SystemClasses) ? &roots_from_clds : NULL); // All threads execute this; the individual threads are task groups. if (CollectedHeap::use_parallel_gc_threads()) { - Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, code_roots); + Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, &code_roots); } else { - Threads::oops_do(roots, roots_from_clds_p, code_roots); + Threads::oops_do(roots, roots_from_clds_p, &code_roots); } if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do)) @@ -206,17 +207,17 @@ if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) { if (so & SO_ScavengeCodeCache) { - assert(code_roots != NULL, "must supply closure for code cache"); + assert(&code_roots != NULL, "must supply closure for code cache"); // We only visit parts of the CodeCache when scavenging. - CodeCache::scavenge_root_nmethods_do(code_roots); + CodeCache::scavenge_root_nmethods_do(&code_roots); } if (so & SO_AllCodeCache) { - assert(code_roots != NULL, "must supply closure for code cache"); + assert(&code_roots != NULL, "must supply closure for code cache"); // CMSCollector uses this to do intermediate-strength collections. // We scan the entire code cache, since CodeCache::do_unloading is not called. - CodeCache::blobs_do(code_roots); + CodeCache::blobs_do(&code_roots); } // Verify that the code cache contents are not subject to // movement by a scavenging collection. @@ -233,13 +234,9 @@ }; static AlwaysTrueClosure always_true; -void SharedHeap::process_weak_roots(OopClosure* root_closure, - CodeBlobClosure* code_roots) { +void SharedHeap::process_weak_roots(OopClosure* root_closure) { // Global (weak) JNI handles JNIHandles::weak_oops_do(&always_true, root_closure); - - CodeCache::blobs_do(code_roots); - StringTable::oops_do(root_closure); } void SharedHeap::set_barrier_set(BarrierSet* bs) { diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/memory/sharedHeap.hpp --- a/src/share/vm/memory/sharedHeap.hpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/memory/sharedHeap.hpp Mon Feb 17 10:13:28 2014 +0100 @@ -238,14 +238,10 @@ void process_strong_roots(bool activate_scope, ScanningOption so, OopClosure* roots, - CodeBlobClosure* code_roots, KlassClosure* klass_closure); - // Apply "blk" to all the weak roots of the system. These include - // JNI weak roots, the code cache, system dictionary, symbol table, - // string table. - void process_weak_roots(OopClosure* root_closure, - CodeBlobClosure* code_roots); + // Apply "root_closure" to the JNI weak roots.. + void process_weak_roots(OopClosure* root_closure); // The functions below are helper functions that a subclass of // "SharedHeap" can use in the implementation of its virtual @@ -275,4 +271,8 @@ size_t capacity); }; +inline SharedHeap::ScanningOption operator|(SharedHeap::ScanningOption so0, SharedHeap::ScanningOption so1) { + return static_cast(static_cast(so0) | static_cast(so1)); +} + #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP diff -r e8ef156f0bc9 -r 7ab49a697539 src/share/vm/runtime/vmStructs.cpp --- a/src/share/vm/runtime/vmStructs.cpp Thu Feb 13 17:57:27 2014 +0100 +++ b/src/share/vm/runtime/vmStructs.cpp Mon Feb 17 10:13:28 2014 +0100 @@ -242,7 +242,7 @@ typedef Hashtable KlassHashtable; typedef HashtableEntry KlassHashtableEntry; typedef TwoOopHashtable SymbolTwoOopHashtable; -typedef BinaryTreeDictionary MetablockTreeDictionary; +typedef BinaryTreeDictionary > MetablockTreeDictionary; //-------------------------------------------------------------------------------- // VM_STRUCTS