818 // Deopt support |
818 // Deopt support |
819 DeoptResourceMark* _deopt_mark; // Holds special ResourceMark for deoptimization |
819 DeoptResourceMark* _deopt_mark; // Holds special ResourceMark for deoptimization |
820 |
820 |
821 intptr_t* _must_deopt_id; // id of frame that needs to be deopted once we |
821 intptr_t* _must_deopt_id; // id of frame that needs to be deopted once we |
822 // transition out of native |
822 // transition out of native |
823 nmethod* _deopt_nmethod; // nmethod that is currently being deoptimized |
823 CompiledMethod* _deopt_nmethod; // CompiledMethod that is currently being deoptimized |
824 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays |
824 vframeArray* _vframe_array_head; // Holds the heap of the active vframeArrays |
825 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped |
825 vframeArray* _vframe_array_last; // Holds last vFrameArray we popped |
826 // Because deoptimization is lazy we must save jvmti requests to set locals |
826 // Because deoptimization is lazy we must save jvmti requests to set locals |
827 // in compiled frames until we deoptimize and we have an interpreter frame. |
827 // in compiled frames until we deoptimize and we have an interpreter frame. |
828 // This holds the pointer to array (yeah like there might be more than one) of |
828 // This holds the pointer to array (yeah like there might be more than one) of |
1296 |
1296 |
1297 intptr_t* must_deopt_id() { return _must_deopt_id; } |
1297 intptr_t* must_deopt_id() { return _must_deopt_id; } |
1298 void set_must_deopt_id(intptr_t* id) { _must_deopt_id = id; } |
1298 void set_must_deopt_id(intptr_t* id) { _must_deopt_id = id; } |
1299 void clear_must_deopt_id() { _must_deopt_id = NULL; } |
1299 void clear_must_deopt_id() { _must_deopt_id = NULL; } |
1300 |
1300 |
1301 void set_deopt_nmethod(nmethod* nm) { _deopt_nmethod = nm; } |
1301 void set_deopt_compiled_method(CompiledMethod* nm) { _deopt_nmethod = nm; } |
1302 nmethod* deopt_nmethod() { return _deopt_nmethod; } |
1302 CompiledMethod* deopt_compiled_method() { return _deopt_nmethod; } |
1303 |
1303 |
1304 Method* callee_target() const { return _callee_target; } |
1304 Method* callee_target() const { return _callee_target; } |
1305 void set_callee_target (Method* x) { _callee_target = x; } |
1305 void set_callee_target (Method* x) { _callee_target = x; } |
1306 |
1306 |
1307 // Oop results of vm runtime calls |
1307 // Oop results of vm runtime calls |
1978 return (CompilerThread*)this; |
1978 return (CompilerThread*)this; |
1979 } |
1979 } |
1980 |
1980 |
1981 // Dedicated thread to sweep the code cache |
1981 // Dedicated thread to sweep the code cache |
1982 class CodeCacheSweeperThread : public JavaThread { |
1982 class CodeCacheSweeperThread : public JavaThread { |
1983 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper |
1983 CompiledMethod* _scanned_compiled_method; // nmethod being scanned by the sweeper |
1984 public: |
1984 public: |
1985 CodeCacheSweeperThread(); |
1985 CodeCacheSweeperThread(); |
1986 // Track the nmethod currently being scanned by the sweeper |
1986 // Track the nmethod currently being scanned by the sweeper |
1987 void set_scanned_nmethod(nmethod* nm) { |
1987 void set_scanned_compiled_method(CompiledMethod* cm) { |
1988 assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value"); |
1988 assert(_scanned_compiled_method == NULL || cm == NULL, "should reset to NULL before writing a new value"); |
1989 _scanned_nmethod = nm; |
1989 _scanned_compiled_method = cm; |
1990 } |
1990 } |
1991 |
1991 |
1992 // Hide sweeper thread from external view. |
1992 // Hide sweeper thread from external view. |
1993 bool is_hidden_from_external_view() const { return true; } |
1993 bool is_hidden_from_external_view() const { return true; } |
1994 |
1994 |
1995 bool is_Code_cache_sweeper_thread() const { return true; } |
1995 bool is_Code_cache_sweeper_thread() const { return true; } |
1996 |
1996 |
1997 // Prevent GC from unloading _scanned_nmethod |
1997 // Prevent GC from unloading _scanned_compiled_method |
1998 void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); |
1998 void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); |
1999 void nmethods_do(CodeBlobClosure* cf); |
1999 void nmethods_do(CodeBlobClosure* cf); |
2000 }; |
2000 }; |
2001 |
2001 |
2002 // A thread used for Compilation. |
2002 // A thread used for Compilation. |