src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
changeset 48807 fd8ccb37fce9
parent 48468 7cc7de9bf4a4
child 49164 7e958a8ebcd3
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Mon Jan 22 12:04:12 2018 +0100
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Fri Jan 19 17:01:34 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -1201,6 +1201,18 @@
       case BarrierSet::G1SATBCTLogging:
         // With G1, don't generate the call if we statically know that the target in uninitialized
         if (!dest_uninitialized) {
+          Label filtered;
+          Address in_progress(r15_thread, in_bytes(JavaThread::satb_mark_queue_offset() +
+                                                   SATBMarkQueue::byte_offset_of_active()));
+          // Is marking active?
+          if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
+            __ cmpl(in_progress, 0);
+          } else {
+            assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
+            __ cmpb(in_progress, 0);
+          }
+          __ jcc(Assembler::equal, filtered);
+
            __ pusha();                      // push registers
            if (count == c_rarg0) {
              if (addr == c_rarg1) {
@@ -1216,6 +1228,8 @@
            }
            __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), 2);
            __ popa();
+
+           __ bind(filtered);
         }
          break;
       case BarrierSet::CardTableForRS: