Permalink
Browse files

call const_missing with a direct VM call

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5126 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
lrz committed Jan 7, 2011
1 parent 968a432 commit 927e7ecdb10a3330d55942ee8e2be1ac96c4ccb5
Showing with 6 additions and 4 deletions.
  1. +1 −0 id.c
  2. +1 −0 id.h
  3. +4 −4 variable.c
View
1 id.c
@@ -75,6 +75,7 @@ Init_id(void)
selNew = sel_registerName("new");
selRespondTo = sel_registerName("respond_to?:");
selMethodMissing = sel_registerName("method_missing:");
+ selConstMissing = sel_registerName("const_missing:");
selCopy = sel_registerName("copy");
selMutableCopy = sel_registerName("mutableCopy");
sel_zone = sel_registerName("zone");
View
1 id.h
@@ -83,6 +83,7 @@ extern SEL selInspect;
extern SEL selNew;
extern SEL selRespondTo;
extern SEL selMethodMissing;
+extern SEL selConstMissing;
extern SEL selCopy;
extern SEL selMutableCopy;
extern SEL selToS;
View
@@ -1291,12 +1291,12 @@ uninitialized_constant(VALUE klass, ID id)
}
static VALUE
-const_missing(VALUE klass, ID id)
+call_const_missing(VALUE klass, ID id)
{
- return rb_funcall(klass, rb_intern("const_missing"), 1, ID2SYM(id));
+ VALUE arg = ID2SYM(id);
+ return rb_vm_call(klass, selConstMissing, 1, &arg);
}
-
/*
* call-seq:
* mod.const_missing(sym) => obj
@@ -1542,7 +1542,7 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
if (k != Qnil) {
return k;
}
- return const_missing(klass, id);
+ return call_const_missing(klass, id);
}
VALUE

0 comments on commit 927e7ec

Please sign in to comment.