< prev index next >

src/hotspot/share/gc/g1/g1ParScanThreadState.hpp

Print this page
rev 59232 : [mq]: scan_task

*** 1,7 **** /* ! * Copyright (c) 2014, 2019, 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. --- 1,7 ---- /* ! * Copyright (c) 2014, 2020, 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.
*** 31,40 **** --- 31,41 ---- #include "gc/g1/g1OopClosures.hpp" #include "gc/g1/g1Policy.hpp" #include "gc/g1/g1RemSet.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/ageTable.hpp" + #include "gc/shared/taskqueue.hpp" #include "memory/allocation.hpp" #include "oops/oop.hpp" #include "utilities/ticks.hpp" class G1OopStarChunkedList;
*** 43,53 **** class HeapRegion; class outputStream; class G1ParScanThreadState : public CHeapObj<mtGC> { G1CollectedHeap* _g1h; ! RefToScanQueue* _refs; G1RedirtyCardsQueue _rdcq; G1CardTable* _ct; G1EvacuationRootClosures* _closures; G1PLABAllocator* _plab_allocator; --- 44,54 ---- class HeapRegion; class outputStream; class G1ParScanThreadState : public CHeapObj<mtGC> { G1CollectedHeap* _g1h; ! ScannerTasksQueue* _task_queue; G1RedirtyCardsQueue _rdcq; G1CardTable* _ct; G1EvacuationRootClosures* _closures; G1PLABAllocator* _plab_allocator;
*** 112,130 **** virtual ~G1ParScanThreadState(); void set_ref_discoverer(ReferenceDiscoverer* rd) { _scanner.set_ref_discoverer(rd); } #ifdef ASSERT ! bool queue_is_empty() const { return _refs->is_empty(); } ! bool verify_ref(narrowOop* ref) const; ! bool verify_ref(oop* ref) const; ! bool verify_task(StarTask ref) const; ! #endif // ASSERT ! template <class T> void do_oop_ext(T* ref); ! template <class T> void push_on_queue(T* ref); template <class T> void enqueue_card_if_tracked(G1HeapRegionAttr region_attr, T* p, oop o) { assert(!HeapRegion::is_in_same_region(p, o), "Should have filtered out cross-region references already."); assert(!_g1h->heap_region_containing(p)->is_young(), "Should have filtered out from-young references already."); --- 113,131 ---- virtual ~G1ParScanThreadState(); void set_ref_discoverer(ReferenceDiscoverer* rd) { _scanner.set_ref_discoverer(rd); } #ifdef ASSERT ! bool queue_is_empty() const { return _task_queue->is_empty(); } ! #endif ! void verify_task(narrowOop* task) const NOT_DEBUG_RETURN; ! void verify_task(oop* task) const NOT_DEBUG_RETURN; ! void verify_task(PartialArrayScanTask task) const NOT_DEBUG_RETURN; ! void verify_task(ScannerTask task) const NOT_DEBUG_RETURN; ! void push_on_queue(ScannerTask task); template <class T> void enqueue_card_if_tracked(G1HeapRegionAttr region_attr, T* p, oop o) { assert(!HeapRegion::is_in_same_region(p, o), "Should have filtered out cross-region references already."); assert(!_g1h->heap_region_containing(p)->is_young(), "Should have filtered out from-young references already.");
*** 156,202 **** // Pass locally gathered statistics to global state. Returns the total number of // HeapWords copied. size_t flush(size_t* surviving_young_words); private: ! #define G1_PARTIAL_ARRAY_MASK 0x2 ! ! inline bool has_partial_array_mask(oop* ref) const { ! return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK; ! } ! ! // We never encode partial array oops as narrowOop*, so return false immediately. ! // This allows the compiler to create optimized code when popping references from ! // the work queue. ! inline bool has_partial_array_mask(narrowOop* ref) const { ! assert(((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) != G1_PARTIAL_ARRAY_MASK, "Partial array oop reference encoded as narrowOop*"); ! return false; ! } ! ! // Only implement set_partial_array_mask() for regular oops, not for narrowOops. ! // We always encode partial arrays as regular oop, to allow the ! // specialization for has_partial_array_mask() for narrowOops above. ! // This means that unintentional use of this method with narrowOops are caught ! // by the compiler. ! inline oop* set_partial_array_mask(oop obj) const { ! assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!"); ! return (oop*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK); ! } ! ! inline oop clear_partial_array_mask(oop* ref) const { ! return cast_to_oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK); ! } ! ! inline void do_oop_partial_array(oop* p); // This method is applied to the fields of the objects that have just been copied. template <class T> inline void do_oop_evac(T* p); ! inline void deal_with_reference(oop* ref_to_scan); ! inline void deal_with_reference(narrowOop* ref_to_scan); ! ! inline void dispatch_reference(StarTask ref); // Tries to allocate word_sz in the PLAB of the next "generation" after trying to // allocate into dest. Previous_plab_refill_failed indicates whether previous // PLAB refill for the original (source) object failed. // Returns a non-NULL pointer if successful, and updates dest if required. --- 157,172 ---- // Pass locally gathered statistics to global state. Returns the total number of // HeapWords copied. size_t flush(size_t* surviving_young_words); private: ! inline void do_partial_array(PartialArrayScanTask task); // This method is applied to the fields of the objects that have just been copied. template <class T> inline void do_oop_evac(T* p); ! inline void dispatch_task(ScannerTask task); // Tries to allocate word_sz in the PLAB of the next "generation" after trying to // allocate into dest. Previous_plab_refill_failed indicates whether previous // PLAB refill for the original (source) object failed. // Returns a non-NULL pointer if successful, and updates dest if required.
*** 230,240 **** void trim_queue_partially(); Tickspan trim_ticks() const; void reset_trim_ticks(); ! inline void steal_and_trim_queue(RefToScanQueueSet *task_queues); // An attempt to evacuate "obj" has failed; take necessary steps. oop handle_evacuation_failure_par(oop obj, markWord m); template <typename T> --- 200,210 ---- void trim_queue_partially(); Tickspan trim_ticks() const; void reset_trim_ticks(); ! inline void steal_and_trim_queue(ScannerTasksQueueSet *task_queues); // An attempt to evacuate "obj" has failed; take necessary steps. oop handle_evacuation_failure_par(oop obj, markWord m); template <typename T>
< prev index next >