mjit.c: include mjit_worker.c

instead of linking functions with mjit_worker.o.

In the r64285's structure, we needed to publish some variables with
mjit_ prefix. But ideally those variables should be completely private
in mjit.o (or old mjit_worker.o), and it was hard.

So I chose an approach similar to vm*.c for mjit.c and mjit_worker.c.
I believe mjit_compile.c is still nice to be separated.

After this commit, I'll remove the mjit_ prefix again...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-08-11 09:37:14 +00:00
parent 6306aa9222
commit a48d1d7991
4 changed files with 241 additions and 291 deletions

31
mjit.c
View file

@ -9,38 +9,11 @@
/* Functions in this file are never executed on MJIT worker thread.
So you can safely use Ruby methods and GC in this file. */
#ifdef __sun
#define __EXTENSIONS__ 1
#endif
/* To share variables privately, include mjit_worker.c instead of linking. */
#include "mjit_worker.c"
#include "internal.h"
#include "vm_core.h"
#include "mjit.h"
#include "gc.h"
#include "constant.h"
#include "id_table.h"
#include "ruby_assert.h"
#include "ruby/thread.h"
#include "ruby/util.h"
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/wait.h>
#include <sys/time.h>
#include <dlfcn.h>
#endif
#include <errno.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include "dln.h"
#include "mjit_internal.h"
extern int rb_thread_create_mjit_thread(void (*worker_func)(void));