hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
changeset 28830 a252e278c3d9
parent 28217 57791914628c
child 29081 c61eb4914428
equal deleted inserted replaced
28718:6bb984acf342 28830:a252e278c3d9
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2015, 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.
    30 #include "runtime/atomic.inline.hpp"
    30 #include "runtime/atomic.inline.hpp"
    31 #include "runtime/mutexLocker.hpp"
    31 #include "runtime/mutexLocker.hpp"
    32 #include "runtime/orderAccess.inline.hpp"
    32 #include "runtime/orderAccess.inline.hpp"
    33 #include "runtime/thread.inline.hpp"
    33 #include "runtime/thread.inline.hpp"
    34 
    34 
    35 G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap) :
    35 G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
    36     CardTableModRefBS(whole_heap)
    36   CardTableModRefBS(whole_heap, kind) { }
    37 {
       
    38   _kind = G1SATBCT;
       
    39 }
       
    40 
    37 
    41 void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
    38 void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
    42   // Nulls should have been already filtered.
    39   // Nulls should have been already filtered.
    43   assert(pre_val->is_oop(true), "Error");
    40   assert(pre_val->is_oop(true), "Error");
    44 
    41 
   130   _card_table->clear(mr);
   127   _card_table->clear(mr);
   131 }
   128 }
   132 
   129 
   133 G1SATBCardTableLoggingModRefBS::
   130 G1SATBCardTableLoggingModRefBS::
   134 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
   131 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
   135   G1SATBCardTableModRefBS(whole_heap),
   132   G1SATBCardTableModRefBS(whole_heap, BarrierSet::G1SATBCTLogging),
   136   _dcqs(JavaThread::dirty_card_queue_set()),
   133   _dcqs(JavaThread::dirty_card_queue_set()),
   137   _listener()
   134   _listener()
   138 {
   135 {
   139   _kind = G1SATBCTLogging;
       
   140   _listener.set_card_table(this);
   136   _listener.set_card_table(this);
   141 }
   137 }
   142 
   138 
   143 void G1SATBCardTableLoggingModRefBS::initialize(G1RegionToSpaceMapper* mapper) {
   139 void G1SATBCardTableLoggingModRefBS::initialize(G1RegionToSpaceMapper* mapper) {
   144   mapper->set_mapping_changed_listener(&_listener);
   140   mapper->set_mapping_changed_listener(&_listener);