changeset 49352:edb65305d3ac

8195148: Collapse G1SATBCardTableModRefBS and G1SATBCardTableLoggingModRefBS into a single G1BarrierSet Reviewed-by: ehelin, kbarrett
author eosterlund
date Tue, 06 Mar 2018 08:36:44 +0100
parents 14e84a4edb9c
children fde3feaaa4ed 825f006619e5
files src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp src/hotspot/cpu/aarch64/templateTable_aarch64.cpp src/hotspot/cpu/arm/assembler_arm.cpp src/hotspot/cpu/arm/assembler_arm_32.cpp src/hotspot/cpu/arm/assembler_arm_64.cpp src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp src/hotspot/cpu/arm/c1_Runtime1_arm.cpp src/hotspot/cpu/arm/interp_masm_arm.cpp src/hotspot/cpu/arm/macroAssembler_arm.cpp src/hotspot/cpu/arm/stubGenerator_arm.cpp src/hotspot/cpu/arm/templateTable_arm.cpp src/hotspot/cpu/ppc/assembler_ppc.cpp src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp src/hotspot/cpu/ppc/macroAssembler_ppc.cpp src/hotspot/cpu/ppc/stubGenerator_ppc.cpp src/hotspot/cpu/ppc/templateTable_ppc_64.cpp src/hotspot/cpu/s390/assembler_s390.cpp src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp src/hotspot/cpu/s390/c1_Runtime1_s390.cpp src/hotspot/cpu/s390/macroAssembler_s390.cpp src/hotspot/cpu/s390/stubGenerator_s390.cpp src/hotspot/cpu/s390/templateTable_s390.cpp src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp src/hotspot/cpu/sparc/macroAssembler_sparc.cpp src/hotspot/cpu/sparc/stubGenerator_sparc.cpp src/hotspot/cpu/sparc/templateTable_sparc.cpp src/hotspot/cpu/x86/assembler_x86.cpp src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp src/hotspot/cpu/x86/c1_Runtime1_x86.cpp src/hotspot/cpu/x86/macroAssembler_x86.cpp src/hotspot/cpu/x86/stubGenerator_x86_32.cpp src/hotspot/cpu/x86/stubGenerator_x86_64.cpp src/hotspot/cpu/x86/templateTable_x86.cpp src/hotspot/cpu/zero/assembler_zero.cpp src/hotspot/share/c1/c1_LIRGenerator.cpp src/hotspot/share/gc/g1/g1BarrierSet.cpp src/hotspot/share/gc/g1/g1BarrierSet.hpp src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp src/hotspot/share/gc/g1/g1CollectedHeap.cpp src/hotspot/share/gc/g1/g1CollectedHeap.hpp src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp src/hotspot/share/gc/g1/g1ParScanThreadState.hpp src/hotspot/share/gc/g1/g1RemSet.cpp src/hotspot/share/gc/g1/g1RemSet.hpp src/hotspot/share/gc/g1/g1SATBCardTableModRefBS.cpp src/hotspot/share/gc/g1/g1SATBCardTableModRefBS.hpp src/hotspot/share/gc/g1/g1SATBCardTableModRefBS.inline.hpp src/hotspot/share/gc/g1/g1StringDedupTable.cpp src/hotspot/share/gc/g1/satbMarkQueue.cpp src/hotspot/share/gc/shared/barrierSet.inline.hpp src/hotspot/share/gc/shared/barrierSetConfig.hpp src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp src/hotspot/share/jvmci/vmStructs_jvmci.cpp src/hotspot/share/memory/metaspaceShared.cpp src/hotspot/share/oops/access.inline.hpp src/hotspot/share/opto/graphKit.cpp src/hotspot/share/opto/runtime.cpp src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp src/hotspot/share/runtime/jniHandles.cpp src/hotspot/share/runtime/vmStructs.cpp
diffstat 66 files changed, 490 insertions(+), 538 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -33,7 +33,7 @@
 #include "runtime/sharedRuntime.hpp"
 #include "vmreg_aarch64.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif
 
 
--- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -44,8 +44,8 @@
 #include "runtime/vframeArray.hpp"
 #include "vmreg_aarch64.inline.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 
 
