[pypy-commit] pypy stm-jit: in-progress

arigo noreply at buildbot.pypy.org
Sun Aug 5 22:34:30 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-jit
Changeset: r56590:97a6262e5976
Date: 2012-08-05 22:34 +0200
http://bitbucket.org/pypy/pypy/changeset/97a6262e5976/

Log:	in-progress

diff --git a/pypy/jit/backend/llsupport/descr.py b/pypy/jit/backend/llsupport/descr.py
--- a/pypy/jit/backend/llsupport/descr.py
+++ b/pypy/jit/backend/llsupport/descr.py
@@ -353,6 +353,10 @@
         from pypy.rlib.clibffi import FFI_DEFAULT_ABI
         assert self.get_call_conv() == FFI_DEFAULT_ABI, (
             "%r: create_call_stub() with a non-default call ABI" % (self,))
+        if rtyper is not None:
+            stm = rtyper.annotator.translator.config.translation.stm
+        else:
+            stm = False
 
         def process(c):
             if c == 'L':
@@ -364,6 +368,8 @@
                 return 'longlong.int2singlefloat(%s)' % (process('i'),)
             arg = 'args_%s[%d]' % (c, seen[c])
             seen[c] += 1
+            if c == 'r' and stm:
+                arg = 'llop.stm_writebarrier(llmemory.GCREF, %s)' % arg
             return arg
 
         def TYPE(arg):
diff --git a/pypy/translator/stm/gcsource.py b/pypy/translator/stm/gcsource.py
--- a/pypy/translator/stm/gcsource.py
+++ b/pypy/translator/stm/gcsource.py
@@ -88,8 +88,20 @@
                         resultlist.append(('instantiate', op.result))
                         continue
                     #
-                    raise Exception("%r: unknown targets, passing GC "
-                                    "arguments or result" % (op,))
+                    # unknwon targets, passing GC arguments or result:
+                    # check that there is already a stm_writebarrier
+                    # protecting all GC arguments.  The stm_writebarrier
+                    # must be inserted manually.  Only for jit.backend's
+                    # bh_call_x().
+                    writebarriers = set()
+                    for op1 in block.operations:
+                        if op1.opname == 'stm_writebarrier':
+                            writebarriers.add(op1.result)
+                    for v in op.args[1:-1]:
+                        if is_gc(v) and v not in writebarriers:
+                            raise Exception("%r: unknown targets, passing "
+                                            "unprotected GC arguments" % (op,))
+                    # the result is listed in a normal dependency.
                 #
                 if is_gc(op.result):
                     resultlist.append((op, op.result))


More information about the pypy-commit mailing list