summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-09 13:46:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-09 13:46:47 +0900
commit5eb446d12f3b6cffd2687fe2c472cbc3374aacf4 (patch)
treebb21a9122db715626a5468c412c1d52e0219b746 /mjit_worker.c
parent1181edd54cdfb86fa6d3fe7cd52deb4b81d370ee (diff)
mjit_worker.c: compile_compact_jit_code is not used on mingw
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index cebb9ce..a839c80 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -896,6 +896,13 @@ compile_c_to_so(const char *c_file, const char *so_file)
static void compile_prelude(FILE *f);
+# ifndef _WIN32 // This requires header transformation but we don't transform header on Windows for now
+# define USE_HEADER_TRANSFORMATION 1
+# else
+# define USE_HEADER_TRANSFORMATION 0
+# endif
+
+# if USE_HEADER_TRANSFORMATION
static bool
compile_compact_jit_code(char* c_file)
{
@@ -918,13 +925,14 @@ compile_compact_jit_code(char* c_file)
fclose(f);
return true;
}
+# endif // USE_HEADER_TRANSFORMATION
// Compile all cached .c files and build a single .so file. Reload all JIT func from it.
// This improves the code locality for better performance in terms of iTLB and iCache.
static void
compact_all_jit_code(void)
{
-# ifndef _WIN32 // This requires header transformation but we don't transform header on Windows for now
+# if USE_HEADER_TRANSFORMATION
struct rb_mjit_unit *unit, *cur = 0;
double start_time, end_time;
static const char c_ext[] = ".c";
@@ -993,7 +1001,7 @@ compact_all_jit_code(void)
free(unit);
verbose(1, "JIT compaction failure (%.1fms): Failed to compact methods", end_time - start_time);
}
-# endif // _WIN32
+# endif // USE_HEADER_TRANSFORMATION
}
#endif // _MSC_VER