ruby-changes:25054
From: shugo <ko1@a...>
Date: Sat, 6 Oct 2012 18:36:50 +0900 (JST)
Subject: [ruby-changes:25054] shugo:r37106 (trunk): * vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option to
shugo 2012-10-06 18:36:35 +0900 (Sat, 06 Oct 2012) New Revision: 37106 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37106 Log: * vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option to 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. Modified files: trunk/ChangeLog trunk/vm_method.c trunk/vm_opts.h Index: ChangeLog =================================================================== --- ChangeLog (revision 37105) +++ ChangeLog (revision 37106) @@ -1,3 +1,11 @@ +Sat Oct 6 18:31:36 2012 Shugo Maeda <shugo@r...> + + * vm_opts.h (OPT_GLOBAL_METHOD_CACHE): new build option to + 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. + Sat Oct 6 16:32:04 2012 Shugo Maeda <shugo@r...> * vm_method.c (search_method): check omod only once for performance. Index: vm_method.c =================================================================== --- vm_method.c (revision 37105) +++ vm_method.c (revision 37106) @@ -497,6 +497,7 @@ rb_method_entry_get_with_omod(VALUE omod, VALUE klass, ID id, VALUE *defined_class_ptr) { +#if OPT_GLOBAL_METHOD_CACHE struct cache_entry *ent; ent = cache + EXPR1(klass, omod, id); @@ -506,6 +507,7 @@ *defined_class_ptr = ent->defined_class; return ent->me; } +#endif return rb_method_entry_get_without_cache(klass, omod, id, defined_class_ptr); Index: vm_opts.h =================================================================== --- vm_opts.h (revision 37105) +++ vm_opts.h (revision 37106) @@ -37,6 +37,7 @@ /* VM running option */ #define OPT_CHECKED_RUN 1 #define OPT_INLINE_METHOD_CACHE 1 +#define OPT_GLOBAL_METHOD_CACHE 1 #define OPT_BLOCKINLINING 0 /* architecture independent, affects generated code */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/