summaryrefslogtreecommitdiff
path: root/vm.c
AgeCommit message (Collapse)Author
2011-04-16* vm.c (Init_VM): suppress warning: "OPT_BASIC_OPERATIONS" is not defined.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31292 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-20* prevent temporary objects from GC, and should not usenobu
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
2011-02-12* vm.c (th_init): rename from th_init2.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30851 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
2011-02-04* vm.c (ruby_thread_data_type): add prefix.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-04 * vm_core.h (GetThreadPtr): use TypedData_Get_Struct() insteadkosaki
CoreDataFromValue() because we need type check. Otherwise, type mismatch can cause segmentation fault crash. [ruby-core:35086] [Ruby 1.9-Bug#4367] * vm.c (thread_data_type): remove static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-12* vm.c (thread_free): reset ruby_current_thread if it points theakr
thread to free. * gc.c (slot_sweep): don't call RUBY_VM_SET_FINALIZER_INTERRUPT if there is no current thread. [ruby-dev:43000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05* vm.c (rb_vm_make_proc): fix indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-30* vm.c (vm_define_method): guard iseq from GC while method definition.wanabe
[ruby-dev:42832] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20* compile.c (setup_args), vm.c (invoke_block_from_c),nobu
vm_insnhelper.c (caller_setup_args): reverted r30241 and r30243 except for the test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-18* compile.c (setup_args), vm.c (invoke_block_from_c),nobu
vm_insnhelper.c (caller_setup_args): fix of r30241. lambda block shoud check argument number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-03* gc.c (rb_objspace_free): With our "lazy-sweep" GC engine, it isshyouhei
possible for an object to survive until its surrounding object space is about to be freed. Those objects, if any, remains not leaked for the rest of a process life. This is problematic because for instance a T_DATA object may have its own destructor to terminate something. * vm.c (ruby_vm_destruct): ruby_current_vm termination should be somewhere after rb_objspace_free for above reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30065 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-11-27* thread.c, vm_core.h: make gvl_acquire/release/init/destructko1
APIs to modularize GVL implementation. * thread_pthread.c, thread_pthread.h: Two GVL implementations. (1) Simple locking GVL which is same as existing GVL. (2) Wake-up queued threads. The wake-up order is simple FIFO. (We can make several queues to support exact priorities, however this causes some issues such as priority inversion and so on.) This impl. prevents spin-loop (*1) caused on SMP environemnts. *1: Only one Ruby thread acqures GVL again and again. Bug #2359 [ruby-core:26694] * thread_win32.c, thread_win32.h: Using simple lock not by CRITICAL_SECTION but by Mutex. Bug #3890 [ruby-dev:42315] * vm.c (ruby_vm_destruct): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-23* vm.c (rb_thread_mark): should mark self in conrolnobu
frames. [ruby-core:33289] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-03* gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24* array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu
transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24* vm.c (vm_define_method): defined method is run with the defaultnobu
public visibility regardless the visibility context of definition. [ruby-core:30638] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19Commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19* test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* iseq.c (insn_operand_intern, rb_iseq_disasm): fix format specifiers.nobu
* vm.c (thread_free): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13 * vm.c (ruby_vm_destruct): This function type was wrong; correct to the ↵shyouhei
prototype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-03* enc/unicode.c (onigenc_unicode_property_name_to_ctype):naruse
remove useless assignment. * vm.c (vm_make_proc_from_block): ditto. * variable.c (rb_ivar_count): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-24* string.c (sym_call), vm.c (invoke_block_from_c),nobu
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
2010-09-09* vm.c (vm_backtrace_each): skip allocator frames which have nonobu
name. [ruby-core:32231] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29* vm.c (rb_thread_method_id_and_class): curried proc has nonobu
method. [ruby-core:31871] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-21* vm.c: add missing prototype of rb_iseq_clone for r29063.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-21* vm.c (vm_define_method): copy iseq to avoid overwriting iseq->klass.wanabe
#2502, #3136. see #2420. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-26* vm.c (rb_thread_mark): should mark iseq itself other than normalnobu
iseq. [ruby-dev:41880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-26* vm.c (rb_thread_mark): mark only self of normal iseqs, notnobu
nodes. [ruby-dev:41874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05* vm.c (thread_free): free altstack to prevent memory leak. a patchmame
from Tomoyuki Chikanaga in [ruby-dev:41815]. [Bug #3537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-18* gc.c (gc_lazy_sweep): clean a warning.naruse
"suggest parentheses around assignment used as truth value" * transcode_data.h (getGB4bt1): clean a warning. "suggest parentheses around arithmetic in operand of |" * transcode_data.h (getGB4bt3): ditto. * vm.c (thread_free): clean a warning. "format 'p' expects type 'void *', but argument 3 has type 'struct rb_mutex_struct *'" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17* load.c (rb_load_internal): remove call to rb_realpath_internalmame
within rb_load_internal which caused big performance degradation. Instead, call rb_realpath_internal in the caller of rb_load_internal. [ruby-dev:41502] [ruby-dev:41610] * vm.c (rb_vm_call_cfunc): ditto. * eval_intern.h (rb_vm_call_cfunc): ditto. * ruby.c (process_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* vm.c (Init_BareVM): call Init_native_thread here.akr
* thread.c (Init_Thread): don't call Init_native_thread. * thread_pthread.c (Init_native_thread): exported. * thread_win32.c (Init_native_thread): ditto. [ruby-dev:41536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* ruby.c (process_options): revert r25330, so that $0 can be seennobu
from required libraries by -r option. [ruby-core:23717] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-03* load.c (ruby_init_ext): statically linked extensions have nonobu
real path. [ruby-dev:41526] * vm.c (rb_vm_call_cfunc): add filepath argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21* vm.c (vm_backtrace_each), vm_eval.c (rb_catch_obj): suppressnobu
warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20* vm.c (vm_backtrace_each): now takes an init function to distinguishmame
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
2010-05-09* compile.c (iseq_compile_each), vm_insnhelper.c (vm_invoke_block,mame
vm_throw): allow "return" and "yield" even in singleton class definition. based on a patch from wanabe <s.wanabe AT gmail.com> for "return". [ruby-core:21379] [ruby-dev:40975] * insns.def (defineclass): ditto (straightforwardly push block ptr, instead of dfp ptr with special flag). * vm_core.h (RUBY_VM_CLASS_SPECIAL_P): ditto (no longer needed). * proc.c (proc_new): ditto (remove handling for special flag). * bootstraptest/test_jump.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-05* vm_method.c (rb_unlink_method_entry, rb_sweep_method_entry):ko1
added. Unlinked method entries are collected to vm->unlinked_method_entry_list. On the GC timing, mark all method entries which are on all living threads. Only non-marked method entries are collected. This hack prevents releasing living method entry. [Performance Consideration] Since this Method Entry GC (MEGC) doesn't occuer frequently, MEGC will not be a performance bottleneck. However, to traverse living method entries, every control frame push needs to clear cfp->me field. This will be a performance issue (because pushing control frame is occurred frequently). Bug #2777 [ruby-dev:40457] * cont.c (fiber_init): init cfp->me. * gc.c (garbage_collect): kick rb_sweep_method_entry(). * method.h (rb_method_entry_t): add a mark field. * vm.c (invoke_block_from_c): set passed me. * vm.c (rb_thread_mark): mark cfp->me. * vm_core.h (rb_thread_t): add a field passed_me. * vm_core.h (rb_vm_t): add a field unlinked_method_entry_list. * vm_insnhelper.c (vm_push_frame): clear cfp->me at all times. * vm_insnhelper.c (vm_call_bmethod): pass me. * bootstraptest/test_method.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15* vm.c (vm_backtrace_each): get rid of use of malloc from signalnobu
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
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