summaryrefslogtreecommitdiff
path: root/vm.c
AgeCommit message (Collapse)Author
2010-03-16* compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolutemame
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
2010-02-20* vm.c (vm_backtrace_each): use called_id when method definitionmatz
structure is already freed. [ruby-dev:40234] [ruby-core:27959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-17* vm_insnhelper.c (vm_call_cfunc): removed unused variable.nobu
* 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
2010-02-12* vm.c (thread_free): fixed typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-11* vm.c (vm_exec): reset thread state before restarting vm loopnobu
from catch scope. [ruby-core:28129], [ruby-core:28143] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-10* vm.c (vm_exec): temporarily revert r26628, which causes SEGV whenmame
executing rubyspec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-09* vm.c (vm_exec): reset thread state before starting vm loop.nobu
[ruby-core:28129] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-30* vm.c (rb_vm_invoke_proc): removed unused variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-26* vm.c (rb_vm_invoke_proc): this function must not catch TAG_RETURNmame
because vm_exec does. This caused rubyspec error. [ruby-dev:40158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26425 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-23* thread.c (thread_start_func_2): unlock all locking mutexesnobu
before clean up. [ruby-core:26877] * thread.c (rb_thread_atfork): no other threads to be joined. * vm_core.h (rb_thread_lock_unlock, rb_thread_lock_destroy): new functions. * vm.c (ruby_vm_destruct): unlock and destroy global VM lock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26390 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-04* gc.c: added UNLIKELY to probes for optimization.yugui
* vm.c: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26239 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-21* encoding.c (Init_Encoding): undef Encoding.new becausenaruse
a class which is rb_undef_alloc-func-ed can't call new method. [ruby-dev:39862] * vm.c (Init_VM): undef RubyVM.new and RubyVM::Env.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-24* vm.c (ruby_vm_destruct, thread_memsize): fix argument type to makemame
RUBY_MARK_FREE_DEBUG available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25908 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-10-26* vm.c (invoke_block_from_c): return Qnil when its iseq isnaruse
SPECIAL CONST. [ruby-core:26335] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21* proc.c (proc_binding): allow proc from method. [ruby-core:25589]nobu
* vm.c (collect_local_variables_in_env): block iseq can be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25015 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-09-09* include/ruby/ruby.h (rb_data_type_struct): constified dsize.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* vm.c (rb_thread_mark): mark callers iseqs. [ruby-core:25474]nobu
[Bug #2062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-07* vm.c (sdr, nsdr): nodoc.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06* compile.c (iseq_specialized_instruction), insns.def (opt_size):ko1
optimize #size methods (by specialized instruction). * id.c, id.h, vm.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24769 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-26* vm.c (collect_local_variables_in_env): skips internal variables.nobu
[ruby-core:25125] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16* vm.c (vm_backtrace_each, vm_backtrace_push),nobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-13* vm.c (vm_exec): returning from lambda runs ensure section.wanabe
[Bug #1729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-12* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: checkko1
definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24511 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-07-07* include/ruby/ruby.h:ko1
rename "...TypeStruct" and "typed_struct" to "TypedData..." and "typeddata", respectively. rename rb_data_type_t#name to rb_data_type_t#wrap_struct_name. * error.c, gc.c, iseq.c, vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07* vm.c ({env,vm,thread}_data_type): constified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22* compile.c (iseq_set_arguments, iseq_compile_each): internalnobu
arrays must be hidden. [ruby-dev:38613] * vm.c (Init_top_self): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16* iseq.c (iseq_memsize): added. Use RTypedData instead of RDatako1
for ISeq. * vm.c (env_memsize, vm_memsize, thread_memsize): added. Use RTypedData instead of RData for Env, VM, Thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17* ruby.c (ruby_script): sets also VM toplevel program name.nobu
* ruby.c (process_options): no longer needs additional frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17* vm.c (rb_vm_get_sourceline): should not access out of bound.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-13* gc.c: add longlife garbage collection. [ruby-dev:38423]nari
(NORMAL_HEAPS_USED): new macro. (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto. (add_longlife_heaps_slot): new function. (rb_newobj_from_longlife_heap): ditto. (rb_newobj_longlife): ditto. (rb_node_newnode_longlife): ditto. (rb_gc_write_barrier): ditto. (remembered_set_recycle): ditto. (rb_gc_mark_remembered_set): ditto. (clear_mark_longlife_heaps): ditto. (gc_sweep_for_longlife): ditto. (assign_heap_slot): new argumnent to longlife heaps slot. (add_freelist): ditto. (gc_sweep): avoid lonlife heap slot. set longlife_collection flag at add heap. (rb_gc_force_recycle): avoid mark object and remembered_set object. (garbage_collect): add longlife collection. (rb_gc_start): invoke longlife collection. (gc_profile_record_get): for longlife collction profile. (gc_profile_result): ditto. * include/ruby/intern.h (rb_gc_write_barrier): declared. * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED. * debug.c (FL_REMEMBERED_SET): ditto. * insns.def (setinlinecache): insert write barrier. * vm_insnhelper.c (vm_method_search): ditto. * set_relation (set_relation): use longlife object. * vm.c (vm_define_method): ditto. * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto. * vm_method.c (rb_add_method): ditto. * class.c (rb_add_method): ditto. * node.h (NEW_NODE_LONGLIFE): new macro. (rb_node_newnode_longlife): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12* vm.c (rb_vm_get_sourceline), vm_insnhelper.c (vm_throw): usenobu
rb_num_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03* vm.c (vm_backtrace): always returns non-nil array if lev isnobu
negative. [ruby-core:21795] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02* vm.c (vm_backtrace_each): progname is not available atnobu
initializing phase. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01* vm.c (vm_backtrace_each): now takes an iterator function.nobu
* 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
2009-01-19* vm_eval.c, eval.c (rb_f_block_given_p): move definition ofko1
"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
2009-01-19* vm.c: add a prefix "rb_" to exposed functionsko1
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
2009-01-19* iseq.c:ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19* eval.c, vm_eval.c (rb_f_local_variables): move definition from eval.cko1
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
2009-01-15* vm.c (rb_vm_inc_const_missing_count, ruby_vm_const_missing_count):ko1
added. * vm_insnhelper.h: ditto. * variable.c (rb_const_get_0), insns.def: Constants should not be cached if const_missing is called. [ruby-core:21059] [Bug #967] * bootstraptest/test_class.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-05* vm.c (rb_iseq_eval): fixed indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29* vm.c (vm_set_eval_stack, vm_set_main_stack, vm_set_top_stack):ko1
check stack overflow. [ruby-dev:37646] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e