hotspot/src/share/vm/opto/compile.hpp
changeset 21089 e1986ff6fe2e
parent 20073 bfc95277d42b
child 21099 46e6bbecd9e5
--- a/hotspot/src/share/vm/opto/compile.hpp	Fri Oct 18 12:15:32 2013 -0700
+++ b/hotspot/src/share/vm/opto/compile.hpp	Sat Oct 19 12:16:43 2013 +0200
@@ -425,6 +425,9 @@
   // Expensive nodes list already sorted?
   bool expensive_nodes_sorted() const;
 
+  // Are we within a PreserveJVMState block?
+  int _preserve_jvm_state;
+
  public:
 
   outputStream* print_inlining_stream() const {
@@ -820,7 +823,9 @@
 
   // Decide how to build a call.
   // The profile factor is a discount to apply to this site's interp. profile.
-  CallGenerator*    call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch, JVMState* jvms, bool allow_inline, float profile_factor, bool allow_intrinsics = true, bool delayed_forbidden = false);
+  CallGenerator*    call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch,
+                                   JVMState* jvms, bool allow_inline, float profile_factor, bool allow_intrinsics = true,
+                                   bool delayed_forbidden = false);
   bool should_delay_inlining(ciMethod* call_method, JVMState* jvms) {
     return should_delay_string_inlining(call_method, jvms) ||
            should_delay_boxing_inlining(call_method, jvms);
@@ -1156,6 +1161,21 @@
 
   // Auxiliary method for randomized fuzzing/stressing
   static bool randomized_select(int count);
+
+  // enter a PreserveJVMState block
+  void inc_preserve_jvm_state() {
+    _preserve_jvm_state++;
+  }
+
+  // exit a PreserveJVMState block
+  void dec_preserve_jvm_state() {
+    _preserve_jvm_state--;
+    assert(_preserve_jvm_state >= 0, "_preserve_jvm_state shouldn't be negative");
+  }
+
+  bool has_preserve_jvm_state() const {
+    return _preserve_jvm_state > 0;
+  }
 };
 
 #endif // SHARE_VM_OPTO_COMPILE_HPP