[pypy-commit] stmgc default: Backed out changeset: 191c168da60e (readding of objects during minor collections to old_objects_to_trace)
Raemi
noreply at buildbot.pypy.org
Fri Jul 19 12:06:55 CEST 2013
Author: Remi Meier <remi.meier at gmail.com>
Branch:
Changeset: r419:ff208391e85c
Date: 2013-07-19 11:51 +0200
http://bitbucket.org/pypy/stmgc/changeset/ff208391e85c/
Log: Backed out changeset: 191c168da60e (readding of objects during minor
collections to old_objects_to_trace)
diff --git a/c4/nursery.c b/c4/nursery.c
--- a/c4/nursery.c
+++ b/c4/nursery.c
@@ -125,9 +125,6 @@
}
/************************************************************/
-/* list for private/protected, old roots that need to be
- kept in old_objects_to_trace */
-static __thread struct GcPtrList private_or_protected_roots = {0, 0, NULL};
static inline gcptr create_old_object_copy(gcptr obj)
{
@@ -207,22 +204,6 @@
(revision_t)END_MARKER_ON)) {
/* 'item' is a regular, non-null pointer */
visit_if_young(end);
- item = *end;
- /* if private or protected, this object needs to be
- traced again in the next minor_collect if it is
- currently in old_objects_to_trace. Because then
- it may be seen as write-ready in the view of
- someone:
- pw = write_barrier(); push_root(pw);
- minor_collect(); pw = pop_root(); // pw still write-ready
- */
- if (item
- && !(item->h_tid & GCFLAG_WRITE_BARRIER) /* not set in
- obj_to_trace*/
- && (item->h_tid & GCFLAG_PRIVATE_FROM_PROTECTED
- || item->h_revision == stm_private_rev_num)) {
- gcptrlist_insert(&private_or_protected_roots, item);
- }
}
else if (item != NULL) {
if (item == END_MARKER_OFF)
@@ -545,15 +526,10 @@
d->num_read_objects_known_old);
assert(gcptrlist_size(&d->private_from_protected) >=
d->num_private_from_protected_known_old);
-#if 0
- /* we could here force the following, but there is little point
- and it's a bad idea to do things in this function that is
- compiled only in debug mode */
d->num_read_objects_known_old =
gcptrlist_size(&d->list_of_read_objects);
d->num_private_from_protected_known_old =
gcptrlist_size(&d->private_from_protected);
-#endif
return 0;
}
else {
diff --git a/c4/test/test_et.py b/c4/test/test_et.py
--- a/c4/test/test_et.py
+++ b/c4/test/test_et.py
@@ -205,6 +205,7 @@
assert list_of_read_objects() == [p2]
def test_write_barrier_after_minor_collect():
+ # should fail
p = oalloc_refs(1)
pw = lib.stm_write_barrier(p)
@@ -220,8 +221,10 @@
assert pw.h_tid & GCFLAG_OLD
rawsetptr(pw, 0, r)
- # pw needs to be readded to old_objects_to_trace
- # before the next minor gc in order for this test to pass
+ # pw not in old_objects_to_trace. A
+ # repeated write_barrier before
+ # rawsetptr() would fix that
+
lib.stm_push_root(r)
minor_collect()
minor_collect()
@@ -232,24 +235,13 @@
pr = lib.stm_read_barrier(p)
assert r != r2
+ # these will fail because pw/pr was
+ # not traced in the last minor_collect,
+ # because they were not registered in
+ # old_objects_to_trace.
assert getptr(pr, 0) != r
assert getptr(pr, 0) == r2
- # the following shouldn't be done
- # because pw was not saved. Just
- # here to check that pw gets removed
- # from old_objects_to_trace when not found
- # on the root stack anymore
- rawsetptr(pw, 0, q)
- lib.stm_push_root(q)
- minor_collect()
- q2 = lib.stm_pop_root()
- check_nursery_free(q)
- pr = lib.stm_read_barrier(p)
- assert q != q2
- assert getptr(pr, 0) == q
- assert getptr(pr, 0) != q2
-
def test_write_barrier_after_minor_collect_young_to_old():
p = nalloc_refs(1)
pw = lib.stm_write_barrier(p)
diff --git a/duhton/listobject.c b/duhton/listobject.c
--- a/duhton/listobject.c
+++ b/duhton/listobject.c
@@ -75,7 +75,7 @@
void _list_append(DuListObject *ob, DuObject *x)
{
- _du_write1(ob);
+ _du_read1(ob);
DuTupleObject *olditems = ob->ob_tuple;
_du_read1(olditems);
@@ -85,6 +85,8 @@
DuTupleObject *newitems = DuTuple_New(newcount);
_du_restore3(ob, x, olditems);
+ _du_write1(ob);
+
for (i=0; i<newcount-1; i++)
newitems->ob_items[i] = olditems->ob_items[i];
newitems->ob_items[newcount-1] = x;
More information about the pypy-commit
mailing list