summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-07-14 21:53:41 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2022-07-14 22:54:20 -0700
commit6c2cad835a0d7d73a00a5048babb113c4afa388b (patch)
tree555fe5df5f4a4a371a67a5cc1b0e5cd5bdbef374 /mjit.c
parented8c21bbd5071b52d0d0612eadbdad8fe192e974 (diff)
MJIT: Share rb_mjit_unit through mjit_unit.h
mjit_compile.c should be able to access this more easily.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6140
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/mjit.c b/mjit.c
index b52c5fad9f..da3fd9d61e 100644
--- a/mjit.c
+++ b/mjit.c
@@ -87,6 +87,7 @@
#include "vm_core.h"
#include "vm_callinfo.h"
#include "mjit.h"
+#include "mjit_unit.h"
#include "gc.h"
#include "ruby_assert.h"
#include "ruby/debug.h"
@@ -149,29 +150,6 @@ typedef intptr_t pid_t;
# define USE_JIT_COMPACTION 1
#endif
-// The unit structure that holds metadata of ISeq for MJIT.
-struct rb_mjit_unit {
- struct ccan_list_node unode;
- // Unique order number of unit.
- int id;
- // Dlopen handle of the loaded object file.
- void *handle;
- rb_iseq_t *iseq;
-#if defined(_WIN32)
- // DLL cannot be removed while loaded on Windows. If this is set, it'll be lazily deleted.
- char *so_file;
-#endif
- // Only used by unload_units. Flag to check this unit is currently on stack or not.
- bool used_code_p;
- // True if it's a unit for JIT compaction
- bool compact_p;
- // mjit_compile's optimization switches
- struct rb_mjit_compile_info compile_info;
- // captured CC values, they should be marked with iseq.
- const struct rb_callcache **cc_entries;
- unsigned int cc_entries_size; // ISEQ_BODY(iseq)->ci_size + ones of inlined iseqs
-};
-
// Linked list of struct rb_mjit_unit.
struct rb_mjit_unit_list {
struct ccan_list_head head;
@@ -1138,13 +1116,6 @@ convert_unit_to_func(struct rb_mjit_unit *unit)
}
#endif
-// To see cc_entries using index returned by `mjit_capture_cc_entries` in mjit_compile.c
-const struct rb_callcache **
-mjit_iseq_cc_entries(const struct rb_iseq_constant_body *const body)
-{
- return body->jit_unit->cc_entries;
-}
-
// Capture cc entries of `captured_iseq` and append them to `compiled_iseq->jit_unit->cc_entries`.
// This is needed when `captured_iseq` is inlined by `compiled_iseq` and GC needs to mark inlined cc.
//