Bug 1030683 - TraceLogger: Add rdtsc for windows, r=bbouvier
authorHannes Verschore <hv1989@gmail.com>
Tue, 01 Jul 2014 06:09:49 +0200
changeset 191643 24d52aa823e52a4e89f193593a2709c476607b9e
parent 191642 b21454d24b051c083fa4ab2aa2f424559db5da61
child 191644 a71d040bbfe814c81eea54cd7126dcadc3d759ed
push id27055
push usercbook@mozilla.com
push dateTue, 01 Jul 2014 12:01:46 +0000
treeherdermozilla-central@4a9353b5762d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1030683
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1030683 - TraceLogger: Add rdtsc for windows, r=bbouvier
js/src/vm/TraceLogging.cpp
--- a/js/src/vm/TraceLogging.cpp
+++ b/js/src/vm/TraceLogging.cpp
@@ -23,17 +23,24 @@ using mozilla::NativeEndian;
 #ifndef TRACE_LOG_DIR
 # if defined(_WIN32)
 #  define TRACE_LOG_DIR ""
 # else
 #  define TRACE_LOG_DIR "/tmp/"
 # endif
 #endif
 
-#if defined(__i386__)
+#if defined(_WIN32)
+#include <intrin.h>
+static __inline uint64_t
+rdtsc(void)
+{
+    return __rdtsc();
+}
+#elif defined(__i386__)
 static __inline__ uint64_t
 rdtsc(void)
 {
     uint64_t x;
     __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
     return x;
 }
 #elif defined(__x86_64__)