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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (get_errinfo, rb_rubylevel_thread_errinfo): Getter for current exception for a given thread
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
"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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
"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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
These lines were mistakenly removed at r19681 and recovered too much at r19684.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk, eval.c, safe.c, inits.c: separate safe.c from eval.c and
make Init_safe().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e