[macruby-changes] [4543] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 27 14:28:07 PDT 2010


Revision: 4543
          http://trac.macosforge.org/projects/ruby/changeset/4543
Author:   lsansonetti at apple.com
Date:     2010-09-27 14:28:06 -0700 (Mon, 27 Sep 2010)
Log Message:
-----------
when compiling write barriers, don't assert that the slot must be in the auto-zone, because it could potentially be used on locals from bindings originally situated on the stack

Modified Paths:
--------------
    MacRuby/trunk/include/ruby/macruby.h
    MacRuby/trunk/kernel.c

Modified: MacRuby/trunk/include/ruby/macruby.h
===================================================================
--- MacRuby/trunk/include/ruby/macruby.h	2010-09-27 12:18:53 UTC (rev 4542)
+++ MacRuby/trunk/include/ruby/macruby.h	2010-09-27 21:28:06 UTC (rev 4543)
@@ -37,19 +37,23 @@
 extern auto_zone_t *__auto_zone;
 #endif
 
-#define GC_WB(dst, newval) \
+#define GC_WB_0(dst, newval, check) \
     do { \
 	void *nv = (void *)newval; \
 	if (!SPECIAL_CONST_P(nv)) { \
 	    if (!auto_zone_set_write_barrier(__auto_zone, \
 			(const void *)dst, (const void *)nv)) { \
-		rb_bug("destination %p isn't in the auto zone", dst); \
+		if (check) { \
+		    rb_bug("destination %p isn't in the auto zone", dst); \
+		} \
 	    } \
 	} \
 	*(void **)dst = nv; \
     } \
     while (0)
 
+#define GC_WB(dst, newval) GC_WB_0(dst, newval, true)
+
 static inline void *
 rb_objc_retain(void *addr)
 {

Modified: MacRuby/trunk/kernel.c
===================================================================
--- MacRuby/trunk/kernel.c	2010-09-27 12:18:53 UTC (rev 4542)
+++ MacRuby/trunk/kernel.c	2010-09-27 21:28:06 UTC (rev 4543)
@@ -27,7 +27,7 @@
 PRIMITIVE VALUE
 vm_gc_wb(VALUE *slot, VALUE val)
 {
-    GC_WB(slot, val);
+    GC_WB_0(slot, val, false);
     return val;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100927/bfbd8e58/attachment.html>


More information about the macruby-changes mailing list