Blame SOURCES/jdk8237396-avoid_triggering_barriers.patch

aa59cc
# HG changeset patch
aa59cc
# User zgu
aa59cc
# Date 1579696811 18000
aa59cc
#      Wed Jan 22 07:40:11 2020 -0500
aa59cc
# Node ID 91ea567eeabeade6b3f8d6cf10c02ba53f700eca
aa59cc
# Parent  082f1d3eb1649ff776cda165ed78d65bc7361ebc
aa59cc
8237396: JvmtiTagMap::weak_oops_do() should not trigger barriers
aa59cc
Reviewed-by: stefank, rkennke
aa59cc
aa59cc
diff --git a/src/hotspot/share/prims/jvmtiTagMap.cpp b/src/hotspot/share/prims/jvmtiTagMap.cpp
aa59cc
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp
aa59cc
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp
aa59cc
@@ -1,5 +1,5 @@
aa59cc
 /*
aa59cc
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
aa59cc
+ * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
aa59cc
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aa59cc
  *
aa59cc
  * This code is free software; you can redistribute it and/or modify it
aa59cc
@@ -96,6 +96,11 @@
aa59cc
   inline oop object_peek()  {
aa59cc
     return NativeAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(object_addr());
aa59cc
   }
aa59cc
+
aa59cc
+  inline oop object_raw() {
aa59cc
+    return RawAccess<>::oop_load(object_addr());
aa59cc
+  }
aa59cc
+
aa59cc
   inline jlong tag() const  { return _tag; }
aa59cc
 
aa59cc
   inline void set_tag(jlong tag) {
aa59cc
@@ -3357,7 +3362,7 @@
aa59cc
       JvmtiTagHashmapEntry* next = entry->next();
aa59cc
 
aa59cc
       // has object been GC'ed
aa59cc
-      if (!is_alive->do_object_b(entry->object_peek())) {
aa59cc
+      if (!is_alive->do_object_b(entry->object_raw())) {
aa59cc
         // grab the tag
aa59cc
         jlong tag = entry->tag();
aa59cc
         guarantee(tag != 0, "checking");
aa59cc
@@ -3375,7 +3380,7 @@
aa59cc
         ++freed;
aa59cc
       } else {
aa59cc
         f->do_oop(entry->object_addr());
aa59cc
-        oop new_oop = entry->object_peek();
aa59cc
+        oop new_oop = entry->object_raw();
aa59cc
 
aa59cc
         // if the object has moved then re-hash it and move its
aa59cc
         // entry to its new location.
aa59cc
@@ -3409,7 +3414,7 @@
aa59cc
   // Re-add all the entries which were kept aside
aa59cc
   while (delayed_add != NULL) {
aa59cc
     JvmtiTagHashmapEntry* next = delayed_add->next();
aa59cc
-    unsigned int pos = JvmtiTagHashmap::hash(delayed_add->object_peek(), size);
aa59cc
+    unsigned int pos = JvmtiTagHashmap::hash(delayed_add->object_raw(), size);
aa59cc
     delayed_add->set_next(table[pos]);
aa59cc
     table[pos] = delayed_add;
aa59cc
     delayed_add = next;