Skip to content

Commit

Permalink
Demote mjit_instruction.rb from builtin to stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Sep 18, 2022
1 parent 67417e7 commit 0e816e6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion inits.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ rb_call_builtin_inits(void)
#if USE_MJIT
BUILTIN(mjit);
BUILTIN(mjit_compiler);
BUILTIN(mjit_instruction);
#endif
Init_builtin_prelude();
}
Expand Down
1 change: 0 additions & 1 deletion mjit_compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions mjit_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions template/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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' \
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions win32/Makefile.sub
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e816e6

Please sign in to comment.