Author: Armin Rigo <ar...@tunes.org> Branch: stmgc-c7 Changeset: r73991:0908ab4fcaad Date: 2014-10-17 14:11 +0200 http://bitbucket.org/pypy/pypy/changeset/0908ab4fcaad/
Log: Kill a test 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,6 +456,8 @@ 'stm_expand_marker': LLOp(), 'stm_setup_expand_marker_for_pypy': LLOp(), + 'stm_count': 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 @@ -250,3 +250,7 @@ return '%s = &rjbuf1;' % (funcgen.expr(op.result),) else: assert False, op.args[0].value + +def stm_count(funcgen, op): + result = funcgen.expr(op.result) + return '%s = _pypy_stm_count();' % (result,) diff --git a/rpython/translator/stm/src_stm/stmgcintf.c b/rpython/translator/stm/src_stm/stmgcintf.c --- a/rpython/translator/stm/src_stm/stmgcintf.c +++ b/rpython/translator/stm/src_stm/stmgcintf.c @@ -220,3 +220,10 @@ } stm_become_globally_unique_transaction(&stm_thread_local, "for the JIT"); } + +long _pypy_stm_count(void) +{ + /* for tests */ + static long value = 0; + return value++; +} diff --git a/rpython/translator/stm/src_stm/stmgcintf.h b/rpython/translator/stm/src_stm/stmgcintf.h --- a/rpython/translator/stm/src_stm/stmgcintf.h +++ b/rpython/translator/stm/src_stm/stmgcintf.h @@ -31,11 +31,14 @@ void _pypy_stm_become_inevitable(const char *); void pypy_stm_become_globally_unique_transaction(void); +char *_pypy_stm_test_expand_marker(void); void pypy_stm_setup_expand_marker(long co_filename_ofs, long co_name_ofs, long co_firstlineno_ofs, long co_lnotab_ofs); +long _pypy_stm_count(void); + static inline void pypy_stm_become_inevitable(const char *msg) { 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 @@ -559,45 +559,3 @@ assert ('starting some_extremely_longish_and_boring_function_name\n' 'File "<bla/br/project/foobaz.py", line 81,' ' in some_extremely_longish_a>\n') in data - - def test_pypy_marker_2(self): - import time - class PyCode(object): - def __init__(self, co_filename, co_name, - co_firstlineno, co_lnotab): - self.co_filename = co_filename - self.co_name = co_name - self.co_firstlineno = co_firstlineno - self.co_lnotab = co_lnotab - # - def check(foobar, retry_counter): - if retry_counter <= 1: - rstm.push_marker(29, lltype.nullptr(rffi.CCHARP.TO)) - start = time.time() - while abs(time.time() - start) < 0.1: - pass - rstm.abort_and_retry() - return 0 - # - S = lltype.GcStruct('S', ('got_exception', OBJECTPTR)) - PS = lltype.Ptr(S) - perform_transaction = rstm.make_perform_transaction(check, PS) - def entry_point(argv): - pycode1 = PyCode("/tmp/foobar.py", "baz", 40, "\x00\x01\x05\x01") - llop.stm_setup_expand_marker_for_pypy( - lltype.Void, pycode1, - "co_filename", "co_name", "co_firstlineno", "co_lnotab") - - # make sure perform_transaction breaks the transaction: - rstm.hint_commit_soon() - assert rstm.should_break_transaction() - - perform_transaction(lltype.malloc(S)) - return 0 - # - t, cbuilder = self.compile(entry_point, backendopt=True) - data, err = cbuilder.cmdexec('a b c d', err=True, - env={'PYPYLOG': 'stm-report:-'}) - assert '0# File "?", line 0, in ?\n' in err - assert '0# 0.1' in err - assert 's: run aborted other\n' in err _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit