summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 05:51:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-13 05:51:14 +0000
commit304850801475722c686e31c93f82e18ede93ba05 (patch)
tree63376683c7df7ef30e67d683904694ad9592114d
parent609c7420d77aed3492648b6dae7adf118d3a8ab9 (diff)
vm_method.c: rb_method_entry_at
* 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
-rw-r--r--ChangeLog5
-rw-r--r--method.h1
-rw-r--r--vm_method.c6
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 43ceb05184..4b4ebd55f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Mon May 13 14:50:35 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon May 13 14:51:12 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_method.c (rb_method_entry_at): return the method entry for id at
+ klass, without ancestors.
* class.c (rb_singleton_class_get): get the singleton class if exists,
or nil.
diff --git a/method.h b/method.h
index b99674a913..e92fe3a870 100644
--- a/method.h
+++ b/method.h
@@ -110,6 +110,7 @@ struct unlinked_method_entry_list_entry {
void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);
rb_method_entry_t *rb_method_entry(VALUE klass, ID id, VALUE *define_class_ptr);
+rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
void rb_add_refined_method_entry(VALUE refined_class, ID mid);
rb_method_entry_t *rb_resolve_refined_method(VALUE refinements,
rb_method_entry_t *me,
diff --git a/vm_method.c b/vm_method.c
index ddcec6cd4e..516b87cb3e 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -510,6 +510,12 @@ search_method(VALUE klass, ID id, VALUE *defined_class_ptr)
return me;
}
+rb_method_entry_t *
+rb_method_entry_at(VALUE klass, ID id)
+{
+ return lookup_method_table(klass, id);
+}
+
/*
* search method entry without the method cache.
*