[pypy-svn] r76157 - in pypy/branch/reflex-support/pypy: jit/codewriter jit/codewriter/test translator/backendopt
arigo at codespeak.net
arigo at codespeak.net
Mon Jul 12 19:08:31 CEST 2010
Author: arigo
Date: Mon Jul 12 19:08:30 2010
New Revision: 76157
Modified:
pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py
pypy/branch/reflex-support/pypy/jit/codewriter/test/test_effectinfo.py
pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py
Log:
Revert r76155, which does not help, and the test in r76154,
which is a bit bogus.
Modified: pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py
==============================================================================
--- pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py (original)
+++ pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py Mon Jul 12 19:08:30 2010
@@ -104,10 +104,3 @@
def analyze_simple_operation(self, op):
return op.opname in ('jit_force_virtualizable',
'jit_force_virtual')
-
- def analyze_unknown_indirect_call(self, op, seen=None):
- # hack hack hack. The idea is that no indirect_call(..., None)
- # should force the virtuals or virtualizables, which is kind of
- # roughly reasonable: such an operation may call either a C function
- # or an 'instantiate' method from a class vtable.
- return False
Modified: pypy/branch/reflex-support/pypy/jit/codewriter/test/test_effectinfo.py
==============================================================================
--- pypy/branch/reflex-support/pypy/jit/codewriter/test/test_effectinfo.py (original)
+++ pypy/branch/reflex-support/pypy/jit/codewriter/test/test_effectinfo.py Mon Jul 12 19:08:30 2010
@@ -1,9 +1,7 @@
from pypy.rpython.lltypesystem.rclass import OBJECT
-from pypy.rpython.lltypesystem import lltype, rffi
+from pypy.rpython.lltypesystem import lltype
from pypy.rpython.ootypesystem import ootype
-from pypy.rpython.test.test_llinterp import gengraph
from pypy.jit.codewriter.effectinfo import effectinfo_from_writeanalyze
-from pypy.jit.codewriter.effectinfo import VirtualizableAnalyzer
class FakeCPU:
def fielddescrof(self, T, fieldname):
@@ -79,19 +77,3 @@
assert not effectinfo.readonly_descrs_fields
assert not effectinfo.write_descrs_fields
assert not effectinfo.write_descrs_arrays
-
-
-def test_external_calls():
- C_METHPTRGETTER = lltype.FuncType([lltype.Signed], lltype.Signed)
- c_get_methptr_getter = rffi.llexternal(
- "cppyy_get_methptr_getter",
- [lltype.Signed], lltype.Ptr(C_METHPTRGETTER))
- #
- def f(handle):
- methgetter = c_get_methptr_getter(handle)
- return methgetter(123)
- t, _, graph = gengraph(f, [int])
- #
- va = VirtualizableAnalyzer(t)
- result = va.analyze_direct_call(graph)
- assert result is False
Modified: pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py
==============================================================================
--- pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py (original)
+++ pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py Mon Jul 12 19:08:30 2010
@@ -72,7 +72,7 @@
return self.analyze_direct_call(graph, seen)
elif op.opname == "indirect_call":
if op.args[-1].value is None:
- return self.analyze_unknown_indirect_call(op, seen)
+ return self.top_result()
return self.analyze_indirect_call(op.args[-1].value, seen)
elif op.opname == "oosend":
name = op.args[0].value
@@ -124,9 +124,6 @@
results.append(self.analyze_direct_call(graph, seen))
return self.join_results(results)
- def analyze_unknown_indirect_call(self, op, seen=None):
- return self.top_result()
-
def analyze_oosend(self, TYPE, name, seen=None):
graphs = TYPE._lookup_graphs(name)
return self.analyze_indirect_call(graphs, seen)
More information about the Pypy-commit
mailing list