Blame SOURCES/jdk8237396-avoid_triggering_barriers.patch

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