comparison src/share/vm/runtime/thread.hpp @ 20393:966601b12d4f

8057535: add a thread extension class Reviewed-by: mgerdin, bdelsart, jcoomes
author sla
date Thu, 04 Sep 2014 11:21:08 +0200
parents 833b0f92429a
children b12a2a9b05ca
comparison
equal deleted inserted replaced
20392:66d359ee9681 20393:966601b12d4f
38 #include "runtime/osThread.hpp" 38 #include "runtime/osThread.hpp"
39 #include "runtime/park.hpp" 39 #include "runtime/park.hpp"
40 #include "runtime/safepoint.hpp" 40 #include "runtime/safepoint.hpp"
41 #include "runtime/stubRoutines.hpp" 41 #include "runtime/stubRoutines.hpp"
42 #include "runtime/threadLocalStorage.hpp" 42 #include "runtime/threadLocalStorage.hpp"
43 #include "runtime/thread_ext.hpp"
43 #include "runtime/unhandledOops.hpp" 44 #include "runtime/unhandledOops.hpp"
44 #include "utilities/macros.hpp" 45 #include "utilities/macros.hpp"
45 46
46 #include "trace/traceBackend.hpp" 47 #include "trace/traceBackend.hpp"
47 #include "trace/traceMacros.hpp" 48 #include "trace/traceMacros.hpp"
255 jlong _allocated_bytes; // Cumulative number of bytes allocated on 256 jlong _allocated_bytes; // Cumulative number of bytes allocated on
256 // the Java heap 257 // the Java heap
257 258
258 TRACE_DATA _trace_data; // Thread-local data for tracing 259 TRACE_DATA _trace_data; // Thread-local data for tracing
259 260
261 ThreadExt _ext;
262
260 int _vm_operation_started_count; // VM_Operation support 263 int _vm_operation_started_count; // VM_Operation support
261 int _vm_operation_completed_count; // VM_Operation support 264 int _vm_operation_completed_count; // VM_Operation support
262 265
263 ObjectMonitor* _current_pending_monitor; // ObjectMonitor this thread 266 ObjectMonitor* _current_pending_monitor; // ObjectMonitor this thread
264 // is waiting to lock 267 // is waiting to lock
433 void set_allocated_bytes(jlong value) { _allocated_bytes = value; } 436 void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
434 void incr_allocated_bytes(jlong size) { _allocated_bytes += size; } 437 void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
435 inline jlong cooked_allocated_bytes(); 438 inline jlong cooked_allocated_bytes();
436 439
437 TRACE_DATA* trace_data() { return &_trace_data; } 440 TRACE_DATA* trace_data() { return &_trace_data; }
441
442 const ThreadExt& ext() const { return _ext; }
443 ThreadExt& ext() { return _ext; }
438 444
439 // VM operation support 445 // VM operation support
440 int vm_operation_ticket() { return ++_vm_operation_started_count; } 446 int vm_operation_ticket() { return ++_vm_operation_started_count; }
441 int vm_operation_completed_count() { return _vm_operation_completed_count; } 447 int vm_operation_completed_count() { return _vm_operation_completed_count; }
442 void increment_vm_operation_completed_count() { _vm_operation_completed_count++; } 448 void increment_vm_operation_completed_count() { _vm_operation_completed_count++; }
1000 1006
1001 // Prepare thread and add to priority queue. If a priority is 1007 // Prepare thread and add to priority queue. If a priority is
1002 // not specified, use the priority of the thread object. Threads_lock 1008 // not specified, use the priority of the thread object. Threads_lock
1003 // must be held while this function is called. 1009 // must be held while this function is called.
1004 void prepare(jobject jni_thread, ThreadPriority prio=NoPriority); 1010 void prepare(jobject jni_thread, ThreadPriority prio=NoPriority);
1011 void prepare_ext();
1005 1012
1006 void set_saved_exception_pc(address pc) { _saved_exception_pc = pc; } 1013 void set_saved_exception_pc(address pc) { _saved_exception_pc = pc; }
1007 address saved_exception_pc() { return _saved_exception_pc; } 1014 address saved_exception_pc() { return _saved_exception_pc; }
1008 1015
1009 1016
1954 static int number_of_non_daemon_threads() { return _number_of_non_daemon_threads; } 1961 static int number_of_non_daemon_threads() { return _number_of_non_daemon_threads; }
1955 1962
1956 // Deoptimizes all frames tied to marked nmethods 1963 // Deoptimizes all frames tied to marked nmethods
1957 static void deoptimized_wrt_marked_nmethods(); 1964 static void deoptimized_wrt_marked_nmethods();
1958 1965
1966 static JavaThread* find_java_thread_from_java_tid(jlong java_tid);
1967
1959 }; 1968 };
1960 1969
1961 1970
1962 // Thread iterator 1971 // Thread iterator
1963 class ThreadClosure: public StackObj { 1972 class ThreadClosure: public StackObj {