Commits

Armin Rigo committed 31f8caa

Tweaks.

Comments (0)

Files changed (3)

pypy/rpython/memory/gc/concurrentms.py

         # is a collection running and the mutator tries to change an object
         # that was not scanned yet.
         self._init_writebarrier_logic()
+        #
+        self.main_thread_ident = ll_thread.get_ident()
 
     def setup(self):
         "Start the concurrent collector thread."
         llarena.arena_reset(adr, self.HDRSIZE, 0)
         llarena.arena_reserve(adr, totalsize)
         return adr + llmemory.raw_malloc_usage(self.HDRSIZE)
+    grow_reservation._always_inline_ = True
 
     def write_barrier(self, newvalue, addr_struct):
         mark = self.header(addr_struct).tid & 0xFF
             raise
 
     def acquire(self, lock):
-        if we_are_translated():
+        if (we_are_translated() or
+                ll_thread.get_ident() != self.main_thread_ident):
             ll_thread.c_thread_acquirelock(lock, 1)
         else:
             while rffi.cast(lltype.Signed,

pypy/translator/c/primitive.py

 import sys
 from pypy.rlib.objectmodel import Symbolic, ComputedIntSymbolic
 from pypy.rlib.objectmodel import CDefinedIntSymbolic
-from pypy.rlib.rarithmetic import r_longlong
+from pypy.rlib.rarithmetic import r_longlong, LONG_BIT
 from pypy.rlib.rfloat import isinf, isnan
 from pypy.rpython.lltypesystem.lltype import *
 from pypy.rpython.lltypesystem import rffi, llgroup
             name = name_small_integer(value.lowpart, db)
             assert (value.rest & value.MASK) == 0
             return '(%s+%dL)' % (name, value.rest)
+        elif isinstance(value, llgroup.HighCombinedSymbolic):
+            name = name_small_integer(value.hipart, db)
+            assert (value.rest & value.MASK) == 0
+            return '((((long)%s)<<%d)+%dL)' % (name, LONG_BIT//2,
+                                               value.rest)
         elif isinstance(value, AddressAsInt):
             return '((long)%s)' % name_address(value.adr, db)
         else:

pypy/translator/c/src/llgroup.h

 #define OP_EXTRACT_USHORT(value, r)         r = (pypy_halfword_t)value
 #define OP_COMBINE_USHORT(ushort, rest, r)  r = ((long)ushort) | rest
 
+#define OP_EXTRACT_HIGH_USHORT(value, r)         \
+    r = (pypy_halfword_t)(value >> (PYPY_LONG_BIT/2))
+#define OP_COMBINE_HIGH_USHORT(ushort, rest, r)  \
+    r = (((long)ushort) << (PYPY_LONG_BIT/2)) | rest
+
 #endif /* _PYPY_LL_GROUP_H_ */