[pypy-commit] pypy stm-jit: Now translation completes.

arigo noreply at buildbot.pypy.org
Wed Aug 8 18:12:19 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-jit
Changeset: r56657:d58e9d5d7331
Date: 2012-08-08 18:11 +0200
http://bitbucket.org/pypy/pypy/changeset/d58e9d5d7331/

Log:	Now translation completes.

diff --git a/pypy/rpython/lltypesystem/lloperation.py b/pypy/rpython/lltypesystem/lloperation.py
--- a/pypy/rpython/lltypesystem/lloperation.py
+++ b/pypy/rpython/lltypesystem/lloperation.py
@@ -412,6 +412,7 @@
     '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),
 
diff --git a/pypy/rpython/memory/gctransform/stmframework.py b/pypy/rpython/memory/gctransform/stmframework.py
--- a/pypy/rpython/memory/gctransform/stmframework.py
+++ b/pypy/rpython/memory/gctransform/stmframework.py
@@ -86,6 +86,9 @@
         # (INSERT_STM_LOCAL_NOT_NEEDED=False in translator/stm/transform)
         self.vars_local_not_needed.update(hop.spaceop.args)
 
+    def gct_gc_store(self, hop):
+        hop.rename('stm_gc_store')
+
 
 class StmShadowStackRootWalker(BaseRootWalker):
     need_root_stack = True
diff --git a/pypy/translator/c/funcgen.py b/pypy/translator/c/funcgen.py
--- a/pypy/translator/c/funcgen.py
+++ b/pypy/translator/c/funcgen.py
@@ -611,6 +611,8 @@
     OP_STM_SETINTERIORFIELD = _OP_STM
     OP_STM_BECOME_INEVITABLE = _OP_STM
     OP_STM_GC_LOAD = _OP_STM
+    OP_STM_GC_STORE = _OP_STM
+    OP_STM_JIT_INVOKE_CODE = _OP_STM
 
 
     def OP_PTR_NONZERO(self, op):
diff --git a/pypy/translator/stm/funcgen.py b/pypy/translator/stm/funcgen.py
--- a/pypy/translator/stm/funcgen.py
+++ b/pypy/translator/stm/funcgen.py
@@ -55,16 +55,25 @@
     access_info = (None, ptr, expr)
     return _stm_generic_get(funcgen, op, access_info)
 
-def stm_gc_load(funcgen, op):
+def _gc_load_store_expr(funcgen, op, v_value):
     ptr = funcgen.expr(op.args[0])
     ofs = funcgen.expr(op.args[1])
-    T = funcgen.lltypemap(op.result)
+    T = funcgen.lltypemap(v_value)
     resulttypename = funcgen.db.gettype(T)
     cresulttypename_ptr = cdecl(resulttypename, ' *')
     expr = '(*(%s)(((char *)(%s)) + (%s)))' % (cresulttypename_ptr, ptr, ofs)
+    return expr
+
+def stm_gc_load(funcgen, op):
+    ptr = funcgen.expr(op.args[0])
+    expr = _gc_load_store_expr(funcgen, op, op.result)
     access_info = (None, ptr, expr)
     return _stm_generic_get(funcgen, op, access_info)
 
+def stm_gc_store(funcgen, op):
+    targetexpr = _gc_load_store_expr(funcgen, op, op.args[-1])
+    return funcgen.generic_set(op, targetexpr)
+
 
 def stm_become_inevitable(funcgen, op):
     try:
@@ -74,6 +83,9 @@
     string_literal = c_string_constant(info)
     return 'stm_try_inevitable(STM_EXPLAIN1(%s));' % (string_literal,)
 
+def stm_jit_invoke_code(funcgen, op):
+    return funcgen.OP_DIRECT_CALL(op)
+
 
 def op_stm(funcgen, op):
     func = globals()[op.opname]


More information about the pypy-commit mailing list