src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp	Fri Feb 10 17:21:31 2012
--- new/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp	Fri Feb 10 17:21:30 2012

*** 1,7 **** --- 1,7 ---- /* ! * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 26,35 **** --- 26,36 ---- #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" + #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" inline void PSScavenge::save_to_space_top_before_gc() { ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); _to_space_top_before_gc = heap->young_gen()->to_space()->top();
*** 63,81 **** --- 64,82 ---- } // Attempt to "claim" oop at p via CAS, push the new obj if successful // This version tests the oop* to make sure it is within the heap before // attempting marking. ! template <class T, bool promote_immediately> inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, T* p) { assert(should_scavenge(p, true), "revisiting object?"); oop o = oopDesc::load_decode_heap_oop_not_null(p); oop new_obj = o->is_forwarded() ? o->forwardee() ! : pm->copy_to_survivor_space<promote_immediately>(o); oopDesc::encode_store_heap_oop_not_null(p, new_obj); // We cannot mark without test, as some code passes us pointers // that are outside the heap. if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) &&
*** 84,106 **** --- 85,111 ---- card_table()->inline_write_ref_field_gc(p, new_obj); } } } class PSScavengeRootsClosure: public OopClosure { + template<bool promote_immediately> + class PSRootsClosure: public OopClosure { private: PSPromotionManager* _promotion_manager; protected: template <class T> void do_oop_work(T *p) { if (PSScavenge::should_scavenge(p)) { // We never card mark roots, maybe call a func without test? ! PSScavenge::copy_and_push_safe_barrier<T, promote_immediately>(_promotion_manager, p); } } public: ! PSScavengeRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { } ! void do_oop(oop* p) { PSScavengeRootsClosure::do_oop_work(p); } ! void do_oop(narrowOop* p) { PSScavengeRootsClosure::do_oop_work(p); } ! PSRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { } ! void do_oop(oop* p) { PSRootsClosure::do_oop_work(p); } ! void do_oop(narrowOop* p) { PSRootsClosure::do_oop_work(p); } }; + typedef PSRootsClosure</*promote_immediately=*/false> PSScavengeRootsClosure; + typedef PSRootsClosure</*promote_immediately=*/true> PSPromoteRootsClosure; + #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSSCAVENGE_INLINE_HPP

src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File