Blame SOURCES/jdk8237396-avoid_triggering_barriers.patch

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