comparison src/share/vm/runtime/thread.hpp @ 3650:0e8a2a629afb

Pass-by compilation broker.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Wed, 16 Nov 2011 21:27:28 +0100
parents bc95d122df79
children dc7902820c9b
comparison
equal deleted inserted replaced
3649:5a8c44b5fb80 3650:0e8a2a629afb
714 oop _threadObj; // The Java level thread object 714 oop _threadObj; // The Java level thread object
715 715
716 // (tw) Necessary for holding a compilation buffer and ci environment. Moved from CompilerThread to JavaThread in order to enable code installation from Java application code. 716 // (tw) Necessary for holding a compilation buffer and ci environment. Moved from CompilerThread to JavaThread in order to enable code installation from Java application code.
717 BufferBlob* _buffer_blob; 717 BufferBlob* _buffer_blob;
718 ciEnv* _env; 718 ciEnv* _env;
719 bool _is_compiling;
719 720
720 #ifdef ASSERT 721 #ifdef ASSERT
721 private: 722 private:
722 int _java_call_counter; 723 int _java_call_counter;
723 724
851 volatile address _exception_pc; // PC where exception happened 852 volatile address _exception_pc; // PC where exception happened
852 volatile address _exception_handler_pc; // PC for handler of exception 853 volatile address _exception_handler_pc; // PC for handler of exception
853 volatile int _exception_stack_size; // Size of frame where exception happened 854 volatile int _exception_stack_size; // Size of frame where exception happened
854 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. 855 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site.
855 856
856 // support for compilation
857 bool _is_compiling; // is true if a compilation is active inthis thread (one compilation per thread possible)
858
859 // support for JNI critical regions 857 // support for JNI critical regions
860 jint _jni_active_critical; // count of entries into JNI critical region 858 jint _jni_active_critical; // count of entries into JNI critical region
861 859
862 // For deadlock detection. 860 // For deadlock detection.
863 int _depth_first_number; 861 int _depth_first_number;
914 } 912 }
915 struct JNINativeInterface_* get_jni_functions() { 913 struct JNINativeInterface_* get_jni_functions() {
916 return (struct JNINativeInterface_ *)_jni_environment.functions; 914 return (struct JNINativeInterface_ *)_jni_environment.functions;
917 } 915 }
918 916
917 bool is_compiling() const { return _is_compiling; }
918 void set_compiling(bool b) { _is_compiling = b; }
919
919 // Get/set the thread's compilation environment. 920 // Get/set the thread's compilation environment.
920 ciEnv* env() { return _env; } 921 ciEnv* env() { return _env; }
921 void set_env(ciEnv* env) { _env = env; } 922 void set_env(ciEnv* env) { _env = env; }
922 923
923 BufferBlob* get_buffer_blob() { return _buffer_blob; } 924 BufferBlob* get_buffer_blob() { return _buffer_blob; }
939 940
940 void cleanup_failed_attach_current_thread(); 941 void cleanup_failed_attach_current_thread();
941 942
942 // Testers 943 // Testers
943 virtual bool is_Java_thread() const { return true; } 944 virtual bool is_Java_thread() const { return true; }
944
945 // compilation
946 void set_is_compiling(bool f) { _is_compiling = f; }
947 bool is_compiling() const { return _is_compiling; }
948 945
949 // Thread chain operations 946 // Thread chain operations
950 JavaThread* next() const { return _next; } 947 JavaThread* next() const { return _next; }
951 void set_next(JavaThread* p) { _next = p; } 948 void set_next(JavaThread* p) { _next = p; }
952 949
1714 CompilerCounters* _counters; 1711 CompilerCounters* _counters;
1715 1712
1716 CompileLog* _log; 1713 CompileLog* _log;
1717 CompileTask* _task; 1714 CompileTask* _task;
1718 CompileQueue* _queue; 1715 CompileQueue* _queue;
1719 bool _is_compiling;
1720 1716
1721 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper 1717 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper
1722 1718
1723 public: 1719 public:
1724 1720
1725 static CompilerThread* current(); 1721 static CompilerThread* current();
1726 1722
1727 CompilerThread(CompileQueue* queue, CompilerCounters* counters); 1723 CompilerThread(CompileQueue* queue, CompilerCounters* counters);
1728 1724
1729 bool is_compiling() const { return _is_compiling; }
1730 void set_compiling(bool b) { _is_compiling = b; }
1731 bool is_Compiler_thread() const { return true; } 1725 bool is_Compiler_thread() const { return true; }
1732 // Hide this compiler thread from external view. 1726 // Hide this compiler thread from external view.
1733 // (tw) For Graal, the compiler thread should be visible. 1727 // (tw) For Graal, the compiler thread should be visible.
1734 bool is_hidden_from_external_view() const { return !UseGraal || !DebugGraal; } 1728 bool is_hidden_from_external_view() const { return !UseGraal || !DebugGraal; }
1735 1729