[pypy-commit] pypy stmgc-c7: merge heads

arigo noreply at buildbot.pypy.org
Sat Feb 21 09:34:23 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r76025:9cb90693e784
Date: 2015-02-20 23:15 +0100
http://bitbucket.org/pypy/pypy/changeset/9cb90693e784/

Log:	merge heads

diff --git a/rpython/tool/runsubprocess.py b/rpython/tool/runsubprocess.py
--- a/rpython/tool/runsubprocess.py
+++ b/rpython/tool/runsubprocess.py
@@ -65,7 +65,9 @@
 
     def spawn_subprocess():
         global _child
-        _child = Popen([sys.executable, _source], bufsize=0,
+        # For STM, it doesn't make sense to run another STM subprocess.
+        # Better just start cpython.
+        _child = Popen(['/usr/bin/python', _source], bufsize=0,
                        stdin=PIPE, stdout=PIPE, close_fds=True)
     spawn_subprocess()
 
diff --git a/rpython/translator/c/src/debug_print.c b/rpython/translator/c/src/debug_print.c
--- a/rpython/translator/c/src/debug_print.c
+++ b/rpython/translator/c/src/debug_print.c
@@ -12,10 +12,10 @@
 #include <windows.h>
 #endif
 #include "common_header.h"
+#include "structdef.h"
 #include "src/profiling.h"
 #include "src/debug_print.h"
 
-__thread_if_stm long pypy_have_debug_prints = -1;
 FILE *pypy_debug_file = NULL;   /* XXX make it thread-local too? */
 static unsigned char debug_ready = 0;
 static unsigned char debug_profile = 0;
diff --git a/rpython/translator/c/src/debug_print.h b/rpython/translator/c/src/debug_print.h
--- a/rpython/translator/c/src/debug_print.h
+++ b/rpython/translator/c/src/debug_print.h
@@ -23,6 +23,14 @@
    Note that 'fname' can be '-' to send the logging data to stderr.
 */
 
+/* We stick pypy_have_debug_prints as a field of pypy_g_ExcData,
+   where it will be cleared in case of STM transaction aborts.
+   XXX XXX this will set to zero the bits that were at one before
+   the transaction started; the log will be truncated sometimes.
+*/
+RPY_EXTERN struct pypy_ExcData0 pypy_g_ExcData;
+#define pypy_have_debug_prints    pypy_g_ExcData.ed_have_debug_prints
+
 /* macros used by the generated code */
 #define PYPY_HAVE_DEBUG_PRINTS    (pypy_have_debug_prints & 1 ? \
                                    (pypy_debug_ensure_opened(), 1) : 0)
@@ -49,7 +57,6 @@
 #define __thread_if_stm  /* nothing */
 #endif
 
-RPY_EXTERN __thread_if_stm long pypy_have_debug_prints;
 RPY_EXTERN __thread_if_stm char pypy_debug_threadid[];
 RPY_EXPORTED FILE *pypy_debug_file;
 
diff --git a/rpython/translator/exceptiontransform.py b/rpython/translator/exceptiontransform.py
--- a/rpython/translator/exceptiontransform.py
+++ b/rpython/translator/exceptiontransform.py
@@ -453,12 +453,14 @@
         EXCDATA = lltype.Struct('ExcData',
             ('exc_type',  self.lltype_of_exception_type),
             ('exc_value', self.lltype_of_exception_value),
+            ('have_debug_prints', lltype.Signed),
             hints={'stm_thread_local': True,
                    'stm_dont_track_raw_accesses':True,
                    'is_excdata': True})
         self.EXCDATA = EXCDATA
 
         exc_data = lltype.malloc(EXCDATA, immortal=True)
+        exc_data.have_debug_prints = -1
         null_type = lltype.nullptr(self.lltype_of_exception_type.TO)
         null_value = lltype.nullptr(self.lltype_of_exception_value.TO)
 


More information about the pypy-commit mailing list