Mercurial > hg > graal-compiler
comparison src/share/vm/memory/referenceProcessor.cpp @ 10031:ebb32c4589f3
Force GC to process graal_installed_code references during marking (GRAAL-257)
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Tue, 11 Jun 2013 19:59:52 +0200 |
parents | aed758eda82a |
children | 4a7dc38ae96b |
comparison
equal
deleted
inserted
replaced
9998:e85afceb39e7 | 10031:ebb32c4589f3 |
---|---|
30 #include "memory/referencePolicy.hpp" | 30 #include "memory/referencePolicy.hpp" |
31 #include "memory/referenceProcessor.hpp" | 31 #include "memory/referenceProcessor.hpp" |
32 #include "oops/oop.inline.hpp" | 32 #include "oops/oop.inline.hpp" |
33 #include "runtime/java.hpp" | 33 #include "runtime/java.hpp" |
34 #include "runtime/jniHandles.hpp" | 34 #include "runtime/jniHandles.hpp" |
35 #ifdef GRAAL | |
36 #include "code/codeCache.hpp" | |
37 #include "code/nmethod.hpp" | |
38 #endif | |
35 | 39 |
36 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL; | 40 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL; |
37 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL; | 41 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL; |
38 bool ReferenceProcessor::_pending_list_uses_discovered_field = false; | 42 bool ReferenceProcessor::_pending_list_uses_discovered_field = false; |
39 jlong ReferenceProcessor::_soft_ref_timestamp_clock = 0; | 43 jlong ReferenceProcessor::_soft_ref_timestamp_clock = 0; |
241 TraceTime tt("JNI Weak Reference", trace_time, false, gclog_or_tty); | 245 TraceTime tt("JNI Weak Reference", trace_time, false, gclog_or_tty); |
242 if (task_executor != NULL) { | 246 if (task_executor != NULL) { |
243 task_executor->set_single_threaded_mode(); | 247 task_executor->set_single_threaded_mode(); |
244 } | 248 } |
245 process_phaseJNI(is_alive, keep_alive, complete_gc); | 249 process_phaseJNI(is_alive, keep_alive, complete_gc); |
250 #ifdef GRAAL | |
251 process_phaseGraalNMethods(keep_alive, complete_gc); | |
252 #endif | |
246 } | 253 } |
247 } | 254 } |
248 | 255 |
249 #ifndef PRODUCT | 256 #ifndef PRODUCT |
250 // Calculate the number of jni handles. | 257 // Calculate the number of jni handles. |
282 #endif | 289 #endif |
283 JNIHandles::weak_oops_do(is_alive, keep_alive); | 290 JNIHandles::weak_oops_do(is_alive, keep_alive); |
284 complete_gc->do_void(); | 291 complete_gc->do_void(); |
285 } | 292 } |
286 | 293 |
294 #ifdef GRAAL | |
295 void ReferenceProcessor::process_phaseGraalNMethods(OopClosure* keep_alive, | |
296 VoidClosure* complete_gc) { | |
297 CodeCache::alive_nmethods_do_graal_methods(keep_alive); | |
298 complete_gc->do_void(); | |
299 } | |
300 | |
301 #endif | |
287 | 302 |
288 template <class T> | 303 template <class T> |
289 bool enqueue_discovered_ref_helper(ReferenceProcessor* ref, | 304 bool enqueue_discovered_ref_helper(ReferenceProcessor* ref, |
290 AbstractRefProcTaskExecutor* task_executor) { | 305 AbstractRefProcTaskExecutor* task_executor) { |
291 | 306 |