--- old/src/share/vm/runtime/thread.hpp 2015-10-14 13:54:40.002266007 +0200 +++ new/src/share/vm/runtime/thread.hpp 2015-10-14 13:54:39.941267482 +0200 @@ -264,8 +264,11 @@ friend class GC_locker; ThreadLocalAllocBuffer _tlab; // Thread-local eden + ThreadLocalAllocBuffer _gclab; // Thread-local allocation buffer for GC (e.g. evacuation) jlong _allocated_bytes; // Cumulative number of bytes allocated on // the Java heap + jlong _allocated_bytes_gclab; // Cumulative number of bytes allocated on + // the Java heap, in GCLABs TRACE_DATA _trace_data; // Thread-local data for tracing @@ -281,6 +284,8 @@ // ObjectMonitor on which this thread called Object.wait() ObjectMonitor* _current_waiting_monitor; + bool _evacuating; + // Private thread-local objectmonitor list - a simple cache organized as a SLL. public: ObjectMonitor* omFreeList; @@ -424,15 +429,23 @@ ThreadLocalAllocBuffer& tlab() { return _tlab; } void initialize_tlab() { if (UseTLAB) { - tlab().initialize(); + tlab().initialize(false); + gclab().initialize(true); } } + // Thread-Local GC Allocation Buffer (GCLAB) support + ThreadLocalAllocBuffer& gclab() { return _gclab; } + jlong allocated_bytes() { return _allocated_bytes; } void set_allocated_bytes(jlong value) { _allocated_bytes = value; } void incr_allocated_bytes(jlong size) { _allocated_bytes += size; } inline jlong cooked_allocated_bytes(); + jlong allocated_bytes_gclab() { return _allocated_bytes_gclab; } + void set_allocated_bytes_gclab(jlong value) { _allocated_bytes_gclab = value; } + void incr_allocated_bytes_gclab(jlong size) { _allocated_bytes_gclab += size; } + TRACE_DATA* trace_data() { return &_trace_data; } const ThreadExt& ext() const { return _ext; } @@ -465,6 +478,14 @@ _current_waiting_monitor = monitor; } + bool is_evacuating() { + return _evacuating; + } + + void set_evacuating(bool evacuating) { + _evacuating = evacuating; + } + // GC support // Apply "f->do_oop" to all root oops in "this". // Apply "cld_f->do_cld" to CLDs that are otherwise not kept alive. @@ -614,6 +635,8 @@ #undef TLAB_FIELD_OFFSET + static ByteSize gclab_start_offset() { return byte_offset_of(Thread, _gclab) + ThreadLocalAllocBuffer::start_offset(); } + static ByteSize allocated_bytes_offset() { return byte_offset_of(Thread, _allocated_bytes); } public: @@ -956,6 +979,10 @@ static DirtyCardQueueSet _dirty_card_queue_set; void flush_barrier_queues(); + + bool _evacuation_in_progress; + static bool _evacuation_in_progress_global; + #endif // INCLUDE_ALL_GCS friend class VMThread; @@ -1375,6 +1402,9 @@ #if INCLUDE_ALL_GCS static ByteSize satb_mark_queue_offset() { return byte_offset_of(JavaThread, _satb_mark_queue); } static ByteSize dirty_card_queue_offset() { return byte_offset_of(JavaThread, _dirty_card_queue); } + + static ByteSize evacuation_in_progress_offset() { return byte_offset_of(JavaThread, _evacuation_in_progress); } + #endif // INCLUDE_ALL_GCS // Returns the jni environment for this thread @@ -1671,6 +1701,12 @@ static DirtyCardQueueSet& dirty_card_queue_set() { return _dirty_card_queue_set; } + + bool evacuation_in_progress() const; + + void set_evacuation_in_progress(bool in_prog); + + static void set_evacuation_in_progress_all_threads(bool in_prog); #endif // INCLUDE_ALL_GCS // This method initializes the SATB and dirty card queues before a