src/hotspot/share/gc/g1/g1ThreadLocalData.hpp
changeset 53747 13acc8e38a29
parent 51441 2e91d927e00c
equal deleted inserted replaced
53746:bdccafc038a2 53747:13acc8e38a29
     1 /*
     1 /*
     2  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    22  */
    22  */
    23 
    23 
    24 #ifndef SHARE_GC_G1_G1THREADLOCALDATA_HPP
    24 #ifndef SHARE_GC_G1_G1THREADLOCALDATA_HPP
    25 #define SHARE_GC_G1_G1THREADLOCALDATA_HPP
    25 #define SHARE_GC_G1_G1THREADLOCALDATA_HPP
    26 
    26 
    27 #include "gc/g1/dirtyCardQueue.hpp"
       
    28 #include "gc/g1/g1BarrierSet.hpp"
    27 #include "gc/g1/g1BarrierSet.hpp"
       
    28 #include "gc/g1/g1DirtyCardQueue.hpp"
    29 #include "gc/shared/satbMarkQueue.hpp"
    29 #include "gc/shared/satbMarkQueue.hpp"
    30 #include "runtime/thread.hpp"
    30 #include "runtime/thread.hpp"
    31 #include "utilities/debug.hpp"
    31 #include "utilities/debug.hpp"
    32 #include "utilities/sizes.hpp"
    32 #include "utilities/sizes.hpp"
    33 
    33 
    34 class G1ThreadLocalData {
    34 class G1ThreadLocalData {
    35 private:
    35 private:
    36   SATBMarkQueue  _satb_mark_queue;
    36   SATBMarkQueue _satb_mark_queue;
    37   DirtyCardQueue _dirty_card_queue;
    37   G1DirtyCardQueue _dirty_card_queue;
    38 
    38 
    39   G1ThreadLocalData() :
    39   G1ThreadLocalData() :
    40       _satb_mark_queue(&G1BarrierSet::satb_mark_queue_set()),
    40       _satb_mark_queue(&G1BarrierSet::satb_mark_queue_set()),
    41       _dirty_card_queue(&G1BarrierSet::dirty_card_queue_set()) {}
    41       _dirty_card_queue(&G1BarrierSet::dirty_card_queue_set()) {}
    42 
    42 
    64 
    64 
    65   static SATBMarkQueue& satb_mark_queue(Thread* thread) {
    65   static SATBMarkQueue& satb_mark_queue(Thread* thread) {
    66     return data(thread)->_satb_mark_queue;
    66     return data(thread)->_satb_mark_queue;
    67   }
    67   }
    68 
    68 
    69   static DirtyCardQueue& dirty_card_queue(Thread* thread) {
    69   static G1DirtyCardQueue& dirty_card_queue(Thread* thread) {
    70     return data(thread)->_dirty_card_queue;
    70     return data(thread)->_dirty_card_queue;
    71   }
    71   }
    72 
    72 
    73   static ByteSize satb_mark_queue_active_offset() {
    73   static ByteSize satb_mark_queue_active_offset() {
    74     return satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active();
    74     return satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active();
    81   static ByteSize satb_mark_queue_buffer_offset() {
    81   static ByteSize satb_mark_queue_buffer_offset() {
    82     return satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_buf();
    82     return satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_buf();
    83   }
    83   }
    84 
    84 
    85   static ByteSize dirty_card_queue_index_offset() {
    85   static ByteSize dirty_card_queue_index_offset() {
    86     return dirty_card_queue_offset() + DirtyCardQueue::byte_offset_of_index();
    86     return dirty_card_queue_offset() + G1DirtyCardQueue::byte_offset_of_index();
    87   }
    87   }
    88 
    88 
    89   static ByteSize dirty_card_queue_buffer_offset() {
    89   static ByteSize dirty_card_queue_buffer_offset() {
    90     return dirty_card_queue_offset() + DirtyCardQueue::byte_offset_of_buf();
    90     return dirty_card_queue_offset() + G1DirtyCardQueue::byte_offset_of_buf();
    91   }
    91   }
    92 };
    92 };
    93 
    93 
    94 #endif // SHARE_GC_G1_G1THREADLOCALDATA_HPP
    94 #endif // SHARE_GC_G1_G1THREADLOCALDATA_HPP