summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-08-28 16:55:58 -0400
committerGitHub <noreply@github.com>2023-08-28 13:55:58 -0700
commit3b815ed7da8261f45b84dcde2c900934f7379dac (patch)
tree84bf9e833e4a572c43d87b545df1d5aba0cbb19b /compile.c
parentf726ad97406dc1c3bccfe74a53931552b9db755f (diff)
Add yarp/yarp_compiler.c (#8042)
* Add yarp/yarp_compiler.c as stencil for compiling YARP This commit adds yarp/yarp_compiler.c, and changes the sync script to ensure that yarp/yarp_compiler.c will not get overwritten * [Misc #119772] Create and expose RubyVM::InstructionSequence.compile_yarp This commit creates the stencil for a compile_yarp function, which we will continue to fill out. It allows us to check the output of compiled YARP code against compiled code without using YARP.
Notes
Notes: Merged-By: jemmaissroff
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 1b382765c7..d7f345d0af 100644
--- a/compile.c
+++ b/compile.c
@@ -43,6 +43,9 @@
#include "builtin.h"
#include "insns.inc"
#include "insns_info.inc"
+#include "yarp/yarp.h"
+
+VALUE rb_iseq_compile_yarp_node(rb_iseq_t * iseq, const yp_node_t * yarp_pointer);
#undef RUBY_UNTYPED_DATA_WARNING
#define RUBY_UNTYPED_DATA_WARNING 0
@@ -855,6 +858,20 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
return iseq_setup(iseq, ret);
}
+static VALUE rb_translate_yarp(rb_iseq_t *iseq, const yp_node_t *node, LINK_ANCHOR *const ret);
+
+VALUE
+rb_iseq_compile_yarp_node(rb_iseq_t * iseq, const yp_node_t * yarp_pointer)
+{
+ DECL_ANCHOR(ret);
+ INIT_ANCHOR(ret);
+
+ CHECK(rb_translate_yarp(iseq, yarp_pointer, ret));
+
+ CHECK(iseq_setup_insn(iseq, ret));
+ return iseq_setup(iseq, ret);
+}
+
static int
rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
{
@@ -13288,3 +13305,5 @@ rb_iseq_ibf_load_extra_data(VALUE str)
RB_GC_GUARD(loader_obj);
return extra_str;
}
+
+#include "yarp/yarp_compiler.c"