summaryrefslogtreecommitdiff
path: root/vm.c
AgeCommit message (Collapse)Author
2012-04-28* parse.y (assoc, parser_yylex): add syntax to splat keyword hash.nobu
[ruby-core:44591][Feature #6353] * compile.c (compile_array_): generate keyword splat insns. * vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate hash. leftward argument is prior currently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12* compile.c (compile_array, compile_array_):ko1
Divide big array (or hash) literals into several blocks and concatetene them. There was a problem that a big array (hash) literal causes SystemStackError exception (stack overflow) because VM push all contents of the literal onto VM stack to make an array (or hash). To solve this issue, we make several arrays (hashes) and concatenate them to make a big array (hash) object. ?? * compile.c (iseq_compile_each, setup_args): use modified compile_array. * vm.c (m_core_hash_from_ary, m_core_hash_merge_ary, m_core_hash_merge_ptr): added for above change. * id.c (Init_id), parse.y: add core method ids. * bootstraptest/test_literal.rb: add simple tests. * bootstraptest/test_eval.rb: remove rescue clause to catch SystemStackError exception. * test/ruby/test_literal.rb: add tests to check no stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15* cont.c (rb_fiber_reset_root_local_storage): add a new function tonagachika
restore rb_thread_t::local_storage. * cont.c (rb_obj_is_fiber): add a new function to tell finalizer to prevent fibers from destroy. * gc.c (rb_objspace_call_finalizer): don't sweep fibers at finalizing objspace. * internal.h (rb_fiber_reset_root_local_storage, rb_obj_is_fiber): add prototypes. * vm.c (ruby_vm_destruct): reset main thread's local_storage before free main thread. rb_thread_t::local_storage is replaced by fiber's local storage when forked from fiber, and it should be already freed when the fiber was destroyed. * test/ruby/test_fiber.rb (test_fork_from_fiber): add test for fork from fiber. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-24* vm.c (rb_iter_break_value): new function to break a block withnobu
the value. [ruby-dev:45132] [Feature #5895] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-20* vm.c (vm_exec): remove workaround for LLVM because r34278 fixes it.naruse
* vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* test/ruby/test_enumerator.rb (test_nested_iteration): fix typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* vm.c (vm_exec): refix r34162; suppress warning and add description.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* gc.c (ruby_mimmalloc): defined for objects need not rb_objspace,naruse
but should return pointer suitable for ruby_xfree; main vm and main thread. patched by Sokolov Yura. https://github.com/ruby/ruby/pull/79 * internal.h: ditto. * vm.c (Init_BareVM): use ruby_mimmalloc. * ext/dl/cfunc.c: #include <ruby/util.h>. * ext/syslog/syslog.c: use xfree because it is allocated by ruby_strdup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c (rb_objspace_free): global_List is allocated with xmalloc.naruse
patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78 * dln_find.c: remove useless replacement of free. * ext/readline/readline.c (readline_attempted_completion_function): strings for readline must allocated with malloc. * process.c (run_exec_dup2): use free; see also r20950. * re.c (onig_new_with_source): use malloc for oniguruma. * vm.c (ruby_vm_destruct): use free for VMs. * vm.c (thread_free): use free for threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-02* vm.c: fix comment.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-30* vm.c (vm_exec): add guard to prevent optimization for LLVM clang.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18* vm.c (vm_define_method): improve guard of iseq from GC. Fixngoto
failure or segmentation fault in test_singleton_method(TestGc) on sparc Solaris10 compiled with Oracle Solaris Studio 12.2. [Bug #5762] [ruby-dev:45000] [Bug #4178] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07* vm.c (vm_set_top_stack, vm_set_eval_stack): check for stacknobu
overflow with stack_max before push new frame. [ruby-core:41520] [Bug #5720] * vm.c (vm_set_main_stack): no stack overflow chances after vm_set_eval_stack(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* bignum.c (big_rshift), compile.c (validate_label,nobu
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open) (rb_io_advise), parse.y (parser_compile_string) (rb_parser_compile_file), proc.c (binding_free), process.c (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core) (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null), signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main), vm_insnhelper.c (vm_expandarray): suppress unused-but-set-variable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-01* vm.c (rb_thread_mark), cont.c (cont_mark): self pointer should notktsj
be marked by itself. Patch by Koichi Sasada. [ruby-dev:44567] [Bug #5386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-01* vm.c (rb_thread_mark): rb_thread_t needs self to be marked.ktsj
[ruby-dev:44566] [Bug #5386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-15* vm.c (rb_vm_get_sourceline): fix indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* variable.c (rb_const_set): show the previous definitionnobu
location. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27* vm.c (rb_vm_rewrite_dfp_in_errinfo): change return typektsj
to suppress a warning. * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27* proc.c (proc_new): force to rewrite errinfo when calling Proc.new in ensure.ktsj
[Bug #5234] [ruby-core:39125] This code will be removed after changing throw mechanism (see r33064). * vm.c (rb_vm_rewrite_dfp_in_errinfo): new function. * vm.c (vm_make_env_each): changed accordingly. * vm_core.h: ditto. * bootstraptest/test_flow.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24* vm.c (vm_make_env_each): work around to solve Bug #2729.ko1
fixes: Bug #2729 a patch from Kazuki Tsujimoto <kazuki@callcc.net> This problem is caused by changing dfp (dynamic env pointer) from saved dfp. Saved dfp is pointed env in VM stack. However, the dfp can be moved because VM copies env from VM stack to the heap. At this copying, dfp was also changed. To solve this problem, I'll try to change throw mechanism (not save target dfp, but save target cfp). * bootstraptest/test_flow.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24* vm_insnhelper.h, vm_insnhelper.c, vm.c, vm_method.c, insns.def:ko1
Manage a redefinition of special methods for each classes. A patch from Joel Gouly <joel.gouly@gmail.com>. Thanks! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24* iseq.h, iseq.c, compile.c: Change the line number data structureko1
to solve an issue reported at [ruby-dev:44413] [Ruby 1.9 - Bug #5217]. Before this fix, each instruction has an information including line number (iseq::iseq_insn_info_table). Instead of this data structure, recording only line number changing places (iseq::iseq_line_info_table). The order of entries in iseq_line_info_table is ascending order of iseq_line_info_table_entry::position. You can get a line number by an iseq and a program counter with this data structure. This fix reduces memory consumption of iseq (bytecode). On my measurement, a rails application consumes 21.8MB for iseq with this fix on the 32bit CPU. Without this fix, it consumes 24.7MB for iseq [ruby-dev:44415]. * proc.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. * vm.c (rb_vm_get_sourceline): change to use rb_iseq_line_no(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-16* vm.c (ruby_threadptr_data_type): rename to hide.nobu
[ruby-core:38972] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02* gc.c (init_heap): allocate sigaltstack after heaps are allocated.naruse
[ruby-dev:44315] [Bug #5139] * vm.c (thread_free): use free because objspace is not ready. * vm.c (th_init): use malloc because objspace is not ready. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-31* vm.c (check_env): print debug messages to stderr.ktsj
[Feature #4871] [ruby-dev:43743] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-31* vm.c (vm_make_env_each): don't save prev env value.ktsj
It is no longer used. [Feature #4871] [ruby-dev:43743] * vm.c (check_env): changed accordingly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-31* vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30* vm.c (th_init): preallocate alternative stack.kosaki
NoMemoryError is better than rb_bug, of course. Patch by Eric Wong. [ruby-core:38572][ruby-core:38594]. * signal.c (rb_register_sigaltstack): ditto. * vm_core.h: moved ALT_STACK_SIZE definition from signal.c. * vm.c (thread_free): use xfree() instead of free(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-29 * math.c: Attach documentation for Math.drbrain
* object.c: Document NIL, TRUE, FALSE. * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR. Document ARGF global constant. * lib/rake: Hide deprecated toplevel constants from RDoc (import from rake trunk). * lib/thwait.rb: Document ThWait. * lib/mathn.rb: Hide Math redefinition from RDoc * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync, Synchronizer. * parse.y: Document SCRIPT_LINES__. * hash.c: Document ENV class and global constant. * vm.c: Document TOPLEVEL_BINDING. * version.c: Document RUBY_* constants. * ruby.c: Document DATA and ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* vm.c, vm_core.h (rb_vm_stack_to_heap): remove const.kosaki
It makes compilations warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* vm.c, vm_core.h (rb_vm_stack_to_heap): fix "const" place.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* method.h, internal.h iseq.h: declare internal functions.akr
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* internal.h: declare more internal functions.akr
* iseq.h (rb_method_get_iseq): declared. * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c, ruby.c, time.c, util.c, vm.c: don't declare internal functions. * eval.c, parse.y, thread_pthread.c: non-existing function declarations removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13* vm_core.h, vm_insnhelper.h: move decl. ofko1
ruby_vm_global_state_version and related macros from vm_core.h to vm_insnhelper.h. * vm.c (vm_clear_all_cache): added. This function is called when ruby_vm_global_state_version overflows. TODO: vm_clear_all_inline_method_cache() is only place holder. We need to implement it ASAP. * vm_method.c (vm_clear_global_method_cache): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11* vm.c (thread_memsize): don't ignore size of th->local_storage.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() fornagachika
type check to get rid of a double free when main Thread has singleton class. [ruby-core:36741] [Bug #4828] * thread.c (rb_obj_is_mutex): add a new utility function. * vm.c (rb_obj_is_thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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