[pypy-commit] stmgc gc-small-uniform: translation fixes. one abort() for not implemented code

arigo noreply at buildbot.pypy.org
Tue Apr 15 10:28:29 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: gc-small-uniform
Changeset: r1158:69b0eac27cb6
Date: 2014-04-14 15:34 +0200
http://bitbucket.org/pypy/stmgc/changeset/69b0eac27cb6/

Log:	translation fixes. one abort() for not implemented code

diff --git a/c7/stm/core.c b/c7/stm/core.c
--- a/c7/stm/core.c
+++ b/c7/stm/core.c
@@ -279,6 +279,7 @@
 
 static void copy_object_to_shared(object_t *obj, int source_segment_num)
 {
+    abort();
     /* Only used by major GC.  XXX There is a lot of code duplication
        with synchronize_object_now() but I don't completely see how to
        improve...
@@ -335,7 +336,7 @@
 static inline void _synchronize_fragment(stm_char *frag, ssize_t frag_size)
 {
     /* First copy the object into the shared page, if needed */
-    uintptr_t page = ((uintptr_t)obj) / 4096UL;
+    uintptr_t page = ((uintptr_t)frag) / 4096UL;
 
     char *src = REAL_ADDRESS(STM_SEGMENT->segment_base, frag);
     char *dst = REAL_ADDRESS(stm_object_pages, frag);
@@ -361,7 +362,8 @@
     */
     assert(!_is_young(obj));
     assert(obj->stm_flags & GCFLAG_WRITE_BARRIER);
-    ssize_t obj_size = stmcb_size_rounded_up((struct object_s *)dst);
+    ssize_t obj_size = stmcb_size_rounded_up(
+        (struct object_s *)REAL_ADDRESS(STM_SEGMENT->segment_base, obj));
     OPT_ASSERT(obj_size >= 16);
 
     if (LIKELY(is_small_uniform(obj))) {
@@ -389,7 +391,7 @@
         _synchronize_fragment((stm_char *)start, copy_size);
 
         start = copy_up_to;
-    
+
     } while (start != end);
 }
 
@@ -434,7 +436,7 @@
             else
                 EVENTUALLY(memcmp(dst, src, frag_size) == 0);  /* same page */
         }
-    }
+    } while (j > 0);
 }
 
 static void push_overflow_objects_from_privatized_pages(void)
@@ -443,7 +445,8 @@
         return;
 
     LIST_FOREACH_R(STM_PSEGMENT->large_overflow_objects, object_t *,
-                   synchronize_object_now(item));
+                   synchronize_object_enqueue(item));
+    synchronize_objects_flush();
 }
 
 static void push_modified_to_other_segments(void)
@@ -465,9 +468,10 @@
 
             /* copy the object to the shared page, and to the other
                private pages as needed */
-            synchronize_object_now(item);
+            synchronize_object_enqueue(item);
         }));
 
+    synchronize_objects_flush();
     list_clear(STM_PSEGMENT->modified_old_objects);
 }
 
diff --git a/c7/stm/smallmalloc.c b/c7/stm/smallmalloc.c
--- a/c7/stm/smallmalloc.c
+++ b/c7/stm/smallmalloc.c
@@ -42,13 +42,15 @@
     memset(full_pages_object_size, 0, sizeof(full_pages_object_size));
 }
 
+static int gmfp_lock = 0;
+
 static void grab_more_free_pages_for_small_allocations(void)
 {
     /* Grab GCPAGE_NUM_PAGES pages out of the top addresses.  Use the
        lock of pages.c to prevent any remapping from occurring under our
        feet.
     */
-    mutex_pages_lock();
+    spinlock_acquire(gmfp_lock);
 
     if (free_uniform_pages == NULL) {
 
@@ -74,7 +76,7 @@
         }
     }
 
-    mutex_pages_unlock();
+    spinlock_release(gmfp_lock);
     return;
 
  out_of_memory:


More information about the pypy-commit mailing list