summaryrefslogtreecommitdiffstats
path: root/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* * compile.c (compile_cpath, iseq_compile_each): revertedshugo2009-12-031-1/+2
| | | | | | | | | | | | | | constant/class variable lookup in instance_eval etc. to the behavior of 1.8. * eval.c (rb_mod_nesting): ditto. * insns.def (putspecialobject, defineclass): ditto. * node.h (NODE_FL_CREF_PUSHED_BY_EVAL): ditto. * vm_core.h (VM_SPECIAL_OBJECT_CONST_BASE): ditto. * vm_eval.c (yield_under, eval_under): ditto. * vm_insnhelper.c (vm_cref_push, vm_get_const_base, vm_get_ev_const, vm_get_cvar_base): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_push_frame): get rid of out-of-boundsnobu2009-11-071-0/+1
| | | | | | | access. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_push_frame): add CHECK_STACK_OVERFLOW.matz2009-11-071-12/+19
| | | | | | | | | | | | | | | | | [ruby-dev:39592] * eval.c (rb_longjmp): add 1 level backtrace for sysstack_error without calling any method to prevent further stack overflow. * eval.c (make_exception): don't call #exception for sysstack_error to prevent stack overflow. * proc.c (Init_Proc): don't freeze sysstack_error. * eval.c (rb_longjmp): move reentrant check after exception preparation. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_exc_raise, rb_exc_fatal, rb_make_exception):nobu2009-11-021-3/+3
| | | | | | | suppressed shorten-64-to-32 warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count): call #size using rb_funcall_no_recursive()matz2009-10-291-32/+0
| | | | | | | | | | | to prevent infinite recursive calls. [ruby-core:24794] * vm_eval.c (rb_funcall_no_recursive): utility function to check direct recursive call. * vm_eval.c (rb_check_funcall): move from eval.c. [refactoring] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz2009-10-291-9/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to_ary. Just call. [ruby-core:23738] * eval.c (rb_check_funcall): new function with method existence check. returns Qundef when the method does not exist. * enumerator.c (enumerator_rewind): just call method, using rb_check_funcall(). [ruby-core:23738] * error.c (exc_equal): ditto. * object.c (convert_type): ditto. * error.c (rb_name_err_mesg_new): export function. * eval.c (make_exception): ditto. * io.c (pop_last_hash): return early when the last argument is nil. * io.c (rb_io_puts): treat T_STRING specially for small optimization. * vm_eval.c (raise_method_missing): skip method call if possible using rb_method_basic_definition_p(). * vm_eval.c (method_missing): ditto. * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_debug): test suites changed to ignore exceptions caused by just-call policy. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_threadptr_errinfo): removed.nobu2009-10-141-6/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_run_node): need to call ruby_cleaup() always evennobu2009-10-141-1/+4
| | | | | | | if any error occurred so far. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Revert changes to Thread#raise made in r25278 [ruby-core:25367]marcandre2009-10-121-1/+1
| | | | | | * eval_intern.h: ditto git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_run_node): if an exception occurred in ruby_option,nobu2009-10-121-9/+19
| | | | | | | the result is not executable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_threadptr_errinfo): renamed.nobu2009-10-101-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_exec_node): removed unused argument.nobu2009-10-101-3/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_threadptr_execute_interrupts_rec, rb_threadptr_raise): ↵marcandre2009-10-101-6/+16
| | | | | | | | Thread#raise with no argument will now re-raise the current exception if there is one [ruby-core:25367] * eval.c (get_errinfo, rb_rubylevel_thread_errinfo): Getter for current exception for a given thread git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_origenviron): remove unused old variable.usa2009-10-021-9/+0
| | | | | | | | [ruby-dev:39412] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (eval.o): needs vm.h.nobu2009-09-181-1/+6
| | | | | | | | | | | * eval.c (ruby_cleanup): destruct current VM before exit. * gc.c (rb_objspace_free): free object space. * vm.c (ruby_vm_destruct): destruct and free VM struct. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h (rb_method_definition_t): split from rb_method_entry_tnobu2009-08-281-1/+1
| | | | | | | | | to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_exc_raise, rb_exc_fatal): nil is used to reraise.nobu2009-08-061-2/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_exc_raise, rb_exc_fatal): require exception object.nobu2009-08-051-0/+2
| | | | | | | [ruby-core:24767] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_longjmp): reset raised flag before fatal error.nobu2009-08-051-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_mod_include): fix document. [ruby-core:24675]mame2009-08-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-5/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longernobu2009-07-161-1/+0
| | | | | | | used. [ruby-dev:38760] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko12009-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | method management. This change affect some VM control stack structure. * vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some refactoring. * insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto. * vm_core.h, compile.c (iseq_specialized_instruction): remove VM_CALL_SEND_BIT. use another optimization tech for Kernel#send. * node.h: remove unused node types. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c: add mark/free functions for method entry. * include/ruby/intern.h: remove decl of rb_define_notimplement_method_id(). nobody can use it because noex is not opend. * iseq.c (iseq_mark): fix to check ic_method is available. * iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rename functions which require a parameterko12009-06-081-2/+2
| | | | | | | | | | | | | | | "rb_thread_t *", the prefix to be rb_threadptr_ instead of rb_thread_. * thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook): change the parameter type from rb_thread_t * to VALUE. * eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c: ditto. * include/ruby/intern.h: remove decl of rb_thread_signal_raise() and rb_thread_signal_exit(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_cleanup): the order of local variables on stack isnobu2009-04-191-6/+7
| | | | | | | | | | | | undefined. should use outermost VALUE for ruby_init_stack. * gc.c (ruby_get_stack_grow_direction, Init_stack): allows volatile pointer. * thread_*.c (ruby_init_stack): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_longjmp), include/ruby/intern.h (ruby_cleanup): fixednobu2009-03-021-1/+1
| | | | | | | prototypes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_iterate): use volatile to suppress warnings.akr2009-02-281-1/+1
| | | | | | | | * eval.c (ruby_cleanup): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): use volatile to suppress warnings.akr2009-02-281-3/+3
| | | | | | | | | | | | | | | * vm_eval.c (eval_string_with_cref): ditto. * thread.c (rb_exec_recursive): ditto. * eval_jump.c (rb_exec_end_proc): ditto. * eval.c (ruby_exec_node): ditto. (rb_longjmp): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_options): evaluator now expects iseq instead of tree.yugui2009-02-221-4/+4
| | | | | | * ruby.c (ruby_process_options): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (vm_backtrace_each): now takes an iterator function.nobu2009-02-011-1/+0
| | | | | | | | | | | | | | * vm_core.h (rb_make_backtrace, rb_backtrace_each): added prototypes. * vm_dump.c (rb_vm_bugreport), vm_eval.c (rb_backtrace): gets rid of allocating objects. * vm_eval.c (rb_backtrace_each): new function which iterates over each backtrace info. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),nobu2009-02-011-2/+2
| | | | | | | | | | | eval.c (rb_iterator_p, rb_need_block), load.c: (Init_load), ruby.c (uscore_get, rb_f_chop), st.c (stat_col), signal.c (rb_signal_buff_size, ruby_sig_finalize), thread.c (rb_thread_sleep_forever, rb_thread_sleep_deadly, rb_thread_alone): protoized. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c, eval.c (rb_f_block_given_p): move definition ofko12009-01-191-42/+0
| | | | | | | | | | | | "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/trunk@21660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add a prefix "rb_" to exposed functionsko12009-01-191-3/+3
| | | | | | | | | | | | | | | | | 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/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm_eval.c (rb_f_local_variables): move definition from eval.cko12009-01-191-59/+0
| | | | | | | | | | 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/trunk@21651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c: remove unused decl.ko12009-01-121-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_frame_callee, rb_frame_caller): rb_frame_callee()ko12008-12-271-1/+7
| | | | | | | | | | | | 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/trunk@21093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (get_errinfo): return th->errinfo valueko12008-12-271-1/+2
| | | | | | | | | | 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/trunk@21086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.ko12008-12-271-1/+1
| | | | | | | | | | | | | | | | | | * 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/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_make_exception): single argument to raise may bematz2008-12-081-3/+3
| | | | | | string compatible object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20585 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