summaryrefslogtreecommitdiff
path: root/eval.c
AgeCommit message (Collapse)Author
2011-05-05 * eval.c (frame_func_id): store result of method_entry_of_iseq() tonagachika
cfp->me because method_entry_of_iseq() might become expensive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-05 * eval.c (frame_func_id): __method__ return different name fromnagachika
methods defined by Module#define_method with a same block. [ruby-core:35386] fixes #4606 * eval (method_entry_of_iseq): new helper function. search control frame stack for a method entry which has given iseq. * test/ruby/test_method.rb: add tests for #4696 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-31* eval.c (rb_mod_s_constants): should ignore crefs withshugo
the NODE_FL_CREF_PUSHED_BY_EVAL flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-24* vm.c (ruby_vm_destruct): run vm exit hooks after all objects arenobu
destructed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-11* eval.c (ruby_cleanup): use rb_ary_free to free internal object.nobu
* gc.h (RUBY_FREE_UNLESS_NULL): get rid of double free. [ruby-core:35192] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* eval.c (ruby_cleanup): fix type.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* NEWS: entry for ruby_vm_at_exit().shyouhei
* eval.c (ruby_cleanup): bug fix around at_exit (1) timing was wrong. (2) execution order was opposite. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 * vm.c (ruby_vm_at_exit): new API. This enables extension libs toshyouhei
hook a VM termination. Right now, because the VM we have is process global, most extensions do not deallocate resources and leave them to Operating System's reaping userland processes. But in a future we plan to have multiple VMs to run simultaneously in a single process (MVM project). At that stage we can no longer rely on OSes and have to manage every resources to be reclaimed properly. So it is. For a forward-compatibility reason this API is introduced now, encouraging you to be as gentle as you can for your resources; that is, tidy up your room. * include/ruby/vm.h: ditto. * vm_core.h (rb_vm_struct): new field. * vm.c (vm_init2): initialize above new field. * eval.c (ruby_cleanup): trigger those hooks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-31* eval.c (ruby_cleanup): free current VM and its objspace evennobu
when exiting by SystemExit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-14* eval.c (frame_func_id), vm_eval.c (rb_iterate),nobu
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
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
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
2010-05-16* eval.c (setup_exception): let SystemStackError#backtrace return anmame
single element array instead of string itself. [ruby-core:30196] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30* eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre
number of arguments * file.c (rb_f_test, rb_file_s_umask): ditto * numeric.c (int_chr, num_step): ditto * process.c (rb_f_sleep): ditto * re.c (rb_reg_initialize_m): ditto * signal.c (rb_f_kill, sig_trap): ditto * string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang, rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto * proc.c (curry): rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27* eval.c (ruby_cleanup): add exception guard around code runningmame
signal handler (of r27513). Absence of the guard made bootstraptest/test_thread.rb fail sometimes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27* eval.c (ruby_cleanup): before cleanup, check signal buffer and runmame
handler if any. [ruby-core:20970] * thread.c (rb_threadptr_check_signal): separeted from timer_thread_function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-04* eval.c (setup_exception): avoid line number 0 when settingmame
$DEBUG=true. [ruby-dev:39116] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25* cont.c, vm_core.h, eval.c: because rb_protect must not be jumped bymame
callcc, revert r26407. And rename trap_tag to protect_tag and change exception message (across trap -> across stack rewinding barrier). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25* cont.c (rb_cont_call, cont_restore_1): remove trap_tag check becausemame
it seems not to make sense. [ruby-dev:40121] * vm_core.h, eval.c (rb_protect): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-24* eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues aboutko1
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
2010-01-05removes the dtrace support. reverts r26239, r26238 and r26235.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-03* trace.h: new file. wraps tracing mechanisms.yugui
* defs/dtrace.d: new file. defined a dtrace provider "ruby". * include/ruby/ruby.h (LIKELY): moved from vm.c. (UNLIKELY): ditto. (OBJSETUP): probe "object-create". (RUBY_EVENT_RESCUE): new event. * vm_exec.c (DEBUG_ENTER_INSN): embeded a probe insn-entry into it. (DEBUG_END_INSN): insn-return. * vm.c (LIKELY): moved into ruby.h. (UNLIKELY): ditto. (Init_BareVM): embeded a probe "raise" into it. * variable.c (rb_class2name_without_alloc): new utility function. * tool/rbinstall.rb (install?(:ext, :arch, :'ext-arch')): installs dtrace.d if necessary. * thread_pthread.c (add_signal_thread_list): probe "raise". (rb_thread_create_timer_thread): ditto. * thread.c (rb_thread_schedule_rec): probes "thread-enter" and "thread-leave", (thread_start_func_2): ditto. (thread_cleanup_func): probe "thread-term" * lib/mkmf.rb: supports dtrace postprocessor on making an extension. * iseq.c (rb_vm_insn_name): new utility function. (rb_vm_insn_len): ditto. * insns.def (hook): probes "method-etnry", "method-return", "line", and "rescue". * compile.c (iseq_compile_each): adds a trace op for "rescue" probe. * gc.c (garbage_collect): probes "gc-begin" and "gc-end". (obj_free): probe "object-free" (garbage_collect_with_gvl): probe "raise" (negative_size_allocation_error): ditto. (rb_memerror): ditto. * eval.c (rb_rescue2): probe "rescue" (rb_longjmp): probe "raise" * ext/probe/probe.c: new extension for application defined probes. * ext/probe/extconf.rb: ditto. * configure.in (--with-tracing-model): new option to choose a tracing mechanism. (DTRACE): new substitution. name of dtrace(1). (RUBY_TRACING_MODEL): new substitution. (DTRACE_OBJ): ditto. (MINIDTRACE_OBJ): ditto. (GOLFDTRACE_OBJ): ditto. (LIBRUBY_DTRACE_OBJ): ditto. (RUBY_DTRACE_POSTPROCESS): new macro. checks whether the dtrace on the system needs postprocessing. (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether the dtrace supports USDT. * Makefile.in: (DTRACE): new variable. name of dtrace(1). (TRACING_MODEL): new variable. name of the chosen tracing mechanism. (DTRACE_OBJ): same as the one in configure.in. (MINIDTRACE_OBJ): ditto. (GOLFDTRACE_OBJ): ditto. (LIBRUBY_DTRACE_OBJ): ditto. (CPPOUTFILE): new substitution. necessary for generating dtrace.d (trace_none.h): new target for TRACING_MODEL=none (RUBY_H_INCLUDES): appended a header for tracing. (distclean-local): also removes preprocessed version of dtrace.d ($(LIBRUBY_A)): needs $(LIBRUBY_DTRACE_OBJ) if dtrace needs postprocessing. ($(PROGRAM)): ditto. (golf): ditto. (miniruby): ditto. ($(arch_hdrdir)/ruby/dtrace.d): new target. preprocessed verson of defs/dtrace.d. generated if necessary. ($(arch_hdrdir)/ruby/trace_dtrace.h): new target. definition of probes. ($(LIBRUBY_DTRACE_OBJ)): new target. generated if dtrace needs postprocessing. ($(DTRACE_OBJ)): ditto. ($(MINIDTRACE_OBJ)): ditto. ($(GOLFDTRACE_OBJ)): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-03* compile.c (compile_cpath, iseq_compile_each): revertedshugo
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
2009-11-07* vm_insnhelper.c (vm_push_frame): get rid of out-of-boundsnobu
access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-07* vm_insnhelper.c (vm_push_frame): add CHECK_STACK_OVERFLOW.matz
[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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-02* eval.c (rb_exc_raise, rb_exc_fatal, rb_make_exception):nobu
suppressed shorten-64-to-32 warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29* enum.c (enum_count): call #size using rb_funcall_no_recursive()matz
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29* array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz
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
2009-10-14* eval.c (rb_threadptr_errinfo): removed.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-14* eval.c (ruby_run_node): need to call ruby_cleaup() always evennobu
if any error occurred so far. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-12* thread.c: Revert changes to Thread#raise made in r25278 [ruby-core:25367]marcandre
* eval_intern.h: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-12* eval.c (ruby_run_node): if an exception occurred in ruby_option,nobu
the result is not executable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10* eval.c (rb_threadptr_errinfo): renamed.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10* eval.c (ruby_exec_node): removed unused argument.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10* thread.c (rb_threadptr_execute_interrupts_rec, rb_threadptr_raise): ↵marcandre
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02* eval.c (rb_origenviron): remove unused old variable.usa
[ruby-dev:39412] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18* common.mk (eval.o): needs vm.h.nobu
* 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
2009-08-28* method.h (rb_method_definition_t): split from rb_method_entry_tnobu
to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06* eval.c (rb_exc_raise, rb_exc_fatal): nil is used to reraise.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05* eval.c (rb_exc_raise, rb_exc_fatal): require exception object.nobu
[ruby-core:24767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05* eval.c (rb_longjmp): reset raised flag before fatal error.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-03* eval.c (rb_mod_include): fix document. [ruby-core:24675]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16* id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longernobu
used. [ruby-dev:38760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15* method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko1
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
2009-06-08* thread.c: rename functions which require a parameterko1
"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
2009-04-19* eval.c (ruby_cleanup): the order of local variables on stack isnobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@23210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02* eval.c (rb_longjmp), include/ruby/intern.h (ruby_cleanup): fixednobu
prototypes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-28* vm_eval.c (rb_iterate): use volatile to suppress warnings.akr
* eval.c (ruby_cleanup): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-28* eval_error.c (error_print): use volatile to suppress warnings.akr
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@22677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22* eval.c (ruby_options): evaluator now expects iseq instead of tree.yugui
* ruby.c (ruby_process_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e