aboutsummaryrefslogtreecommitdiffstats
path: root/tool/compile_prelude.rb
Commit message (Collapse)AuthorAgeFilesLines
* Drop executable bits of files that are not executable.knu2012-11-221-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warnings.naruse2012-07-251-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c, vm_eval.c: set th->base_block properly.ko12012-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | th->base_block is information for (a) parsing, (b) compiling and (c) setting up the frame to execute the program passed by `eval' method. For example, (1) parser need to know up-level variables to detect it is variable or method without paren. Befor (a), (b) and (c), VM set th->base_block by passed bindng (or previous frame information). After execute (a), (b) and (c), VM should clear th->base_block. However, if (a), (b) or (c) raises an exception, then th->base_block is not cleared. Problem is that the uncleared value th->balo_block is used for irrelevant iseq compilation. It causes SEGV or critical error. I tried to solve this problem: to clear them before exception, but finally I found out that it is difficult to do it (Ruby program can be run in many places). Because of this background, I set th->base_block before compiling iseq and restore it after compiling. Basically, th->base_block is dirty hack (similar to global variable) and this patch is also dirty. * bootstraptest/test_eval.rb: add a test for above. * internal.h: remove unused decl. * iseq.c (rb_iseq_compile_with_option): add base_block parameter. set th->base_block before compation and restore it after compilation. * ruby.c (require_libraries): pass 0 as base_block instead of setting th->base_block * tool/compile_prelude.rb (prelude_eval): apply above changes. * vm.c, vm_eval.c: ditto. * vm_core.h: add comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb (Prelude#initialize): ignore emptynobu2011-01-151-0/+1
| | | | | | preludes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: enable optimization.nobu2010-04-281-3/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: typo.nobu2010-04-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (ruby_init_loadpath_safe): mark initial load paths.nobu2010-03-121-1/+1
| | | | | | | | | | * gem_prelude.rb (push_all_highest_version_gems_on_load_path): search insertion position by initial load path mark. * lib/rubygems.rb (Gem.load_path_insert_index): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: TMP_RUBY_PREFIX should replace rubylibprefix but ↵muraken2010-03-121-1/+1
| | | | | | not prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (ruby_init_loadpath_safe, ruby_init_gems): set and removenobu2010-03-111-77/+145
| | | | | | | | | | | TMP_RUBY_PREFIX. * variable.c (rb_mod_remove_const): new function. * tool/compile_prelude.rb: split each preludes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: fix require path.mame2010-02-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: reverted.nobu2009-09-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: evaluates in the main context.nobu2009-09-081-1/+1
| | | | | | | [ruby-core:25474] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: fixes a regexp pattern for require.yugui2009-08-081-2/+2
| | | | | | It had matched 'require("foo"('. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: too long string literal causes compile errorusa2009-07-311-5/+10
| | | | | | | | on some platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: replaces "require" with in-place evaluationyugui2009-07-301-1/+20
| | | | | | | | | | | so that copy & paste for lib/rubygems/default.rb is not necessary. * gem_prelude.rb: removes copied codes from lib/rubygems/defaults.rb. uses require instead. * common.mk (prelude.c): adds dependency for lib/rubygems/defaults.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/*: executable.nobu2009-06-301-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: use US-ASCII name.nobu2009-06-301-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: print "<internal:prelude>" instead ofmame2008-09-101-1/+1
| | | | | | | "prelude.rb" on stack trace. [ruby-dev:36129] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: allows extra suffix after .c.nobu2008-04-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb (C_ESC): use octal escape to avoidakr2008-02-011-2/+2
| | | | | | | "\x09for (;;) ..." to be interpret the first character 0x9f. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * trunk/common.mk, goruby.c, golf_prelude.rb: for golfers.nobu2007-12-251-1/+2
| | | | | | | | | * trunk/main.c (main): hook for embedding applications. * trunk/tool/compile_prelude.rb: can change initialize function name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: use erb.akr2007-12-211-18/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/enc-setup.mak: extracts BUILTIN_ENCOBJS.nobu2007-12-171-0/+2
| | | | | | | * tool/compile_prelude.rb: needs srcdir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (encs): new target to compile external encodings.nobu2007-12-171-17/+1
| | | | | | | | | | | | | | | | | | * enc/Makefile.in: became a serb template. * enc/make_encmake.rb: creates enc.mk from enc/Makefile.in using serb. * lib/mkmf.rb (relative_from): moved from ext/extmk.rb. * lib/mkmf.rb ($extmk): true if under to top source directory, not only ext. * lib/mkmf.rb (depend_rules): extracted from create_makefile. * tool/serb.rb (serb): splitted from tool/compile_prelude.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: fix TMP_RUBY_PREFIX for relative load pathakr2007-11-151-2/+1
| | | | | | | environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* escape "{" too.akr2007-11-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: absolute path may not start with a slash.akr2007-11-151-2/+2
| | | | | | | pointed by usa. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: fix first substitution.akr2007-11-151-3/+4
| | | | | | | use constant for prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: use constant for prefix.akr2007-11-151-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: use simple template system for sourceakr2007-11-151-32/+38
| | | | | | | code generation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb (c_esc): need to escape closing brace.matz2007-11-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: adjust RbConfig::CONFIG paths relativeakr2007-11-151-12/+26
| | | | | | | to the installation path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add comment for interpreter issue.akr2007-11-101-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use 1.9 feature.akr2007-11-101-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gem_prelude.rb: new file for gem libraries. currently empty.akr2007-11-101-9/+55
| | | | | | | | | | | | | | | | | * common.mk: generate ext_prelude.c by prelude.rb and gem_prelude.rb. ruby (not miniruby) is linked with ext_prelude.o instead of prelude.o. * inits.c (rb_call_inits): don't call Init_prelude. * ruby.c: support --disable-gems option. (ruby_init_gems): new function to define Gem::Enable and invoke Init_prelude. (process_options): call ruby_init_gems just after ruby_init_loadpath. * tool/compile_prelude.rb: support multiple files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (prelude.o): depends on vm_core.h now.nobu2007-08-251-5/+8
| | | | | | | | | | | * common.mk (prelude.c): depends on tool/compile_prelude.rb too. * common.mk (prereq): updates all auto-generated sources. * tool/compile_prelude.rb: separated dynamic and static portions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tool/compile_prelude.rb: fix to include "vm_core.h".ko12007-08-241-3/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prelude.rb: added. run this script on startup.ko12007-08-241-0/+25
* tool/compile_prelude.rb: compile prelude.rb to C string. (prelude.rb -> prelude.c) * common.mk: fix to build with prelude.c. * inits.c (rb_call_inits): ditto. * thread.c (Init_Thread): move definition of Mutex#synchronize to prelude.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e