--- a/src/hotspot/share/opto/compile.cpp Mon Feb 04 21:42:47 2019 +0100
+++ b/src/hotspot/share/opto/compile.cpp Mon Feb 04 17:35:35 2019 -0800
@@ -3820,6 +3820,11 @@
}
}
+bool Compile::is_compiling_clinit_for(ciKlass* k) {
+ ciMethod* root = method(); // the root method of compilation
+ return root->is_static_initializer() && root->holder() == k; // access in the context of clinit
+}
+
#ifndef PRODUCT
//------------------------------verify_graph_edges---------------------------
// Walk the Graph and verify that there is a one-to-one correspondence