18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "classfile/javaClasses.hpp" 27 #include "classfile/systemDictionary.hpp" 28 #include "gc_implementation/shared/gcTimer.hpp" 29 #include "gc_implementation/shared/gcTraceTime.hpp" 30 #include "gc_interface/collectedHeap.hpp" 31 #include "gc_interface/collectedHeap.inline.hpp" 32 #include "memory/referencePolicy.hpp" 33 #include "memory/referenceProcessor.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "runtime/java.hpp" 36 #include "runtime/jniHandles.hpp" 37 38 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL; 39 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL; 40 bool ReferenceProcessor::_pending_list_uses_discovered_field = false; 41 jlong ReferenceProcessor::_soft_ref_timestamp_clock = 0; 42 43 void referenceProcessor_init() { 44 ReferenceProcessor::init_statics(); 45 } 46 47 void ReferenceProcessor::init_statics() { 48 // We need a monotonically non-decreasing time in ms but 49 // os::javaTimeMillis() does not guarantee monotonicity. 50 jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; 51 52 // Initialize the soft ref timestamp clock. 53 _soft_ref_timestamp_clock = now; 54 // Also update the soft ref clock in j.l.r.SoftReference 55 java_lang_ref_SoftReference::set_clock(_soft_ref_timestamp_clock); 56 57 _always_clear_soft_ref_policy = new AlwaysClearPolicy(); | 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "classfile/javaClasses.hpp" 27 #include "classfile/systemDictionary.hpp" 28 #include "gc_implementation/shared/gcTimer.hpp" 29 #include "gc_implementation/shared/gcTraceTime.hpp" 30 #include "gc_interface/collectedHeap.hpp" 31 #include "gc_interface/collectedHeap.inline.hpp" 32 #include "memory/referencePolicy.hpp" 33 #include "memory/referenceProcessor.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "runtime/java.hpp" 36 #include "runtime/jniHandles.hpp" 37 38 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 39 40 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL; 41 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL; 42 bool ReferenceProcessor::_pending_list_uses_discovered_field = false; 43 jlong ReferenceProcessor::_soft_ref_timestamp_clock = 0; 44 45 void referenceProcessor_init() { 46 ReferenceProcessor::init_statics(); 47 } 48 49 void ReferenceProcessor::init_statics() { 50 // We need a monotonically non-decreasing time in ms but 51 // os::javaTimeMillis() does not guarantee monotonicity. 52 jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; 53 54 // Initialize the soft ref timestamp clock. 55 _soft_ref_timestamp_clock = now; 56 // Also update the soft ref clock in j.l.r.SoftReference 57 java_lang_ref_SoftReference::set_clock(_soft_ref_timestamp_clock); 58 59 _always_clear_soft_ref_policy = new AlwaysClearPolicy(); |