[macruby-changes] [5126] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 6 19:22:41 PST 2011


Revision: 5126
          http://trac.macosforge.org/projects/ruby/changeset/5126
Author:   lsansonetti at apple.com
Date:     2011-01-06 19:22:35 -0800 (Thu, 06 Jan 2011)
Log Message:
-----------
call const_missing with a direct VM call

Modified Paths:
--------------
    MacRuby/trunk/id.c
    MacRuby/trunk/id.h
    MacRuby/trunk/variable.c

Modified: MacRuby/trunk/id.c
===================================================================
--- MacRuby/trunk/id.c	2011-01-07 02:02:46 UTC (rev 5125)
+++ MacRuby/trunk/id.c	2011-01-07 03:22:35 UTC (rev 5126)
@@ -75,6 +75,7 @@
     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");

Modified: MacRuby/trunk/id.h
===================================================================
--- MacRuby/trunk/id.h	2011-01-07 02:02:46 UTC (rev 5125)
+++ MacRuby/trunk/id.h	2011-01-07 03:22:35 UTC (rev 5126)
@@ -83,6 +83,7 @@
 extern SEL selNew;
 extern SEL selRespondTo;
 extern SEL selMethodMissing;
+extern SEL selConstMissing;
 extern SEL selCopy;
 extern SEL selMutableCopy;
 extern SEL selToS;

Modified: MacRuby/trunk/variable.c
===================================================================
--- MacRuby/trunk/variable.c	2011-01-07 02:02:46 UTC (rev 5125)
+++ MacRuby/trunk/variable.c	2011-01-07 03:22:35 UTC (rev 5126)
@@ -1291,12 +1291,12 @@
 }
 
 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 @@
     if (k != Qnil) {
 	return k;
     }
-    return const_missing(klass, id);
+    return call_const_missing(klass, id);
 }
 
 VALUE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110106/50bfd8eb/attachment.html>


More information about the macruby-changes mailing list