< prev index next >

src/hotspot/share/runtime/javaThread.hpp

Print this page
*** 464,10 ***
--- 464,12 ---
    // It's signed for error detection.
    intx _held_monitor_count;  // used by continuations for fast lock detection
    intx _jni_monitor_count;
    ObjectMonitor* _unlocked_inflated_monitor;
  
+   bool _can_call_java;
+ 
  private:
  
    friend class VMThread;
    friend class ThreadWaitTransition;
    friend class VM_Exit;

*** 516,13 ***
    };
    void exit(bool destroy_vm, ExitType exit_type = normal_exit);
  
    void cleanup_failed_attach_current_thread(bool is_daemon);
  
    // Testers
    virtual bool is_Java_thread() const            { return true;  }
!   virtual bool can_call_java() const             { return true; }
  
    virtual bool is_active_Java_thread() const;
  
    // Thread oop. threadObj() can be null for initial JavaThread
    // (or for threads attached via JNI)
--- 518,26 ---
    };
    void exit(bool destroy_vm, ExitType exit_type = normal_exit);
  
    void cleanup_failed_attach_current_thread(bool is_daemon);
  
+   class NoJavaCodeMark : public StackObj {
+     friend JavaThread;
+     JavaThread* _target;
+     bool _orig;
+    public:
+     NoJavaCodeMark(JavaThread* t) : _target(t), _orig(t->_can_call_java) {
+       _target->_can_call_java = false;
+     }
+     ~NoJavaCodeMark() {
+       _target->_can_call_java = _orig;
+     }
+   };
+ 
    // Testers
    virtual bool is_Java_thread() const            { return true;  }
!   virtual bool can_call_java() const             { return _can_call_java; }
  
    virtual bool is_active_Java_thread() const;
  
    // Thread oop. threadObj() can be null for initial JavaThread
    // (or for threads attached via JNI)

*** 971,10 ***
--- 986,12 ---
    // Print current stack trace for checked JNI warnings and JNI fatal errors.
    // This is the external format from above, but selecting the platform
    // or vthread as applicable.
    void print_jni_stack();
  
+   void print_native_stack_on(outputStream* st);
+ 
    // Print stack traces in various internal formats
    void trace_stack()                             PRODUCT_RETURN;
    void trace_stack_from(vframe* start_vf)        PRODUCT_RETURN;
    void trace_frames()                            PRODUCT_RETURN;
  

*** 1153,12 ***
--- 1170,18 ---
    // Track the class we want to initialize but for which we have to wait
    // on its init_lock() because it is already being initialized.
    void set_class_to_be_initialized(InstanceKlass* k);
    InstanceKlass* class_to_be_initialized() const;
  
+   // The most recent active <clinit> invocation is tracked by this variable.
+   // The setter returns the previous value, so it can be restored later if needed.
+   InstanceKlass* set_class_being_initialized(InstanceKlass* k);
+   InstanceKlass* class_being_initialized() const;
+ 
  private:
    InstanceKlass* _class_to_be_initialized;
+   InstanceKlass* _class_being_initialized;
  
    // java.lang.Thread.sleep support
    ParkEvent * _SleepEvent;
  public:
    bool sleep(jlong millis);
< prev index next >