From 6c2cad835a0d7d73a00a5048babb113c4afa388b Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 14 Jul 2022 21:53:41 -0700 Subject: MJIT: Share rb_mjit_unit through mjit_unit.h mjit_compile.c should be able to access this more easily. --- mjit.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'mjit.c') 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. // -- cgit v1.2.3