summaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* merges r24403 and r24439 from trunk into ruby_1_9_1.yugui2009-08-081-0/+6
| | | | | | | | | | -- * eval.c (rb_exc_raise, rb_exc_fatal): require exception object. [ruby-core:24767] -- * eval.c (rb_exc_raise, rb_exc_fatal): nil is used to reraise. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24401 from trunk into ruby_1_9_1.yugui2009-08-081-0/+1
| | | | | | | | | -- * eval.c (rb_longjmp): reset raised flag before fatal error. * eval_error.c (error_print): file can be NULL. line can be 0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r24148 from trunk into ruby_1_9_1.yugui2009-07-171-1/+0
| | | | | | | | -- * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer used. [ruby-dev:38760] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r23210 from trunk into ruby_1_9_1.yugui2009-05-041-3/+4
| | | | | | | | -- * eval.c (ruby_cleanup): the order of local variables on stack is undefined. should use outermost VALUE for ruby_init_stack. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21660 from trunk into ruby_1_9_1.yugui2009-01-281-42/+0
| | | | | | | | | | | * vm_eval.c, eval.c (rb_f_block_given_p): move definition of "iterator?" and "block_given?" to make static. * vm.c (vm_get_ruby_level_caller_cfp): make it static. * eval_intern.h, vm_insnhelper.c: move decl. of vm_get_ruby_level_caller_cfp() from eval_intern.h to vm_insnhelper.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21659 from trunk into ruby_1_9_1.yugui2009-01-281-3/+3
| | | | | | | | | | | | | | | | * vm.c: add a prefix "rb_" to exposed functions vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(), vm_get_sourceline(), vm_cref(), vm_localjump_error(), vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump(). This changes may affect only core because most of renamed functions require a pointer of not-exposed struct such as rb_thread_t or NODE. In short, they are core functions. * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c, vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21651 from trunk into ruby_1_9_1.yugui2009-01-281-59/+0
| | | | | | | | | * eval.c, vm_eval.c (rb_f_local_variables): move definition from eval.c to vm_eval.c because vm_collect_local_variables_in_heap() should be static function. * vm.c (vm_collect_local_variables_in_heap): make it static. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21093 from trunk into ruby_1_9_1.yugui2008-12-281-1/+7
| | | | | | | | | | | * eval.c (rb_frame_callee, rb_frame_caller): rb_frame_callee() should return method id on current frame. add rb_frame_caller() to get method id on parent frame. Bug #884 [ruby-dev:37446] * eval.c (rb_f_method_name): use rb_frame_caller() instead of rb_frame_callee(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21086 from trunk into ruby_1_9_1.yugui2008-12-281-1/+2
| | | | | | | | | * eval.c (get_errinfo): return th->errinfo value if normal errinfo place (dynamic local viriable) is not found. fixes Bug #732 [ruby-dev:37046]. * bootstraptest/test_proc.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r21079 from trunk into ruby_1_9_1.yugui2008-12-271-1/+1
| | | | | | | | | | | | | | | | | * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first. * vm.c (vm_set_main_stack, rb_iseq_eval_main): added. * parse.y (rb_parser_compile_file): fix to check parse_in_eval flag. * eval.c (ruby_exec_node): use rb_iseq_eval_main() instead of rb_iseq_eval(). * iseq.c (rb_iseq_new_main), vm_core.h: added. main script (specified by -e or script name) should be run under TOPLEVEL_BINDING using Kernel#eval. Above changes simulate Kernel#eval behaviour. [ruby-dev:37240] * compile.c (make_name_for_block): skip iseq except block type. this fix is needed for [ruby-dev:37240], and also fixes [ruby-dev:35392]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merges r20585 from trunk into ruby_1_9_1.yugui2008-12-121-3/+3
| | | | | | | * eval.c (rb_make_exception): single argument to raise may be string compatible object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* removed unsupported platforms from an ifdef macro.yugui2008-10-051-1/+1
| | | | | | These lines were mistakenly removed at r19681 and recovered too much at r19684. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: come back definition of environ.naruse2008-10-051-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports VMS.yugui2008-10-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * error.c: ditto. * eval.c: ditto. * eval_intern.h: ditto. * include/ruby/defines.h: ditto. * include/ruby/ruby.h: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * vms/config.h: removed. * vms/vms.h: ditto. * vms/vmsruby_private.c: ditto. * vms/vmsruby_private.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports Windows CE.yugui2008-10-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: ditto. * include/ruby/defines.h: ditto. * include/ruby/win32.h: ditto. * ruby.c: ditto. * strftime.c: ditto. * win32/Makefile.sub: ditto. * win32/win32.c: ditto. * ext/tk/extconf.rb: ditto. * lib/fileutils.rb: ditto. * test/fileutils/test_fileutils.rb: ditto. * wince/*: removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports MacOS 9 or before.yugui2008-10-041-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: ditto. * eval_intern.h: ditto. * ext/extmk.rb: ditto. * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto. * ext/tk/stubs.c: ditto. * file.c: ditto. * hash.c: ditto. * include/ruby/defines.h: ditto. * ruby.c: ditto. * signal.c: ditto. * vm_core.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (Init_vm_eval): define module_eval, class_eval and evalakr2008-09-251-3/+0
| | | | | | | here for rdoc. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, vm_core.h: move definition ofko12008-09-231-53/+1
| | | | | | | | | | | | | | | | | | | | | RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_safe.c, safe.c: rename eval_safe.c to safe.c.ko12008-09-231-3/+0
| | | | | | | | | * common.mk, eval.c, safe.c, inits.c: separate safe.c from eval.c and make Init_safe(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko12008-09-151-3/+0
| | | | | | | | | | | | | | to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/signal.h: removed.ko12008-09-031-26/+0
| | | | | | | | | | | | | | | * common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c, io.c, process.c, signal.c: vm_core.h: ditto. Some unused external global variables are also removed. (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending, rb_thread_critical) * ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c, ext/readline/readline.c, ext/socket/depend, ext/socket/socket.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): typo fixed in r17833.nobu2008-07-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freezenobu2008-07-021-1/+2
| | | | | | | messages of preallocated special exceptions also. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_interrupt): trick to suppress GCC warning.shyouhei2008-07-011-2/+1
| | | | | | | * sprintf.c (rb_str_format): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_block_given_p): fix to skip class frame.ko12008-06-151-2/+6
| | | | | | | | | [ruby-core:14813] * KNOWNBUGS.rb, bootstraptest/test_method.rb: move solved test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (rb_vm_t), vm.c (rb_vm_mark): moved preallocated specialnobu2008-06-151-3/+6
| | | | | | | | | | | | | | | | exceptions. * eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze preallocated special exceptions. * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace if it was frozen. * gc.c (rb_memerror): raise nomem_error without backtrace if failed to make backtrace. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, eval_intern.h (PASS_PASSED_BLOCK):ko12008-06-101-6/+4
| | | | | | | | | | | | | | | set a VM_FRAME_FLAG_PASSED flag to skip this frame when searching ruby-level-cfp. * eval.c, eval_intern.h, proc.c: fix to check cfp. if there is no valid ruby-level-cfp, cause RuntimeError exception. [ruby-dev:34128] * vm_core.h, vm_evalbody.c, vm.c, vm_dump.c, vm_insnhelper.c, insns.def: rename FRAME_MAGIC_* to VM_FRAME_MAGIC_*. * KNOWNBUGS.rb, bootstraptest/test*.rb: move solved bugs. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_stack): don't declare. it is a macro now.akr2008-06-091-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-1/+1
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_finalize_0): clear trace_func after executing ENDmame2008-06-051-1/+1
| | | | | | | | | procs. * thread.c: fix typo. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_method.c: renamed from vm_method.c. "vm_method.c" is includedko12008-05-241-1523/+15
| | | | | | | | | | | | | | | by "vm.c". * vm_eval.c: added. Some codes are moved from "eval.c" * common.mk: fix for above changes. * compile.c: make a vm_eval(0) * eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c, id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c, blockinlining.c: fix for above changes. and do some refactoring. this changes improve rb_yield() performance. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, eval_intern.h, include/ruby/intern.h, include/ruby/ruby.h,ko12008-05-221-20/+20
| | | | | | | | vm.c, vm_core.h, vm_insnhelper.c: remove pointless "const". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm.c, vm_core.h, vm_insnhelper.c: specify "const".ko12008-05-221-21/+22
| | | | | | | | * vm_opts.h: add a OPT_TOKEN_THREADED_CODE macro. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm_insnhelper.c: fix cref in instance_evalko12008-05-191-1/+1
| | | | | | | | | | | and cvar_base search protocol. * bootstraptest/test_knownbug.rb, test_eval.rb: move soleved test and add new tests. * test/ruby/test_eval.rb: fix tests for spec. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.ko12008-05-191-95/+36
| | | | | | | | | | | | | | VM value stack frame of block contains cref information. (dfp[-1] points CREF) * compile.c, eval_intern.h, eval_method.c, load.c, proc.c, vm_dump.h, vm_core.h: ditto. * include/ruby/ruby.h, gc.c: remove T_VALUES because of above changes. * bootstraptest/test_eval.rb, test_knownbug.rb: move solved test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): defer calling of rb_frame_self() until itmatz2008-05-131-2/+5
| | | | | | | | become really necessary. * eval.c (rb_call): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): wrap ruby_finalize_0 by SAVE_ROOT_JMPBUF toakr2008-05-051-1/+7
| | | | | | | avoid SEGV by at_exit { Fiber.new{}.resume } on IA64. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_respond_to): check the result of respond_to? methodakr2008-05-041-1/+1
| | | | | | | by RTEST. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):nobu2008-04-121-12/+9
| | | | | | | | | | | | | | | | use iseq instead of NODE. * gc.c (source_filenames): removed. * include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free, ripper_initialize): rb_source_filename() is no longer used. * compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos, parser_warn, e_option_supplied, warn_unless_e_option, range_op, cond0): nd_file is no longer used. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_loop): Mention StopIteration in the document.knu2008-04-101-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h: add new constants for rb_call()'s scope.matz2008-04-011-9/+6
| | | | | | | | | | * eval.c (iterate_method): use CALL_* scope constant to specify proper scope value. * eval.c (rb_each, rb_apply, rb_funcall, rb_funcall2, rb_funcall3): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_instance_eval): invalid comment syntax.nobu2008-03-211-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h (rb_thread_raised_set): use generic flags.nobu2008-03-121-11/+4
| | | | | | | | | | | * eval.c (rb_longjmp): clear all raised flags. * eval.c (stack_check): leave clearing flag to rb_longjmp. * gc.c (rb_memerror): use thread raised flag instead of static flag. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_local_variables): local_variables should return anmatz2008-03-101-1/+1
| | | | | | | | array of symbols. [ruby-dev:34008] * vm.c (collect_local_variables_in_env): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix doc.akr2008-03-091-5/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (stack_check): made flag per threads.nobu2008-02-281-7/+9
| | | | | | | * thread.c (rb_thread_set_raised, rb_thread_reset_raised): prefixed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_raise_jump): moved adjustment for control frame.nobu2008-02-191-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node): no thread starts inside iseq compilation.nobu2008-02-191-3/+5
| | | | | | | | | * eval.c (rb_f_raise): skip current control frame. [ruby-core:15589] * insns.def (opt_div): raise as the ordinary method. [ruby-core:15589] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (eval): allow to eval in a binding that has a singleton method.mame2008-02-131-1/+1
| | | | | | | | | | | | [ruby-dev:33763] * test/ruby/test_proc.rb: add tests to achieve over 70% test coverage of time.c. * test/ruby/test_method.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e