1. Wubin Qu
  2. pypy

Commits

Armin Rigo  committed 1c60f24

Tweaks and fixes

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

Comments (0)

Files changed (3)

File pypy/rpython/lltypesystem/lloperation.py

View file
     # direct_calls and maybe several casts, but it looks less heavy-weight
     # to keep them as operations until the genc stage)
 
-    'stm_getfield':           LLOp(sideeffects=False, canrun=True),
-    'stm_getarrayitem':       LLOp(sideeffects=False, canrun=True),
-    'stm_getinteriorfield':   LLOp(sideeffects=False, canrun=True),
+    'stm_barrier':            LLOp(sideeffects=False),
     'stm_become_inevitable':  LLOp(),
-    'stm_writebarrier':       LLOp(),
-    'stm_local_not_needed':   LLOp(),
-    'stm_normalize_global':   LLOp(),
+    'stm_ptr_eq':             LLOp(sideeffects=False),
     'stm_start_transaction':  LLOp(canrun=True, canmallocgc=True),
     'stm_stop_transaction':   LLOp(canrun=True, canmallocgc=True),
 
     'gc_load':                LLOp(sideeffects=False),   # so far, only if stm
     'gc_store':               LLOp(),                    # so far, only if stm
-    'stm_gc_load':            LLOp(sideeffects=False),
-    'stm_gc_store':           LLOp(),
 
-    'stm_jit_invoke_code':    LLOp(canmallocgc=True),
+    #'stm_jit_invoke_code':    LLOp(canmallocgc=True),
 
     # __________ address operations __________
 

File pypy/translator/c/genc.py

View file
         translator = self.translator
 
         if self.config.translation.stm:
-            from pypy.translator.stm import transform
+            from pypy.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.
-            transformer = transform.STMTransformer(self.translator)
+            transformer = transform2.STMTransformer(self.translator)
             transformer.transform()
 
         gcpolicyclass = self.get_gcpolicyclass()

File pypy/translator/stm/transform2.py

View file
 from pypy.objspace.flow.model import SpaceOperation, Constant, Variable
-from pypy.objspace.flow.model import checkgraph, c_last_exception
-from pypy.translator.unsimplify import varoftype
+from pypy.objspace.flow.model import checkgraph, c_last_exception, Block, Link
+from pypy.translator.unsimplify import varoftype, insert_empty_block
 from pypy.rpython.lltypesystem import lltype
 from pypy.translator.backendopt.writeanalyze import WriteAnalyzer, top_set
 
     'W': 'WN',
     'N': 'N'}
 
+def unwraplist(list_v):
+    for v in list_v: 
+        if isinstance(v, Constant):
+            yield v.value
+        elif isinstance(v, Variable):
+            yield None    # unknown
+        else:
+            raise AssertionError(v)
+
 def is_immutable(op):
     if op.opname in ('getfield', 'setfield'):
         STRUCT = op.args[0].concretetype.TO
 
             block.operations = newoperations
             #
-            assert block.exitswitch != c_last_exception   # transformed already
             for link in block.exits:
+                newoperations = []
                 for i, v in enumerate(link.args):
                     link.args[i] = renamings_get(v)
+                if newoperations:
+                    # must put them in a fresh block along the link
+                    annotator = stmtransformer.translator.annotator
+                    newblock = insert_empty_block(annotator, link,
+                                                  newoperations)