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.
This commit is contained in:
Jemma Issroff 2023-08-28 16:55:58 -04:00 committed by GitHub
parent f726ad9740
commit 3b815ed7da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2023-08-28 20:56:20 +00:00
Merged-By: jemmaissroff
5 changed files with 150 additions and 1 deletions

View file

@ -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"