[macruby-changes] [655] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Oct 7 19:00:06 PDT 2008
Revision: 655
http://trac.macosforge.org/projects/ruby/changeset/655
Author: lsansonetti at apple.com
Date: 2008-10-07 19:00:05 -0700 (Tue, 07 Oct 2008)
Log Message:
-----------
more GC crasher fixes
Modified Paths:
--------------
MacRuby/trunk/eval_intern.h
MacRuby/trunk/parse.y
MacRuby/trunk/vm_core.h
Modified: MacRuby/trunk/eval_intern.h
===================================================================
--- MacRuby/trunk/eval_intern.h 2008-10-08 00:18:37 UTC (rev 654)
+++ MacRuby/trunk/eval_intern.h 2008-10-08 02:00:05 UTC (rev 655)
@@ -172,8 +172,28 @@
#define TAG_FATAL RUBY_TAG_FATAL
#define TAG_MASK RUBY_TAG_MASK
+#if WITH_OBJC
+static inline VALUE
+__new_throw_object(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
+{
+ NEWOBJ(n, NODE);
+ n->flags |= T_NODE;
+ nd_set_type(n, type);
+
+ /* no WB! */
+ n->u1.value = a0;
+ n->u2.value = a1;
+ n->u3.value = a2;
+
+ return (VALUE)n;
+}
#define NEW_THROW_OBJECT(val, pt, st) \
+ (__new_throw_object(NODE_LIT, (val), (pt), (st)))
+#else
+#define NEW_THROW_OBJECT(val, pt, st) \
((VALUE)NEW_NODE(NODE_LIT, (val), (pt), (st)))
+#endif
+
#define SET_THROWOBJ_CATCH_POINT(obj, val) \
(RNODE((obj))->u2.value = (val))
#define SET_THROWOBJ_STATE(obj, val) \
Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y 2008-10-08 00:18:37 UTC (rev 654)
+++ MacRuby/trunk/parse.y 2008-10-08 02:00:05 UTC (rev 655)
@@ -174,6 +174,7 @@
if (tbl->pos == tbl->capa) {
tbl->capa = tbl->capa * 2;
REALLOC_N(tbl->tbl, ID, tbl->capa);
+ GC_WB(&tbl->tbl, tbl->tbl);
}
tbl->tbl[tbl->pos++] = id;
}
@@ -5158,6 +5159,7 @@
if (toksiz > 4096) {
toksiz = 60;
REALLOC_N(tokenbuf, char, 60);
+ GC_WB(&tokenbuf, tokenbuf);
}
return tokenbuf;
}
@@ -5170,6 +5172,7 @@
if (tokidx >= toksiz) {
do {toksiz *= 2;} while (toksiz < tokidx);
REALLOC_N(tokenbuf, char, toksiz);
+ GC_WB(&tokenbuf, tokenbuf);
}
return &tokenbuf[tokidx-n];
}
@@ -5181,6 +5184,7 @@
if (tokidx >= toksiz) {
toksiz *= 2;
REALLOC_N(tokenbuf, char, toksiz);
+ GC_WB(&tokenbuf, tokenbuf);
}
}
Modified: MacRuby/trunk/vm_core.h
===================================================================
--- MacRuby/trunk/vm_core.h 2008-10-08 00:18:37 UTC (rev 654)
+++ MacRuby/trunk/vm_core.h 2008-10-08 02:00:05 UTC (rev 655)
@@ -585,9 +585,15 @@
typedef rb_control_frame_t *
(FUNC_FASTCALL(*rb_insn_func_t))(rb_thread_t *, rb_control_frame_t *);
+#if WITH_OBJC
+#define GC_GUARDED_PTR(p) (VALUE)(p)
+#define GC_GUARDED_PTR_REF(p) (void *)(p)
+#define GC_GUARDED_PTR_P(p) (VALUE)(p)
+#else
#define GC_GUARDED_PTR(p) ((VALUE)((VALUE)(p) | 0x01))
#define GC_GUARDED_PTR_REF(p) ((void *)(((VALUE)p) & ~0x03))
#define GC_GUARDED_PTR_P(p) (((VALUE)p) & 0x01)
+#endif
#define RUBY_VM_METHOD_NODE NODE_METHOD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20081007/379d90b5/attachment-0001.html
More information about the macruby-changes
mailing list