[pypy-commit] pypy stm: Add the missing operations.
arigo
noreply at buildbot.pypy.org
Fri Oct 28 18:30:56 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: stm
Changeset: r48576:f647b24f79f3
Date: 2011-10-28 18:07 +0200
http://bitbucket.org/pypy/pypy/changeset/f647b24f79f3/
Log: Add the missing operations.
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
@@ -392,6 +392,13 @@
'stm_getfield': LLOp(sideeffects=False, canrun=True),
'stm_setfield': LLOp(),
+ 'stm_begin_transaction': LLOp(),
+ 'stm_commit_transaction': LLOp(),
+ 'stm_begin_inevitable_transaction': LLOp(),
+ 'stm_transaction_boundary': LLOp(),
+ 'stm_declare_variable': LLOp(),
+ 'stm_try_inevitable': LLOp(),
+
# __________ address operations __________
'boehm_malloc': LLOp(),
diff --git a/pypy/translator/backendopt/canraise.py b/pypy/translator/backendopt/canraise.py
--- a/pypy/translator/backendopt/canraise.py
+++ b/pypy/translator/backendopt/canraise.py
@@ -10,10 +10,14 @@
py.log.setconsumer("canraise", ansi_log)
class RaiseAnalyzer(graphanalyze.BoolGraphAnalyzer):
+ fail_on_unknown_operation = False
+
def analyze_simple_operation(self, op, graphinfo):
try:
return bool(LL_OPERATIONS[op.opname].canraise)
except KeyError:
+ if self.fail_on_unknown_operation:
+ raise
log.WARNING("Unknown operation: %s" % op.opname)
return True
diff --git a/pypy/translator/stm/test/test_transform.py b/pypy/translator/stm/test/test_transform.py
--- a/pypy/translator/stm/test/test_transform.py
+++ b/pypy/translator/stm/test/test_transform.py
@@ -39,7 +39,16 @@
from pypy.config.pypyoption import get_pypy_config
self.config = get_pypy_config(translating=True)
self.config.translation.stm = True
- return StandaloneTests.compile(self, entry_point, debug=True)
+ #
+ # Prevent the RaiseAnalyzer from just emitting "WARNING: Unknown
+ # operation". We want instead it to crash.
+ from pypy.translator.backendopt.canraise import RaiseAnalyzer
+ RaiseAnalyzer.fail_on_unknown_operation = True
+ try:
+ res = StandaloneTests.compile(self, entry_point, debug=True)
+ finally:
+ del RaiseAnalyzer.fail_on_unknown_operation
+ return res
def test_no_pointer_operations(self):
def simplefunc(argv):
More information about the pypy-commit
mailing list