Recent changes added a HandleMark and this function creates Handles to hold oops over GC. It breaks the usual scoping conventions. Since BiasedLocking is default false, we didn't find this in testing. But Thanks to [~hseigel] for finding it.
To reproduce change this test and run.
diff --git a/test/hotspot/jtreg/runtime/7158988/FieldMonitor.java b/test/hotspot/jtreg/runtime/7158988/FieldMonitor.java
--- a/test/hotspot/jtreg/runtime/7158988/FieldMonitor.java
+++ b/test/hotspot/jtreg/runtime/7158988/FieldMonitor.java
@@ -62,7 +62,7 @@
public static final String CLASS_NAME = "TestPostFieldModification";
public static final String FIELD_NAME = "value";
- public static final String ARGUMENTS = "-Xshare:off -Xlog:gc";
+ public static final String ARGUMENTS = "-Xshare:off -Xlog:gc -XX:+UseBiasedLocking";
public static void main(String[] args)
throws IOException, InterruptedException {