diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-28 00:49:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-28 00:49:25 +0000 |
commit | 614bc7f9f842e9385f64b32c59c79b05e2bd2f59 (patch) | |
tree | bc245fe0afa594cbee09b1d6dda3bd990460ab38 /tool | |
parent | 382085b75b80d8f6ebc2a420a7c0b59791faede4 (diff) |
* tool/compile_prelude.rb: enable optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/compile_prelude.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb index 7cf54110cc..0ed5558ba3 100755 --- a/tool/compile_prelude.rb +++ b/tool/compile_prelude.rb @@ -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); |