1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* tool/compile_prelude.rb: enable optimization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-28 00:49:25 +00:00
parent 382085b75b
commit 614bc7f9f8
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Wed Apr 28 09:49:21 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* tool/compile_prelude.rb: enable optimization.
Wed Apr 28 09:43:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (warn_balanced): do not warn for EXPR_ENDFN.

View file

@ -113,6 +113,16 @@ prelude_prefix_path(VALUE self)
}
% end
% unless preludes.empty?
VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
static void
prelude_eval(VALUE code, VALUE name, VALUE line)
{
rb_iseq_eval(rb_iseq_compile_with_option(code, name, Qnil, line, Qtrue));
}
% end
% if @have_sublib
static VALUE
prelude_require(VALUE self, VALUE nth)
@ -136,7 +146,7 @@ prelude_require(VALUE self, VALUE nth)
default:
return Qfalse;
}
rb_iseq_eval(rb_iseq_compile(code, name, INT2FIX(1)));
prelude_eval(code, name, INT2FIX(1));
return Qtrue;
}
@ -159,10 +169,10 @@ Init_<%=init_name%>(void)
% end
% preludes.each do |i, prelude, lines, sub|
% next if sub
rb_iseq_eval(rb_iseq_compile(
prelude_eval(
rb_usascii_str_new(prelude_code<%=i%>, sizeof(prelude_code<%=i%>) - 1),
rb_usascii_str_new(prelude_name<%=i%>, sizeof(prelude_name<%=i%>) - 1),
INT2FIX(1)));
INT2FIX(1));
% end
% if @have_sublib or @need_ruby_prefix
rb_gc_force_recycle(prelude);