[pypy-commit] pypy fast-gil: Reduce the diff

arigo noreply at buildbot.pypy.org
Tue Jun 24 15:42:06 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: fast-gil
Changeset: r72190:00acabcd683c
Date: 2014-06-24 14:22 +0200
http://bitbucket.org/pypy/pypy/changeset/00acabcd683c/

Log:	Reduce the diff

diff --git a/rpython/jit/backend/llsupport/test/zrpy_releasegil_test.py b/rpython/jit/backend/llsupport/test/zrpy_releasegil_test.py
--- a/rpython/jit/backend/llsupport/test/zrpy_releasegil_test.py
+++ b/rpython/jit/backend/llsupport/test/zrpy_releasegil_test.py
@@ -27,7 +27,7 @@
             glob.event += 1
 
         def before(n, x):
-            invoke_around_extcall(func, None)
+            invoke_around_extcall(func, func)
             return (n, None, None, None, None, None,
                     None, None, None, None, None, None)
         #
diff --git a/rpython/rlib/objectmodel.py b/rpython/rlib/objectmodel.py
--- a/rpython/rlib/objectmodel.py
+++ b/rpython/rlib/objectmodel.py
@@ -575,6 +575,9 @@
     raise TypeError, "hlinvoke is meant to be rtyped and not called direclty"
 
 def invoke_around_extcall(before, after):
+    """Call before() before any external function call, and after() after.
+    At the moment only one pair before()/after() can be registered at a time.
+    """
     # NOTE: the hooks are cleared during translation!  To be effective
     # in a compiled program they must be set at run-time.
     from rpython.rtyper.lltypesystem import rffi
@@ -583,10 +586,8 @@
     # the 'aroundstate' contains regular function and not ll pointers to them,
     # but let's call llhelper() anyway to force their annotation
     from rpython.rtyper.annlowlevel import llhelper
-    if before is not None:
-        llhelper(rffi.AroundFnPtr, before)
-    if after is not None:
-        llhelper(rffi.AroundFnPtr, after)
+    llhelper(rffi.AroundFnPtr, before)
+    llhelper(rffi.AroundFnPtr, after)
 
 def is_in_callback():
     from rpython.rtyper.lltypesystem import rffi
diff --git a/rpython/translator/c/gcc/trackgcroot.py b/rpython/translator/c/gcc/trackgcroot.py
--- a/rpython/translator/c/gcc/trackgcroot.py
+++ b/rpython/translator/c/gcc/trackgcroot.py
@@ -846,10 +846,6 @@
         return []
 
     def _visit_xchg(self, line):
-        # ignore the special locking xchg put there by custom assembler
-        # in thread_pthread.c, with an associated comment
-        if line.endswith('*/\n'):
-            return []
         # only support the format used in VALGRIND_DISCARD_TRANSLATIONS
         # which is to use a marker no-op "xchgl %ebx, %ebx"
         match = self.r_binaryinsn.match(line)
diff --git a/rpython/translator/c/src/thread_nt.c b/rpython/translator/c/src/thread_nt.c
--- a/rpython/translator/c/src/thread_nt.c
+++ b/rpython/translator/c/src/thread_nt.c
@@ -244,7 +244,4 @@
     InterlockedDecrement(&pending_acquires);
 }
 
-#ifdef RPY_FASTGIL
 # error "XXX implement me"
-InterlockedExchangePointer
-#endif


More information about the pypy-commit mailing list