Reviewers: vogelheim,
Description:
Version 4.5.18.1 (cherry-pick)
Merged dea59184cc44ac131c43596972bea49524dae85e
Merged 9cc183d8996948d71660a8b1dbddfeaee2f79ada
Mark class as exported to fix win build.
Revert of Use CLOCK_REALTIME_COARSE when available. (patchset #1 id:1 of
https://codereview.chromium.org/1151283005/)
BUG=chromium:470930
LOG=N
[email protected]
Please review this at https://codereview.chromium.org/1153543004/
Base URL: https://chromium.googlesource.com/v8/[email protected]
Affected files (+2, -37 lines):
M include/v8.h
M include/v8-version.h
M src/base/platform/time.cc
Index: include/v8-version.h
diff --git a/include/v8-version.h b/include/v8-version.h
index
63d662dbc0a745b4eda87b66b545ef193833a6d7..a7f92597fac1fc8c4ca91f77ca67157ef98c9df9
100644
--- a/include/v8-version.h
+++ b/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 18
-#define V8_PATCH_LEVEL 0
+#define V8_PATCH_LEVEL 1
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
0bc9d6453d476710776ba1d3ac954d479491a50b..83baf8af81ec8fc62fda8b87c60f5be3a65ed6a1
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1198,7 +1198,7 @@ class V8_EXPORT ScriptCompiler {
* For streaming incomplete script data to V8. The embedder should
implement a
* subclass of this class.
*/
- class ExternalSourceStream {
+ class V8_EXPORT ExternalSourceStream {
public:
virtual ~ExternalSourceStream() {}
Index: src/base/platform/time.cc
diff --git a/src/base/platform/time.cc b/src/base/platform/time.cc
index
b9c3c181ab038826599eb86e4943a6a9ccdfd183..b6a11cff34f313661536eb0d20b43cf7d598e479
100644
--- a/src/base/platform/time.cc
+++ b/src/base/platform/time.cc
@@ -20,16 +20,10 @@
#include "src/base/lazy-instance.h"
#include "src/base/win32-headers.h"
#endif
-#include "src/base/atomicops.h"
#include "src/base/cpu.h"
#include "src/base/logging.h"
#include "src/base/platform/platform.h"
-// CLOCK_REALTIME_COARSE was added in Linux 2.6.32.
-#if V8_OS_LINUX && !defined(CLOCK_REALTIME_COARSE)
-#define CLOCK_REALTIME_COARSE 5
-#endif
-
namespace v8 {
namespace base {
@@ -258,40 +252,11 @@ FILETIME Time::ToFiletime() const {
#elif V8_OS_POSIX
Time Time::Now() {
-#ifdef CLOCK_REALTIME_COARSE
- struct timespec ts;
- static const clockid_t kInvalidClockId = static_cast<clockid_t>(-1);
- static clockid_t cached_clock_id = kInvalidClockId;
- clockid_t clock_id = NoBarrier_Load(&cached_clock_id);
- if (V8_UNLIKELY(clock_id == kInvalidClockId)) {
- // Use CLOCK_REALTIME_COARSE when available (linux >= 2.6.32) and
precise
- // enough. Unlike CLOCK_REALTIME, its coarse cousin is normally
serviced
- // from the vDSO, without making an actual system call.
- //
- // CLOCK_REALTIME_COARSE precision is determined by CONFIG_HZ, the
number
- // of ticks per second that the kernel runs at. Granularity can be as
low
- // as one update every few hundred milliseconds so we need to ensure
it is
- // not _too_ coarse. Most kernels are built with CONFIG_HZ=1000,
providing
- // a one millisecond precision that is good enough for our purposes.
- if (clock_getres(CLOCK_REALTIME_COARSE, &ts) < 0 || ts.tv_sec > 0 ||
- ts.tv_nsec > 1000 * 1000) {
- clock_id = CLOCK_REALTIME; // Not available or not suitable.
- } else {
- clock_id = CLOCK_REALTIME_COARSE;
- }
- NoBarrier_Store(&cached_clock_id, clock_id);
- }
- int result = clock_gettime(clock_id, &ts);
- DCHECK_EQ(0, result);
- USE(result);
- return FromTimespec(ts);
-#else
struct timeval tv;
int result = gettimeofday(&tv, NULL);
DCHECK_EQ(0, result);
USE(result);
return FromTimeval(tv);
-#endif
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.