mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
load prelude.rb by builtin features.
The script in prelude.rb was embed in MRI to load it (eval this script at everyboot). This commit change the loading process of prelude.rb. MRI doesn't eval a script, but load from compiled binary with builtin feature. So that Init_prelude() does not load `prelude.rb` now.
This commit is contained in:
parent
c9ffe751d1
commit
9c1abe2a6c
3 changed files with 9 additions and 3 deletions
|
@ -163,7 +163,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
|
|||
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
|
||||
|
||||
DEFAULT_PRELUDES = $(GEM_PRELUDE)
|
||||
PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(DEFAULT_PRELUDES)
|
||||
PRELUDE_SCRIPTS = $(DEFAULT_PRELUDES)
|
||||
GEM_PRELUDE = $(srcdir)/gem_prelude.rb
|
||||
PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
|
||||
GOLFPRELUDES = {$(srcdir)}golf_prelude.c
|
||||
|
@ -1000,6 +1000,7 @@ BUILTIN_RB_SRCS = \
|
|||
$(srcdir)/io.rb \
|
||||
$(srcdir)/pack.rb \
|
||||
$(srcdir)/trace_point.rb \
|
||||
$(srcdir)/prelude.rb \
|
||||
$(empty)
|
||||
BUILTIN_RB_INCS = $(BUILTIN_RB_SRCS:.rb=.rbinc)
|
||||
|
||||
|
@ -2231,6 +2232,8 @@ inits.$(OBJEXT): {$(VPATH)}onigmo.h
|
|||
inits.$(OBJEXT): {$(VPATH)}oniguruma.h
|
||||
inits.$(OBJEXT): {$(VPATH)}st.h
|
||||
inits.$(OBJEXT): {$(VPATH)}subst.h
|
||||
inits.$(OBJEXT): {$(VPATH)}builtin.h
|
||||
inits.$(OBJEXT): {$(VPATH)}prelude.rbinc
|
||||
io.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
|
||||
io.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
|
||||
io.$(OBJEXT): $(CCAN_DIR)/list/list.h
|
||||
|
@ -2689,7 +2692,6 @@ prelude.$(OBJEXT): {$(VPATH)}node.h
|
|||
prelude.$(OBJEXT): {$(VPATH)}onigmo.h
|
||||
prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
|
||||
prelude.$(OBJEXT): {$(VPATH)}prelude.c
|
||||
prelude.$(OBJEXT): {$(VPATH)}prelude.rb
|
||||
prelude.$(OBJEXT): {$(VPATH)}ruby_assert.h
|
||||
prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
|
||||
prelude.$(OBJEXT): {$(VPATH)}st.h
|
||||
|
|
4
inits.c
4
inits.c
|
@ -10,6 +10,8 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "internal.h"
|
||||
#include "builtin.h"
|
||||
#include "prelude.rbinc"
|
||||
|
||||
#define CALL(n) {void Init_##n(void); Init_##n();}
|
||||
|
||||
|
@ -66,6 +68,7 @@ rb_call_inits(void)
|
|||
CALL(vm_stack_canary);
|
||||
CALL(gc_stress);
|
||||
|
||||
// enable builtin loading
|
||||
CALL(builtin);
|
||||
|
||||
CALL(GC);
|
||||
|
@ -73,5 +76,6 @@ rb_call_inits(void)
|
|||
CALL(ast);
|
||||
CALL(vm_trace);
|
||||
CALL(pack);
|
||||
load_prelude();
|
||||
}
|
||||
#undef CALL
|
||||
|
|
|
@ -38,7 +38,7 @@ class Prelude
|
|||
@builtin_count = 0
|
||||
@preludes = {}
|
||||
@mains = preludes.map do |filename|
|
||||
if prelude = filename.end_with?("prelude.rb")
|
||||
if prelude = filename.end_with?("_prelude.rb")
|
||||
@prelude_count += 1
|
||||
else
|
||||
@builtin_count += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue