Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r76611:f8ee0444befc Date: 2015-03-28 09:38 +0100 http://bitbucket.org/pypy/pypy/changeset/f8ee0444befc/
Log: merge heads diff --git a/rpython/rtyper/extfunc.py b/rpython/rtyper/extfunc.py --- a/rpython/rtyper/extfunc.py +++ b/rpython/rtyper/extfunc.py @@ -157,12 +157,11 @@ r_result = rtyper.getrepr(s_result) ll_result = r_result.lowleveltype name = getattr(self, 'name', None) or self.instance.__name__ - method_name = rtyper.type_system.name[:2] + 'typeimpl' fake_method_name = rtyper.type_system.name[:2] + 'typefakeimpl' - impl = getattr(self, method_name, None) - fakeimpl = getattr(self, fake_method_name, self.instance) + impl = getattr(self, 'lltypeimpl', None) + fakeimpl = getattr(self, 'lltypefakeimpl', self.instance) if impl: - if hasattr(self, fake_method_name): + if hasattr(self, 'lltypefakeimpl'): # If we have both an llimpl and an llfakeimpl, # we need a wrapper that selects the proper one and calls it from rpython.tool.sourcetools import func_with_new_name diff --git a/rpython/translator/backendopt/all.py b/rpython/translator/backendopt/all.py --- a/rpython/translator/backendopt/all.py +++ b/rpython/translator/backendopt/all.py @@ -151,8 +151,6 @@ inline_heuristic, call_count_pred=None, inline_graph_from_anywhere=False): - - type_system = translator.rtyper.type_system.name # inline functions in each other if inline_threshold: log.inlining("phase with threshold factor: %s" % inline_threshold) @@ -171,7 +169,7 @@ # vaporize mallocs if config.mallocs: log.malloc("starting malloc removal") - remove_mallocs(translator, graphs, type_system) + remove_mallocs(translator, graphs) if config.print_statistics: print "after malloc removal:" diff --git a/rpython/translator/backendopt/malloc.py b/rpython/translator/backendopt/malloc.py --- a/rpython/translator/backendopt/malloc.py +++ b/rpython/translator/backendopt/malloc.py @@ -536,17 +536,17 @@ raise AssertionError(op.opname) -def remove_simple_mallocs(graph, type_system='lltypesystem', verbose=True): +def remove_simple_mallocs(graph, verbose=True): remover = LLTypeMallocRemover(verbose) return remover.remove_simple_mallocs(graph) -def remove_mallocs(translator, graphs=None, type_system="lltypesystem"): +def remove_mallocs(translator, graphs=None): if graphs is None: graphs = translator.graphs tot = 0 for graph in graphs: - count = remove_simple_mallocs(graph, type_system=type_system, verbose=translator.config.translation.verbose) + count = remove_simple_mallocs(graph, verbose=translator.config.translation.verbose) if count: # remove typical leftovers from malloc removal removenoops.remove_same_as(graph) diff --git a/rpython/translator/backendopt/test/test_all.py b/rpython/translator/backendopt/test/test_all.py --- a/rpython/translator/backendopt/test/test_all.py +++ b/rpython/translator/backendopt/test/test_all.py @@ -42,7 +42,6 @@ HUGE_THRESHOLD = 100*INLINE_THRESHOLD_FOR_TEST class TestLLType(object): - type_system = 'lltype' check_malloc_removed = MallocRemovalTest.check_malloc_removed def translateopt(self, func, sig, **optflags): diff --git a/rpython/translator/backendopt/test/test_inline.py b/rpython/translator/backendopt/test/test_inline.py --- a/rpython/translator/backendopt/test/test_inline.py +++ b/rpython/translator/backendopt/test/test_inline.py @@ -47,8 +47,6 @@ self.data2 = 456 class TestInline(BaseRtypingTest): - type_system = 'lltype' - def translate(self, func, argtypes): t = TranslationContext() t.buildannotator().build_types(func, argtypes) diff --git a/rpython/translator/backendopt/test/test_malloc.py b/rpython/translator/backendopt/test/test_malloc.py --- a/rpython/translator/backendopt/test/test_malloc.py +++ b/rpython/translator/backendopt/test/test_malloc.py @@ -10,7 +10,6 @@ from rpython.conftest import option class TestMallocRemoval(object): - type_system = 'lltype' MallocRemover = LLTypeMallocRemover def check_malloc_removed(cls, graph): diff --git a/rpython/translator/backendopt/test/test_mallocv.py b/rpython/translator/backendopt/test/test_mallocv.py --- a/rpython/translator/backendopt/test/test_mallocv.py +++ b/rpython/translator/backendopt/test/test_mallocv.py @@ -17,8 +17,6 @@ class TestMallocRemoval(object): - type_system = 'lltype' - def check_malloc_removed(cls, graph, expected_mallocs, expected_calls): count_mallocs = 0 count_calls = 0 diff --git a/rpython/translator/backendopt/test/test_storesink.py b/rpython/translator/backendopt/test/test_storesink.py --- a/rpython/translator/backendopt/test/test_storesink.py +++ b/rpython/translator/backendopt/test/test_storesink.py @@ -7,8 +7,6 @@ from rpython.conftest import option class TestStoreSink(object): - type_system = 'lltype' - def translate(self, func, argtypes): t = TranslationContext() t.buildannotator().build_types(func, argtypes) diff --git a/rpython/translator/backendopt/test/test_writeanalyze.py b/rpython/translator/backendopt/test/test_writeanalyze.py --- a/rpython/translator/backendopt/test/test_writeanalyze.py +++ b/rpython/translator/backendopt/test/test_writeanalyze.py @@ -7,8 +7,6 @@ class BaseTest(object): - - type_system = 'lltype' Analyzer = WriteAnalyzer def translate(self, func, sig): diff --git a/rpython/translator/test/test_exceptiontransform.py b/rpython/translator/test/test_exceptiontransform.py --- a/rpython/translator/test/test_exceptiontransform.py +++ b/rpython/translator/test/test_exceptiontransform.py @@ -27,8 +27,6 @@ return interp.eval_graph(graph, values) class TestExceptionTransform: - type_system = 'lltype' - def compile(self, fn, inputargs): from rpython.translator.c.test.test_genc import compile return compile(fn, inputargs) @@ -239,7 +237,7 @@ etrafo.create_exception_handling(g) ops = dict.fromkeys([o.opname for b, o in g.iterblockops()]) assert 'zero_gc_pointers_inside' in ops - + def test_llexternal(self): from rpython.rtyper.lltypesystem.rffi import llexternal from rpython.rtyper.lltypesystem import lltype _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit