src/hotspot/share/gc/shared/cardTableModRefBS.inline.hpp
changeset 47609 a1f68e415b48
parent 47216 71c04702a3d5
child 47998 fb0275c320a0
--- a/src/hotspot/share/gc/shared/cardTableModRefBS.inline.hpp	Mon Oct 09 13:56:59 2017 +0200
+++ b/src/hotspot/share/gc/shared/cardTableModRefBS.inline.hpp	Mon Oct 09 14:39:59 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2017, 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
@@ -30,10 +30,10 @@
 #include "runtime/orderAccess.inline.hpp"
 
 template <class T> inline void CardTableModRefBS::inline_write_ref_field(T* field, oop newVal, bool release) {
-  jbyte* byte = byte_for((void*)field);
+  volatile jbyte* byte = byte_for((void*)field);
   if (release) {
     // Perform a releasing store if requested.
-    OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
+    OrderAccess::release_store(byte, jbyte(dirty_card));
   } else {
     *byte = dirty_card;
   }