summaryrefslogtreecommitdiff
path: root/vm.c
AgeCommit message (Collapse)Author
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
2008-12-27* vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.ko1
* 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
2008-12-25* proc.c (proc_new): should use proc_dup() if block has Proc.ko1
* vm.c (vm_make_proc_from_block): should use rb_cProc for block. * vm.c (vm_make_proc): add an assertion. * bootstraptest/test_proc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24* vm.c (invoke_block_from_c): fix to point right cfp.ko1
* vm.c (vm_make_proc, vm_make_proc_from_block), vm_core.h: remove unused parameter cfp. * vm_insnhelper.c, proc.c (proc_new): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15* vm.c (vm_backtrace): defaults to script name for C functions.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09* compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu
(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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05* compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),nobu
(ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with ruby_. * iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-21* vm.c (thread_free): th->vm may be NULL when pthread_creatematz
failed for ENOMEM. [ruby-dev:37095] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-12* vm.c, vm_insnhelper.h (ruby_vm_redefined_flag): apply optimizationko1
patch proposed by Paul Brannan. [ruby-core:19171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26* vm.c (vm_jump_tag_but_local_jump): exc is not used if val is nil.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, node.h: move node.h from include path.ko1
This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, vm_core.h: move definition ofko1
RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* common.mk: clean upko1
- remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko1
to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08* vm.c (rb_mRubyVMFrozenCore): registered for GC.akr
* re.c (rb_reg_preprocess_dregexp): fix GC problem on MacOS X with powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* vm.c (thread_recycle_stack_slot, thread_recycle_stack_count):ko1
make it static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* vm.c (rb_vm_mark): commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* vm_core.h (struct rb_vm_struct): replaced signal staff with trapnobu
staff. * signal.c (signal_buff): per process resouce now. * signal.c (trap_list): moved to VM. * signal.c (rb_get_next_signal): reverted. * signal.c (rb_trap_exit): trap_pending_list was no longer used. * thread.c (timer_thread_function): delivers buffered per-process signals to each VMs. * vm.c (rb_vm_mark): marks trap_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20* proc.c (proc_new): use the given class.nobu
* vm.c (vm_make_proc): added an argument for the class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-15* vm.c (Init_VM): get rid of SEGV in a trace proc.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14* vm.c (REWIND_CFP): get rid of statement expressions.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14* vm.c (Init_VM): hide FrozenCore.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* vm.c: rewind cfp to show proper backtrace.ko1
[ruby-dev:35820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12* vm.c, vm_insnhelper.c (vm_define_method): moveko1
function place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-01* vm.c (Init_BareVM): check failure of malloc().mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27* vm_core.h, thread.c: It is now prohibited to use Data_Get_Struct inmame
*_free against an object that is going to be free'ed. So, change type of thread_t#keeping_mutexes from VALUE to mutex_t. * vm.c: remove mark to keeping_mutexes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27* include/ruby/ruby.h: add a type T_DEFERRED.ko1
* gc.c: fix deferred finalizer system. finalize processes of T_DATA and T_FILE are executed after gc process. And fix to use BUILTIN_TYPE() instead of seeing flag. * thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT() and check intterupt_flag at rb_thread_execute_interrupts(). * thread.c (mutex_mark): fix to mark next_mutex. * vm.c (rb_thread_mark): fix to mark keeping_mutexes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-25* vm.c (vm_invoke_proc): skip setting safe_level ifko1
it from bmethod. This change makes test/ruby/test_proc.rb pass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e