< prev index next >

src/hotspot/share/runtime/vframeArray.cpp

Print this page
rev 59865 : 8249192: MonitorInfo stores raw oops across safepoints
Summary: Change raw oops in MonitorInfo to Handles and update Resource/HandleMarks.
Reviewed-by: sspitsyn, dholmes, coleenp, dcubed

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -68,10 +68,13 @@
   _removed_monitors = false;
 #endif
 
   int index;
 
+  {
+    ResourceMark rm;
+    HandleMark hm;
   // Get the monitors off-stack
 
   GrowableArray<MonitorInfo*>* list = vf->monitors();
   if (list->is_empty()) {
     _monitors = NULL;

@@ -93,10 +96,11 @@
         dest->set_obj(monitor->owner());
         monitor->lock()->move_to(monitor->owner(), dest->lock());
       }
     }
   }
+  }
 
   // Convert the vframe locals and expressions to off stack
   // values. Because we will not gc all oops can be converted to
   // intptr_t (i.e. a stack slot) and we are fine. This is
   // good since we are inside a HandleMark and the oops in our
< prev index next >