[pypy-svn] pypy jit-lsprofile: change C structure a bit to reuse stuff in asm_* instead of copying (wrongly)
fijal
commits-noreply at bitbucket.org
Thu Apr 7 09:18:32 CEST 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jit-lsprofile
Changeset: r43188:5300489d4c50
Date: 2011-04-07 09:18 +0200
http://bitbucket.org/pypy/pypy/changeset/5300489d4c50/
Log: change C structure a bit to reuse stuff in asm_* instead of copying
(wrongly)
diff --git a/pypy/translator/c/src/debug_print.h b/pypy/translator/c/src/debug_print.h
--- a/pypy/translator/c/src/debug_print.h
+++ b/pypy/translator/c/src/debug_print.h
@@ -103,6 +103,8 @@
}
+#define OP_LL_READ_TIMESTAMP(val) READ_TIMESTAMP(val)
+
#ifndef READ_TIMESTAMP
/* asm_xxx.h may contain a specific implementation of READ_TIMESTAMP.
* This is the default generic timestamp implementation.
diff --git a/pypy/translator/c/src/g_include.h b/pypy/translator/c/src/g_include.h
--- a/pypy/translator/c/src/g_include.h
+++ b/pypy/translator/c/src/g_include.h
@@ -38,7 +38,6 @@
#include "src/instrument.h"
#include "src/asm.h"
-#include "src/timer.h"
#include "src/profiling.h"
diff --git a/pypy/translator/c/src/timer.h b/pypy/translator/c/src/timer.h
deleted file mode 100644
--- a/pypy/translator/c/src/timer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef PYPY_TIMER_H
-#define PYPY_TIMER_H
-
-/* XXX Some overlap with the stuff in asm_gcc_x86
- */
-#define OP_LL_READ_TIMESTAMP(v) v = pypy_read_timestamp();
-
-#ifndef PYPY_NOT_MAIN_FILE
-/* implementations */
-
-#ifdef _WIN32
-long long pypy_read_timestamp(void) {
- long long timestamp;
- long long scale;
- QueryPerformanceCounter((LARGE_INTEGER*)&(timestamp));
- return timestamp;
-}
-
-#else
-
-#include "inttypes.h"
-
-long long pypy_read_timestamp(void) {
- uint32_t low, high;
- __asm__ __volatile__ (
- "rdtsc" : "=a" (low), "=d" (high)
- );
- return ((long long)high << 32) + low;
-}
-
-#endif
-#endif
-#endif
More information about the Pypy-commit
mailing list