Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r73770:9e29983c1261
Date: 2014-10-04 19:32 +0200
http://bitbucket.org/pypy/pypy/changeset/9e29983c1261/
Log: Kill the now-deprecated __pypy__.thread.longest_xxx() functions
diff --git a/pypy/module/__pypy__/__init__.py b/pypy/module/__pypy__/__init__.py
--- a/pypy/module/__pypy__/__init__.py
+++ b/pypy/module/__pypy__/__init__.py
@@ -38,8 +38,6 @@
'_atomic_enter': 'interp_atomic.atomic_enter',
'_exclusive_atomic_enter': 'interp_atomic.exclusive_atomic_enter',
'_atomic_exit': 'interp_atomic.atomic_exit',
- 'longest_abort_info': 'interp_atomic.longest_abort_info',
- 'reset_longest_abort_info':'interp_atomic.reset_longest_abort_info',
'getsegmentlimit': 'interp_atomic.getsegmentlimit',
'hint_commit_soon': 'interp_atomic.hint_commit_soon',
'is_atomic': 'interp_atomic.is_atomic',
diff --git a/pypy/module/__pypy__/interp_atomic.py
b/pypy/module/__pypy__/interp_atomic.py
--- a/pypy/module/__pypy__/interp_atomic.py
+++ b/pypy/module/__pypy__/interp_atomic.py
@@ -69,24 +69,6 @@
return space.wrap(giltl.is_atomic)
-@unwrap_spec(mintime=float)
-def longest_abort_info(space, mintime=0.0):
- if space.config.translation.stm:
- from rpython.rlib import rstm
- if rstm.longest_marker_time() <= mintime:
- return space.w_None
- a, b, c, d = rstm.longest_abort_info()
- return space.newtuple([space.wrap(a), space.wrap(b),
- space.wrap(c), space.wrap(d)])
- else:
- return space.w_None
-
-def reset_longest_abort_info(space):
- if space.config.translation.stm:
- from rpython.rlib.rstm import reset_longest_abort_info
- reset_longest_abort_info()
-
-
def hint_commit_soon(space):
if space.config.translation.stm:
from rpython.rlib.rstm import hint_commit_soon
diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -154,22 +154,6 @@
def pop_marker():
llop.stm_pop_marker(lltype.Void)
-@dont_look_inside # XXX allow looking inside this function
-def longest_marker_time():
- return llop.stm_longest_marker_time(lltype.Float)
-
-@dont_look_inside
-def longest_abort_info():
- state = llop.stm_longest_marker_state(lltype.Signed)
- time = llop.stm_longest_marker_time(lltype.Float)
- cself = llop.stm_longest_marker_self(rffi.CCHARP)
- cother = llop.stm_longest_marker_other(rffi.CCHARP)
- return (state, time, rffi.charp2str(cself), rffi.charp2str(cother))
-
-@dont_look_inside
-def reset_longest_abort_info():
- llop.stm_reset_longest_marker_state(lltype.Void)
-
# ____________________________________________________________
class _Entry(ExtRegistryEntry):
diff --git a/rpython/rtyper/lltypesystem/lloperation.py
b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -456,12 +456,6 @@
'stm_expand_marker': LLOp(),
'stm_setup_expand_marker_for_pypy': LLOp(),
- 'stm_longest_marker_state': LLOp(),
- 'stm_longest_marker_time': LLOp(),
- 'stm_longest_marker_self': LLOp(),
- 'stm_longest_marker_other': LLOp(),
- 'stm_reset_longest_marker_state': LLOp(),
-
# __________ address operations __________
'boehm_malloc': LLOp(),
diff --git a/rpython/translator/stm/funcgen.py
b/rpython/translator/stm/funcgen.py
--- a/rpython/translator/stm/funcgen.py
+++ b/rpython/translator/stm/funcgen.py
@@ -241,28 +241,6 @@
return 'pypy_stm_setup_expand_marker(%s, %s, %s, %s);' % (
offsets[0], offsets[1], offsets[2], offsets[3])
-def stm_longest_marker_state(funcgen, op):
- result = funcgen.expr(op.result)
- return '%s = (Signed)stm_thread_local.longest_marker_state;' % (result,)
-
-def stm_longest_marker_time(funcgen, op):
- result = funcgen.expr(op.result)
- return '%s = stm_thread_local.longest_marker_time;' % (result,)
-
-def stm_longest_marker_self(funcgen, op):
- result = funcgen.expr(op.result)
- return '%s = stm_thread_local.longest_marker_self;' % (result,)
-
-def stm_longest_marker_other(funcgen, op):
- result = funcgen.expr(op.result)
- return '%s = stm_thread_local.longest_marker_other;' % (result,)
-
-def stm_reset_longest_marker_state(funcgen, op):
- return ('stm_thread_local.longest_marker_state = 0;\n'
- 'stm_thread_local.longest_marker_time = 0.0;\n'
- 'stm_thread_local.longest_marker_self[0] = 0;\n'
- 'stm_thread_local.longest_marker_other[0] = 0;')
-
def stm_rewind_jmp_frame(funcgen, op):
if len(op.args) == 0:
assert op.result.concretetype is lltype.Void
diff --git a/rpython/translator/stm/test/test_ztranslated.py
b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -255,48 +255,6 @@
data = cbuilder.cmdexec('')
assert 'ok\n' in data
- def test_abort_info(self):
- class Parent(object):
- pass
- class Foobar(Parent):
- pass
- globf = Foobar()
-
- def setxy(globf, retry_counter):
- if retry_counter > 1:
- globf.xy = 100 + retry_counter
-
- def check(_, retry_counter):
- setxy(globf, retry_counter)
- if retry_counter < 3:
- rstm.abort_and_retry()
- print rstm.longest_marker_time()
- print rstm.longest_abort_info()
- rstm.reset_longest_abort_info()
- print rstm.longest_abort_info()
- return 0
-
- PS = lltype.Ptr(lltype.GcStruct('S', ('got_exception', OBJECTPTR)))
- perform_transaction = rstm.make_perform_transaction(check, PS)
-
- def main(argv):
- Parent().xy = 0
- globf.xy = -2
- globf.yx = 'hi there %d' % len(argv)
-
- # make sure perform_transaction breaks the transaction:
- rstm.hint_commit_soon()
- assert rstm.should_break_transaction()
-
- perform_transaction(lltype.nullptr(PS.TO))
- return 0
- t, cbuilder = self.compile(main)
- data = cbuilder.cmdexec('a b')
- #
- # 6 == STM_TIME_RUN_ABORTED_OTHER
- import re; r = re.compile(r'0.00\d+\n\(6, 0.00\d+, , \)\n\(0, 0.00+, ,
\)\n$')
- assert r.match(data)
-
def test_weakref(self):
import weakref
class Foo(object):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit