Revision: 408 http://trac.macosforge.org/projects/ruby/changeset/408 Author: lsansonetti@apple.com Date: 2008-08-04 18:35:38 -0700 (Mon, 04 Aug 2008) Log Message: ----------- wip Modified Paths: -------------- MacRuby/branches/lrz_unstable/class.c MacRuby/branches/lrz_unstable/objc.m MacRuby/branches/lrz_unstable/proc.c Modified: MacRuby/branches/lrz_unstable/class.c =================================================================== --- MacRuby/branches/lrz_unstable/class.c 2008-08-05 00:36:41 UTC (rev 407) +++ MacRuby/branches/lrz_unstable/class.c 2008-08-05 01:35:38 UTC (rev 408) @@ -666,6 +666,20 @@ * Outer.included_modules #=> [Mixin] */ +static void +rb_mod_included_modules_nosuper(VALUE mod, VALUE ary) +{ + VALUE inc_mods = rb_ivar_get(mod, idIncludedModules); + if (inc_mods != Qnil) { + int i, count = RARRAY_LEN(inc_mods); + for (i = 0; i < count; i++) { + VALUE imod = RARRAY_AT(inc_mods, i); + rb_ary_push(ary, imod); + rb_ary_concat(ary, rb_mod_included_modules(imod)); + } + } +} + VALUE rb_mod_included_modules(VALUE mod) { @@ -673,15 +687,7 @@ #if WITH_OBJC for (p = mod; p; p = RCLASS_SUPER(p)) { - VALUE inc_mods = rb_ivar_get(p, idIncludedModules); - if (inc_mods != Qnil) { - int i, count = RARRAY_LEN(inc_mods); - for (i = 0; i < count; i++) { - VALUE imod = RARRAY_AT(inc_mods, i); - rb_ary_push(ary, imod); - rb_ary_concat(ary, rb_mod_included_modules(imod)); - } - } + rb_mod_included_modules_nosuper(p, ary); if (RCLASS_MODULE(p)) break; } @@ -748,6 +754,8 @@ * Math.ancestors #=> [Math] */ +static void rb_mod_included_modules_nosuper(VALUE, VALUE); + VALUE rb_mod_ancestors(VALUE mod) { @@ -756,7 +764,7 @@ #if WITH_OBJC for (p = mod; p; p = RCLASS_SUPER(p)) { rb_ary_push(ary, p); - rb_ary_concat(ary, rb_mod_included_modules(p)); + rb_mod_included_modules_nosuper(p, ary); if (RCLASS_MODULE(p)) break; } Modified: MacRuby/branches/lrz_unstable/objc.m =================================================================== --- MacRuby/branches/lrz_unstable/objc.m 2008-08-05 00:36:41 UTC (rev 407) +++ MacRuby/branches/lrz_unstable/objc.m 2008-08-05 01:35:38 UTC (rev 408) @@ -1254,7 +1254,7 @@ Method method; char type[128]; long i, argc; - VALUE *argv; + VALUE *argv, klass; NODE *body, *node; rcv = (*(id **)args)[0]; @@ -1278,14 +1278,15 @@ rrcv = rcv == NULL ? Qnil : (VALUE)rcv; mid = rb_intern((const char *)sel); + klass = CLASS_OF(rrcv); - DLOG("RCALL", "[%p %s] node=%p argc=%ld", (void *)rrcv, (char *)sel, body, argc); + DLOG("RCALL", "%c[<%s %p> %s] node=%p", class_isMetaClass((Class)klass) ? '+' : '-', class_getName((Class)klass), (void *)rrcv, (char *)sel, body); VALUE rb_vm_call(rb_thread_t * th, VALUE klass, VALUE recv, VALUE id, ID oid, int argc, const VALUE *argv, const NODE *body, int nosuper); - ret = rb_vm_call(GET_THREAD(), CLASS_OF(rrcv), rrcv, mid, Qnil, + ret = rb_vm_call(GET_THREAD(), klass, rrcv, mid, Qnil, argc, argv, node, 0); method_getReturnType(method, type, sizeof type); Modified: MacRuby/branches/lrz_unstable/proc.c =================================================================== --- MacRuby/branches/lrz_unstable/proc.c 2008-08-05 00:36:41 UTC (rev 407) +++ MacRuby/branches/lrz_unstable/proc.c 2008-08-05 01:35:38 UTC (rev 408) @@ -770,7 +770,9 @@ data->body = body; data->rclass = rclass; data->oid = oid; +#if !WITH_OBJC OBJ_INFECT(method, klass); +#endif return method; } @@ -877,7 +879,9 @@ data->body = orig->body; data->rclass = orig->rclass; data->oid = orig->oid; +#if !WITH_OBJC OBJ_INFECT(method, obj); +#endif return method; }
participants (1)
-
source_changes@macosforge.org