summaryrefslogtreecommitdiff
path: root/vm_method.c
AgeCommit message (Collapse)Author
2013-06-14* class.c, include/ruby/ruby.h: add write barriers for T_CLASS,ko1
T_MODULE, T_ICLASS. * constant.h: constify rb_const_entry_t::value and file to detect assignment. * variable.c, internal.h (rb_st_insert_id_and_value, rb_st_copy): added. update table with write barrier. * method.h: constify some variables to detect assignment. * object.c (init_copy): add WBs. * variable.c: ditto. * vm_method.c (rb_add_method): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06vm_method.c: change argument of set_visibilitynobu
* vm_method.c (set_visibility): use rb_method_flag_t as well as set_method_visibility() and rename argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06vm_method.c: top_private rdocnobu
* vm_method.c (top_private): copy rdoc from top_public. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31vm_method.c: extract set_visibilitynobu
* vm_method.c (set_visibility): extract from rb_mod_public(), rb_mod_protected() and rb_mod_private(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25no clearing method cachenobu
* variable.c (set_const_visibility): return without clearing method cache if no arguments. * vm_method.c (set_method_visibility): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25vm_method.c: quote method namenobu
* vm_method.c (set_method_visibility): quote unprintable method name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13vm_method.c: rb_method_entry_atnobu
* vm_method.c (rb_method_entry_at): return the method entry for id at klass, without ancestors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-02id.def: predefined IDsnobu
* defs/id.def: add more predefined IDs used in core. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18vm_method.c: fix visibility on anonymous modulenobu
* vm_method.c (rb_mod_public_method): fix visibility on anonymous module. set visibility of singleton method, not method in base class. [ruby-core:54404] [Bug #8284] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-24* vm_method.c (rb_sweep_method_entry): simplify code to unlink.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-13vm_method.c: overrid flag of prepending methodnobu
* vm_method.c (rb_export_method): directly override the flag of method defined in prepending class too, not adding zsuper entry. [ruby-core:53106] [Bug #8005] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-24* object.c: Document methods receiving string and convert to symbolzzak
Patch by Stefan Rusterholz * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-14vm_method.c: fix method_removednobu
* vm_method.c: call method_removed hook on called class, not on prepending iclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-06vm_method.c: show respond_to locationnobu
* proc.c (rb_method_entry_location, rb_{mod,obj}_method_location): new functions to obtain source location of method definition. * vm_method.c (rb_obj_respond_to): show the location of old style respond_to? method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05vm_method.c: drop include_all flagnobu
* vm_method.c (rb_obj_respond_to): drop optional include_all flag if respond_to? method is defined in old style. [Bug #7722] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-16vm_method.c: suppress warningsnobu
* vm_method.c (call_cfunc_invoker_func): suppress wrong warnings "C4550: expression evaluates to a function which is missing an argument list." by VC6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07* vm_method.c (Init_eval_method): main.public and main.privateshugo
should be private. * proc.c (Init_Proc): main.define_method should be private. * test/ruby/test_module.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-30vm_method.c: idRespond_to_missingnobu
* vm_method.c (respond_to_missing): use idRespond_to_missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22internal.h: quote unprintablenobu
* internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and IDs. [Bug #7574] [ruby-dev:46749] * string.c (rb_str_quote_unprintable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-17* method.h: remove `VM_METHOD_TYPE_CFUNC_FRAMELESS' method type.ko1
This method type is for optimized CFUNC such as Fixnum#+ and so on. This feature is half-baked and no way to use them. [Background] Now, VM has opt_plus instructions to optimize `+' methods for some Classes (such as Fixnum, Float (flonum)). We call this type of instructions as `specialized instructions'. This simple technique improve simple program dramatically. However, we can make specialized instructions for only several types (classes) and selectors (method names) because a large instruction will be slow. In other words, this technique has no extensibility. To overcome this problem, VM_METHOD_TYPE_CFUNC_FRAMELESS was introduced (r37198). This type is a variant of CFUNC, but called their functiions directly without building a method frame. Any CFUNC method can be defined as frameless methods if a method is not needed to make method frame. Frameless methods are faster as specialized instructions (a bit slower, but no need to care). No problem described at http://charlie.bz/blog/why-do-singleton-methods-make-ruby-slow because this technique doesn't see class, but see method body itself. Alias is also no problem. [Problem] However, we can't set frameless method type for polymorphic methods such as Array#[]. Necessity for method frame depends on which parameter type. For example, Fixnum#+ needs method frame if coerce is needed. Current VM_METHOD_TYPE_CFUNC_FRAMELESS is not flexible and need more tuning to introduce it. Expected behavior of frameless method type may be: result = optimized_cfunc(params); /* call optimized cfunc */ if (result == Qundef) { result = normal_cfunc(); } This is why I say this feature is half-baked. We need to learn primitive method in Smalltalk more. (I heard this name at RubyConf Taiwan this month. Thanks!) [Conclusion] Nobody may use this feature and there is no compatibility issue. This feature goes to next minor (2.1?). * proc.c (rb_method_entry_arity): ditto. * vm_eval.c, vm_insnhelper.c, vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-10* vm_method.c (rb_method_entry_without_refinements): useshugo
rb_resolve_refined_method() to search superclasses if me->def->orig_me is 0. This change fixes make test-all TESTS="json ruby/test_refinement.rb". * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-09* vm_insnhelper.c (vm_call_opt_send): Kernel#send should not useshugo
refinements. * proc.c (mnew): Kernel#method, Kernel#public_method, Module#instance_method, and Module#public_instance_method should not use refinements. * vm_method.c (rb_method_boundp): Kernel#respond_to? should not use refinements. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06* revised r37993 to avoid SEGV/ILL in tests. In r37993, a methodshugo
entry with VM_METHOD_TYPE_REFINED holds only the original method definition, so ci->me is set to a method entry allocated in the stack, and it causes SEGV/ILL. In this commit, a method entry with VM_METHOD_TYPE_REFINED holds the whole original method entry. Furthermore, rb_thread_mark() is changed to mark cfp->klass to avoid GC for iclasses created by copy_refinement_iclass(). * vm_method.c (rb_method_entry_make): add a method entry with VM_METHOD_TYPE_REFINED to the class refined by the refinement if the target module is a refinement. When a method entry with VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with the same name is searched in refinements. If such a method is found, the method is invoked. Otherwise, the original method in the refined class (rb_method_definition_t::body.orig_me) is invoked. This change is made to simplify the normal method lookup and to improve the performance of normal method calls. * vm_method.c (EXPR1, search_method, rb_method_entry), vm_eval.c (rb_call0, rb_search_method_entry): do not use refinements for method lookup. * vm_insnhelper.c (vm_call_method): search methods in refinements if ci->me is VM_METHOD_TYPE_REFINED. If the method is called by super (i.e., ci->call == vm_call_super_method), skip the same method entry as the current method to avoid infinite call of the same method. * class.c (include_modules_at): add a refined method entry for each method defined in a module included in a refinement. * class.c (rb_prepend_module): set an empty table to RCLASS_M_TBL(klass) to add refined method entries, because refinements should have priority over prepended modules. * proc.c (mnew): use rb_method_entry_with_refinements() to get a refined method. * vm.c (rb_thread_mark): mark cfp->klass for iclasses created by copy_refinement_iclass(). * vm.c (Init_VM), cont.c (fiber_init): initialize th->cfp->klass. * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip the test because it should pass successfully. * test/ruby/test_refinement.rb (test_redefine_refined_method): new test for the case a refined method is redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01time.c, vm_method.c: update rdocnobu
* time.c (time_{mdump,dump,mload,load): update rdoc. * vm_method.c (obj_respond_to_missing): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01vm_method.c: privatenobu
* vm_method.c (basic_obj_respond_to): call even if private. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01vm_method.c: make initialize methods privatenobu
* id.c (Init_id), template/id.h.tmpl: add initialize_{copy,clone,dup} and respond_to_missing?. * vm_method.c (rb_method_entry_make): make above methods private. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* revert r37993 to avoid SEGV in tests.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_method.c (rb_method_entry_make): add a method entry withshugo
VM_METHOD_TYPE_REFINED to the class refined by the refinement if the target module is a refinement. When a method entry with VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with the same name is searched in refinements. If such a method is found, the method is invoked. Otherwise, the original method in the refined class (rb_method_definition_t::body.orig_def) is invoked. This change is made to simplify the normal method lookup and to improve the performance of normal method calls. * vm_method.c (EXPR1, search_method, rb_method_entry), vm_eval.c (rb_call0, rb_search_method_entry): do not use refinements for method lookup. * vm_insnhelper.c (vm_call_method): search methods in refinements if ci->me is VM_METHOD_TYPE_REFINED. If the method is called by super (i.e., ci->call == vm_call_super_method), skip the same method entry as the current method to avoid infinite call of the same method. * class.c (include_modules_at): add a refined method entry for each method defined in a module included in a refinement. * class.c (rb_prepend_module): set an empty table to RCLASS_M_TBL(klass) to add refined method entries, because refinements should have priority over prepended modules. * proc.c (mnew): use rb_method_entry_with_refinements() to get a refined method. * test/ruby/test_refinement.rb (test_inline_method_cache): do not skip the test because it should pass successfully. * test/ruby/test_refinement.rb (test_redefine_refined_method): new test for the case a refined method is redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13* vm_insnhelper.c (vm_call_cfunc_with_frame): don't use ci afterko1
EXEC_EVENT_HOOK because ci can be overridden. * vm_eval.c: ditto. * method.h: change invoker's parameters types. * vm_method.c (call_cfunc_invoker_func): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-07* eval.c (rb_mod_refine): set RMODULE_IS_REFINEMENT to a createdshugo
refinement module, and don't override method_added. * vm_method.c (rb_method_entry_make): check redefinition of optimized methods when a method is added to a refinement module. [ruby-core:48970] [Bug #7290] * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25* include/ruby/ruby.h, class.c: remove (revert)ko1
`rb_add_method_cfunc_frameless()' API. This API is not mature to become an offical API. For example, we can not use this API with `rb_define_private_method()'. * method.h, vm_method.c (rb_add_method_cfunc_frameless): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-23* vm_core.h, vm_insnhelper.c, vm_eval.c (OPT_CALL_CFUNC_WITHOUT_FRAME):ko1
add a new otpimization and its macro `OPT_CALL_CFUNC_WITHOUT_FRAME'. This optimization makes all cfunc method calls `frameless', which is fster than ordinal cfunc method call. If `frame' is needed (for example, it calls another method with `rb_funcall()'), then build a frame. In other words, this optimization delays frame building. However, to delay the frame building, we need additional overheads: (1) Store the last call information. (2) Check the delayed frame buidling before the frame is needed. (3) Overhead to build a delayed frame. rb_thread_t::passed_ci is storage of delayed cfunc call information. (1) is lightweight because it is only 1 assignment to `passed_ci'. To achieve (2), we modify GET_THREAD() to check `passed_ci' every time. It causes 10% overhead on my envrionment. This optimization only works for cfunc methods which do not need their `frame'. After evaluation on my environment, this optimization does not effective every time. Because of this evaluation results, this optimization is disabled at default. * vm_insnhelper.c, vm.c: add VM_PROFILE* macros to measure behaviour of VM internals. I will extend this feature. * vm_method.c, method.h: change parameters of the `invoker' function. Receive `func' pointer as the first parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19* method.h (rb_method_cfunc_t::invoker): add new field (func ptr)ko1
`invoker'. `invoker' function invoke cfunc body (rb_method_cfunc_t::func). `invoker' is set at method definition timing. With this change, the big `switch' (branch) in `call_cfunc()' is no longer needed. However, the performance benefit is only a bit. * vm_core.h (rb_call_info_t::aux::func): add a new field to store cfunc body function pointer. * vm_method.c (call_cfunc_invoker_func): add a new function which returns a suitable invoke function. * vm_method.c (setup_method_cfunc_struct): added. * vm_method.c (rb_add_method): fix to set `invoker'. * vm_eval.c (vm_call0_body): catch up above changes. * vm_insnhelper.c (call_cfunc): removed. * vm_insnhelper.c (vm_call_cfunc): fix to call cfunc body with `invoker' function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18vm_method.c: check arity earliernobu
* vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless): check arity earlier at definition time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18* class.c (rb_define_frameless_method): rename fromko1
rb_define_method_fast(). Defined method with this C API does not make a method frame. It is bit lightweight than ordinal C functions. Now only 0 or 1 argc are permitted. * method.h (VM_METHOD_TYPE_CFUNC_FRAMELESS): rename macro name from VM_METHOD_TYPE_CFUNC_FAST. * vm_insnhelper.c, vm_method.c: rename related functions. * proc.c (rb_method_entry_arity): catch up above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-15* method.h: introduce new method type VM_METHOD_TYPE_CFUNC_FAST.ko1
This method is similar to VM_METHOD_TYPE_CFUNC methods, but called cfunc without building new frame (does not push new control frame). If error is occured in cfunc, the backtrace only shows caller frame and upper. This kind of methods can be added by rb_define_method_fast(). This feature is similar to specialized instructions (opt_plus, etc), but more flexible (but a bit slower). * class.c (rb_define_method_fast): added. Maybe it will be renamed soon. * vm_insnhelper.c (vm_call_method): support method type VM_METHOD_TYPE_CFUNC_FAST. * proc.c (rb_method_entry_arity): catch up new method type. * vm_method.c (rb_add_method_cfunc_fast): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-08* eval.c, gc.c, iseq.c, node.h, vm_insnhelper.c, vm_insnhelper.h,shugo
vm_method.c: rename omod and overlaid modules to refinements. * eval.c (hidden_identity_hash_new): renamed from identity_hash_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-06* vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option toshugo
enable/disable global method caching. [ruby-dev:46203] [Bug #7111] * vm_method.c (rb_method_entry_get_with_omod): don't use global method cache if OPT_GLOBAL_METHOD_CACHE is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-06* vm_method.c (search_method): check omod only once for performance.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-28* vm_method.c (search_method): copy refinement iclasses to searchshugo
superclasses correctly. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-27* eval.c (rb_overlay_module, rb_mod_refine): accept a module as theshugo
argument of Module#refine. * vm_method.c (search_method): if klass is an iclass, lookup the original module of the iclass in omod in order to allow refinements of modules. * test/ruby/test_refinement.rb: add tests for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-08internal.h: allocator function in rb_classext_tnobu
* internal.h (struct rb_classext_struct): move allocator function into rb_classext_t from ordinary method table. [ruby-dev:46121] [Feature #6993] * object.c (rb_obj_alloc): call allocator function directly. * vm_method.c (rb_define_alloc_func, rb_undef_alloc_func) (rb_get_alloc_func): use allocator function in rb_classext_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-07* vm_method.c (rb_redefine_opt_method): use RCLASS_ORIGIN to avoidshugo
SEGV when a module-prepended class is refined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-02* eval.c (rb_mod_using): new method Module#using. [experimental]shugo
* eval.c (rb_mod_refine): new method Module#refine. [experimental] * eval.c (f_using): new method Kernel#using. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-02* class.c, insns.def, method.h, proc.c, vm.c, vm_core.h, vm_eval.c,shugo
vm_insnhelper.c, vm_insnhelper.h, vm_method.c: add klass to rb_control_frame_t to implement super correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-01RB_TYPE_P BUILTIN_TYPEnobu
* string.c, vm_insnhelper.c, vm_method.c: use RB_TYPE_P() and BUILTIN_TYPE() if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-02prepend: fix mixing with includenobu
* class.c (rb_include_module): include modules after the origin. * class.c (include_modules_at): skip prepended modules. * class.c (rb_prepend_module): now basic.klass in ICLASS refers the old original class/module. [ruby-dev:45868][Bug #6662] * class.c (rb_mod_ancestors): ditto. * vm_method.c (search_method): search method entry from the origin iclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-27remove from original m_tblnobu
* vm_method.c (remove_method): remove the method from the original m_tbl on a prepended module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e