comparison src/share/vm/utilities/globalDefinitions.hpp @ 4712:e7dead7e90af

7117303: VM uses non-monotonic time source and complains that it is non-monotonic Summary: Replaces calls to os::javaTimeMillis(), which does not (and cannot) guarantee monotonicity, in GC code to an equivalent expression that uses os::javaTimeNanos(). os::javaTimeNanos is guaranteed monotonically non-decreasing if the underlying platform provides a monotonic time source. Changes in OS files are to make use of the newly defined constants in globalDefinitions.hpp. Reviewed-by: dholmes, ysr
author johnc
date Mon, 19 Dec 2011 10:02:05 -0800
parents 436b4a3231bf
children 94ec88ca68e2
comparison
equal deleted inserted replaced
4711:adedfbbf0360 4712:e7dead7e90af
172 // example from seconds to milliseconds and microseconds 172 // example from seconds to milliseconds and microseconds
173 173
174 const int MILLIUNITS = 1000; // milli units per base unit 174 const int MILLIUNITS = 1000; // milli units per base unit
175 const int MICROUNITS = 1000000; // micro units per base unit 175 const int MICROUNITS = 1000000; // micro units per base unit
176 const int NANOUNITS = 1000000000; // nano units per base unit 176 const int NANOUNITS = 1000000000; // nano units per base unit
177
178 const jlong NANOSECS_PER_SEC = CONST64(1000000000);
179 const jint NANOSECS_PER_MILLISEC = 1000000;
177 180
178 inline const char* proper_unit_for_byte_size(size_t s) { 181 inline const char* proper_unit_for_byte_size(size_t s) {
179 if (s >= 10*M) { 182 if (s >= 10*M) {
180 return "M"; 183 return "M";
181 } else if (s >= 10*K) { 184 } else if (s >= 10*K) {