зеркало из https://github.com/github/ruby.git
Move YJIT internal macros away from yjit.h. Tweak style
Since this file is exposed to the rest of the codebase and they don't really need to know about things like PLATFORM_SUPPORTED_P.
This commit is contained in:
Родитель
ed723ca76f
Коммит
884b6f3dbb
19
yjit.c
19
yjit.c
|
@ -12,6 +12,25 @@
|
|||
|
||||
#include "yjit_asm.c"
|
||||
|
||||
#ifndef YJIT_CHECK_MODE
|
||||
# define YJIT_CHECK_MODE 0
|
||||
#endif
|
||||
|
||||
// >= 1: print when output code invalidation happens
|
||||
// >= 2: dump list of instructions when regions compile
|
||||
#ifndef YJIT_DUMP_MODE
|
||||
# define YJIT_DUMP_MODE 0
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# define PLATFORM_SUPPORTED_P 0
|
||||
#else
|
||||
# define PLATFORM_SUPPORTED_P 1
|
||||
#endif
|
||||
|
||||
// USE_MJIT comes from configure options
|
||||
#define JIT_ENABLED USE_MJIT
|
||||
|
||||
// Code block into which we write machine code
|
||||
static codeblock_t block;
|
||||
static codeblock_t *cb = NULL;
|
||||
|
|
30
yjit.h
30
yjit.h
|
@ -1,40 +1,18 @@
|
|||
#ifndef YJIT_H
|
||||
#define YJIT_H 1
|
||||
//
|
||||
// This file contains definitions YJIT exposes to the CRuby codebase
|
||||
//
|
||||
|
||||
#ifndef YJIT_H
|
||||
#define YJIT_H 1
|
||||
|
||||
#include "ruby/internal/config.h"
|
||||
#include "ruby_assert.h" // for RUBY_DEBUG
|
||||
#include "vm_core.h"
|
||||
#include "method.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define PLATFORM_SUPPORTED_P 0
|
||||
#else
|
||||
#define PLATFORM_SUPPORTED_P 1
|
||||
#endif
|
||||
|
||||
#define JIT_ENABLED USE_MJIT
|
||||
|
||||
#ifndef YJIT_CHECK_MODE
|
||||
#define YJIT_CHECK_MODE 0
|
||||
#endif
|
||||
|
||||
// >= 1: print when output code invalidation happens
|
||||
// >= 2: dump list of instructions when regions compile
|
||||
#ifndef YJIT_DUMP_MODE
|
||||
#define YJIT_DUMP_MODE 0
|
||||
#endif
|
||||
|
||||
// YJIT_STATS controls whether to support runtime counters in generated code
|
||||
// and in the interpreter.
|
||||
#ifndef YJIT_STATS
|
||||
# define YJIT_STATS RUBY_DEBUG
|
||||
#endif // ifndef YJIT_STATS
|
||||
|
||||
#ifndef rb_iseq_t
|
||||
typedef struct rb_iseq_struct rb_iseq_t;
|
||||
#define rb_iseq_t rb_iseq_t
|
||||
#endif
|
||||
|
||||
struct rb_yjit_options {
|
||||
|
|
Загрузка…
Ссылка в новой задаче