Mercurial > hg > truffle
comparison src/share/vm/runtime/thread.hpp @ 8151:b8f261ba79c6
Minimize diff to plain HotSpot version.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 07 Mar 2013 21:00:29 +0100 |
parents | 5fc51c1ecdeb |
children | b9a918201d47 |
comparison
equal
deleted
inserted
replaced
8150:b66f831ac5ab | 8151:b8f261ba79c6 |
---|---|
767 friend class VMStructs; | 767 friend class VMStructs; |
768 private: | 768 private: |
769 JavaThread* _next; // The next thread in the Threads list | 769 JavaThread* _next; // The next thread in the Threads list |
770 oop _threadObj; // The Java level thread object | 770 oop _threadObj; // The Java level thread object |
771 | 771 |
772 // (thomaswue) Necessary for holding a compilation buffer and ci environment. | 772 // (thomaswue) Necessary for holding a compilation buffer. |
773 // Moved up from CompilerThread to JavaThread in order to enable code | 773 // Moved up from CompilerThread to JavaThread in order to enable code |
774 // installation from Java application code. | 774 // installation from Java application code. |
775 BufferBlob* _buffer_blob; | 775 BufferBlob* _buffer_blob; |
776 ciEnv* _env; | |
777 bool _is_compiling; | |
778 | |
779 #ifdef ASSERT | 776 #ifdef ASSERT |
780 private: | 777 private: |
781 int _java_call_counter; | 778 int _java_call_counter; |
782 | 779 |
783 public: | 780 public: |
903 | 900 |
904 private: | 901 private: |
905 | 902 |
906 #ifdef GRAAL | 903 #ifdef GRAAL |
907 address _graal_alternate_call_target; | 904 address _graal_alternate_call_target; |
908 DebugScopedValue* _debug_scope; | 905 #endif |
909 #endif | |
910 #ifdef HIGH_LEVEL_INTERPRETER | |
911 bool _high_level_interpreter_in_vm; | |
912 #endif | |
913 | |
914 StackGuardState _stack_guard_state; | 906 StackGuardState _stack_guard_state; |
915 | 907 |
916 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper | 908 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper |
917 | 909 |
918 // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is | 910 // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is |
920 // code) | 912 // code) |
921 volatile oop _exception_oop; // Exception thrown in compiled code | 913 volatile oop _exception_oop; // Exception thrown in compiled code |
922 volatile address _exception_pc; // PC where exception happened | 914 volatile address _exception_pc; // PC where exception happened |
923 volatile address _exception_handler_pc; // PC for handler of exception | 915 volatile address _exception_handler_pc; // PC for handler of exception |
924 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. | 916 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. |
917 | |
918 // support for compilation | |
919 bool _is_compiling; // is true if a compilation is active inthis thread (one compilation per thread possible) | |
925 | 920 |
926 // support for JNI critical regions | 921 // support for JNI critical regions |
927 jint _jni_active_critical; // count of entries into JNI critical region | 922 jint _jni_active_critical; // count of entries into JNI critical region |
928 | 923 |
929 // For deadlock detection. | 924 // For deadlock detection. |
980 _jni_environment.functions = functionTable; | 975 _jni_environment.functions = functionTable; |
981 } | 976 } |
982 struct JNINativeInterface_* get_jni_functions() { | 977 struct JNINativeInterface_* get_jni_functions() { |
983 return (struct JNINativeInterface_ *)_jni_environment.functions; | 978 return (struct JNINativeInterface_ *)_jni_environment.functions; |
984 } | 979 } |
985 | 980 |
986 bool is_compiling() const { return _is_compiling; } | |
987 void set_compiling(bool b) { _is_compiling = b; } | |
988 | |
989 // Get/set the thread's compilation environment. | |
990 ciEnv* env() { return _env; } | |
991 void set_env(ciEnv* env) { _env = env; } | |
992 | 981 |
993 BufferBlob* get_buffer_blob() { return _buffer_blob; } | 982 BufferBlob* get_buffer_blob() { return _buffer_blob; } |
994 void set_buffer_blob(BufferBlob* b) { _buffer_blob = b; }; | 983 void set_buffer_blob(BufferBlob* b) { _buffer_blob = b; }; |
995 | 984 |
996 // This function is called at thread creation to allow | 985 // This function is called at thread creation to allow |
1015 _scanned_nmethod = nm; | 1004 _scanned_nmethod = nm; |
1016 } | 1005 } |
1017 | 1006 |
1018 // Testers | 1007 // Testers |
1019 virtual bool is_Java_thread() const { return true; } | 1008 virtual bool is_Java_thread() const { return true; } |
1009 | |
1010 // compilation | |
1011 void set_is_compiling(bool f) { _is_compiling = f; } | |
1012 bool is_compiling() const { return _is_compiling; } | |
1020 | 1013 |
1021 // Thread chain operations | 1014 // Thread chain operations |
1022 JavaThread* next() const { return _next; } | 1015 JavaThread* next() const { return _next; } |
1023 void set_next(JavaThread* p) { _next = p; } | 1016 void set_next(JavaThread* p) { _next = p; } |
1024 | 1017 |
1281 MemRegion deferred_card_mark() const { return _deferred_card_mark; } | 1274 MemRegion deferred_card_mark() const { return _deferred_card_mark; } |
1282 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } | 1275 void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } |
1283 | 1276 |
1284 #ifdef GRAAL | 1277 #ifdef GRAAL |
1285 void set_graal_alternate_call_target(address a) { _graal_alternate_call_target = a; } | 1278 void set_graal_alternate_call_target(address a) { _graal_alternate_call_target = a; } |
1286 | |
1287 DebugScopedValue* debug_scope() const { return _debug_scope; } | |
1288 void set_debug_scope(DebugScopedValue* ds) { _debug_scope = ds; } | |
1289 #endif | |
1290 #ifdef HIGH_LEVEL_INTERPRETER | |
1291 bool high_level_interpreter_in_vm() { return _high_level_interpreter_in_vm; } | |
1292 void set_high_level_interpreter_in_vm(bool value) { _high_level_interpreter_in_vm = value; } | |
1293 #endif | 1279 #endif |
1294 | 1280 |
1295 // Exception handling for compiled methods | 1281 // Exception handling for compiled methods |
1296 oop exception_oop() const { return _exception_oop; } | 1282 oop exception_oop() const { return _exception_oop; } |
1297 address exception_pc() const { return _exception_pc; } | 1283 address exception_pc() const { return _exception_pc; } |
1371 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state ); } | 1357 static ByteSize thread_state_offset() { return byte_offset_of(JavaThread, _thread_state ); } |
1372 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc ); } | 1358 static ByteSize saved_exception_pc_offset() { return byte_offset_of(JavaThread, _saved_exception_pc ); } |
1373 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread ); } | 1359 static ByteSize osthread_offset() { return byte_offset_of(JavaThread, _osthread ); } |
1374 #ifdef GRAAL | 1360 #ifdef GRAAL |
1375 static ByteSize graal_alternate_call_target_offset() { return byte_offset_of(JavaThread, _graal_alternate_call_target); } | 1361 static ByteSize graal_alternate_call_target_offset() { return byte_offset_of(JavaThread, _graal_alternate_call_target); } |
1376 #endif | |
1377 #ifdef HIGH_LEVEL_INTERPRETER | |
1378 static ByteSize high_level_interpreter_in_vm_offset() { return byte_offset_of(JavaThread, _high_level_interpreter_in_vm); } | |
1379 #endif | 1362 #endif |
1380 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop ); } | 1363 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop ); } |
1381 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc ); } | 1364 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc ); } |
1382 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); } | 1365 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); } |
1383 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); } | 1366 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); } |
1830 class CompilerThread : public JavaThread { | 1813 class CompilerThread : public JavaThread { |
1831 friend class VMStructs; | 1814 friend class VMStructs; |
1832 private: | 1815 private: |
1833 CompilerCounters* _counters; | 1816 CompilerCounters* _counters; |
1834 | 1817 |
1818 ciEnv* _env; | |
1835 CompileLog* _log; | 1819 CompileLog* _log; |
1836 CompileTask* _task; | 1820 CompileTask* _task; |
1837 CompileQueue* _queue; | 1821 CompileQueue* _queue; |
1838 | 1822 |
1839 | 1823 |
1843 | 1827 |
1844 CompilerThread(CompileQueue* queue, CompilerCounters* counters); | 1828 CompilerThread(CompileQueue* queue, CompilerCounters* counters); |
1845 | 1829 |
1846 bool is_Compiler_thread() const { return true; } | 1830 bool is_Compiler_thread() const { return true; } |
1847 // Hide this compiler thread from external view. | 1831 // Hide this compiler thread from external view. |
1848 // (thomaswue) For Graal, the compiler thread should be visible. | 1832 bool is_hidden_from_external_view() const { return true; } |
1849 bool is_hidden_from_external_view() const { | |
1850 #ifdef GRAALVM | |
1851 return !DebugGraal; | |
1852 #else | |
1853 return true; | |
1854 #endif | |
1855 } | |
1856 | 1833 |
1857 CompileQueue* queue() { return _queue; } | 1834 CompileQueue* queue() { return _queue; } |
1858 CompilerCounters* counters() { return _counters; } | 1835 CompilerCounters* counters() { return _counters; } |
1836 | |
1837 // Get/set the thread's compilation environment. | |
1838 ciEnv* env() { return _env; } | |
1839 void set_env(ciEnv* env) { _env = env; } | |
1859 | 1840 |
1860 // Get/set the thread's logging information | 1841 // Get/set the thread's logging information |
1861 CompileLog* log() { return _log; } | 1842 CompileLog* log() { return _log; } |
1862 void init_log(CompileLog* log) { | 1843 void init_log(CompileLog* log) { |
1863 // Set once, for good. | 1844 // Set once, for good. |