< prev index next >

src/share/vm/runtime/thread.hpp

Print this page

        

*** 25,34 **** --- 25,35 ---- #ifndef SHARE_VM_RUNTIME_THREAD_HPP #define SHARE_VM_RUNTIME_THREAD_HPP #include "gc/shared/threadLocalAllocBuffer.hpp" #include "memory/allocation.hpp" + #include "memory/vtBuffer.hpp" #include "oops/oop.hpp" #include "prims/jni.h" #include "prims/jvmtiExport.hpp" #include "runtime/frame.hpp" #include "runtime/javaFrameAnchor.hpp"
*** 992,1001 **** --- 993,1013 ---- // and during exception propagation, pop the top // _frames_to_pop_failed_realloc frames, the ones that reference // failed reallocations. int _frames_to_pop_failed_realloc; + // Buffered value types support + void* _vt_alloc_ptr; + void* _vt_alloc_limit; + VTBufferChunk* _local_free_chunk; + // Next 4 fields are used to monitor VT buffer memory consumption + // We may want to not support them in PRODUCT builds + jint _vtchunk_in_use; + jint _vtchunk_max; + jint _vtchunk_total_returned; + jlong _vtchunk_total_memory_buffered; + #ifndef PRODUCT int _jmp_ring_index; struct { // We use intptr_t instead of address so debugger doesn't try and display strings intptr_t _target;
*** 1671,1680 **** --- 1683,1693 ---- void print_value(); void print_thread_state_on(outputStream*) const PRODUCT_RETURN; void print_thread_state() const PRODUCT_RETURN; void print_on_error(outputStream* st, char* buf, int buflen) const; void print_name_on_error(outputStream* st, char* buf, int buflen) const; + void print_vt_buffer_stats_on(outputStream* st) const; void verify(); const char* get_thread_name() const; private: // factor out low-level mechanics for use in both normal and error cases const char* get_thread_name_string(char* buf = NULL, int buflen = 0) const;
*** 1872,1881 **** --- 1885,1923 ---- } static inline void set_stack_size_at_create(size_t value) { _stack_size_at_create = value; } + void* vt_alloc_ptr() const { return _vt_alloc_ptr; } + void set_vt_alloc_ptr(void* ptr) { _vt_alloc_ptr = ptr; } + void* vt_alloc_limit() const { return _vt_alloc_limit; } + void set_vt_alloc_limit(void* ptr) { _vt_alloc_limit = ptr; } + VTBufferChunk* local_free_chunk() const { return _local_free_chunk; } + void set_local_free_chunk(VTBufferChunk* chunk) { _local_free_chunk = chunk; } + VTBufferChunk* current_chunk() { + if (_vt_alloc_ptr == NULL) return NULL; + VTBufferChunk* chunk = VTBufferChunk::chunk(_vt_alloc_ptr); + assert(chunk->owner() == this, "Sanity check"); + return chunk; + // return _vt_alloc_ptr == NULL ? NULL : VTBufferChunk::chunk(_vt_alloc_ptr); + } + + void increment_vtchunk_in_use() { + _vtchunk_in_use++; + if (_vtchunk_in_use > _vtchunk_max) _vtchunk_max = _vtchunk_in_use; + } + void decrement_vtchunk_in_use() { _vtchunk_in_use--; } + jint vtchunk_in_use() const { return _vtchunk_in_use; } + jint vtchunk_max() const { return _vtchunk_max; } + void increment_vtchunk_returned() { _vtchunk_total_returned++; } + jint vtchunk_total_returned() const { return _vtchunk_total_returned; } + void increment_vtchunk_total_memory_buffered(jlong size) { _vtchunk_total_memory_buffered += size; } + jlong vtchunk_total_memory_buffered() const { return _vtchunk_total_memory_buffered; } + + static ByteSize vt_alloc_ptr_offset() { return byte_offset_of(JavaThread, _vt_alloc_ptr); } + + #if INCLUDE_ALL_GCS // SATB marking queue support SATBMarkQueue& satb_mark_queue() { return _satb_mark_queue; } static SATBMarkQueueSet& satb_mark_queue_set() { return _satb_mark_queue_set;
*** 2136,2145 **** --- 2178,2188 ---- } static void print_on_error(outputStream* st, Thread* current, char* buf, int buflen); static void print_on_error(Thread* this_thread, outputStream* st, Thread* current, char* buf, int buflen, bool* found_current); static void print_threads_compiling(outputStream* st, char* buf, int buflen); + static void print_vt_buffer_stats_on(outputStream* st); // Get Java threads that are waiting to enter a monitor. If doLock // is true, then Threads_lock is grabbed as needed. Otherwise, the // VM needs to be at a safepoint. static GrowableArray<JavaThread*>* get_pending_threads(int count,
< prev index next >