< prev index next >
src/hotspot/share/runtime/thread.hpp
Print this page
rev 47591 : Add Thread Local handshakes and thread local polling
rev 47592 : imported patch Atomic-Update-Rebase-3
@@ -29,10 +29,11 @@
#include "gc/shared/threadLocalAllocBuffer.hpp"
#include "memory/allocation.hpp"
#include "oops/oop.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/frame.hpp"
+#include "runtime/handshake.hpp"
#include "runtime/javaFrameAnchor.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"
#include "runtime/osThread.hpp"
@@ -269,10 +270,12 @@
friend class NoAllocVerifier;
friend class NoSafepointVerifier;
friend class PauseNoSafepointVerifier;
friend class GCLocker;
+ volatile void* _polling_page; // Thread local polling page
+
ThreadLocalAllocBuffer _tlab; // Thread-local eden
jlong _allocated_bytes; // Cumulative number of bytes allocated on
// the Java heap
mutable TRACE_DATA _trace_data; // Thread-local data for tracing
@@ -547,10 +550,12 @@
address _stack_base;
size_t _stack_size;
uintptr_t _self_raw_id; // used by get_thread (mutable)
int _lgrp_id;
+ volatile void** polling_page_addr() { return &_polling_page; }
+
public:
// Stack overflow support
address stack_base() const { assert(_stack_base != NULL,"Sanity check"); return _stack_base; }
void set_stack_base(address base) { _stack_base = base; }
size_t stack_size() const { return _stack_size; }
@@ -615,10 +620,12 @@
static ByteSize active_handles_offset() { return byte_offset_of(Thread, _active_handles); }
static ByteSize stack_base_offset() { return byte_offset_of(Thread, _stack_base); }
static ByteSize stack_size_offset() { return byte_offset_of(Thread, _stack_size); }
+ static ByteSize polling_page_offset() { return byte_offset_of(Thread, _polling_page); }
+
#define TLAB_FIELD_OFFSET(name) \
static ByteSize tlab_##name##_offset() { return byte_offset_of(Thread, _tlab) + ThreadLocalAllocBuffer::name##_offset(); }
TLAB_FIELD_OFFSET(start)
TLAB_FIELD_OFFSET(end)
@@ -1133,10 +1140,37 @@
void set_doing_unsafe_access(bool val) { _doing_unsafe_access = val; }
bool do_not_unlock_if_synchronized() { return _do_not_unlock_if_synchronized; }
void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }
+ inline void set_polling_page(void* poll_value);
+ inline volatile void* get_polling_page();
+
+ private:
+ // Support for thread handshake operations
+ HandshakeState _handshake;
+ public:
+ void set_handshake_operation(HandshakeOperation* op) {
+ _handshake.set_operation(this, op);
+ }
+
+ bool has_handshake() const {
+ return _handshake.has_operation();
+ }
+
+ void cancel_handshake() {
+ _handshake.cancel(this);
+ }
+
+ void handshake_process_by_self() {
+ _handshake.process_by_self(this);
+ }
+
+ void handshake_process_by_vmthread() {
+ _handshake.process_by_vmthread(this);
+ }
+
// Suspend/resume support for JavaThread
private:
inline void set_ext_suspended();
inline void clear_ext_suspended();
< prev index next >