summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-15 05:15:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-15 05:15:26 +0000
commitd5b7e690320e969d77be665927fe8a493aa5806d (patch)
tree12b8365f6e82595980cf54f3bd13bc7f941a49f4 /vm_method.c
parent94fc275e16390962cb06653033078894987ac76f (diff)
* vm_eval.c (vm_call_super): uses method_missing().
* vm_eval.c (method_missing): get rid of too large alloca. * vm_eval.c (rb_call0, method_missing): uses idMethodMissing. * vm_method.c (rb_add_method, remove_method, rb_undef): uses id__send__. * vm_method.c (Init_eval_method): removed IDs which are defined as immediate values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/vm_method.c b/vm_method.c
index 72fc33f54e..f3387ed506 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -8,9 +8,8 @@
static void rb_vm_check_redefinition_opt_method(const NODE *node);
-static ID __send__, object_id;
+static ID object_id;
static ID removed, singleton_removed, undefined, singleton_undefined;
-static ID eqq, each, aref, aset, match, missing;
static ID added, singleton_added;
struct cache_entry { /* method hash table. */
@@ -166,7 +165,7 @@ rb_add_method(VALUE klass, ID mid, NODE * node, int noex)
rb_warn("redefining Object#initialize may cause infinite loop");
}
- if (mid == object_id || mid == __send__) {
+ if (mid == object_id || mid == id__send__) {
if (node && nd_type(node) == RUBY_VM_METHOD_NODE) {
rb_warn("redefining `%s' may cause serious problem",
rb_id2name(mid));
@@ -313,7 +312,7 @@ remove_method(VALUE klass, ID mid)
}
if (OBJ_FROZEN(klass))
rb_error_frozen("class/module");
- if (mid == object_id || mid == __send__ || mid == idInitialize) {
+ if (mid == object_id || mid == id__send__ || mid == idInitialize) {
rb_warn("removing `%s' may cause serious problem", rb_id2name(mid));
}
if (st_lookup(RCLASS_M_TBL(klass), mid, &data)) {
@@ -480,7 +479,7 @@ rb_undef(VALUE klass, ID id)
rb_id2name(id));
}
rb_frozen_class_p(klass);
- if (id == object_id || id == __send__ || id == idInitialize) {
+ if (id == object_id || id == id__send__ || id == idInitialize) {
rb_warn("undefining `%s' may cause serious problem", rb_id2name(id));
}
body = search_method(klass, id, &origin);
@@ -1128,13 +1127,6 @@ Init_eval_method(void)
rb_define_singleton_method(rb_vm_top_self(), "private", top_private, -1);
object_id = rb_intern("object_id");
- __send__ = rb_intern("__send__");
- eqq = rb_intern("===");
- each = rb_intern("each");
- aref = rb_intern("[]");
- aset = rb_intern("[]=");
- match = rb_intern("=~");
- missing = rb_intern("method_missing");
added = rb_intern("method_added");
singleton_added = rb_intern("singleton_method_added");
removed = rb_intern("method_removed");