aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
Commit message (Collapse)AuthorAgeFilesLines
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-4/+4
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_eval_cmd): fix indent.nobu2011-09-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_object.rb: tests that respond_to? returns false.nobu2011-08-051-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (check_funcall): try respond_to? first if redefined.nobu2011-08-051-4/+13
| | | | | | [Bug #5158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_set_len): new function to set array length.nobu2011-07-291-0/+1
| | | | | | | * vm_eval.c (method_missing): set the length of argv array, to mark arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_apply): get rid of too large alloca.nobu2011-07-291-1/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_pthread.c (rb_thread_create_timer_thread): removedkosaki2011-07-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | rb_disable_interrupt()/rb_enable_interrupt(). * vm_core.h: ditto. * process.c (static void before_exec): ditto. * process.c (static void after_exec): ditto. [Bug #4765] [ruby-dev:43571] * eval_intern.h: removed rb_trap_restore_mask(). * vm_eval.c (rb_throw_obj): ditto. * eval.c (setup_exception): ditto. * signal.c: removed trap_last_mask. * signal.c (trap_restore_mask): removed. * signal.c (init_sigchld): comment clarification why signal block is needed. and removed trap_last_mask operation. * signal.c (trap_ensure): removed trap_last_mask operation. * signal.c (rb_disable_interrupt, rb_enable_interrupt): made static and removed sigdelset(SIGVTALARM) and sigdelset(SIGSEGV). * process.c (rb_syswait): removed implicit signal handler change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, internal.h iseq.h: declare internal functions.akr2011-06-181-1/+0
| | | | | | | | | | | | | | | | | | * compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cancel subversion backfire. sorrymatz2011-03-071-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_set_params): allow GC parameter configuration bymatz2011-03-071-4/+4
| | | | | | | environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c: fix camelCase to snake_case in documentation code examples.naruse2011-03-051-4/+4
| | | | | | | | | | | | | | | | patched by Andrew Grimm. fixes Bug #4469 * marshal.c: ditto. * proc.c: ditto. * sample/biorhythm.rb: ditto. * vm_eval.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prevent temporary objects from GC, and should not usenobu2011-02-201-1/+2
| | | | | | | RSTRING_PTR() for function calls since it evaluates the argument a couple of times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_throw_obj): add GC guard to prevent intermediatenagachika2011-01-261-0/+1
| | | | | | variable from GC. [Bug #4322] [ruby-dev:43108] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_funcall): ensure va_end after va_init_list. Coveritymame2010-11-151-1/+2
| | | | | | Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_call), vm.c (invoke_block_from_c),nobu2010-09-241-0/+8
| | | | | | | | | | vm_insnhelper.c (vm_yield_with_cfunc): pass given block. [ruby-core:32075] * vm_eval.c (rb_funcall_passing_block): new function to call method with passing given block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (vm_call0): fix for VM_METHOD_TYPE_NOTIMPLEMENTED.nobu2010-08-071-0/+1
| | | | | | | [ruby-dev:41953] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (frame_func_id), vm_eval.c (rb_iterate),nobu2010-07-141-0/+1
| | | | | | | | | vm_insnhelper.c (vm_yield_with_cfunc): as the name of a C-level block, use the current method ID at the creation point. [ruby-dev:41852] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed trailing spaces.nobu2010-05-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_caller): update rdoc. a patch from Nobuhiro IMAImame2010-05-241-7/+8
| | | | | | <nov at yo.rim.or.jp> in [ruby-dev:41387]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (vm_backtrace_each), vm_eval.c (rb_catch_obj): suppressnobu2010-05-211-1/+1
| | | | | | warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_caller): update rdoc. a patch from Nobuhiro IMAImame2010-05-201-1/+5
| | | | | | <nov at yo.rim.or.jp> in [ruby-dev:41348]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (vm_backtrace_each): now takes an init function to distinguishmame2010-05-201-6/+4
| | | | | | | | an empty stack from out of stack. [ruby-dev:41366] * vm_eval.c (print_backtrace, rb_thread_backtrace): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_f_caller): return [] instead of nil when the functionmame2010-05-191-2/+4
| | | | | | is called on toplevel. [ruby-dev:41348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (proc_binding): don't propagative filename and line_no ofmame2010-05-161-1/+1
| | | | | | | | binding that is created from C level. [ruby-dev:41322] * vm_eval.c (eval_string_with_cref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Harmonize documentation, in particular regarding:marcandre2010-05-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - methods returning enumerators - array methods and argument naming (array -> ary, an_array -> new_ary) - minor improvements, typo fixed and styling issues Other documentation errors fixed: - return value was self instead of a new array (or vice-versa) for Array#{pop,shift,permutation,repeated_permutation,keep_if} - Array#rindex was missing the form with a block. * dir.c: ditto. * enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify that #each will be finish before any element is yielded. * error.c: ditto. * gc.c: ditto. * hash.c: ditto. * io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948] * numeric.c: ditto. * range.c: ditto. * string.c: ditto. * struct.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (eval_string_with_cref): propagative filename and line_nomame2010-05-091-0/+4
| | | | | | | | | of binding. [ruby-dev:38767] [ruby-core:28307] * vm_core.h (rb_binding_t), proc.c: add filename and line_no fields to preserve them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (vm_backtrace_each): get rid of use of malloc from signalnobu2010-04-151-2/+10
| | | | | | | | | handler by using ruby_engine_name. [ruby-core:29497] * vm_eval.c (print_backtrace): file may be nil when segfaulted in very early stage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (rb_method_location): return attr's location if it is setup.wanabe2010-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | [Feature #2084] * NEWS: follow above. * vm_method.c (rb_add_method): save attr's location. * gc.c (mark_method_entry): mark attr's location. * method.h (rb_method_definition_t): add member to save attr's location. * vm_eval.c (vm_call0): follow above. * vm_insnhelper.c (vm_call_method): ditto. * vm_method.c (rb_method_definition_eq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolutemame2010-03-161-0/+10
| | | | | | | | | | | | | | | path field into rb_iseq_t. The field contains a string representing a path to corresponding source file. or nil when the iseq is created from -e, stdin, eval, etc. This field is used for require_relative. [ruby-dev:40004] * load.c (rb_f_require_relative): add C implementation of require_relative. * prelude.rb (require_relative): get rid of Ruby implementation of require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_cfunc): removed unused variable.nobu2010-02-171-1/+5
| | | | | | | * vm.c (vm_frametype_name): define only when VMDEBUG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_backtrace): "circular require" warning was output tomame2010-01-271-1/+1
| | | | | | | stdout except the first line. All line is output to stderr now. [ruby-dev:40147] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues aboutko12010-01-241-1/+14
| | | | | | | | | | | return and c-return trace. This issue skips (c-)return event with global jump such as break or return. This fix make vm invoke hooks at stack rewind timing. fix [ruby-core:27606] [Bug #2610]. * test/ruby/test_settracefunc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_iterate): remove SEGV (retry).mame2009-12-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_iterate): remove SEGV (use the original patch).mame2009-12-201-11/+13
| | | | | | [ruby-dev:39874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_iterate): pass current block when the argument bl_procmame2009-12-201-7/+11
| | | | | | | | | | | | is NULL. This behavior can be used to make enumerator faster [ruby-dev:39874] * enumerator.c (enumerator_each): pass current block directly instead of trampoline block (enumerator_each_i). * io.c (argf_each_line, argf_each_byte, argf_each_char): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (check_funcall): reset method_missing_reason beforenobu2009-12-191-0/+1
| | | | | | | | trying the call. based on a patch from Yehuda Katz in [ruby-core:27219]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (yield_under): yields self the same as 1.8.shugo2009-12-101-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* avoid SEGV in instance_eval without block.shugo2009-12-041-1/+6
| | | | | | instance_eval does not yield self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (compile_cpath, iseq_compile_each): revertedshugo2009-12-031-4/+6
| | | | | | | | | | | | | | 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (check_funcall_failed): pass ID. [ruby-core:26934]nobu2009-11-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (check_funcall_failed): should rescue user raisedmatz2009-11-281-3/+2
| | | | | | | NoMethodError. rescue all NoMethodError if receiver does not respond to the method name. [ruby-dev:39796] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_search_method_entry): refine error message.akr2009-11-251-9/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_search_method_entry): show flags and klass value inakr2009-11-211-10/+21
| | | | | | | not implemented error message. git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e