src/share/vm/runtime/thread.hpp

changeset 6911
ce8f6bb717c9
parent 6680
78bbf4d43a14
child 6973
4af19b914f53
     1.1 --- a/src/share/vm/runtime/thread.hpp	Wed Jul 02 22:54:18 2014 +0200
     1.2 +++ b/src/share/vm/runtime/thread.hpp	Tue Apr 29 15:17:27 2014 +0200
     1.3 @@ -436,18 +436,7 @@
     1.4    jlong allocated_bytes()               { return _allocated_bytes; }
     1.5    void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
     1.6    void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
     1.7 -  jlong cooked_allocated_bytes() {
     1.8 -    jlong allocated_bytes = OrderAccess::load_acquire(&_allocated_bytes);
     1.9 -    if (UseTLAB) {
    1.10 -      size_t used_bytes = tlab().used_bytes();
    1.11 -      if ((ssize_t)used_bytes > 0) {
    1.12 -        // More-or-less valid tlab.  The load_acquire above should ensure
    1.13 -        // that the result of the add is <= the instantaneous value
    1.14 -        return allocated_bytes + used_bytes;
    1.15 -      }
    1.16 -    }
    1.17 -    return allocated_bytes;
    1.18 -  }
    1.19 +  inline jlong cooked_allocated_bytes();
    1.20  
    1.21    TRACE_DATA* trace_data()              { return &_trace_data; }
    1.22  
    1.23 @@ -1046,12 +1035,8 @@
    1.24  #else
    1.25    // Use membars when accessing volatile _thread_state. See
    1.26    // Threads::create_vm() for size checks.
    1.27 -  JavaThreadState thread_state() const           {
    1.28 -    return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
    1.29 -  }
    1.30 -  void set_thread_state(JavaThreadState s)       {
    1.31 -    OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
    1.32 -  }
    1.33 +  inline JavaThreadState thread_state() const;
    1.34 +  inline void set_thread_state(JavaThreadState s);
    1.35  #endif
    1.36    ThreadSafepointState *safepoint_state() const  { return _safepoint_state; }
    1.37    void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
    1.38 @@ -1775,7 +1760,7 @@
    1.39    // clearing/querying jni attach status
    1.40    bool is_attaching_via_jni() const { return _jni_attach_state == _attaching_via_jni; }
    1.41    bool has_attached_via_jni() const { return is_attaching_via_jni() || _jni_attach_state == _attached_via_jni; }
    1.42 -  void set_done_attaching_via_jni() { _jni_attach_state = _attached_via_jni; OrderAccess::fence(); }
    1.43 +  inline void set_done_attaching_via_jni();
    1.44  private:
    1.45    // This field is used to determine if a thread has claimed
    1.46    // a par_id: it is UINT_MAX if the thread has not claimed a par_id;

mercurial