summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
AgeCommit message (Collapse)Author
2014-11-09vm.c: super in bmethodnobu
* vm_eval.c (vm_call_super): allow bound proc method to call super method. * vm_insnhelper.c (vm_yield_with_cfunc): push defined class and bound proc method entry to the control frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-02* vm_core.h: change iseq parameter data structure.ko1
https://bugs.ruby-lang.org/issues/10440#change-49694 * change terminology `arg' to `param'. * move rb_iseq_t::arg_* to rb_iseq_t::param. * move rb_iseq_t::arg_size to rb_iseq_t::param::size. * move rb_iseq_t::argc to rb_iseq_t::param::lead_num. * move rb_iseq_t::arg_opts to rb_iseq_t::param::opt_num. * move rb_iseq_t::arg_rest to rb_iseq_t::param::rest_start. * move rb_iseq_t::arg_post_num to rb_iseq_t::param::post_num. * move rb_iseq_t::arg_post_start to rb_iseq_t::param::post_start. * move rb_iseq_t::arg_block to rb_iseq_t::param::block_start. * move rb_iseq_t::arg_keyword* to rb_iseq_t::param::keyword. rb_iseq_t::param::keyword is allocated only when keyword parameters are available. * introduce rb_iseq_t::param::flags to represent parameter availability. For example, rb_iseq_t::param::flags::has_kw represents that this iseq has keyword parameters and rb_iseq_t::param::keyword is allocated. We don't need to compare with -1 to check availability. * remove rb_iseq_t::arg_simple. * compile.c: catch up this change. * iseq.c: ditto. * proc.c: ditto. * vm.c, vm_args.c, vm_dump.c, vm_insnhelper.c: ditto. * iseq.c (iseq_data_to_ary): support keyword argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-02* rewrite method/block parameter fitting logic to optimizeko1
keyword arguments/parameters and a splat argument. [Feature #10440] (Details are described in this ticket) Most of complex part is moved to vm_args.c. Now, ISeq#to_a does not catch up new instruction format. * vm_core.h: change iseq data structures. * introduce rb_call_info_kw_arg_t to represent keyword arguments. * add rb_call_info_t::kw_arg. * rename rb_iseq_t::arg_post_len to rb_iseq_t::arg_post_num. * rename rb_iseq_t::arg_keywords to arg_keyword_num. * rename rb_iseq_t::arg_keyword to rb_iseq_t::arg_keyword_bits. to represent keyword bitmap parameter index. This bitmap parameter shows that which keyword parameters are given or not given (0 for given). It is refered by `checkkeyword' instruction described bellow. * rename rb_iseq_t::arg_keyword_check to rb_iseq_t::arg_keyword_rest to represent keyword rest parameter index. * add rb_iseq_t::arg_keyword_default_values to represent default keyword values. * rename VM_CALL_ARGS_SKIP_SETUP to VM_CALL_ARGS_SIMPLE to represent (ci->flag & (SPLAT|BLOCKARG)) && ci->blockiseq == NULL && ci->kw_arg == NULL. * vm_insnhelper.c, vm_args.c: rewrite with refactoring. * rewrite splat argument code. * rewrite keyword arguments/parameters code. * merge method and block parameter fitting code into one code base. * vm.c, vm_eval.c: catch up these changes. * compile.c (new_callinfo): callinfo requires kw_arg parameter. * compile.c (compile_array_): check the last argument Hash object or not. If Hash object and all keys are Symbol literals, they are compiled to keyword arguments. * insns.def (checkkeyword): add new instruction. This instruction check the availability of corresponding keyword. For example, a method "def foo k1: 'v1'; end" is cimpiled to the following instructions. 0000 checkkeyword 2, 0 # check k1 is given. 0003 branchif 9 # if given, jump to address #9 0005 putstring "v1" 0007 setlocal_OP__WC__0 3 # k1 = 'v1' 0009 trace 8 0011 putnil 0012 trace 16 0014 leave * insns.def (opt_send_simple): removed and add new instruction "opt_send_without_block". * parse.y (new_args_tail_gen): reorder variables. Before this patch, a method "def foo(k1: 1, kr1:, k2: 2, **krest, &b)" has parameter variables "k1, kr1, k2, &b, internal_id, krest", but this patch reorders to "kr1, k1, k2, internal_id, krest, &b". (locate a block variable at last) * parse.y (vtable_pop): added. This function remove latest `n' variables from vtable. * iseq.c: catch up iseq data changes. * proc.c: ditto. * class.c (keyword_error): export as rb_keyword_error(). * common.mk: depend vm_args.c for vm.o. * hash.c (rb_hash_has_key): export. * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-30vm_insnhelper.c: allow to_arynobu
* vm_insnhelper.c (vm_callee_setup_arg{_complex,}): try conversion by to_ary for a lambda, as well as a proc. [ruby-core:65887] [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-20vm_insnhelper.c: preserve encodingnobu
* vm_insnhelper.c (vm_getivar): preserve variable name encoding in warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-19variable.c, vm_insnhelper.c: improve performancenobu
* variable.c (rb_ivar_get), vm_insnhelper.c (vm_getivar): improve instance variable retrieval performance by checking ruby_verbose before call of rb_warning and evaluation of its argument. [ruby-core:65786] [Feature #10396] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-19vm_insnhelper.c: refactoringnobu
* vm_insnhelper.c (vm_getivar): move common expressions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-10variable.c: check index overflownobu
* variable.c (rb_ivar_set), vm_insnhelper.c (vm_setivar): check instance variable index overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-10rb_call_info_t: shrink to 96 bytes from 104 bytes on 64-bitnormal
This keeps ci->flag and ci->aux.index consistent across 32-bit and 64-bit platforms. ci->flag: VM_CALL_* flags only use 9 bits, currently ci->aux.index: 2 billion ivars per class should be enough for anybody This saves around 50K allocations on "valgrind ruby -e exit" on x86-64 before: total heap usage: 48,122 allocs, 19,253 frees, 8,099,197 bytes allocated after: total heap usage: 48,069 allocs, 19,214 frees, 8,047,266 bytes allocated * vm_core.h (rb_call_info_t): ci->flag becomes 32-bit unsigned int ci->index becomes a 32-bit signed int (from signed long). Reorder for better packing on 64-bit, giving an 8 byte reduction from 104 to 96 bytes for each ci. * compile.c (new_callinfo, setup_args, iseq_compile_each, iseq_build_from_ary_body): adjust for type changes * vm_insnhelper.c (vm_getivar): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-04variable: cleanup to use rb_const_lookupnormal
* variable.c: cleanup to use rb_const_lookup * vm_insnshelper.c: ditto This reduces casting and long lines. This should make it easier to switch to alternatives to st for constant storage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-03vm_insnhelper.c: fix unusable super classnobu
* vm_insnhelper.c (vm_call_method): unusable super class should cause method missing when BasicObject is refined but not been using. [ruby-core:64166] [Bug #10106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-16* vm_core.h (struct rb_iseq_struct): stack_max is changed to intngoto
because all calculations related to stack_max in compile.c (iseq_set_sequence) and vm_insnhelper.c (vm_push_frame) are conducted by using int. This partly reverts r23945. * vm_insnhelper.c (vm_push_frame): ditto. This reverts r42401. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-14vm_core.h (struct rb_iseq_struct): reduce to 296 bytes on 64-bitnormal
Most iseq do not have a catch_table, so avoid needlessly adding 4-8 bytes to the struct for the common case. Changes from v2: - iseq_catch_table_size removed, use if (...) for (;...;) Changes from v1: - renamed iseq->_catch_table to iseq->catch_table - iseq_catch_table_bytes: made a static inline function - iseq_catch_table_size: new function replaces the iseq_catch_table_each iterator macro * iseq.h (struct iseq_catch_table): new flexible array struct (iseq_catch_table_bytes): allocated size function * vm_core.h (struct rb_iseq_struct): uupdate catch_table member * compile.c (iseq_set_exception_table): update for struct changes * iseq.c (iseq_free): ditto * iseq.c (iseq_memsize): ditto * iseq.c (rb_iseq_disasm): ditto * iseq.c (iseq_data_to_ary): ditto * iseq.c (rb_iseq_build_for_ruby2cext): ditto (untested) * vm.c (vm_exec): ditto * vm_core.h (struct rb_iseq_struct): ditto * vm_insnhelper.c (vm_throw): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-10vm_insnhelper.c: fix implicit splat keyword argumentnobu
* vm_insnhelper.c (vm_callee_setup_keyword_arg): adjust VM stack pointer to get rid of overwriting splat arguments by arguments for `to_hash` conversion. [ruby-core:63593] [Bug #10016] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-28eval.c: no method calls at stack overflownobu
* eval.c (setup_exception): get rid of method calls before raising stack overflow, not to cause stack overflow again. * defs/id.def: add IDs for backtraces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23Backtrace for SystemStackErrornobu
* eval.c (setup_exception): set backtrace in system stack error other than the pre-allocated sysstack_error. [Feature #6216] * proc.c (Init_Proc): freeze the pre-allocated sysstack_error. * vm_insnhelper.c (vm_stackoverflow): raise new instance for each times without calling any methods to keep the backtrace with no further stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-20insns.def: avoid type-punned pointer castnobu
* insns.def (once), vm_insnhelper.c (vm_once_exec): turn the parameter into a VALUE to get rid of type-punned pointer cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-19* vm.c (invoke_block_from_c): move call/return event timing forko1
bmethod. It can invoke inconsistent call event if this call raises argument error. [Bug #9959] * vm_insnhelper.c (vm_call_bmethod_body): ditto. * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-30* vm.c (invoke_block_from_c): add VM_FRAME_FLAG_BMETHOD to recordko1
it is bmethod frame. * vm.c (vm_exec): invoke RUBY_EVENT_RETURN event if rollbacked frame is VM_FRAME_FLAG_BMETHOD. [Bug #9759] * test/ruby/test_settracefunc.rb: add a test for TracePoint/set_trace_func. * vm_core.h: renmae rb_thread_t::passed_me to rb_thread_t::passed_bmethod_me to clarify the usage. * vm_insnhelper.c (vm_call_bmethod_body): use renamed member. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-11proc.c: fix super in bound UnboundMethodnobu
* proc.c (rb_method_call_with_block, umethod_bind): call with IClass including the module for a module instance method. [ruby-core:61936] [Bug #9721] * vm_insnhelper.c (vm_search_super_method): allow bound UnboundMethod case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-11vm_insnhelper.c: preserve encodingsnobu
* vm_insnhelper.c (vm_search_super_method): preserve encodings of classes in message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-13vm_insnhelper.c: relax arity checknobu
* vm.c (invoke_block_from_c): add splattable argument. * vm.c (vm_invoke_proc): disallow to splat when directly invoked. * vm_insnhelper.c (vm_callee_setup_arg_complex, vm_callee_setup_arg): relax arity check of yielded lambda. [ruby-core:61340] [Bug #9605] * test/ruby/test_yield.rb (TestRubyYieldGen#emu_bind_params): no longer raise ArgumentError when splatting to lambda. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-12vm_insnhelper.c: disable fastpath if splatnobu
* vm_insnhelper.c (vm_callee_setup_arg): disable fastpath if splat argument, since argc may differ for each calls. [ruby-core:61422] [Bug #9622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-12vm_insnhelper.c: inline functionnobu
* vm_insnhelper.c (vm_callee_setup_arg): turn a macro into an inline function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-13* vm_insnhelper.c (vm_call_method): should check ci->me->flag ofshugo
a refining method in case the method is private. [ruby-core:60111] [Bug #9452] * vm_method.c (make_method_entry_refined): set me->flag of a refined method entry to NOEX_PUBLIC in case the original method is private and it is refined as a public method. The original flag is stored in me->def->body.orig_me, so it's OK to make a refined method entry public. [ruby-core:60111] [Bug #9452] * test/ruby/test_refinement.rb: related tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-08vm_insnhelper.c: adjust indentnobu
* vm_insnhelper.c (check_match): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-10vm_insnhelper.c: boudn method transplantingnobu
* vm_insnhelper.c (vm_search_super_method): allow bound method from a module, yet another method transplanting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-08vm_insnhelper.c: revive r44455 for bound module methodnobu
* vm_insnhelper.c (vm_search_super_method): when super called in a bound UnboundMethod generated from a module, no superclass is found since the current defined class is the module, then call method_missing in that case. [ruby-core:59619] [Bug #9377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-29proc.c: fix inherited method ownernobu
* proc.c (mnew_from_me): keep iclass as-is, to make inheritance chain consistent. [ruby-core:59358] [Bug #9315] * proc.c (method_owner): return the original defined_class from prepended iclass, instead. * vm_insnhelper.c (vm_search_super_method): revert r44455, no longer defined_class becomes a module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-28vm_insnhelper.c: missing super in method modulenobu
* vm_insnhelper.c (vm_search_super_method): direct superclass of a module is found when super called in a Method object generated a method defined in a module, call method_missing in that case. [ruby-core:59358] [Bug #9315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-25* vm_insnhelper.c (argument_error): insert dummy frame to makeko1
a backtrace object intead of modify backtrace string array. [Bug #9295] * test/ruby/test_backtrace.rb: add a test for this patch. fix test to compare a result of Exception#backtrace with a result of Exception#backtrace_locations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-20* include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN intoko1
RB_OBJ_WRITE and RB_OBJ_WRITTEN. * array.c, class.c, compile.c, hash.c, internal.h, iseq.c, proc.c, process.c, re.c, string.c, variable.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-19vm_insnhelper.c: optimize for looptmm1
* vm_insnhelper.c (vm_call_iseq_setup_normal): simple for loop condition optimization. this area shows up as a hotspot in VM profiles. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14vm_insnhelper.c: post arguments as mandatorynobu
* vm_insnhelper.c (vm_callee_setup_arg_complex): count post arguments as mandatory arguments. [ruby-core:57706] [Bug #8993] * vm_insnhelper.c (vm_yield_setup_block_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09* internal.h (RCLASS_SERIAL): Add RCLASS_SERIAL as a conveniencecharliesome
accessor for RCLASS_EXT(klass)->class_serial. * class.c, vm_insnhelper.c, vm_method.c: Use RCLASS_SERIAL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09* compile.c, insns.def, test/ruby/test_rubyvm.rb, vm.c, vm_core.h,charliesome
vm_insnhelper.c, vm_insnhelper.h, vm_method.c: Rename method_serial to global_method_state and constant_serial to global_constant_state after discussion with ko1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08class.c, vm_insnhelper.c: check unknown keywordsnobu
* class.c (rb_get_kwargs): if optional is negative, unknown keywords are allowed. * vm_insnhelper.c (vm_callee_setup_keyword_arg): check unknown keywords. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08gc.c: promote long-lived NODE_CREF objects to oldgentmm1
* include/ruby/ruby.h: add RGENGC_WB_PROTECTED_NODE_CREF setting In a large app, this reduces the size of remembered_shady_object_count by 80%. [Bug #9225] [ruby-core:58947] * gc.c (rb_node_newnode): add FL_WB_PROTECTED flag to NODE_CREF * class.c (rewrite_cref_stack): insert OBJ_WRITE for NODE_CREF * iseq.c (set_relation): ditto * iseq.c (rb_iseq_clone): ditto * vm_eval.c (rb_yield_refine_block): ditto * vm_insnhelper.c (vm_cref_push): ditto * vm_insnhelper.h (COPY_CREF): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-06class.c: move kwarg functionsnobu
* class.c (rb_extract_keywords, rb_get_kwargs): move from vm_insnhelper.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-06vm_insnhelper.c: rb_get_kwargsnobu
* vm_insnhelper.c (rb_get_kwargs): get keyword argument values from an option hash, not only checking keys. * dir.c (dir_initialize): use rb_get_kwargs. * gc.c (gc_start_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30vm_insnhelper.c: keyword hash functionsnobu
* vm_insnhelper.c (rb_extract_keywords, rb_check_keyword_opthash): extract from vm_callee_setup_keyword_arg. * class.c (rb_scan_args): check if keys of keyword hash are symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29* vm_insnhelper.c (check_match): Fix SEGV with VM_CHECKMATCH_TYPE_CASEsorah
and class of `pattern` has `method_missing` [Bug #8882] [ruby-core:58606] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* insns.def: unify ic_constant_serial and ic_class_serial into one fieldcharliesome
ic_serial. This is possible because these fields are only ever used exclusively with each other. * insns.def: ditto * vm_core.h: ditto * vm_insnhelper.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* class.c: unify names of vm state version counters to 'serial'.charliesome
This includes renaming 'vm_state_version_t' to 'rb_serial_t', 'method_state' to 'method_serial', 'seq' to 'class_serial', 'vmstat' to 'constant_serial', etc. * insns.def: ditto * internal.h: ditto * vm.c: ditto * vm_core.h: ditto * vm_insnhelper.c: ditto * vm_insnhelper.h: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: splitcharliesome
ruby_vm_global_state_version into two separate counters - one for the global method state and one for the global constant state. This means changes to constants do not affect method caches, and changes to methods do not affect constant caches. In particular, this means inclusions of modules containing constants no longer globally invalidate the method cache. * class.c, eval.c, include/ruby/intern.h, insns.def, vm.c, vm_method.c: rename rb_clear_cache_by_class to rb_clear_method_cache_by_class * class.c, include/ruby/intern.h, variable.c, vm_method.c: add rb_clear_constant_cache * compile.c, vm_core.h, vm_insnhelper.c: rename vmstat field in rb_call_info_struct to method_state * vm_method.c: rename vmstat field in struct cache_entry to method_state git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17* vm_insnhelper.c (vm_call_method): set ci->me to 0 when theshugo
original method of a refined method is undef to avoid SEGV. * vm_method.c (rb_method_entry_without_refinements): return 0 when the original method of a refined method is undef to avoid SEGV. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07* proc.c: catch up last commit.ko1
Type of return value of rb_iseq_first_lineno() is now VALUE. * vm_insnhelper.c (argument_error): ditto. * vm_method.c (rb_method_entry_make): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07* iseq.c, internal.h: change to public (but internal) functionsko1
* VALUE rb_iseq_path(VALUE iseqval); * VALUE rb_iseq_absolute_path(VALUE iseqval); * VALUE rb_iseq_label(VALUE iseqval); * VALUE rb_iseq_base_label(VALUE iseqval); * VALUE rb_iseq_first_lineno(VALUE iseqval); And new (temporary) function: * VALUE rb_iseq_klass(VALUE iseqval); * iseq.c. vm_core.h (int rb_iseq_first_lineno): remove function `int rb_iseq_first_lineno(const rb_iseq_t *iseq)'. Use `VALUE rb_iseq_first_lineno(VALUE iseqval)' instead. * proc.c. vm_insnhelper.c, vm_method.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-29* vm_insnhelper.c (vm_callee_setup_arg_complex, vm_yield_setup_block_args):ktsj
clear keyword arguments to prevent GC bug which occurs while marking VM stack. [ruby-dev:47729] [Bug #8964] * test/ruby/test_keyword.rb: tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-25* include/ruby/ruby.h: rename RARRAY_RAWPTR() to RARRAY_CONST_PTR().ko1
RARRAY_RAWPTR(ary) returns (const VALUE *) type pointer and usecase of this macro is not acquire raw pointer, but acquire read-only pointer. So we rename to better name. RSTRUCT_RAWPTR() is also renamed to RSTRUCT_CONST_PTR() (I expect that nobody use it). * array.c, compile.c, cont.c, enumerator.c, gc.c, proc.c, random.c, string.c, struct.c, thread.c, vm_eval.c, vm_insnhelper.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e