Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r12:78d0be847b9a
Date: 2013-05-26 13:06 +0200
http://bitbucket.org/pypy/stmgc/changeset/78d0be847b9a/

Log:    Fix the test simply by killing GCFLAG_PRIVATE_COPY, which was not
        used any more.

diff --git a/c3/et.c b/c3/et.c
--- a/c3/et.c
+++ b/c3/et.c
@@ -641,7 +641,6 @@
   G2L_LOOP_FORWARD(d->public_to_private, item)
     {
       gcptr L = item->val;
-      assert(L->h_tid & GCFLAG_PRIVATE_COPY);
       assert(!(L->h_tid & GCFLAG_VISITED));
       assert(!(L->h_tid & GCFLAG_PUBLIC_TO_PRIVATE));
       assert(!(L->h_tid & GCFLAG_PREBUILT_ORIGINAL));
@@ -653,7 +652,6 @@
       fprintf(stderr, "%p->h_revision = %p (UpdateChainHeads)\n",
               L, (gcptr)new_revision);
 #endif
-      L->h_tid &= ~GCFLAG_PRIVATE_COPY;
       L->h_revision = new_revision;
 
       if (is_young(L))
@@ -675,7 +673,6 @@
       gcptr R = item->addr;
       revision_t v = (revision_t)item->val;
 
-      assert(!(R->h_tid & GCFLAG_PRIVATE_COPY));
       assert(R->h_tid & GCFLAG_PUBLIC_TO_PRIVATE);
       assert(!(R->h_tid & GCFLAG_NURSERY_MOVED));
       assert(!(R->h_tid & GCFLAG_STOLEN));
diff --git a/c3/et.h b/c3/et.h
--- a/c3/et.h
+++ b/c3/et.h
@@ -33,8 +33,7 @@
  *     young |     [ protected objects  |  private objects  (--> grows) ]
  *  (nursery)|
  *
- * GCFLAG_PRIVATE_COPY is set on a private object that is a "private copy",
- * i.e. is the newer version of some pre-existing non-private object.
+ * GCFLAG_OLD is set on old objects.
  *
  * GCFLAG_VISITED is used temporarily during major collections.
  *
@@ -53,32 +52,28 @@
  *
  * GCFLAG_NURSERY_MOVED is used temporarily during minor collections.
  *
- * GCFLAG_OLD is set on old objects.
- *
  * GCFLAG_STOLEN is set of protected objects after we notice that they
  * have been stolen.
  */
-#define GCFLAG_PRIVATE_COPY      (STM_FIRST_GCFLAG << 0)
+#define GCFLAG_OLD               (STM_FIRST_GCFLAG << 0)
 #define GCFLAG_VISITED           (STM_FIRST_GCFLAG << 1)
 #define GCFLAG_PUBLIC_TO_PRIVATE (STM_FIRST_GCFLAG << 2)
 #define GCFLAG_PREBUILT_ORIGINAL (STM_FIRST_GCFLAG << 3)
 #define GCFLAG_WRITE_BARRIER     (STM_FIRST_GCFLAG << 4)
 #define GCFLAG_NURSERY_MOVED     (STM_FIRST_GCFLAG << 5)
-#define GCFLAG_OLD               (STM_FIRST_GCFLAG << 6)
-#define GCFLAG_STOLEN            (STM_FIRST_GCFLAG << 7)
+#define GCFLAG_STOLEN            (STM_FIRST_GCFLAG << 6)
 
 /* this value must be reflected in PREBUILT_FLAGS in stmgc.h */
 #define GCFLAG_PREBUILT  (GCFLAG_VISITED           | \
                           GCFLAG_PREBUILT_ORIGINAL | \
                           GCFLAG_OLD)
 
-#define GC_FLAG_NAMES  { "PRIVATE_COPY",      \
+#define GC_FLAG_NAMES  { "OLD",               \
                          "VISITED",           \
                          "PUBLIC_TO_PRIVATE", \
                          "PREBUILT_ORIGINAL", \
                          "WRITE_BARRIER",     \
                          "NURSERY_MOVED",     \
-                         "OLD",               \
                          "STOLEN",            \
                          NULL }
 
diff --git a/c3/nursery.c b/c3/nursery.c
--- a/c3/nursery.c
+++ b/c3/nursery.c
@@ -159,14 +159,12 @@
 
     memcpy(localobj, globalobj, size);
 
-    assert(!(localobj->h_tid & GCFLAG_PRIVATE_COPY));
     assert(!(localobj->h_tid & GCFLAG_NURSERY_MOVED));
     localobj->h_tid &= ~(GCFLAG_VISITED           |
                          GCFLAG_PUBLIC_TO_PRIVATE |
                          GCFLAG_PREBUILT_ORIGINAL |
                          GCFLAG_WRITE_BARRIER     |
                          GCFLAG_OLD);
-    localobj->h_tid |= GCFLAG_PRIVATE_COPY;
     localobj->h_revision = stm_local_revision;
     return localobj;
 }
@@ -214,6 +212,7 @@
 void stmgc_committed_transaction(struct tx_descriptor *d)
 {
     spinlock_release(d->collection_lock);
+    gcptrlist_clear(&d->protected_with_private_copy);
 }
 
 void stmgc_abort_transaction(struct tx_descriptor *d)
diff --git a/c3/stmgc.h b/c3/stmgc.h
--- a/c3/stmgc.h
+++ b/c3/stmgc.h
@@ -21,7 +21,7 @@
 #define STM_SIZE_OF_USER_TID       (sizeof(revision_t) / 2)    /* in bytes */
 #define STM_FIRST_GCFLAG           (1L << (8 * STM_SIZE_OF_USER_TID))
 #define STM_USER_TID_MASK          (STM_FIRST_GCFLAG - 1)
-#define PREBUILT_FLAGS             (STM_FIRST_GCFLAG * (2 + 8 + 64))
+#define PREBUILT_FLAGS             (STM_FIRST_GCFLAG * (1 + 2 + 8))
 #define PREBUILT_REVISION          1
 
 
diff --git a/c3/test/support.py b/c3/test/support.py
--- a/c3/test/support.py
+++ b/c3/test/support.py
@@ -90,7 +90,6 @@
     /* some constants normally private that are useful in the tests */
     #define WORD                     ...
     #define GC_PAGE_SIZE             ...
-    #define GCFLAG_PRIVATE_COPY      ...
     #define GCFLAG_VISITED           ...
     #define GCFLAG_PUBLIC_TO_PRIVATE ...
     #define GCFLAG_PREBUILT_ORIGINAL ...
@@ -469,7 +468,6 @@
 
 def make_global(p1):
     assert p1.h_revision == lib.get_local_revision()
-    assert not (p1.h_tid & GCFLAG_PRIVATE_COPY)
     p1.h_revision = (lib.stm_global_cur_time() | 1) - 2
 
 def delegate(p1, p2):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to