summaryrefslogtreecommitdiff
path: root/mjit_c.h
diff options
context:
space:
mode:
Diffstat (limited to 'mjit_c.h')
-rw-r--r--mjit_c.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/mjit_c.h b/mjit_c.h
index 120f07280d..b9569b0bd1 100644
--- a/mjit_c.h
+++ b/mjit_c.h
@@ -1,19 +1,42 @@
// This file is parsed by tool/mjit/generate.rb to generate mjit_c.rb
-#ifndef MJIT_COMPILER_H
-#define MJIT_COMPILER_H
+#ifndef MJIT_C_H
+#define MJIT_C_H
#include "ruby/internal/config.h"
#include "vm_core.h"
#include "vm_callinfo.h"
#include "builtin.h"
+#include "ccan/list/list.h"
#include "mjit.h"
-#include "mjit_unit.h"
#include "shape.h"
// Macros to check if a position is already compiled using compile_status.stack_size_for_pos
#define NOT_COMPILED_STACK_SIZE -1
#define ALREADY_COMPILED_P(status, pos) (status->stack_size_for_pos[pos] != NOT_COMPILED_STACK_SIZE)
+// 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
+};
+
// Storage to keep data which is consistent in each conditional branch.
// This is created and used for one `compile_insns` call and its values
// should be copied for extra `compile_insns` call.
@@ -51,4 +74,4 @@ struct compile_status {
struct inlined_call_context inline_context;
};
-#endif /* MJIT_COMPILER_H */
+#endif /* MJIT_C_H */