diff src/share/vm/runtime/thread.hpp @ 3555:22d11b3bc561

Various hacks to be able to install machine code from a Java thread.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 24 Aug 2011 01:05:02 +0200
parents 344264424174
children bc95d122df79
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.hpp	Mon Aug 22 19:55:06 2011 +0200
+++ b/src/share/vm/runtime/thread.hpp	Wed Aug 24 01:05:02 2011 +0200
@@ -713,6 +713,10 @@
   JavaThread*    _next;                          // The next thread in the Threads list
   oop            _threadObj;                     // The Java level thread object
 
+  // (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.
+  BufferBlob*   _buffer_blob;
+  ciEnv*        _env;
+
 #ifdef ASSERT
  private:
   int _java_call_counter;
@@ -909,6 +913,13 @@
   struct JNINativeInterface_* get_jni_functions() {
     return (struct JNINativeInterface_ *)_jni_environment.functions;
   }
+  
+  // Get/set the thread's compilation environment.
+  ciEnv*        env()                            { return _env; }
+  void          set_env(ciEnv* env)              { _env = env; }
+
+  BufferBlob*   get_buffer_blob()                { return _buffer_blob; }
+  void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; };
 
   // This function is called at thread creation to allow
   // platform specific thread variables to be initialized.
@@ -1696,12 +1707,10 @@
  private:
   CompilerCounters* _counters;
 
-  ciEnv*        _env;
   CompileLog*   _log;
   CompileTask*  _task;
   CompileQueue* _queue;
   bool          _is_compiling;
-  BufferBlob*   _buffer_blob;
 
   nmethod*      _scanned_nmethod;  // nmethod being scanned by the sweeper
 
@@ -1721,13 +1730,6 @@
   CompileQueue* queue()                          { return _queue; }
   CompilerCounters* counters()                   { return _counters; }
 
-  // Get/set the thread's compilation environment.
-  ciEnv*        env()                            { return _env; }
-  void          set_env(ciEnv* env)              { _env = env; }
-
-  BufferBlob*   get_buffer_blob()                { return _buffer_blob; }
-  void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; };
-
   // Get/set the thread's logging information
   CompileLog*   log()                            { return _log; }
   void          init_log(CompileLog* log) {