mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
mreges r20743 from trunk into ruby_1_9_1.
* 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/branches/ruby_1_9_1@20810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f29b34f482
commit
237ad3e163
3 changed files with 38 additions and 38 deletions
16
vm_method.c
16
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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue