Revision
4152
Author
lsansonetti@apple.com
Date
2010-05-25 17:19:26 -0700 (Tue, 25 May 2010)

Log Message

some optimizations in the ivar primitives

Modified Paths

Diff

Modified: MacRuby/trunk/kernel.c (4151 => 4152)


--- MacRuby/trunk/kernel.c	2010-05-25 22:07:00 UTC (rev 4151)
+++ MacRuby/trunk/kernel.c	2010-05-26 00:19:26 UTC (rev 4152)
@@ -41,11 +41,14 @@
 		    return val;
 		}
 	    }
+	    goto find_slot;
 	}
     }
 
     if (cache->slot == SLOT_CACHE_VIRGIN) {
-	const int slot = rb_vm_get_ivar_slot(obj, name, true);
+	int slot;
+find_slot:
+	slot = rb_vm_get_ivar_slot(obj, name, true);
 	if (slot >= 0) {
 	    cache->klass = *(VALUE *)obj;
 	    cache->slot = slot;
@@ -79,11 +82,14 @@
 		    return;
 		}
 	    }
+	    goto find_slot;
 	}
     }
 
     if (cache->slot == SLOT_CACHE_VIRGIN) {
-	const int slot = rb_vm_get_ivar_slot(obj, name, true);
+	int slot;
+find_slot:
+	slot = rb_vm_get_ivar_slot(obj, name, true);
 	if (slot >= 0) {
 	    cache->klass = *(VALUE *)obj;
 	    cache->slot = slot;