Commits

Armin Rigo committed 2607c50

Run a mechanical translation of imports.

  • Participants
  • Parent commits b289e16
  • Branches stm-thread-2

Comments (0)

Files changed (40)

pypy/interpreter/pyopcode.py

                 # one of the opcodes in the one of the sequences
                 #    * POP_TOP/LOAD_CONST/RETURN_VALUE
                 #    * POP_TOP/LOAD_FAST/RETURN_VALUE
-                from pypy.rlib import rstm
+                from rpython.rlib import rstm
                 if rstm.should_break_transaction():
                     opcode = ord(co_code[next_instr])
                     if opcode not in (self.opcodedesc.RETURN_VALUE.index,

pypy/module/thread/atomic.py

 
 def exclusive_atomic_enter(space):
     if space.config.translation.stm:
-        from pypy.rlib.rstm import is_atomic
+        from rpython.rlib.rstm import is_atomic
         count = is_atomic()
     else:
         giltl = space.threadlocals
 
 def atomic_enter(space):
     if space.config.translation.stm:
-        from pypy.rlib.rstm import increment_atomic
+        from rpython.rlib.rstm import increment_atomic
         increment_atomic()
     else:
         giltl = space.threadlocals
 
 def atomic_exit(space, w_ignored1=None, w_ignored2=None, w_ignored3=None):
     if space.config.translation.stm:
-        from pypy.rlib.rstm import decrement_atomic, is_atomic
+        from rpython.rlib.rstm import decrement_atomic, is_atomic
         if is_atomic():
             decrement_atomic()
             return

pypy/module/thread/stm.py

 from pypy.module.thread.threadlocals import OSThreadLocals
 from pypy.module.thread.error import wrap_thread_error
 from pypy.module.thread import ll_thread
-from pypy.rlib import rstm
-from pypy.rlib.objectmodel import invoke_around_extcall
+from rpython.rlib import rstm
+from rpython.rlib.objectmodel import invoke_around_extcall
 
 
 class STMThreadLocals(OSThreadLocals):

rpython/jit/backend/llsupport/gc.py

 
     def rewrite_assembler(self, cpu, operations, gcrefs_output_list):
         if not self.stm:
-            from pypy.jit.backend.llsupport.rewrite import GcRewriterAssembler
+            from rpython.jit.backend.llsupport.rewrite import GcRewriterAssembler
         else:
-            from pypy.jit.backend.llsupport import stmrewrite
+            from rpython.jit.backend.llsupport import stmrewrite
             GcRewriterAssembler = stmrewrite.GcStmRewriterAssembler
         rewriter = GcRewriterAssembler(self, cpu)
         newops = rewriter.rewrite(operations)
             self.do_write_barrier = do_write_barrier
 
     def _setup_barriers_for_stm(self):
-        from pypy.rpython.memory.gc import stmgc
+        from rpython.rtyper.memory.gc import stmgc
         WBDescr = WriteBarrierDescr
         self.P2Rdescr = WBDescr(self, (stmgc.GCFLAG_GLOBAL,      'P2R',
                                        'stm_DirectReadBarrier'))
 
         if self.stm:
             # XXX remove the indirections in the following calls
-            from pypy.rlib import rstm
+            from rpython.rlib import rstm
             self.generate_function('stm_try_inevitable',
                                    rstm.become_inevitable, [],
                                    RESULT=lltype.Void)

rpython/jit/backend/llsupport/stmrewrite.py

-from pypy.jit.backend.llsupport.rewrite import GcRewriterAssembler
-from pypy.jit.metainterp.resoperation import ResOperation, rop
-from pypy.jit.metainterp.history import BoxPtr, ConstPtr, ConstInt
-from pypy.rlib.objectmodel import specialize
+from rpython.jit.backend.llsupport.rewrite import GcRewriterAssembler
+from rpython.jit.metainterp.resoperation import ResOperation, rop
+from rpython.jit.metainterp.history import BoxPtr, ConstPtr, ConstInt
+from rpython.rlib.objectmodel import specialize
 
 #
 # STM Support

rpython/jit/backend/llsupport/test/test_gc.py

         assert self.llop1.record == [('barrier', s_adr)]
 
     def test_gen_write_barrier(self):
-        from pypy.jit.backend.llsupport.rewrite import GcRewriterAssembler
+        from rpython.jit.backend.llsupport.rewrite import GcRewriterAssembler
         gc_ll_descr = self.gc_ll_descr
         llop1 = self.llop1
         #

rpython/jit/backend/llsupport/test/test_stmrewrite.py

-from pypy.jit.backend.llsupport.descr import *
-from pypy.jit.backend.llsupport.gc import *
-from pypy.jit.metainterp.gc import get_description
-from pypy.jit.backend.llsupport.test.test_rewrite import RewriteTests
+from rpython.jit.backend.llsupport.descr import *
+from rpython.jit.backend.llsupport.gc import *
+from rpython.jit.metainterp.gc import get_description
+from rpython.jit.backend.llsupport.test.test_rewrite import RewriteTests
 
 
 class TestStm(RewriteTests):

rpython/jit/backend/x86/assembler.py

 
     def stm_threadlocal(self, globaladdr):
         if self.with_stm():
-            from pypy.jit.backend.x86 import stmtlocal
+            from rpython.jit.backend.x86 import stmtlocal
             globaladdr -= stmtlocal.threadlocal_base()
             assert -0x10000 <= globaladdr < 0x10000 #estimate: "should be small"
             # --- in particular, fits_in_32bits() must be true
 
     def stm_SEGPREFIX(self, mc):
         if self.with_stm():
-            from pypy.jit.backend.x86 import stmtlocal
+            from rpython.jit.backend.x86 import stmtlocal
             stmtlocal.tl_segment_prefix(mc)
 
     @staticmethod

rpython/jit/backend/x86/stmtlocal.py

-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.jit.backend.x86.arch import WORD
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.jit.backend.x86.arch import WORD
 
 
 if WORD == 4:

rpython/rlib/atomic_ops.py

 import py
 from pypy.tool.autopath import pypydir
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
 
 
 cdir = py.path.local(pypydir) / 'translator' / 'stm'

rpython/rlib/objectmodel.py

     return rffi.stackcounter.stacks_counter > 1
 
 def has_around_extcall():
-    from pypy.rpython.lltypesystem import rffi
+    from rpython.rtyper.lltypesystem import rffi
     return rffi.aroundstate.before is not None
 
 

rpython/rlib/rstm.py

 import threading
-from pypy.translator.stm import stmgcintf
-from pypy.rlib.debug import ll_assert, fatalerror
-from pypy.rlib.objectmodel import keepalive_until_here, specialize
-from pypy.rlib.objectmodel import we_are_translated
-from pypy.rlib.rposix import get_errno, set_errno
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rclass
-from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.rpython.annlowlevel import (cast_instance_to_base_ptr,
+from rpython.translator.stm import stmgcintf
+from rpython.rlib.debug import ll_assert, fatalerror
+from rpython.rlib.objectmodel import keepalive_until_here, specialize
+from rpython.rlib.objectmodel import we_are_translated
+from rpython.rlib.rposix import get_errno, set_errno
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, rclass
+from rpython.rtyper.lltypesystem.lloperation import llop
+from rpython.rtyper.annlowlevel import (cast_instance_to_base_ptr,
                                       llhelper)
 
 def is_inevitable():

rpython/rlib/test/test_atomic_ops.py

-from pypy.rlib.atomic_ops import bool_cas
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
+from rpython.rlib.atomic_ops import bool_cas
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 
 
 ARRAY = rffi.CArray(llmemory.Address)
     return 0
 
 def test_translate_bool_cas():
-    from pypy.translator.c.test.test_genc import compile
+    from rpython.translator.c.test.test_genc import compile
 
     f = compile(test_bool_cas, [])
     res = f()

rpython/rtyper/llinterp.py

             self.tracer = Tracer()
 
     def eval_entry_point(self, graph, args=()):
-        from pypy.rpython.lltypesystem import lltype, rffi
+        from rpython.rtyper.lltypesystem import lltype, rffi
         ARGV = graph.startblock.inputargs[1].concretetype
         args = [''] + list(args)
         ll_args = lltype.malloc(ARGV.TO, len(args), flavor='raw')

rpython/rtyper/lltypesystem/llmemory.py

 
 class AddressAsUInt(AddressAsInt):
     def annotation(self):
-        from pypy.annotation import model
+        from rpython.annotator import model
         return model.SomeInteger(unsigned=True)
     def lltype(self):
         return lltype.Unsigned

rpython/rtyper/memory/gc/stmgc.py

-from pypy.rpython.lltypesystem import lltype, llmemory, llarena, llgroup
-from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.rpython.lltypesystem.llmemory import raw_malloc_usage, raw_memcopy
-from pypy.rpython.memory.gc.base import GCBase, MovingGCBase
-from pypy.rpython.memory.support import mangle_hash
-from pypy.rpython.annlowlevel import llhelper
-from pypy.rlib.rarithmetic import LONG_BIT, r_uint
-from pypy.rlib.debug import ll_assert, debug_start, debug_stop, fatalerror
-from pypy.rlib.debug import debug_print
+from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup
+from rpython.rtyper.lltypesystem.lloperation import llop
+from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage, raw_memcopy
+from rpython.rtyper.memory.gc.base import GCBase, MovingGCBase
+from rpython.rtyper.memory.support import mangle_hash
+from rpython.rtyper.annlowlevel import llhelper
+from rpython.rlib.rarithmetic import LONG_BIT, r_uint
+from rpython.rlib.debug import ll_assert, debug_start, debug_stop, fatalerror
+from rpython.rlib.debug import debug_print
 from pypy.module.thread import ll_thread
 
 
             assert stm_operations == 'use_real_one', (
                 "XXX not provided so far: stm_operations == %r" % (
                 stm_operations,))
-            from pypy.translator.stm.stmgcintf import StmOperations
+            from rpython.translator.stm.stmgcintf import StmOperations
             stm_operations = StmOperations()
         #
-        from pypy.rpython.memory.gc import stmshared
+        from rpython.rtyper.memory.gc import stmshared
         self.stm_operations = stm_operations
         self.nursery_size = nursery_size
         self.maximum_extra_threshold = 0
         of the GC.  The C-level transaction should already be started."""
         ll_assert(self.stm_operations.in_transaction(),
                   "setup_thread: not in a transaction")
-        from pypy.rpython.memory.gc.stmtls import StmGCTLS
+        from rpython.rtyper.memory.gc.stmtls import StmGCTLS
         stmtls = StmGCTLS(self)
         stmtls.start_transaction()
 
 
     @always_inline
     def get_tls(self):
-        from pypy.rpython.memory.gc.stmtls import StmGCTLS
+        from rpython.rtyper.memory.gc.stmtls import StmGCTLS
         tls = self.stm_operations.get_tls()
         return StmGCTLS.cast_address_to_tls_object(tls)
 

rpython/rtyper/memory/gc/stmshared.py

-from pypy.rpython.lltypesystem import lltype, llmemory, llarena
-from pypy.rlib.objectmodel import free_non_gc_object
+from rpython.rtyper.lltypesystem import lltype, llmemory, llarena
+from rpython.rlib.objectmodel import free_non_gc_object
 
 NULL = llmemory.NULL
 

rpython/rtyper/memory/gc/stmtls.py

-from pypy.rpython.lltypesystem import lltype, llmemory, llarena, rffi
-from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.rpython.annlowlevel import cast_instance_to_base_ptr, llhelper
-from pypy.rpython.annlowlevel import cast_base_ptr_to_instance, base_ptr_lltype
-from pypy.rlib.objectmodel import we_are_translated, free_non_gc_object
-from pypy.rlib.objectmodel import specialize
-from pypy.rlib.rarithmetic import r_uint
-from pypy.rlib.debug import ll_assert, fatalerror
-from pypy.rlib.debug import debug_start, debug_stop, debug_print
+from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, rffi
+from rpython.rtyper.lltypesystem.lloperation import llop
+from rpython.rtyper.annlowlevel import cast_instance_to_base_ptr, llhelper
+from rpython.rtyper.annlowlevel import cast_base_ptr_to_instance, base_ptr_lltype
+from rpython.rlib.objectmodel import we_are_translated, free_non_gc_object
+from rpython.rlib.objectmodel import specialize
+from rpython.rlib.rarithmetic import r_uint
+from rpython.rlib.debug import ll_assert, fatalerror
+from rpython.rlib.debug import debug_start, debug_stop, debug_print
 
-from pypy.rpython.memory.gc.stmgc import WORD, NULL
-from pypy.rpython.memory.gc.stmgc import always_inline, dont_inline
-from pypy.rpython.memory.gc.stmgc import GCFLAG_GLOBAL, GCFLAG_VISITED
-from pypy.rpython.memory.gc.stmgc import GCFLAG_LOCAL_COPY
-from pypy.rpython.memory.gc.stmgc import GCFLAG_POSSIBLY_OUTDATED
-from pypy.rpython.memory.gc.stmgc import GCFLAG_NOT_WRITTEN
-from pypy.rpython.memory.gc.stmgc import GCFLAG_HASH_FIELD, GCFLAG_NEW_HASH
-from pypy.rpython.memory.gc.stmgc import hdr_revision, set_hdr_revision
+from rpython.rtyper.memory.gc.stmgc import WORD, NULL
+from rpython.rtyper.memory.gc.stmgc import always_inline, dont_inline
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_GLOBAL, GCFLAG_VISITED
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_LOCAL_COPY
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_POSSIBLY_OUTDATED
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_NOT_WRITTEN
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_HASH_FIELD, GCFLAG_NEW_HASH
+from rpython.rtyper.memory.gc.stmgc import hdr_revision, set_hdr_revision
 
 SIZE_OF_SIGNED = llmemory.sizeof(lltype.Signed)
 
         self.set_extra_threshold(self.gc.maximum_extra_threshold)
         #
         # --- a thread-local allocator for the shared area
-        from pypy.rpython.memory.gc.stmshared import StmGCThreadLocalAllocator
+        from rpython.rtyper.memory.gc.stmshared import StmGCThreadLocalAllocator
         self.sharedarea_tls = StmGCThreadLocalAllocator(self.gc.sharedarea)
         self.copied_local_objects = self.AddressStack()   # XXX KILL
         # --- the LOCAL objects which are weakrefs.  They are also listed
             self.detect_flag_combination = -1
         #
         # Move away the previous sharedarea_tls and start a new one.
-        from pypy.rpython.memory.gc.stmshared import StmGCThreadLocalAllocator
+        from rpython.rtyper.memory.gc.stmshared import StmGCThreadLocalAllocator
         previous_sharedarea_tls = self.sharedarea_tls
         self.sharedarea_tls = StmGCThreadLocalAllocator(self.gc.sharedarea)
         #

rpython/rtyper/memory/gc/test/test_stmgc.py

 import py
-from pypy.rlib.rarithmetic import r_uint
-from pypy.rpython.lltypesystem import lltype, llmemory, llarena, llgroup, rffi
-from pypy.rpython.memory.gc.stmgc import StmGC, WORD, REV_INITIAL
-from pypy.rpython.memory.gc.stmgc import GCFLAG_GLOBAL, GCFLAG_NOT_WRITTEN
-from pypy.rpython.memory.gc.stmgc import GCFLAG_POSSIBLY_OUTDATED
-from pypy.rpython.memory.gc.stmgc import GCFLAG_LOCAL_COPY, GCFLAG_VISITED
-from pypy.rpython.memory.gc.stmgc import GCFLAG_HASH_FIELD
-from pypy.rpython.memory.gc.stmgc import hdr_revision, set_hdr_revision
-from pypy.rpython.memory.support import mangle_hash
+from rpython.rlib.rarithmetic import r_uint
+from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup, rffi
+from rpython.rtyper.memory.gc.stmgc import StmGC, WORD, REV_INITIAL
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_GLOBAL, GCFLAG_NOT_WRITTEN
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_POSSIBLY_OUTDATED
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_LOCAL_COPY, GCFLAG_VISITED
+from rpython.rtyper.memory.gc.stmgc import GCFLAG_HASH_FIELD
+from rpython.rtyper.memory.gc.stmgc import hdr_revision, set_hdr_revision
+from rpython.rtyper.memory.support import mangle_hash
 
 
 S = lltype.GcStruct('S', ('a', lltype.Signed), ('b', lltype.Signed),
         tldict[obj] = localobj
 
     def tldict_enum(self):
-        from pypy.rpython.memory.gc.stmtls import StmGCTLS
+        from rpython.rtyper.memory.gc.stmtls import StmGCTLS
         callback = StmGCTLS._stm_enum_callback
         tls = self.get_tls()
         for key, value in self._tldicts[self.threadnum].iteritems():
 
     def test_random_gc_usage(self):
         import random
-        from pypy.rpython.memory.gc.test import test_stmtls
+        from rpython.rtyper.memory.gc.test import test_stmtls
         self.gc.root_walker = test_stmtls.FakeRootWalker()
         #
         sr2 = {}    # {obj._obj: obj._obj} following the 'sr2' attribute
             print 'Iteration %d finished' % iteration
 
     def test_relocalize_objects_after_transaction_break(self):
-        from pypy.rpython.memory.gc.test import test_stmtls
+        from rpython.rtyper.memory.gc.test import test_stmtls
         self.gc.root_walker = test_stmtls.FakeRootWalker()
         #
         tr1 = self.malloc(SR, globl=True)   # three prebuilt objects
         self.checkflags(tr3_adr, True, True)     # tr3 has become global again
 
     def test_obj_with_invalid_offset_after_transaction_stop(self):
-        from pypy.rpython.memory.gc.test import test_stmtls
+        from rpython.rtyper.memory.gc.test import test_stmtls
         self.gc.root_walker = test_stmtls.FakeRootWalker()
         #
         tr1, tr1_adr = self.malloc(SR, globl=False)  # local
         py.test.raises(llarena.ArenaError, self.gc.root_walker.pop)
 
     def test_non_prebuilt_relocalize_after_transaction_break(self):
-        from pypy.rpython.memory.gc.test import test_stmtls
+        from rpython.rtyper.memory.gc.test import test_stmtls
         self.gc.root_walker = test_stmtls.FakeRootWalker()
         #
         tr1, tr1_adr = self.malloc(SR, globl=False)  # local
         assert s2 == tr1.s1   # tr1 is a root, so not copied yet
 
     def test_weakref_to_local_in_main_thread(self):
-        from pypy.rpython.memory.gc.test import test_stmtls
+        from rpython.rtyper.memory.gc.test import test_stmtls
         self.gc.root_walker = test_stmtls.FakeRootWalker()
         #
         sr1, sr1_adr = self.malloc(SR, globl=False)
         assert a == sr1_adr
 
     def test_prebuilt_nongc(self):
-        from pypy.rpython.memory.gc.test import test_stmtls
+        from rpython.rtyper.memory.gc.test import test_stmtls
         self.gc.root_walker = test_stmtls.FakeRootWalker()
         NONGC = lltype.Struct('NONGC', ('s', lltype.Ptr(S)))
         nongc = lltype.malloc(NONGC, immortal=True, flavor='raw')

rpython/rtyper/memory/gc/test/test_stmtls.py

 import py
-from pypy.rlib.rarithmetic import r_uint
-from pypy.rpython.lltypesystem import lltype, llmemory, llarena, llgroup
-from pypy.rpython.memory.gc.stmtls import StmGCTLS, WORD
-from pypy.rpython.memory.support import get_address_stack, get_address_deque
-from pypy.rpython.memory.gcheader import GCHeaderBuilder
+from rpython.rlib.rarithmetic import r_uint
+from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup
+from rpython.rtyper.memory.gc.stmtls import StmGCTLS, WORD
+from rpython.rtyper.memory.support import get_address_stack, get_address_deque
+from rpython.rtyper.memory.gcheader import GCHeaderBuilder
 
 
 NULL = llmemory.NULL
             callback(arg, root)
 
 class FakeGC:
-    from pypy.rpython.memory.support import AddressDict, null_address_dict
+    from rpython.rtyper.memory.support import AddressDict, null_address_dict
     DEBUG = True
     AddressStack = get_address_stack()
     AddressDeque = get_address_deque()

rpython/rtyper/memory/gctransform/framework.py

 
 
     def _declare_functions(self, GCClass, getfn, s_gc, s_typeid16):
-        from pypy.rpython.memory.gc.base import ARRAY_TYPEID_MAP
-        from pypy.rpython.memory.gc import inspector
+        from rpython.rtyper.memory.gc.base import ARRAY_TYPEID_MAP
+        from rpython.rtyper.memory.gc import inspector
 
         s_gcref = annmodel.SomePtr(llmemory.GCREF)
         gcdata = self.gcdata

rpython/rtyper/memory/gctransform/nogcstm.py

-from pypy.rpython.memory.gctransform.boehm import BoehmGCTransformer
-from pypy.rpython.lltypesystem import lltype, llmemory
-from pypy.rlib.rarithmetic import r_uint, LONG_BIT
+from rpython.rtyper.memory.gctransform.boehm import BoehmGCTransformer
+from rpython.rtyper.lltypesystem import lltype, llmemory
+from rpython.rlib.rarithmetic import r_uint, LONG_BIT
 
 
 _first_gcflag            = 1 << (LONG_BIT//2)

rpython/rtyper/memory/gctransform/stmframework.py

-from pypy.rpython.memory.gctransform import shadowstack
-from pypy.rpython.memory.gctransform.framework import BaseRootWalker
-from pypy.rpython.memory.gctransform.framework import sizeofaddr
-from pypy.rpython.lltypesystem import lltype, llmemory
-from pypy.rpython import rmodel
-from pypy.annotation import model as annmodel
-from pypy.rlib.debug import fatalerror_notb
-from pypy.rlib.nonconst import NonConstant
-from pypy.rlib.objectmodel import specialize
+from rpython.rtyper.memory.gctransform import shadowstack
+from rpython.rtyper.memory.gctransform.framework import BaseRootWalker
+from rpython.rtyper.memory.gctransform.framework import sizeofaddr
+from rpython.rtyper.lltypesystem import lltype, llmemory
+from rpython.rtyper import rmodel
+from rpython.annotator import model as annmodel
+from rpython.rlib.debug import fatalerror_notb
+from rpython.rlib.nonconst import NonConstant
+from rpython.rlib.objectmodel import specialize
 
 
 END_MARKER = -8      # keep in sync with src_stm/rpyintf.c
     root_stack_depth = 163840
 
     def __init__(self, gctransformer):
-        from pypy.rpython.memory.gctransform import shadowstack
+        from rpython.rtyper.memory.gctransform import shadowstack
         #
         BaseRootWalker.__init__(self, gctransformer)
         # we use the thread-local self.stackgcdata to store state;

rpython/translator/c/funcgen.py

             if not self._is_stm():
                 raise AssertionError("STM transformation not applied.  "
                                      "You need '--stm'")
-            from pypy.translator.stm.funcgen import op_stm
+            from rpython.translator.stm.funcgen import op_stm
             self.__class__.op_stm = op_stm
         return self.op_stm(op)
     OP_STM_START_TRANSACTION = _OP_STM

rpython/translator/c/gc.py

 
     def gettransformer(self):
         if self.db.translator.config.translation.stm:
-            from pypy.rpython.memory.gctransform import nogcstm
+            from rpython.rtyper.memory.gctransform import nogcstm
             return nogcstm.NoneSTMGCTransformer(self.db.translator)
         return BoehmGcPolicy.gettransformer(self)
 
 class StmFrameworkGcPolicy(BasicFrameworkGcPolicy):
     
     def gettransformer(self):
-        from pypy.rpython.memory.gctransform import stmframework
+        from rpython.rtyper.memory.gctransform import stmframework
         return stmframework.StmFrameworkGCTransformer(self.db.translator)
 
 

rpython/translator/c/genc.py

         translator = self.translator
 
         if self.config.translation.stm:
-            from pypy.translator.stm import transform2
+            from rpython.translator.stm import transform2
             self.getentrypointptr()    # build the wrapper first
             # ^^ this is needed to make sure we see the no-GC wrapper function
             # calling the GC entrypoint function.
         self.merge_eci(db.gcpolicy.compilation_info())
 
         if self.config.translation.stm:
-            from pypy.translator.stm.stmgcintf import eci
+            from rpython.translator.stm.stmgcintf import eci
             self.merge_eci(eci)
 
         all = []
         if self._entrypoint_wrapper is not None:
             return self._entrypoint_wrapper
         #
-        from pypy.annotation import model as annmodel
-        from pypy.rpython.lltypesystem import rffi
-        from pypy.rpython.annlowlevel import MixLevelHelperAnnotator
+        from rpython.annotator import model as annmodel
+        from rpython.rtyper.lltypesystem import rffi
+        from rpython.rtyper.annlowlevel import MixLevelHelperAnnotator
         entrypoint = self.entrypoint
         stm_nogc = (self.config.translation.stm and
                     self.config.translation.gc == "none")
         #
         def entrypoint_wrapper(argc, argv):
             if stm_nogc:
-                from pypy.translator.stm.funcgen import _stm_nogc_init_function
+                from rpython.translator.stm.funcgen import _stm_nogc_init_function
                 _stm_nogc_init_function()
             list = [""] * argc
             i = 0

rpython/translator/stm/funcgen.py

-from pypy.translator.c.support import c_string_constant
-from pypy.translator.stm.stmgcintf import StmOperations
+from rpython.translator.c.support import c_string_constant
+from rpython.translator.stm.stmgcintf import StmOperations
 
 
 def stm_start_transaction(funcgen, op):

rpython/translator/stm/inevitable.py

-from pypy.rpython.lltypesystem import lltype, lloperation, rclass
-from pypy.translator.stm.writebarrier import is_immutable
-from pypy.objspace.flow.model import SpaceOperation, Constant
-from pypy.translator.unsimplify import varoftype
-from pypy.translator.simplify import get_funcobj
+from rpython.rtyper.lltypesystem import lltype, lloperation, rclass
+from rpython.translator.stm.writebarrier import is_immutable
+from rpython.flowspace.model import SpaceOperation, Constant
+from rpython.translator.unsimplify import varoftype
+from rpython.translator.simplify import get_funcobj
 
 
 ALWAYS_ALLOW_OPERATIONS = set([
                           varoftype(lltype.Void))
 
 def insert_turn_inevitable(graph):
-    from pypy.translator.backendopt.writeanalyze import FreshMallocs
+    from rpython.translator.backendopt.writeanalyze import FreshMallocs
     fresh_mallocs = FreshMallocs(graph)
     for block in graph.iterblocks():
         for i in range(len(block.operations)-1, -1, -1):

rpython/translator/stm/jitdriver.py

-from pypy.rpython.lltypesystem import lltype, rclass
-from pypy.objspace.flow.model import checkgraph, copygraph
-from pypy.objspace.flow.model import Block, Link, SpaceOperation, Constant
-from pypy.translator.unsimplify import split_block, varoftype
-from pypy.translator.stm.stmgcintf import StmOperations
-from pypy.annotation.model import lltype_to_annotation, s_Int
-from pypy.rpython.annlowlevel import (MixLevelHelperAnnotator,
+from rpython.rtyper.lltypesystem import lltype, rclass
+from rpython.flowspace.model import checkgraph, copygraph
+from rpython.flowspace.model import Block, Link, SpaceOperation, Constant
+from rpython.translator.unsimplify import split_block, varoftype
+from rpython.translator.stm.stmgcintf import StmOperations
+from rpython.annotator.model import lltype_to_annotation, s_Int
+from rpython.rtyper.annlowlevel import (MixLevelHelperAnnotator,
                                       cast_base_ptr_to_instance)
-from pypy.rlib import rstm
+from rpython.rlib import rstm
 from pypy.tool.sourcetools import compile2
 
 

rpython/translator/stm/stmgcintf.py

 import py
 from pypy.tool.autopath import pypydir
-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.translator.tool.cbuild import ExternalCompilationInfo
-from pypy.rlib.rarithmetic import LONG_BIT
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.translator.tool.cbuild import ExternalCompilationInfo
+from rpython.rlib.rarithmetic import LONG_BIT
 
 
 cdir = py.path.local(pypydir) / 'translator' / 'stm'

rpython/translator/stm/test/support.py

 """CompiledSTMTests, a support class for translated tests with STM"""
 
-from pypy.translator.c.test.test_standalone import StandaloneTests
+from rpython.translator.c.test.test_standalone import StandaloneTests
 
 
 class CompiledSTMTests(StandaloneTests):
         #
         # Prevent the RaiseAnalyzer from just emitting "WARNING: Unknown
         # operation".  We want instead it to crash.
-        from pypy.translator.backendopt.canraise import RaiseAnalyzer
+        from rpython.translator.backendopt.canraise import RaiseAnalyzer
         RaiseAnalyzer.fail_on_unknown_operation = True
         try:
             res = StandaloneTests.compile(self, entry_point, debug=True,

rpython/translator/stm/test/targetdemo2.py

 import time
 from pypy.module.thread import ll_thread
-from pypy.rlib import rstm, jit
-from pypy.rlib.objectmodel import invoke_around_extcall, we_are_translated
-from pypy.rlib.objectmodel import compute_identity_hash
-from pypy.rlib.debug import ll_assert
-from pypy.rpython.lltypesystem import lltype, rffi, rclass
+from rpython.rlib import rstm, jit
+from rpython.rlib.objectmodel import invoke_around_extcall, we_are_translated
+from rpython.rlib.objectmodel import compute_identity_hash
+from rpython.rlib.debug import ll_assert
+from rpython.rtyper.lltypesystem import lltype, rffi, rclass
 
 
 class Node:

rpython/translator/stm/test/targetjit1.py

 from pypy.module.thread import ll_thread
-from pypy.rlib import jit, rstm
-from pypy.rlib.objectmodel import invoke_around_extcall
+from rpython.rlib import jit, rstm
+from rpython.rlib.objectmodel import invoke_around_extcall
 
 
 class Global(object):
 
 # _____ Define and setup target ___
 
-from pypy.jit.codewriter.policy import JitPolicy
+from rpython.jit.codewriter.policy import JitPolicy
 
 def jitpolicy(driver):
     return JitPolicy()

rpython/translator/stm/test/test_inevitable.py

-from pypy.rpython.lltypesystem import lltype, llmemory, rffi
-from pypy.rpython.llinterp import LLFrame
-from pypy.rpython.test import test_llinterp
-from pypy.rpython.test.test_llinterp import get_interpreter, clear_tcache
-from pypy.translator.stm.inevitable import insert_turn_inevitable
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
+from rpython.rtyper.llinterp import LLFrame
+from rpython.rtyper.test import test_llinterp
+from rpython.rtyper.test.test_llinterp import get_interpreter, clear_tcache
+from rpython.translator.stm.inevitable import insert_turn_inevitable
 from pypy.conftest import option
 
 

rpython/translator/stm/test/test_jitdriver.py

-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.stm.test.transform2_support import BaseTestTransform
-from pypy.rlib.jit import JitDriver
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.translator.stm.test.transform2_support import BaseTestTransform
+from rpython.rlib.jit import JitDriver
 
 
 class TestJitDriver(BaseTestTransform):

rpython/translator/stm/test/test_writebarrier.py

-from pypy.rpython.lltypesystem import lltype, rffi
-from pypy.translator.stm.test.transform2_support import BaseTestTransform
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.translator.stm.test.transform2_support import BaseTestTransform
 
 
 class TestTransform(BaseTestTransform):

rpython/translator/stm/test/test_ztranslated.py

 import py
-from pypy.rlib import rstm, rgc
-from pypy.translator.stm.test.support import NoGcCompiledSTMTests
-from pypy.translator.stm.test.support import CompiledSTMTests
-from pypy.translator.stm.test import targetdemo2
+from rpython.rlib import rstm, rgc
+from rpython.translator.stm.test.support import NoGcCompiledSTMTests
+from rpython.translator.stm.test.support import CompiledSTMTests
+from rpython.translator.stm.test import targetdemo2
 
 
 class TestNoGcSTMTranslated(NoGcCompiledSTMTests):
             pass
         def check(foobar, retry_counter):
             return 0    # do nothing
-        from pypy.rpython.lltypesystem import lltype
+        from rpython.rtyper.lltypesystem import lltype
         R = lltype.GcStruct('R', ('x', lltype.Signed))
         S1 = lltype.Struct('S1', ('r', lltype.Ptr(R)))
         s1 = lltype.malloc(S1, immortal=True, flavor='raw')

rpython/translator/stm/test/transform2_support.py

-from pypy.rpython.lltypesystem import lltype, opimpl
-from pypy.rpython.llinterp import LLFrame
-from pypy.rpython.test.test_llinterp import get_interpreter, clear_tcache
-from pypy.translator.stm.transform2 import STMTransformer
-from pypy.translator.stm.writebarrier import MORE_PRECISE_CATEGORIES
+from rpython.rtyper.lltypesystem import lltype, opimpl
+from rpython.rtyper.llinterp import LLFrame
+from rpython.rtyper.test.test_llinterp import get_interpreter, clear_tcache
+from rpython.translator.stm.transform2 import STMTransformer
+from rpython.translator.stm.writebarrier import MORE_PRECISE_CATEGORIES
 from pypy.conftest import option
 
 

rpython/translator/stm/transform2.py

         self.translator.stm_transformation_applied = True
 
     def transform_write_barrier(self):
-        from pypy.translator.backendopt.writeanalyze import WriteAnalyzer
-        from pypy.translator.stm.writebarrier import insert_stm_barrier
+        from rpython.translator.backendopt.writeanalyze import WriteAnalyzer
+        from rpython.translator.stm.writebarrier import insert_stm_barrier
         #
         self.write_analyzer = WriteAnalyzer(self.translator)
         for graph in self.translator.graphs:
         del self.write_analyzer
 
     def transform_turn_inevitable(self):
-        from pypy.translator.stm.inevitable import insert_turn_inevitable
+        from rpython.translator.stm.inevitable import insert_turn_inevitable
         #
         for graph in self.translator.graphs:
             insert_turn_inevitable(graph)
 
     def transform_jit_driver(self):
-        from pypy.translator.stm.jitdriver import reorganize_around_jit_driver
+        from rpython.translator.stm.jitdriver import reorganize_around_jit_driver
         #
         for graph in self.translator.graphs:
             reorganize_around_jit_driver(self, graph)
 
     def start_log(self):
-        from pypy.translator.c.support import log
+        from rpython.translator.c.support import log
         log.info("Software Transactional Memory transformation")
 
     def print_logs(self):
-        from pypy.translator.c.support import log
+        from rpython.translator.c.support import log
         log.info("Software Transactional Memory transformation applied")

rpython/translator/stm/writebarrier.py

-from pypy.objspace.flow.model import SpaceOperation, Constant, Variable
-from pypy.translator.unsimplify import varoftype, insert_empty_block
-from pypy.rpython.lltypesystem import lltype
-from pypy.translator.backendopt.writeanalyze import top_set
+from rpython.flowspace.model import SpaceOperation, Constant, Variable
+from rpython.translator.unsimplify import varoftype, insert_empty_block
+from rpython.rtyper.lltypesystem import lltype
+from rpython.translator.backendopt.writeanalyze import top_set
 
 
 MALLOCS = set([