diff --git a/.gitignore b/.gitignore index 52089ac21cf3a7..73012bb3ed1b40 100644 --- a/.gitignore +++ b/.gitignore @@ -236,7 +236,7 @@ lcov*.info /rb_mjit_header.h /mjit_config.h /include/ruby-*/*/rb_mjit_min_header-*.h -/mjit_instruction.rb +/lib/mjit/instruction.rb # /wasm/ /wasm/tests/*.wasm diff --git a/common.mk b/common.mk index 5f016d6fc34b21..2956e2c93e6ffc 100644 --- a/common.mk +++ b/common.mk @@ -1081,7 +1081,6 @@ BUILTIN_RB_SRCS = \ $(srcdir)/marshal.rb \ $(srcdir)/mjit.rb \ $(srcdir)/mjit_compiler.rb \ - $(srcdir)/mjit_instruction.rb \ $(srcdir)/pack.rb \ $(srcdir)/trace_point.rb \ $(srcdir)/warning.rb \ @@ -1173,7 +1172,7 @@ vm_call_iseq_optimized.inc: $(srcdir)/template/call_iseq_optimized.inc.tmpl $(ECHO) generating $@ $(Q) $(BASERUBY) $(tooldir)/generic_erb.rb -c -o $@ $(srcdir)/template/call_iseq_optimized.inc.tmpl -$(MINIPRELUDE_C): $(COMPILE_PRELUDE) $(BUILTIN_RB_SRCS) $(srcdir)/mjit_instruction.rb +$(MINIPRELUDE_C): $(COMPILE_PRELUDE) $(BUILTIN_RB_SRCS) $(ECHO) generating $@ $(Q) $(BASERUBY) $(tooldir)/generic_erb.rb -I$(srcdir) -o $@ \ $(srcdir)/template/prelude.c.tmpl $(BUILTIN_RB_SRCS) @@ -9302,7 +9301,6 @@ miniinit.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h miniinit.$(OBJEXT): $(CCAN_DIR)/list/list.h miniinit.$(OBJEXT): $(CCAN_DIR)/str/str.h miniinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h -miniinit.$(OBJEXT): $(srcdir)/mjit_instruction.rb miniinit.$(OBJEXT): $(top_srcdir)/internal/array.h miniinit.$(OBJEXT): $(top_srcdir)/internal/compilers.h miniinit.$(OBJEXT): $(top_srcdir)/internal/gc.h @@ -9494,7 +9492,6 @@ miniinit.$(OBJEXT): {$(VPATH)}miniprelude.c miniinit.$(OBJEXT): {$(VPATH)}missing.h miniinit.$(OBJEXT): {$(VPATH)}mjit.rb miniinit.$(OBJEXT): {$(VPATH)}mjit_compiler.rb -miniinit.$(OBJEXT): {$(VPATH)}mjit_instruction.rb miniinit.$(OBJEXT): {$(VPATH)}nilclass.rb miniinit.$(OBJEXT): {$(VPATH)}node.h miniinit.$(OBJEXT): {$(VPATH)}numeric.rb @@ -9748,7 +9745,6 @@ mjit_compiler.$(OBJEXT): $(CCAN_DIR)/list/list.h mjit_compiler.$(OBJEXT): $(CCAN_DIR)/str/str.h mjit_compiler.$(OBJEXT): $(hdrdir)/ruby.h mjit_compiler.$(OBJEXT): $(hdrdir)/ruby/ruby.h -mjit_compiler.$(OBJEXT): $(srcdir)/mjit_instruction.rb mjit_compiler.$(OBJEXT): $(top_srcdir)/internal/array.h mjit_compiler.$(OBJEXT): $(top_srcdir)/internal/class.h mjit_compiler.$(OBJEXT): $(top_srcdir)/internal/compile.h @@ -9934,7 +9930,6 @@ mjit_compiler.$(OBJEXT): {$(VPATH)}mjit_compiler.c mjit_compiler.$(OBJEXT): {$(VPATH)}mjit_compiler.h mjit_compiler.$(OBJEXT): {$(VPATH)}mjit_compiler.rb mjit_compiler.$(OBJEXT): {$(VPATH)}mjit_compiler.rbinc -mjit_compiler.$(OBJEXT): {$(VPATH)}mjit_instruction.rbinc mjit_compiler.$(OBJEXT): {$(VPATH)}mjit_unit.h mjit_compiler.$(OBJEXT): {$(VPATH)}node.h mjit_compiler.$(OBJEXT): {$(VPATH)}ruby_assert.h diff --git a/inits.c b/inits.c index f43ece0e47a024..65a54d8f29b026 100644 --- a/inits.c +++ b/inits.c @@ -105,7 +105,6 @@ rb_call_builtin_inits(void) #if USE_MJIT BUILTIN(mjit); BUILTIN(mjit_compiler); - BUILTIN(mjit_instruction); #endif Init_builtin_prelude(); } diff --git a/mjit_compiler.c b/mjit_compiler.c index 5163bbcf6bf7a6..2594678f779aad 100644 --- a/mjit_compiler.c +++ b/mjit_compiler.c @@ -165,6 +165,5 @@ has_cache_for_send(rb_execution_context_t *ec, VALUE self, VALUE cc_addr, VALUE extern bool rb_splat_or_kwargs_p(const struct rb_callinfo *restrict ci); #include "mjit_compiler.rbinc" -#include "mjit_instruction.rbinc" #endif // USE_MJIT diff --git a/mjit_compiler.rb b/mjit_compiler.rb index 9e032fc747703e..4996e773dcd2a5 100644 --- a/mjit_compiler.rb +++ b/mjit_compiler.rb @@ -132,5 +132,6 @@ def rb_cSymbol; Primitive.cexpr! 'PTR2NUM(rb_cSymbol)' end def rb_cFloat; Primitive.cexpr! 'PTR2NUM(rb_cFloat)' end end + require "mjit/instruction" require "mjit/compiler" end diff --git a/template/Makefile.in b/template/Makefile.in index a644a92754f425..06878d552f13ad 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -504,6 +504,11 @@ clean-local:: $(Q)$(RM) -r mjit_build_dir.* -$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD) +main: $(srcdir)/lib/mjit/instruction.rb +$(srcdir)/lib/mjit/instruction.rb: $(tooldir)/ruby_vm/views/instruction.rb.erb $(srcdir)/insns.def + $(ECHO) generating $@ + $(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@ + # DTrace static library hacks described here: # https://marc.info/?l=opensolaris-dtrace-discuss&m=114761203110734&w=4 ruby-glommed.$(OBJEXT): @@ -669,10 +674,6 @@ $(INSNS): $(srcdir)/insns.def vm_opts.h \ $(ECHO) generating $@ $(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@ -$(srcdir)/mjit_instruction.rb: $(tooldir)/ruby_vm/views/mjit_instruction.rb.erb - $(ECHO) generating $@ - $(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@ - loadpath: verconf.h @$(CPP) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/loadpath.c | \ sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \ diff --git a/tool/ruby_vm/views/mjit_instruction.rb.erb b/tool/ruby_vm/views/instruction.rb.erb similarity index 100% rename from tool/ruby_vm/views/mjit_instruction.rb.erb rename to tool/ruby_vm/views/instruction.rb.erb diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 361af556cdab9e..e84f978bb72e4f 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1351,10 +1351,6 @@ INSNS = opt_sc.inc optinsn.inc optunifs.inc insns.inc insns_info.inc \ ! endif !endif -$(srcdir)/mjit_instruction.rb: $(tooldir)/ruby_vm/views/mjit_instruction.rb.erb - $(ECHO) generating $@ - $(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@ - verconf.h: verconf.mk loadpath: verconf.h