summaryrefslogtreecommitdiffstats
path: root/vm_eval.c
Commit message (Collapse)AuthorAgeFilesLines
* * vm_eval.c (rb_search_method_entry): show flags and klass value inakr2009-11-211-10/+21
| | | | | | | not implemented error message. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_search_method_entry): avoid trigraph.akr2009-11-201-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_search_method_entry): show the type of the hiddenakr2009-11-181-6/+52
| | | | | | | | object. (rb_type_str): new function for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): protected singleton methods ofshugo2009-11-161-1/+1
| | | | | | | | | | an object should not be able to called from other instances of the class of the object. [ruby-core:26761] * vm_eval.c (rb_method_call_status): ditto. * test/ruby/test_module.rb (test_protected_singleton_method): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count): remove optimization using #size.matz2009-10-311-15/+3
| | | | | | | | revert r25560. * vm_eval.c (rb_funcall_no_recursive): remove method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (check_funcall): logic updated according tomatz2009-10-311-16/+56
| | | | | | | | | | | | | [ruby-dev:39594]. search method entry, call if it exists; otherwise check method_missing, call if it was overridden, protecting exceptions; if NoMethodError happens, check method name. * vm_eval.c (vm_call0): use idMethodMissing. * vm_eval.c (rb_search_method_entry): typo fixed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (enum call_type): get rid of last comma.nobu2009-10-301-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (vm_call0, vm_call_super, rb_f_send, rb_f_public_send):nobu2009-10-301-7/+8
| | | | | | | fixed call_type. [ruby-dev:39581] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_search_method_emtry, rb_method_call_status): splitnobu2009-10-301-73/+67
| | | | | | | | | | | | from rb_call0(). * vm_eval.c (rb_check_funcall): get rid of raising exceptions and hiding further exceptions. [ruby-dev:39584] * vm_eval.c (rb_funcall_no_recursive): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count): call #size using rb_funcall_no_recursive()matz2009-10-291-0/+42
| | | | | | | | | | | 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-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * vm_eval.c (eval_string): rdoc fix [ruby-core:26086]marcandre2009-10-141-5/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25129 ↵matz2009-09-281-0/+8
| | | | b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu2009-09-211-3/+5
| | | | | | | | | thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_catch_obj, rb_catch, rb_f_catch): No longer use the obsolete ↵marcandre2009-09-151-32/+24
| | | | | | function rb_iterate. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (eval_string_with_cref): fix to check local_table_size.ko12009-09-011-1/+1
| | | | | | | | [ruby-dev:39205] [Bug #2024] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Doxygen comment.yugui2009-08-291-0/+59
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_call0): gets rid of checking method cache twice.yugui2009-08-291-1/+1
| | | | | | | * method.h (rb_get_method_entry): added a prototype of the function. (rb_method_entry_without_cache): more friendly name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h (rb_method_definition_t): split from rb_method_entry_tnobu2009-08-281-14/+17
| | | | | | | | | 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
* * vm.c (vm_backtrace_each, vm_backtrace_push),nobu2009-08-161-2/+3
| | | | | | | | vm_eval.c (print_backtrace), vm_dump.c (bugreport_backtrace): rb_backtrace_iter_func now takes VALUE as file and method names. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c: adjusted indent.nobu2009-07-161-58/+58
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko12009-07-151-114/+134
| | | | | | | | | | | | | | | | | | | | | 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
* * vm_eval.c (rb_call0): refine exception message for hidden objects.akr2009-06-151-2/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c, vm_eval.c: add Thread.backtrace.ko12009-06-141-0/+19
| | | | | | | | * test/ruby/test_thread.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_local_variables): now returns symbols. a patch fromnobu2009-06-121-1/+1
| | | | | | | Run Paint Run Run at [ruby-core:23828]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_catch): updated rdoc about generalized argument,nobu2009-06-121-5/+11
| | | | | | | and the case without arguments. [ruby-core:23827] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_throw): fixed rdoc about execption.nobu2009-06-121-1/+1
| | | | | | | [ruby-core:23824] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long tonobu2009-05-201-4/+4
| | | | | | | | | cast to int. [ruby-dev:38508] * struct.c, vm_eval.c, vm_insnhelper.c: use RARRAY_LENINT. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c, vm_insnhelper.c: argument number is restricted tonobu2009-05-201-3/+3
| | | | | | | int, and fixed overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_catch): gets rid of issue with gcc 4.4. a patchnobu2009-05-091-1/+1
| | | | | | | from Alexey Froloff in [ruby-core:23398]. [ruby-core:22924] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (eval_string_with_cref): replaces the message ifnobu2009-03-301-3/+11
| | | | | | | frozen. [ruby-dev:38208] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_throw_obj): inverted call flow. [ruby-core:22872]nobu2009-03-131-21/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22927 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-1/+1
| | | | | | | | | | | | | | | * 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
* stripped trailing spaces.nobu2009-02-221-2/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (method_missing): should not pop cfp if missing methodnobu2009-02-221-6/+27
| | | | | | | | | | | | | is method_missing. [ruby-core:22298] * vm_eval.c (rb_raise_method_missing): new function to directly raise NoMethodError. * vm_insnhelper.c (vm_call_method): fixed the case method_missing is missing. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (eval_string_with_cref): use rb_vm_get_ruby_level_next_cfp()ko12009-02-131-1/+1
| | | | | | | | | | | instead of vm_get_ruby_level_caller_cfp(). checking a upper frame is not enough. [ruby-dev:37984] * proc.c, vm_core.h: declare rb_vm_get_ruby_level_next_cfp() on vm_core.h. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (vm_backtrace_each): now takes an iterator function.nobu2009-02-011-7/+15
| | | | | | | | | | | | | | * 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
* * vm_eval.c, eval.c (rb_f_block_given_p): move definition ofko12009-01-191-0/+41
| | | | | | | | | | | | "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-2/+2
| | | | | | | | | | | | | | | | | 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
* * iseq.c:ko12009-01-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn(). rename ruby_iseq_disasm() -> rb_iseq_disasm(). * compile.c: rename ruby_iseq_compile() -> rb_iseq_compile_node(). rename ruby_iseq_translate_threaded_code() -> rb_iseq_translate_threaded_code(). rename ruby_insns_name_array() -> rb_insns_name_array(). rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary(). * iseq.c, compile.c: remove ruby_insn_make_insn_table() and make static function insn_make_insn_table(). * iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c, blockinlining.c: ditto. Rename strange "ruby_" prefix to "rb_" prefix. This changes may affect only core because renamed functions require a pointer of rb_iseq_t which is not exposed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm_eval.c (rb_f_local_variables): move definition from eval.cko12009-01-191-0/+58
| | | | | | | | | | 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
* * vm_eval.c (rb_f_loop): return enumerator if no block given.matz2008-12-271-1/+2
| | | | | | [ruby-list:45747] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead ofko12008-12-271-4/+4
| | | | | | | | | | | | | calling id when NODE_CFUNC or NODE_BMETHOD. fixes Bug #632 [ruby-core:19282]. * vm_eval.c (vm_call0, vm_call_super): ditto. * vm_method.c (rb_add_method, rb_alias): store original id in nd_file field of NODE_METHOD. * test/stringio/test_stringio.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_method): use class of method definedko12008-12-241-1/+1
| | | | | | | | | | | | instead of receiver's class on bmethod. fixes [ruby-core:20786] * bootstraptest/test_method.rb: add a test for above. * vm_insnhelper.c (vm_setup_method): remove unused parameter klass. * vm_insnhelper.h (CALL_METHOD): ditto. * insns.def, vm_eval.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (vm_call0): NODE_ZSUPER supported. [ruby-core:20480]nobu2008-12-151-0/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (vm_call_super): uses method_missing().nobu2008-12-151-26/+20
| | | | | | | | | | | | | | | * vm_eval.c (method_missing): get rid of too large alloca. * vm_eval.c (rb_call0, method_missing): uses idMethodMissing. * vm_method.c (rb_add_method, remove_method, rb_undef): uses id__send__. * vm_method.c (Init_eval_method): removed IDs which are defined as immediate values. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu2008-12-091-1/+1
| | | | | | | | | | | | | (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (Init_vm_eval): define module_eval, class_eval and evalakr2008-09-251-0/+3
| | | | | | | here for rdoc. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e