@@ -1107,7 +1107,7 @@
         // arg0 : previous value of memory
 
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           __ mov(r0, (int)id);
           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), r0);
           __ should_not_reach_here();
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -48,9 +48,9 @@
 #include "runtime/thread.hpp"
 
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif
 
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -633,7 +633,7 @@
   void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized, RegSet saved_regs) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       // With G1, don't generate the call if we statically know that the target in uninitialized
       if (!dest_uninitialized) {
         __ push(saved_regs, sp);
@@ -680,7 +680,7 @@
     assert_different_registers(start, end, scratch);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
 
         {
           __ push(saved_regs, sp);
--- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -148,7 +148,7 @@
   assert(val == noreg || val == r0, "parameter is just for looks");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         // flatten object address if needed
         if (obj.index() == noreg && obj.offset() == 0) {
--- a/src/hotspot/cpu/arm/assembler_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/assembler_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -43,8 +43,8 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/cpu/arm/assembler_arm_32.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/assembler_arm_32.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -43,8 +43,8 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/cpu/arm/assembler_arm_64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/assembler_arm_64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -43,8 +43,8 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -34,7 +34,7 @@
 #include "utilities/macros.hpp"
 #include "vmreg_arm.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif // INCLUDE_ALL_GCS
 
 #define __ ce->masm()->
--- a/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -43,8 +43,8 @@
 #include "utilities/align.hpp"
 #include "vmreg_arm.inline.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 
 // Note: Rtemp usage is this file should not impact C2 and should be
--- a/src/hotspot/cpu/arm/interp_masm_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/interp_masm_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -43,8 +43,8 @@
 #include "runtime/sharedRuntime.hpp"
 
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -44,9 +44,9 @@
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif
 
--- a/src/hotspot/cpu/arm/stubGenerator_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/stubGenerator_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -2870,7 +2870,7 @@
   void gen_write_ref_array_pre_barrier(Register addr, Register count, int callee_saved_regs) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         assert( addr->encoding() < callee_saved_regs, "addr must be saved");
         assert(count->encoding() < callee_saved_regs, "count must be saved");
@@ -2932,7 +2932,7 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         BLOCK_COMMENT("G1PostBarrier");
         if (addr != R0) {
--- a/src/hotspot/cpu/arm/templateTable_arm.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/arm/templateTable_arm.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -193,7 +193,7 @@
   assert_different_registers(obj.base(), new_val, tmp1, tmp2, tmp3, noreg);
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         // flatten object address if needed
         assert (obj.mode() == basic_offset, "pre- or post-indexing is not supported here");
--- a/src/hotspot/cpu/ppc/assembler_ppc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/ppc/assembler_ppc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -38,8 +38,8 @@
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -34,7 +34,7 @@
 #include "utilities/macros.hpp"
 #include "vmreg_ppc.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif // INCLUDE_ALL_GCS
 
 #define __ ce->masm()->
--- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -43,8 +43,8 @@
 #include "utilities/macros.hpp"
 #include "vmreg_ppc.inline.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 
 // Implementation of StubAssembler
@@ -711,7 +711,7 @@
     case g1_pre_barrier_slow_id:
       {
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           goto unimplemented_entry;
         }
 
@@ -788,7 +788,7 @@
   case g1_post_barrier_slow_id:
     {
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           goto unimplemented_entry;
         }
 
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -44,9 +44,9 @@
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 #ifdef COMPILER2
@@ -3171,8 +3171,8 @@
   Label& filtered = (filtered_ext != NULL) ? *filtered_ext : filtered_int;
   assert_different_registers(Rstore_addr, Rnew_val, Rtmp1, Rtmp2);
 
-  G1SATBCardTableLoggingModRefBS* bs =
-    barrier_set_cast<G1SATBCardTableLoggingModRefBS>(Universe::heap()->barrier_set());
+  G1BarrierSet* bs =
+    barrier_set_cast<G1BarrierSet>(Universe::heap()->barrier_set());
   CardTable* ct = bs->card_table();
 
   // Does store cross heap regions?
--- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -627,7 +627,7 @@
                                        Register preserve1 = noreg, Register preserve2 = noreg) {
     BarrierSet* const bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
           int spill_slots = 3;
@@ -689,7 +689,7 @@
     BarrierSet* const bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         {
           int spill_slots = (preserve != noreg) ? 1 : 0;
           const int frame_size = align_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);
--- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -64,7 +64,7 @@
 
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         // Load and record the previous value.
         __ g1_write_barrier_pre(Rbase, offset,
--- a/src/hotspot/cpu/s390/assembler_s390.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/s390/assembler_s390.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -39,8 +39,8 @@
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif
 
--- a/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2016 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -35,7 +35,7 @@
 #include "utilities/macros.hpp"
 #include "vmreg_s390.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif // INCLUDE_ALL_GCS
 
 #define __ ce->masm()->
--- a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -43,8 +43,8 @@
 #include "vmreg_s390.inline.hpp"
 #include "registerSaver_s390.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 
 // Implementation of StubAssembler
@@ -768,7 +768,7 @@
       { // Z_R1_scratch: previous value of memory
 
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           __ should_not_reach_here(FILE_AND_LINE);
           break;
         }
@@ -837,7 +837,7 @@
     case g1_post_barrier_slow_id:
       { // Z_R1_scratch: oop address, address of updated memory slot
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           __ should_not_reach_here(FILE_AND_LINE);
           break;
         }
--- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -51,9 +51,9 @@
 #include "utilities/events.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif
 
@@ -3709,9 +3709,9 @@
 
   assert_different_registers(Rstore_addr, Rnew_val, Rtmp1, Rtmp2); // Most probably, Rnew_val == Rtmp3.
 
-  G1SATBCardTableModRefBS* bs = (G1SATBCardTableModRefBS*) Universe::heap()->barrier_set();
+  G1BarrierSet* bs = barrier_set_cast<G1BarrierSet>(Universe::heap()->barrier_set());
   CardTable* ct = bs->card_table();
-  assert(bs->kind() == BarrierSet::G1SATBCTLogging, "wrong barrier");
+  assert(bs->kind() == BarrierSet::G1BarrierSet, "wrong barrier");
 
   BLOCK_COMMENT("g1_write_barrier_post {");
 
--- a/src/hotspot/cpu/s390/stubGenerator_s390.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/s390/stubGenerator_s390.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -697,7 +697,7 @@
 
     BarrierSet* const bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         // With G1, don't generate the call if we statically know that the target is uninitialized.
         if (!dest_uninitialized) {
           // Is marking active?
@@ -742,7 +742,7 @@
   void gen_write_ref_array_post_barrier(Register addr, Register count, bool branchToEnd) {
     BarrierSet* const bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         {
           if (branchToEnd) {
             assert_different_registers(addr,  Z_R0_scratch);  // would be destroyed by push_frame()
--- a/src/hotspot/cpu/s390/templateTable_s390.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/s390/templateTable_s390.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -206,7 +206,7 @@
   __ verify_oop(val);
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
 #ifdef ASSERT
         if (val_is_null) { // Check if the flag setting reflects reality.
--- a/src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -33,7 +33,7 @@
 #include "utilities/macros.hpp"
 #include "vmreg_sparc.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif // INCLUDE_ALL_GCS
 
 #define __ ce->masm()->
--- a/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -41,8 +41,8 @@
 #include "utilities/align.hpp"
 #include "vmreg_sparc.inline.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 
 // Implementation of StubAssembler
@@ -762,7 +762,7 @@
     case g1_pre_barrier_slow_id:
       { // G4: previous value of memory
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           __ save_frame(0);
           __ set((int)id, O1);
           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);
@@ -833,7 +833,7 @@
     case g1_post_barrier_slow_id:
       {
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           __ save_frame(0);
           __ set((int)id, O1);
           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);
--- a/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -46,9 +46,9 @@
 #include "utilities/align.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 #ifdef COMPILER2
@@ -3665,8 +3665,8 @@
 
   if (new_val == G0) return;
 
-  G1SATBCardTableLoggingModRefBS* bs =
-    barrier_set_cast<G1SATBCardTableLoggingModRefBS>(Universe::heap()->barrier_set());
+  G1BarrierSet* bs =
+    barrier_set_cast<G1BarrierSet>(Universe::heap()->barrier_set());
   CardTable* ct = bs->card_table();
 
   if (G1RSBarrierRegionFilter) {
@@ -3706,8 +3706,8 @@
   if (heap->kind() == CollectedHeap::G1CollectedHeap) {
     // Only needed for G1
     if (dirty_card_log_enqueue == 0) {
-      G1SATBCardTableLoggingModRefBS* bs =
-        barrier_set_cast<G1SATBCardTableLoggingModRefBS>(heap->barrier_set());
+      G1BarrierSet* bs =
+        barrier_set_cast<G1BarrierSet>(heap->barrier_set());
       CardTable *ct = bs->card_table();
       generate_dirty_card_log_enqueue(ct->byte_map_base());
       assert(dirty_card_log_enqueue != 0, "postcondition.");
--- a/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -836,7 +836,7 @@
   void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
           Register tmp = O5;
@@ -898,7 +898,7 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
 
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         {
           // Get some new fresh output registers.
           __ save_frame(0);
--- a/src/hotspot/cpu/sparc/templateTable_sparc.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/sparc/templateTable_sparc.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -55,7 +55,7 @@
   assert(index == noreg || offset == 0, "only one offset");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         // Load and record the previous value.
         __ g1_write_barrier_pre(base, index, offset,
--- a/src/hotspot/cpu/x86/assembler_x86.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/assembler_x86.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -38,8 +38,8 @@
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -34,7 +34,7 @@
 #include "utilities/macros.hpp"
 #include "vmreg_x86.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif // INCLUDE_ALL_GCS
 
 
--- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -42,8 +42,8 @@
 #include "utilities/macros.hpp"
 #include "vmreg_x86.inline.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 
 
@@ -1563,7 +1563,7 @@
         // arg0 : previous value of memory
 
         BarrierSet* bs = Universe::heap()->barrier_set();
-        if (bs->kind() != BarrierSet::G1SATBCTLogging) {
+        if (bs->kind() != BarrierSet::G1BarrierSet) {
           __ movptr(rax, (int)id);
           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax);
           __ should_not_reach_here();
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -46,9 +46,9 @@
 #include "runtime/thread.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 #include "crc32c.h"
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -678,8 +678,7 @@
     assert_different_registers(start, count);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-#if INCLUDE_ALL_GCS
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!uninitialized_target) {
           Register thread = rax;
@@ -728,8 +727,7 @@
     BarrierSet* bs = Universe::heap()->barrier_set();
     assert_different_registers(start, count);
     switch (bs->kind()) {
-#if INCLUDE_ALL_GCS
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         {
           __ pusha();                      // push registers
           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post),
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1201,7 +1201,7 @@
   void  gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
           Label filtered;
@@ -1257,7 +1257,7 @@
     assert_different_registers(start, count, scratch);
     BarrierSet* bs = Universe::heap()->barrier_set();
     switch (bs->kind()) {
-      case BarrierSet::G1SATBCTLogging:
+      case BarrierSet::G1BarrierSet:
         {
           __ pusha();             // push registers (overkill)
           if (c_rarg0 == count) { // On win64 c_rarg0 == rcx
--- a/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/x86/templateTable_x86.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -154,7 +154,7 @@
   assert(val == noreg || val == rax, "parameter is just for looks");
   switch (barrier) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       {
         // flatten object address if needed
         // We do it regardless of precise because we need the registers
--- a/src/hotspot/cpu/zero/assembler_zero.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/cpu/zero/assembler_zero.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -38,8 +38,8 @@
 #include "runtime/stubRoutines.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif // INCLUDE_ALL_GCS
 
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -1459,7 +1459,7 @@
   // Do the pre-write barrier, if any.
   switch (_bs->kind()) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info);
       break;
 #endif // INCLUDE_ALL_GCS
@@ -1475,7 +1475,7 @@
 void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
   switch (_bs->kind()) {
 #if INCLUDE_ALL_GCS
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       G1SATBCardTableModRef_post_barrier(addr,  new_val);
       break;
 #endif // INCLUDE_ALL_GCS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2001, 2018, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1BarrierSet.inline.hpp"
+#include "gc/g1/g1CardTable.inline.hpp"
+#include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/heapRegion.hpp"
+#include "gc/g1/satbMarkQueue.hpp"
+#include "logging/log.hpp"
+#include "oops/oop.inline.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "runtime/thread.inline.hpp"
+
+G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
+  CardTableModRefBS(card_table, BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)),
+  _dcqs(JavaThread::dirty_card_queue_set())
+{ }
+
+void G1BarrierSet::enqueue(oop pre_val) {
+  // Nulls should have been already filtered.
+  assert(oopDesc::is_oop(pre_val, true), "Error");
+
+  if (!JavaThread::satb_mark_queue_set().is_active()) return;
+  Thread* thr = Thread::current();
+  if (thr->is_Java_thread()) {
+    JavaThread* jt = (JavaThread*)thr;
+    jt->satb_mark_queue().enqueue(pre_val);
+  } else {
+    MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag);
+    JavaThread::satb_mark_queue_set().shared_satb_queue()->enqueue(pre_val);
+  }
+}
+
+template <class T> void
+G1BarrierSet::write_ref_array_pre_work(T* dst, int count) {
+  if (!JavaThread::satb_mark_queue_set().is_active()) return;
+  T* elem_ptr = dst;
+  for (int i = 0; i < count; i++, elem_ptr++) {
+    T heap_oop = oopDesc::load_heap_oop(elem_ptr);
+    if (!oopDesc::is_null(heap_oop)) {
+      enqueue(oopDesc::decode_heap_oop_not_null(heap_oop));
+    }
+  }
+}
+
+void G1BarrierSet::write_ref_array_pre(oop* dst, int count, bool dest_uninitialized) {
+  if (!dest_uninitialized) {
+    write_ref_array_pre_work(dst, count);
+  }
+}
+
+void G1BarrierSet::write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) {
+  if (!dest_uninitialized) {
+    write_ref_array_pre_work(dst, count);
+  }
+}
+
+void G1BarrierSet::write_ref_field_post_slow(volatile jbyte* byte) {
+  // In the slow path, we know a card is not young
+  assert(*byte != G1CardTable::g1_young_card_val(), "slow path invoked without filtering");
+  OrderAccess::storeload();
+  if (*byte != G1CardTable::dirty_card_val()) {
+    *byte = G1CardTable::dirty_card_val();
+    Thread* thr = Thread::current();
+    if (thr->is_Java_thread()) {
+      JavaThread* jt = (JavaThread*)thr;
+      jt->dirty_card_queue().enqueue(byte);
+    } else {
+      MutexLockerEx x(Shared_DirtyCardQ_lock,
+                      Mutex::_no_safepoint_check_flag);
+      _dcqs.shared_dirty_card_queue()->enqueue(byte);
+    }
+  }
+}
+
+void G1BarrierSet::invalidate(MemRegion mr) {
+  if (mr.is_empty()) {
+    return;
+  }
+  volatile jbyte* byte = _card_table->byte_for(mr.start());
+  jbyte* last_byte = _card_table->byte_for(mr.last());
+  Thread* thr = Thread::current();
+    // skip all consecutive young cards
+  for (; byte <= last_byte && *byte == G1CardTable::g1_young_card_val(); byte++);
+
+  if (byte <= last_byte) {
+    OrderAccess::storeload();
+    // Enqueue if necessary.
+    if (thr->is_Java_thread()) {
+      JavaThread* jt = (JavaThread*)thr;
+      for (; byte <= last_byte; byte++) {
+        if (*byte == G1CardTable::g1_young_card_val()) {
+          continue;
+        }
+        if (*byte != G1CardTable::dirty_card_val()) {
+          *byte = G1CardTable::dirty_card_val();
+          jt->dirty_card_queue().enqueue(byte);
+        }
+      }
+    } else {
+      MutexLockerEx x(Shared_DirtyCardQ_lock,
+                      Mutex::_no_safepoint_check_flag);
+      for (; byte <= last_byte; byte++) {
+        if (*byte == G1CardTable::g1_young_card_val()) {
+          continue;
+        }
+        if (*byte != G1CardTable::dirty_card_val()) {
+          *byte = G1CardTable::dirty_card_val();
+          _dcqs.shared_dirty_card_queue()->enqueue(byte);
+        }
+      }
+    }
+  }
+}
+
+void G1BarrierSet::on_thread_attach(JavaThread* thread) {
+  // This method initializes the SATB and dirty card queues before a
+  // JavaThread is added to the Java thread list. Right now, we don't
+  // have to do anything to the dirty card queue (it should have been
+  // activated when the thread was created), but we have to activate
+  // the SATB queue if the thread is created while a marking cycle is
+  // in progress. The activation / de-activation of the SATB queues at
+  // the beginning / end of a marking cycle is done during safepoints
+  // so we have to make sure this method is called outside one to be
+  // able to safely read the active field of the SATB queue set. Right
+  // now, it is called just before the thread is added to the Java
+  // thread list in the Threads::add() method. That method is holding
+  // the Threads_lock which ensures we are outside a safepoint. We
+  // cannot do the obvious and set the active field of the SATB queue
+  // when the thread is created given that, in some cases, safepoints
+  // might happen between the JavaThread constructor being called and the
+  // thread being added to the Java thread list (an example of this is
+  // when the structure for the DestroyJavaVM thread is created).
+  assert(!SafepointSynchronize::is_at_safepoint(), "We should not be at a safepoint");
+  assert(!thread->satb_mark_queue().is_active(), "SATB queue should not be active");
+  assert(thread->satb_mark_queue().is_empty(), "SATB queue should be empty");
+  assert(thread->dirty_card_queue().is_active(), "Dirty card queue should be active");
+
+  // If we are creating the thread during a marking cycle, we should
+  // set the active field of the SATB queue to true.
+  if (thread->satb_mark_queue_set().is_active()) {
+    thread->satb_mark_queue().set_active(true);
+  }
+}
+
+void G1BarrierSet::on_thread_detach(JavaThread* thread) {
+  // Flush any deferred card marks, SATB buffers and dirty card queue buffers
+  CardTableModRefBS::on_thread_detach(thread);
+  thread->satb_mark_queue().flush();
+  thread->dirty_card_queue().flush();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2001, 2018, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1BARRIERSET_HPP
+#define SHARE_VM_GC_G1_G1BARRIERSET_HPP
+
+#include "gc/shared/cardTableModRefBS.hpp"
+
+class DirtyCardQueueSet;
+class CardTable;
+class G1CardTable;
+
+// This barrier is specialized to use a logging barrier to support
+// snapshot-at-the-beginning marking.
+
+class G1BarrierSet: public CardTableModRefBS {
+  friend class VMStructs;
+ private:
+  DirtyCardQueueSet& _dcqs;
+
+ public:
+  G1BarrierSet(G1CardTable* table);
+  ~G1BarrierSet() { }
+
+  // Add "pre_val" to a set of objects that may have been disconnected from the
+  // pre-marking object graph.
+  static void enqueue(oop pre_val);
+
+  static void enqueue_if_weak_or_archive(DecoratorSet decorators, oop value);
+
+  template <class T> void write_ref_array_pre_work(T* dst, int count);
+  virtual void write_ref_array_pre(oop* dst, int count, bool dest_uninitialized);
+  virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized);
+
+  template <DecoratorSet decorators, typename T>
+  void write_ref_field_pre(T* field);
+
+  // NB: if you do a whole-heap invalidation, the "usual invariant" defined
+  // above no longer applies.
+  void invalidate(MemRegion mr);
+
+  void write_region(MemRegion mr)         { invalidate(mr); }
+  void write_ref_array_work(MemRegion mr) { invalidate(mr); }
+
+  template <DecoratorSet decorators, typename T>
+  void write_ref_field_post(T* field, oop new_val);
+  void write_ref_field_post_slow(volatile jbyte* byte);
+
+  virtual void on_thread_attach(JavaThread* thread);
+  virtual void on_thread_detach(JavaThread* thread);
+
+  // Callbacks for runtime accesses.
+  template <DecoratorSet decorators, typename BarrierSetT = G1BarrierSet>
+  class AccessBarrier: public ModRefBarrierSet::AccessBarrier<decorators, BarrierSetT> {
+    typedef ModRefBarrierSet::AccessBarrier<decorators, BarrierSetT> ModRef;
+    typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
+
+  public:
+    // Needed for loads on non-heap weak references
+    template <typename T>
+    static oop oop_load_not_in_heap(T* addr);
+
+    // Needed for non-heap stores
+    template <typename T>
+    static void oop_store_not_in_heap(T* addr, oop new_value);
+
+    // Needed for weak references
+    static oop oop_load_in_heap_at(oop base, ptrdiff_t offset);
+
+    // Defensive: will catch weak oops at addresses in heap
+    template <typename T>
+    static oop oop_load_in_heap(T* addr);
+  };
+};
+
+template<>
+struct BarrierSet::GetName<G1BarrierSet> {
+  static const BarrierSet::Name value = BarrierSet::G1BarrierSet;
+};
+
+template<>
+struct BarrierSet::GetType<BarrierSet::G1BarrierSet> {
+  typedef ::G1BarrierSet type;
+};
+
+#endif // SHARE_VM_GC_G1_G1BARRIERSET_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2016, 2018, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1BARRIERSET_INLINE_HPP
+#define SHARE_VM_GC_G1_G1BARRIERSET_INLINE_HPP
+
+#include "gc/g1/g1BarrierSet.hpp"
+#include "gc/g1/g1CardTable.hpp"
+#include "gc/shared/accessBarrierSupport.inline.hpp"
+#include "oops/oop.inline.hpp"
+
+template <DecoratorSet decorators, typename T>
+inline void G1BarrierSet::write_ref_field_pre(T* field) {
+  if (HasDecorator<decorators, AS_DEST_NOT_INITIALIZED>::value ||
+      HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
+    return;
+  }
+
+  T heap_oop = RawAccess<MO_VOLATILE>::oop_load(field);
+  if (!oopDesc::is_null(heap_oop)) {
+    enqueue(oopDesc::decode_heap_oop_not_null(heap_oop));
+  }
+}
+
+template <DecoratorSet decorators, typename T>
+inline void G1BarrierSet::write_ref_field_post(T* field, oop new_val) {
+  volatile jbyte* byte = _card_table->byte_for(field);
+  if (*byte != G1CardTable::g1_young_card_val()) {
+    // Take a slow path for cards in old
+    write_ref_field_post_slow(byte);
+  }
+}
+
+inline void G1BarrierSet::enqueue_if_weak_or_archive(DecoratorSet decorators, oop value) {
+  assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
+  // Archive roots need to be enqueued since they add subgraphs to the
+  // Java heap that were not there at the snapshot when marking started.
+  // Weak and phantom references also need enqueueing for similar reasons.
+  const bool in_archive_root   = (decorators & IN_ARCHIVE_ROOT) != 0;
+  const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
+  const bool peek              = (decorators & AS_NO_KEEPALIVE) != 0;
+  const bool needs_enqueue     = in_archive_root || (!peek && !on_strong_oop_ref);
+
+  if (needs_enqueue && value != NULL) {
+    enqueue(value);
+  }
+}
+
+template <DecoratorSet decorators, typename BarrierSetT>
+template <typename T>
+inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
+oop_load_not_in_heap(T* addr) {
+  oop value = ModRef::oop_load_not_in_heap(addr);
+  enqueue_if_weak_or_archive(decorators, value);
+  return value;
+}
+
+template <DecoratorSet decorators, typename BarrierSetT>
+template <typename T>
+inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
+oop_load_in_heap(T* addr) {
+  oop value = ModRef::oop_load_in_heap(addr);
+  enqueue_if_weak_or_archive(decorators, value);
+  return value;
+}
+
+template <DecoratorSet decorators, typename BarrierSetT>
+inline oop G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
+oop_load_in_heap_at(oop base, ptrdiff_t offset) {
+  oop value = ModRef::oop_load_in_heap_at(base, offset);
+  enqueue_if_weak_or_archive(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
+  return value;
+}
+
+template <DecoratorSet decorators, typename BarrierSetT>
+template <typename T>
+inline void G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
+oop_store_not_in_heap(T* addr, oop new_value) {
+  if (HasDecorator<decorators, IN_CONCURRENT_ROOT>::value) {
+    // For roots not scanned in a safepoint, we have to apply SATB barriers
+    // even for roots.
+    G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
+    bs->write_ref_field_pre<decorators>(addr);
+  }
+  Raw::oop_store(addr, new_value);
+}
+
+#endif // SHARE_VM_GC_G1_G1BARRIERSET_INLINE_HPP
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -53,7 +53,6 @@
 #include "gc/g1/g1RemSet.hpp"
 #include "gc/g1/g1RootClosures.hpp"
 #include "gc/g1/g1RootProcessor.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/g1YCTypes.hpp"
 #include "gc/g1/g1YoungRemSetSamplingThread.hpp"
@@ -1606,9 +1605,9 @@
   // Create the barrier set for the entire reserved region.
   G1CardTable* ct = new G1CardTable(reserved_region());
   ct->initialize();
-  G1SATBCardTableLoggingModRefBS* bs = new G1SATBCardTableLoggingModRefBS(ct);
+  G1BarrierSet* bs = new G1BarrierSet(ct);
   bs->initialize();
-  assert(bs->is_a(BarrierSet::G1SATBCTLogging), "sanity");
+  assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
   set_barrier_set(bs);
   _card_table = ct;
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
 
 #include "gc/g1/evacuationInfo.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1BiasedArray.hpp"
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectionSet.hpp"
@@ -39,7 +40,6 @@
 #include "gc/g1/g1HRPrinter.hpp"
 #include "gc/g1/g1InCSetState.hpp"
 #include "gc/g1/g1MonitoringSupport.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/g1SurvivorRegions.hpp"
 #include "gc/g1/g1YCTypes.hpp"
 #include "gc/g1/heapRegionManager.hpp"
@@ -1157,10 +1157,6 @@
 
   virtual bool is_in_closed_subset(const void* p) const;
 
-  G1SATBCardTableLoggingModRefBS* g1_barrier_set() {
-    return barrier_set_cast<G1SATBCardTableLoggingModRefBS>(barrier_set());
-  }
-
   G1HotCardCache* g1_hot_card_cache() const { return _hot_card_cache; }
 
   G1CardTable* card_table() const {
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -25,10 +25,10 @@
 #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
 #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
 
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.hpp"
 #include "gc/g1/g1CollectorState.hpp"
 #include "gc/g1/g1ConcurrentMark.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
 #include "gc/shared/taskqueue.hpp"
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -26,11 +26,11 @@
 #define SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_HPP
 
 #include "gc/g1/dirtyCardQueue.hpp"
+#include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.hpp"
 #include "gc/g1/g1OopClosures.hpp"
 #include "gc/g1/g1Policy.hpp"
 #include "gc/g1/g1RemSet.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/shared/ageTable.hpp"
 #include "memory/allocation.hpp"
 #include "oops/oop.hpp"
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -33,7 +33,6 @@
 #include "gc/g1/g1HotCardCache.hpp"
 #include "gc/g1/g1OopClosures.inline.hpp"
 #include "gc/g1/g1RemSet.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.inline.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
--- a/src/hotspot/share/gc/g1/g1RemSet.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1RemSet.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -45,7 +45,6 @@
 class G1RemSetScanState;
 class G1ParScanThreadState;
 class G1Policy;
-class G1SATBCardTableModRefBS;
 class G1ScanObjsDuringScanRSClosure;
 class G1ScanObjsDuringUpdateRSClosure;
 class HeapRegionClaimer;
--- a/src/hotspot/share/gc/g1/g1SATBCardTableModRefBS.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2001, 2018, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "gc/g1/g1CardTable.inline.hpp"
-#include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.inline.hpp"
-#include "gc/g1/heapRegion.hpp"
-#include "gc/g1/satbMarkQueue.hpp"
-#include "logging/log.hpp"
-#include "oops/oop.inline.hpp"
-#include "runtime/mutexLocker.hpp"
-#include "runtime/thread.inline.hpp"
-
-G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(
-  G1CardTable* card_table,
-  const BarrierSet::FakeRtti& fake_rtti) :
-  CardTableModRefBS(card_table, fake_rtti.add_tag(BarrierSet::G1SATBCT))
-{ }
-
-void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
-  // Nulls should have been already filtered.
-  assert(oopDesc::is_oop(pre_val, true), "Error");
-
-  if (!JavaThread::satb_mark_queue_set().is_active()) return;
-  Thread* thr = Thread::current();
-  if (thr->is_Java_thread()) {
-    JavaThread* jt = (JavaThread*)thr;
-    jt->satb_mark_queue().enqueue(pre_val);
-  } else {
-    MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag);
-    JavaThread::satb_mark_queue_set().shared_satb_queue()->enqueue(pre_val);
-  }
-}
-
-template <class T> void
-G1SATBCardTableModRefBS::write_ref_array_pre_work(T* dst, int count) {
-  if (!JavaThread::satb_mark_queue_set().is_active()) return;
-  T* elem_ptr = dst;
-  for (int i = 0; i < count; i++, elem_ptr++) {
-    T heap_oop = oopDesc::load_heap_oop(elem_ptr);
-    if (!oopDesc::is_null(heap_oop)) {
-      enqueue(oopDesc::decode_heap_oop_not_null(heap_oop));
-    }
-  }
-}
-
-void G1SATBCardTableModRefBS::write_ref_array_pre(oop* dst, int count, bool dest_uninitialized) {
-  if (!dest_uninitialized) {
-    write_ref_array_pre_work(dst, count);
-  }
-}
-
-void G1SATBCardTableModRefBS::write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) {
-  if (!dest_uninitialized) {
-    write_ref_array_pre_work(dst, count);
-  }
-}
-
-G1SATBCardTableLoggingModRefBS::
-G1SATBCardTableLoggingModRefBS(G1CardTable* card_table) :
-  G1SATBCardTableModRefBS(card_table, BarrierSet::FakeRtti(G1SATBCTLogging)),
-  _dcqs(JavaThread::dirty_card_queue_set()) {}
-
-void G1SATBCardTableLoggingModRefBS::write_ref_field_post_slow(volatile jbyte* byte) {
-  // In the slow path, we know a card is not young
-  assert(*byte != G1CardTable::g1_young_card_val(), "slow path invoked without filtering");
-  OrderAccess::storeload();
-  if (*byte != G1CardTable::dirty_card_val()) {
-    *byte = G1CardTable::dirty_card_val();
-    Thread* thr = Thread::current();
-    if (thr->is_Java_thread()) {
-      JavaThread* jt = (JavaThread*)thr;
-      jt->dirty_card_queue().enqueue(byte);
-    } else {
-      MutexLockerEx x(Shared_DirtyCardQ_lock,
-                      Mutex::_no_safepoint_check_flag);
-      _dcqs.shared_dirty_card_queue()->enqueue(byte);
-    }
-  }
-}
-
-void G1SATBCardTableLoggingModRefBS::invalidate(MemRegion mr) {
-  if (mr.is_empty()) {
-    return;
-  }
-  volatile jbyte* byte = _card_table->byte_for(mr.start());
-  jbyte* last_byte = _card_table->byte_for(mr.last());
-  Thread* thr = Thread::current();
-    // skip all consecutive young cards
-  for (; byte <= last_byte && *byte == G1CardTable::g1_young_card_val(); byte++);
-
-  if (byte <= last_byte) {
-    OrderAccess::storeload();
-    // Enqueue if necessary.
-    if (thr->is_Java_thread()) {
-      JavaThread* jt = (JavaThread*)thr;
-      for (; byte <= last_byte; byte++) {
-        if (*byte == G1CardTable::g1_young_card_val()) {
-          continue;
-        }
-        if (*byte != G1CardTable::dirty_card_val()) {
-          *byte = G1CardTable::dirty_card_val();
-          jt->dirty_card_queue().enqueue(byte);
-        }
-      }
-    } else {
-      MutexLockerEx x(Shared_DirtyCardQ_lock,
-                      Mutex::_no_safepoint_check_flag);
-      for (; byte <= last_byte; byte++) {
-        if (*byte == G1CardTable::g1_young_card_val()) {
-          continue;
-        }
-        if (*byte != G1CardTable::dirty_card_val()) {
-          *byte = G1CardTable::dirty_card_val();
-          _dcqs.shared_dirty_card_queue()->enqueue(byte);
-        }
-      }
-    }
-  }
-}
-
-void G1SATBCardTableLoggingModRefBS::on_thread_attach(JavaThread* thread) {
-  // This method initializes the SATB and dirty card queues before a
-  // JavaThread is added to the Java thread list. Right now, we don't
-  // have to do anything to the dirty card queue (it should have been
-  // activated when the thread was created), but we have to activate
-  // the SATB queue if the thread is created while a marking cycle is
-  // in progress. The activation / de-activation of the SATB queues at
-  // the beginning / end of a marking cycle is done during safepoints
-  // so we have to make sure this method is called outside one to be
-  // able to safely read the active field of the SATB queue set. Right
-  // now, it is called just before the thread is added to the Java
-  // thread list in the Threads::add() method. That method is holding
-  // the Threads_lock which ensures we are outside a safepoint. We
-  // cannot do the obvious and set the active field of the SATB queue
-  // when the thread is created given that, in some cases, safepoints
-  // might happen between the JavaThread constructor being called and the
-  // thread being added to the Java thread list (an example of this is
-  // when the structure for the DestroyJavaVM thread is created).
-  assert(!SafepointSynchronize::is_at_safepoint(), "We should not be at a safepoint");
-  assert(!thread->satb_mark_queue().is_active(), "SATB queue should not be active");
-  assert(thread->satb_mark_queue().is_empty(), "SATB queue should be empty");
-  assert(thread->dirty_card_queue().is_active(), "Dirty card queue should be active");
-
-  // If we are creating the thread during a marking cycle, we should
-  // set the active field of the SATB queue to true.
-  if (thread->satb_mark_queue_set().is_active()) {
-    thread->satb_mark_queue().set_active(true);
-  }
-}
-
-void G1SATBCardTableLoggingModRefBS::on_thread_detach(JavaThread* thread) {
-  // Flush any deferred card marks, SATB buffers and dirty card queue buffers
-  CardTableModRefBS::on_thread_detach(thread);
-  thread->satb_mark_queue().flush();
-  thread->dirty_card_queue().flush();
-}
--- a/src/hotspot/share/gc/g1/g1SATBCardTableModRefBS.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2001, 2018, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_HPP
-#define SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_HPP
-
-#include "gc/g1/g1RegionToSpaceMapper.hpp"
-#include "gc/shared/cardTableModRefBS.hpp"
-#include "memory/memRegion.hpp"
-#include "oops/oop.hpp"
-#include "utilities/macros.hpp"
-
-class DirtyCardQueueSet;
-class G1SATBCardTableLoggingModRefBS;
-class CardTable;
-class G1CardTable;
-
-// This barrier is specialized to use a logging barrier to support
-// snapshot-at-the-beginning marking.
-
-class G1SATBCardTableModRefBS: public CardTableModRefBS {
-  friend class VMStructs;
-protected:
-  G1SATBCardTableModRefBS(G1CardTable* table, const BarrierSet::FakeRtti& fake_rtti);
-  ~G1SATBCardTableModRefBS() { }
-
-public:
-  // Add "pre_val" to a set of objects that may have been disconnected from the
-  // pre-marking object graph.
-  static void enqueue(oop pre_val);
-
-  static void enqueue_if_weak_or_archive(DecoratorSet decorators, oop value);
-
-  template <class T> void write_ref_array_pre_work(T* dst, int count);
-  virtual void write_ref_array_pre(oop* dst, int count, bool dest_uninitialized);
-  virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized);
-
-  template <DecoratorSet decorators, typename T>
-  void write_ref_field_pre(T* field);
-};
-
-template<>
-struct BarrierSet::GetName<G1SATBCardTableModRefBS> {
-  static const BarrierSet::Name value = BarrierSet::G1SATBCT;
-};
-
-template<>
-struct BarrierSet::GetType<BarrierSet::G1SATBCT> {
-  typedef G1SATBCardTableModRefBS type;
-};
-
-// Adds card-table logging to the post-barrier.
-// Usual invariant: all dirty cards are logged in the DirtyCardQueueSet.
-class G1SATBCardTableLoggingModRefBS: public G1SATBCardTableModRefBS {
- private:
-  DirtyCardQueueSet& _dcqs;
-
- public:
-  G1SATBCardTableLoggingModRefBS(G1CardTable* card_table);
-
-  // NB: if you do a whole-heap invalidation, the "usual invariant" defined
-  // above no longer applies.
-  void invalidate(MemRegion mr);
-
-  void write_region(MemRegion mr)         { invalidate(mr); }
-  void write_ref_array_work(MemRegion mr) { invalidate(mr); }
-
-  template <DecoratorSet decorators, typename T>
-  void write_ref_field_post(T* field, oop new_val);
-  void write_ref_field_post_slow(volatile jbyte* byte);
-
-  virtual void on_thread_attach(JavaThread* thread);
-  virtual void on_thread_detach(JavaThread* thread);
-
-  // Callbacks for runtime accesses.
-  template <DecoratorSet decorators, typename BarrierSetT = G1SATBCardTableLoggingModRefBS>
-  class AccessBarrier: public ModRefBarrierSet::AccessBarrier<decorators, BarrierSetT> {
-    typedef ModRefBarrierSet::AccessBarrier<decorators, BarrierSetT> ModRef;
-    typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
-
-  public:
-    // Needed for loads on non-heap weak references
-    template <typename T>
-    static oop oop_load_not_in_heap(T* addr);
-
-    // Needed for non-heap stores
-    template <typename T>
-    static void oop_store_not_in_heap(T* addr, oop new_value);
-
-    // Needed for weak references
-    static oop oop_load_in_heap_at(oop base, ptrdiff_t offset);
-
-    // Defensive: will catch weak oops at addresses in heap
-    template <typename T>
-    static oop oop_load_in_heap(T* addr);
-  };
-};
-
-template<>
-struct BarrierSet::GetName<G1SATBCardTableLoggingModRefBS> {
-  static const BarrierSet::Name value = BarrierSet::G1SATBCTLogging;
-};
-
-template<>
-struct BarrierSet::GetType<BarrierSet::G1SATBCTLogging> {
-  typedef G1SATBCardTableLoggingModRefBS type;
-};
-
-#endif // SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_HPP
--- a/src/hotspot/share/gc/g1/g1SATBCardTableModRefBS.inline.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2016, 2018, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_INLINE_HPP
-#define SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_INLINE_HPP
-
-#include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
-#include "gc/shared/accessBarrierSupport.inline.hpp"
-
-template <DecoratorSet decorators, typename T>
-inline void G1SATBCardTableModRefBS::write_ref_field_pre(T* field) {
-  if (HasDecorator<decorators, AS_DEST_NOT_INITIALIZED>::value ||
-      HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
-    return;
-  }
-
-  T heap_oop = oopDesc::load_heap_oop(field);
-  if (!oopDesc::is_null(heap_oop)) {
-    enqueue(oopDesc::decode_heap_oop_not_null(heap_oop));
-  }
-}
-
-template <DecoratorSet decorators, typename T>
-inline void G1SATBCardTableLoggingModRefBS::write_ref_field_post(T* field, oop new_val) {
-  volatile jbyte* byte = _card_table->byte_for(field);
-  if (*byte != G1CardTable::g1_young_card_val()) {
-    // Take a slow path for cards in old
-    write_ref_field_post_slow(byte);
-  }
-}
-
-inline void G1SATBCardTableModRefBS::enqueue_if_weak_or_archive(DecoratorSet decorators, oop value) {
-  assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
-  // Archive roots need to be enqueued since they add subgraphs to the
-  // Java heap that were not there at the snapshot when marking started.
-  // Weak and phantom references also need enqueueing for similar reasons.
-  const bool in_archive_root   = (decorators & IN_ARCHIVE_ROOT) != 0;
-  const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
-  const bool peek              = (decorators & AS_NO_KEEPALIVE) != 0;
-  const bool needs_enqueue     = in_archive_root || (!peek && !on_strong_oop_ref);
-
-  if (needs_enqueue && value != NULL) {
-    enqueue(value);
-  }
-}
-
-template <DecoratorSet decorators, typename BarrierSetT>
-template <typename T>
-inline oop G1SATBCardTableLoggingModRefBS::AccessBarrier<decorators, BarrierSetT>::
-oop_load_not_in_heap(T* addr) {
-  oop value = ModRef::oop_load_not_in_heap(addr);
-  enqueue_if_weak_or_archive(decorators, value);
-  return value;
-}
-
-template <DecoratorSet decorators, typename BarrierSetT>
-template <typename T>
-inline oop G1SATBCardTableLoggingModRefBS::AccessBarrier<decorators, BarrierSetT>::
-oop_load_in_heap(T* addr) {
-  oop value = ModRef::oop_load_in_heap(addr);
-  enqueue_if_weak_or_archive(decorators, value);
-  return value;
-}
-
-template <DecoratorSet decorators, typename BarrierSetT>
-inline oop G1SATBCardTableLoggingModRefBS::AccessBarrier<decorators, BarrierSetT>::
-oop_load_in_heap_at(oop base, ptrdiff_t offset) {
-  oop value = ModRef::oop_load_in_heap_at(base, offset);
-  enqueue_if_weak_or_archive(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset), value);
-  return value;
-}
-
-template <DecoratorSet decorators, typename BarrierSetT>
-template <typename T>
-inline void G1SATBCardTableLoggingModRefBS::AccessBarrier<decorators, BarrierSetT>::
-oop_store_not_in_heap(T* addr, oop new_value) {
-  if (HasDecorator<decorators, IN_CONCURRENT_ROOT>::value) {
-    // For roots not scanned in a safepoint, we have to apply SATB barriers
-    // even for roots.
-    G1SATBCardTableLoggingModRefBS *bs = barrier_set_cast<G1SATBCardTableLoggingModRefBS>(BarrierSet::barrier_set());
-    bs->write_ref_field_pre<decorators>(addr);
-  }
-  Raw::oop_store(addr, new_value);
-}
-
-#endif // SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_INLINE_HPP
--- a/src/hotspot/share/gc/g1/g1StringDedupTable.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1StringDedupTable.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -25,8 +25,8 @@
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
 #include "classfile/javaClasses.inline.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/g1/g1StringDedupTable.hpp"
 #include "gc/shared/gcLocker.hpp"
@@ -383,7 +383,7 @@
   if (existing_value != NULL) {
     // Enqueue the reference to make sure it is kept alive. Concurrent mark might
     // otherwise declare it dead if there are no other strong references to this object.
-    G1SATBCardTableModRefBS::enqueue(existing_value);
+    G1BarrierSet::enqueue(existing_value);
 
     // Existing value found, deduplicate string
     java_lang_String::set_value(java_string, existing_value);
--- a/src/hotspot/share/gc/g1/satbMarkQueue.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/g1/satbMarkQueue.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -40,8 +40,7 @@
   // them with their active field set to false. If a thread is
   // created during a cycle and its SATB queue needs to be activated
   // before the thread starts running, we'll need to set its active
-  // field to true. This is done in G1SATBCardTableLoggingModRefBS::
-  // on_thread_attach().
+  // field to true. This is done in G1SBarrierSet::on_thread_attach().
   PtrQueue(qset, permanent, false /* active */)
 { }
 
--- a/src/hotspot/share/gc/shared/barrierSet.inline.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/shared/barrierSet.inline.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -26,7 +26,6 @@
 #define SHARE_VM_GC_SHARED_BARRIERSET_INLINE_HPP
 
 #include "gc/shared/barrierSet.hpp"
-#include "gc/shared/barrierSetConfig.inline.hpp"
 #include "utilities/align.hpp"
 
 // count is number of array elements being written
--- a/src/hotspot/share/gc/shared/barrierSetConfig.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/shared/barrierSetConfig.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -29,26 +29,18 @@
 
 #if INCLUDE_ALL_GCS
 #define FOR_EACH_CONCRETE_INCLUDE_ALL_GC_BARRIER_SET_DO(f) \
-  f(G1SATBCTLogging)
+  f(G1BarrierSet)
 #else
 #define FOR_EACH_CONCRETE_INCLUDE_ALL_GC_BARRIER_SET_DO(f)
 #endif
 
-#if INCLUDE_ALL_GCS
-#define FOR_EACH_ABSTRACT_INCLUDE_ALL_GC_BARRIER_SET_DO(f) \
-  f(G1SATBCT)
-#else
-#define FOR_EACH_ABSTRACT_INCLUDE_ALL_GC_BARRIER_SET_DO(f)
-#endif
-
 // Do something for each concrete barrier set part of the build.
 #define FOR_EACH_CONCRETE_BARRIER_SET_DO(f)          \
   f(CardTableModRef)                                 \
   FOR_EACH_CONCRETE_INCLUDE_ALL_GC_BARRIER_SET_DO(f)
 
 #define FOR_EACH_ABSTRACT_BARRIER_SET_DO(f)          \
-  f(ModRef)                                          \
-  FOR_EACH_ABSTRACT_INCLUDE_ALL_GC_BARRIER_SET_DO(f)
+  f(ModRef)
 
 // Do something for each known barrier set.
 #define FOR_EACH_BARRIER_SET_DO(f)    \
--- a/src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -31,7 +31,7 @@
 #include "gc/shared/cardTableModRefBS.inline.hpp"
 
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.inline.hpp" // G1 support
+#include "gc/g1/g1BarrierSet.inline.hpp" // G1 support
 #endif
 
 #endif // SHARE_VM_GC_SHARED_BARRIERSETCONFIG_INLINE_HPP
--- a/src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_SHARED_MODREFBARRIERSET_INLINE_HPP
 #define SHARE_VM_GC_SHARED_MODREFBARRIERSET_INLINE_HPP
 
+#include "gc/shared/barrierSet.inline.hpp"
 #include "gc/shared/modRefBarrierSet.hpp"
 #include "oops/klass.inline.hpp"
 #include "oops/objArrayOop.hpp"
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -41,7 +41,8 @@
 #include "runtime/vm_version.hpp"
 
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
+#include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/heapRegion.hpp"
 #endif
 
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -38,7 +38,6 @@
 #if INCLUDE_ALL_GCS
 #include "gc/g1/g1Allocator.inline.hpp"
 #include "gc/g1/g1CollectedHeap.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #endif
 #include "gc/shared/gcLocker.hpp"
 #include "interpreter/bytecodeStream.hpp"
--- a/src/hotspot/share/oops/access.inline.hpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/oops/access.inline.hpp	Tue Mar 06 08:36:44 2018 +0100
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_RUNTIME_ACCESS_INLINE_HPP
 #define SHARE_VM_RUNTIME_ACCESS_INLINE_HPP
 
-#include "gc/shared/barrierSet.inline.hpp"
+#include "gc/shared/barrierSetConfig.inline.hpp"
 #include "metaprogramming/conditional.hpp"
 #include "metaprogramming/isFloatingPoint.hpp"
 #include "metaprogramming/isIntegral.hpp"
--- a/src/hotspot/share/opto/graphKit.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/opto/graphKit.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -25,8 +25,8 @@
 #include "precompiled.hpp"
 #include "ci/ciUtilities.hpp"
 #include "compiler/compileLog.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #include "gc/g1/g1CardTable.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/cardTable.hpp"
@@ -1561,7 +1561,7 @@
   BarrierSet* bs = Universe::heap()->barrier_set();
   set_control(ctl);
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
       break;
 
@@ -1577,7 +1577,7 @@
 bool GraphKit::can_move_pre_barrier() const {
   BarrierSet* bs = Universe::heap()->barrier_set();
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       return true; // Can move it if no safepoint
 
     case BarrierSet::CardTableModRef:
@@ -1600,7 +1600,7 @@
   BarrierSet* bs = Universe::heap()->barrier_set();
   set_control(ctl);
   switch (bs->kind()) {
-    case BarrierSet::G1SATBCTLogging:
+    case BarrierSet::G1BarrierSet:
       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
       break;
 
@@ -4349,7 +4349,7 @@
     // The Object.clone() intrinsic uses this path if !ReduceInitialCardMarks.
     // We don't need a barrier here if the destination is a newly allocated object
     // in Eden. Otherwise, GC verification breaks because we assume that cards in Eden
-    // are set to 'g1_young_gen' (see G1SATBCardTableModRefBS::verify_g1_young_region()).
+    // are set to 'g1_young_gen' (see G1CardTable::verify_g1_young_region()).
     assert(!use_ReduceInitialCardMarks(), "can only happen with card marking");
     Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw);
     __ if_then(card_val, BoolTest::ne, young_card); {
--- a/src/hotspot/share/opto/runtime.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/opto/runtime.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -34,7 +34,6 @@
 #include "code/vtableStubs.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/oopMap.hpp"
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
 #include "gc/g1/heapRegion.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/collectedHeap.hpp"
--- a/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -31,7 +31,7 @@
 #include "runtime/thread.hpp"
 #include "utilities/stack.inline.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif
 
 
@@ -51,7 +51,7 @@
   // might not find the object.
 #if INCLUDE_ALL_GCS
   if (UseG1GC && o != NULL) {
-    G1SATBCardTableModRefBS::enqueue(o);
+    G1BarrierSet::enqueue(o);
   }
 #endif
 }
--- a/src/hotspot/share/runtime/jniHandles.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/runtime/jniHandles.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -34,7 +34,7 @@
 #include "utilities/align.hpp"
 #include "utilities/debug.hpp"
 #if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1BarrierSet.hpp"
 #endif
 
 OopStorage* JNIHandles::_global_handles = NULL;
@@ -153,7 +153,7 @@
   oop result = jweak_ref(handle);
 #if INCLUDE_ALL_GCS
   if (result != NULL && UseG1GC) {
-    G1SATBCardTableModRefBS::enqueue(result);
+    G1BarrierSet::enqueue(result);
   }
 #endif // INCLUDE_ALL_GCS
   return result;
--- a/src/hotspot/share/runtime/vmStructs.cpp	Tue Mar 06 13:08:59 2018 +0100
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Tue Mar 06 08:36:44 2018 +0100
@@ -2237,8 +2237,7 @@
                                                                           \
   declare_constant(BarrierSet::ModRef)                                    \
   declare_constant(BarrierSet::CardTableModRef)                           \
-  declare_constant(BarrierSet::G1SATBCT)                                  \
-  declare_constant(BarrierSet::G1SATBCTLogging)                           \
+  declare_constant(BarrierSet::G1BarrierSet)                              \
                                                                           \
   declare_constant(BOTConstants::LogN)                                    \
   declare_constant(BOTConstants::LogN_words)                              \