From 7deb41b0e88b3670476ed86bab541340f5551b52 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 9 Jun 2020 22:30:14 +0900 Subject: Generate C source file to represent `mrb_irep` structures. Type `mrbc -S -B -o ` to generate the C source code that holds compiled `mrb_irep`. Appending the following code to the bottom of the generated code, `mruby` executes the compiled code: ```C int main() { mrb_state *mrb = mrb_open(); struct RProc *p = mrb_proc_new(mrb, &init_irep); mrb_vm_run(mrb, p, mrb_top_self(mrb), 0); mrb_close(mrb); return 0; } ``` Eventually static compile should use this representation, instead of `uint8_t` array that holds `mrb` data, so that we can skip interpreting `mrb` data. --- include/mruby/irep.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mruby/irep.h b/include/mruby/irep.h index 359fb6796..64a38227c 100644 --- a/include/mruby/irep.h +++ b/include/mruby/irep.h @@ -65,6 +65,7 @@ typedef struct mrb_irep { #define MRB_ISEQ_NO_FREE 1 #define MRB_IREP_NO_FREE 2 +#define MRB_IREP_STATIC 3 MRB_API mrb_irep *mrb_add_irep(mrb_state *mrb); -- cgit v1.2.3