[pypy-commit] stmgc card-marking: Split _stm_write_slowpath_card() in two, as needed for the PyPy JIT

arigo noreply at buildbot.pypy.org
Mon Jun 30 17:02:09 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: card-marking
Changeset: r1264:1ee48e74669d
Date: 2014-06-30 17:02 +0200
http://bitbucket.org/pypy/stmgc/changeset/1ee48e74669d/

Log:	Split _stm_write_slowpath_card() in two, as needed for the PyPy JIT

diff --git a/c7/stm/core.c b/c7/stm/core.c
--- a/c7/stm/core.c
+++ b/c7/stm/core.c
@@ -235,6 +235,15 @@
     return (size >= _STM_MIN_CARD_OBJ_SIZE);
 }
 
+char _stm_write_slowpath_card_extra(object_t *obj)
+{
+    /* the PyPy JIT calls this function directly if it finds that an
+       array doesn't have the GCFLAG_CARDS_SET */
+    bool mark_card = obj_should_use_cards(obj);
+    write_slowpath_common(obj, mark_card);
+    return mark_card;
+}
+
 void _stm_write_slowpath_card(object_t *obj, uintptr_t index)
 {
     /* If CARDS_SET is not set so far, issue a normal write barrier.
@@ -242,8 +251,7 @@
        card marking instead.
     */
     if (!(obj->stm_flags & GCFLAG_CARDS_SET)) {
-        bool mark_card = obj_should_use_cards(obj);
-        write_slowpath_common(obj, mark_card);
+        char mark_card = _stm_write_slowpath_card_extra(obj);
         if (!mark_card)
             return;
     }
diff --git a/c7/stmgc.h b/c7/stmgc.h
--- a/c7/stmgc.h
+++ b/c7/stmgc.h
@@ -108,6 +108,7 @@
    but it's not exposed to C code so far */
 void _stm_write_slowpath(object_t *);
 void _stm_write_slowpath_card(object_t *, uintptr_t);
+char _stm_write_slowpath_card_extra(object_t *);
 object_t *_stm_allocate_slowpath(ssize_t);
 object_t *_stm_allocate_external(ssize_t);
 void _stm_become_inevitable(const char*);


More information about the pypy-commit mailing list