mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c29c44c454
commit
960e8a419f
3 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Sat Oct 6 18:31:36 2012 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Sat Oct 6 16:32:04 2012 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* vm_method.c (search_method): check omod only once for performance.
|
* vm_method.c (search_method): check omod only once for performance.
|
||||||
|
|
|
@ -497,6 +497,7 @@ rb_method_entry_t *
|
||||||
rb_method_entry_get_with_omod(VALUE omod, VALUE klass, ID id,
|
rb_method_entry_get_with_omod(VALUE omod, VALUE klass, ID id,
|
||||||
VALUE *defined_class_ptr)
|
VALUE *defined_class_ptr)
|
||||||
{
|
{
|
||||||
|
#if OPT_GLOBAL_METHOD_CACHE
|
||||||
struct cache_entry *ent;
|
struct cache_entry *ent;
|
||||||
|
|
||||||
ent = cache + EXPR1(klass, omod, id);
|
ent = cache + EXPR1(klass, omod, id);
|
||||||
|
@ -506,6 +507,7 @@ rb_method_entry_get_with_omod(VALUE omod, VALUE klass, ID id,
|
||||||
*defined_class_ptr = ent->defined_class;
|
*defined_class_ptr = ent->defined_class;
|
||||||
return ent->me;
|
return ent->me;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return rb_method_entry_get_without_cache(klass, omod, id,
|
return rb_method_entry_get_without_cache(klass, omod, id,
|
||||||
defined_class_ptr);
|
defined_class_ptr);
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
/* VM running option */
|
/* VM running option */
|
||||||
#define OPT_CHECKED_RUN 1
|
#define OPT_CHECKED_RUN 1
|
||||||
#define OPT_INLINE_METHOD_CACHE 1
|
#define OPT_INLINE_METHOD_CACHE 1
|
||||||
|
#define OPT_GLOBAL_METHOD_CACHE 1
|
||||||
#define OPT_BLOCKINLINING 0
|
#define OPT_BLOCKINLINING 0
|
||||||
|
|
||||||
/* architecture independent, affects generated code */
|
/* architecture independent, affects generated code */
|
||||||
|
|
Loading…
Reference in a new issue