comparison src/share/vm/ci/ciEnv.cpp @ 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 be4ca325525a
children 5e9645341ec3
comparison
equal deleted inserted replaced
3554:b20889b42d12 3555:22d11b3bc561
92 92
93 // ------------------------------------------------------------------ 93 // ------------------------------------------------------------------
94 // ciEnv::ciEnv 94 // ciEnv::ciEnv
95 ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter) { 95 ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter) {
96 VM_ENTRY_MARK; 96 VM_ENTRY_MARK;
97 97 CompilerThread* compiler_thread = CompilerThread::current();
98 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc. 98 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc.
99 thread->set_env(this); 99 thread->set_env(this);
100 assert(ciEnv::current() == this, "sanity"); 100 assert(ciEnv::current() == this, "sanity");
101 101
102 _oop_recorder = NULL; 102 _oop_recorder = NULL;
104 _dependencies = NULL; 104 _dependencies = NULL;
105 _failure_reason = NULL; 105 _failure_reason = NULL;
106 _compilable = MethodCompilable; 106 _compilable = MethodCompilable;
107 _break_at_compile = false; 107 _break_at_compile = false;
108 _compiler_data = NULL; 108 _compiler_data = NULL;
109 #ifndef PRODUCT 109 //#ifndef PRODUCT
110 assert(!firstEnv, "not initialized properly"); 110 // assert(!firstEnv, "not initialized properly");
111 #endif /* !PRODUCT */ 111 //#endif /* !PRODUCT */
112 112
113 _system_dictionary_modification_counter = system_dictionary_modification_counter; 113 _system_dictionary_modification_counter = system_dictionary_modification_counter;
114 _num_inlined_bytecodes = 0; 114 _num_inlined_bytecodes = 0;
115 assert(task == NULL || thread->task() == task, "sanity"); 115 assert(task == NULL || compiler_thread->task() == task, "sanity");
116 _task = task; 116 _task = task;
117 _log = NULL; 117 _log = NULL;
118 118
119 // Temporary buffer for creating symbols and such. 119 // Temporary buffer for creating symbols and such.
120 _name_buffer = NULL; 120 _name_buffer = NULL;
147 147
148 ciEnv::ciEnv(Arena* arena) { 148 ciEnv::ciEnv(Arena* arena) {
149 ASSERT_IN_VM; 149 ASSERT_IN_VM;
150 150
151 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc. 151 // Set up ciEnv::current immediately, for the sake of ciObjectFactory, etc.
152 CompilerThread* current_thread = CompilerThread::current(); 152 JavaThread* current_thread = JavaThread::current();
153 assert(current_thread->env() == NULL, "must be"); 153 assert(current_thread->env() == NULL, "must be");
154 current_thread->set_env(this); 154 current_thread->set_env(this);
155 assert(ciEnv::current() == this, "sanity"); 155 assert(ciEnv::current() == this, "sanity");
156 156
157 _oop_recorder = NULL; 157 _oop_recorder = NULL;
159 _dependencies = NULL; 159 _dependencies = NULL;
160 _failure_reason = NULL; 160 _failure_reason = NULL;
161 _compilable = MethodCompilable_never; 161 _compilable = MethodCompilable_never;
162 _break_at_compile = false; 162 _break_at_compile = false;
163 _compiler_data = NULL; 163 _compiler_data = NULL;
164 #ifndef PRODUCT 164 //#ifndef PRODUCT
165 assert(firstEnv, "must be first"); 165 // assert(firstEnv, "must be first");
166 firstEnv = false; 166 // firstEnv = false;
167 #endif /* !PRODUCT */ 167 //#endif /* !PRODUCT */
168 168
169 _system_dictionary_modification_counter = 0; 169 _system_dictionary_modification_counter = 0;
170 _num_inlined_bytecodes = 0; 170 _num_inlined_bytecodes = 0;
171 _task = NULL; 171 _task = NULL;
172 _log = NULL; 172 _log = NULL;
200 _the_min_jint_string = NULL; 200 _the_min_jint_string = NULL;
201 } 201 }
202 202
203 ciEnv::~ciEnv() { 203 ciEnv::~ciEnv() {
204 _factory->cleanup(); 204 _factory->cleanup();
205 CompilerThread* current_thread = CompilerThread::current(); 205 JavaThread* current_thread = JavaThread::current();
206 _factory->remove_symbols(); 206 _factory->remove_symbols();
207 current_thread->set_env(NULL); 207 current_thread->set_env(NULL);
208 } 208 }
209 209
210 // ------------------------------------------------------------------ 210 // ------------------------------------------------------------------