[pypy-svn] r54375 - in pypy/branch/oo-jit/pypy: annotation jit/codegen/cli/test translator/cli translator/cli/src
antocuni at codespeak.net
antocuni at codespeak.net
Sat May 3 17:17:09 CEST 2008
Author: antocuni
Date: Sat May 3 17:17:07 2008
New Revision: 54375
Modified:
pypy/branch/oo-jit/pypy/annotation/bookkeeper.py
pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_interpreter.py
pypy/branch/oo-jit/pypy/translator/cli/dotnet.py
pypy/branch/oo-jit/pypy/translator/cli/src/pypylib.cs
Log:
test_simple_fixed passes; we need to use DynamicInvoke to call the
delegate, else the result is wrong (not sure if it's a mono or
pythonnet bug)
Modified: pypy/branch/oo-jit/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/branch/oo-jit/pypy/annotation/bookkeeper.py (original)
+++ pypy/branch/oo-jit/pypy/annotation/bookkeeper.py Sat May 3 17:17:07 2008
@@ -8,7 +8,7 @@
from pypy.objspace.flow.model import Constant
from pypy.annotation.model import SomeString, SomeChar, SomeFloat, \
SomePtr, unionof, SomeInstance, SomeDict, SomeBuiltin, SomePBC, \
- SomeInteger, SomeOOInstance, TLS, SomeAddress, \
+ SomeInteger, SomeOOInstance, SomeOOObject, TLS, SomeAddress, \
SomeUnicodeCodePoint, SomeOOStaticMeth, s_None, s_ImpossibleValue, \
SomeLLADTMeth, SomeBool, SomeTuple, SomeOOClass, SomeImpossibleValue, \
SomeUnicodeString, SomeList, SomeObject, HarmlesslyBlocked, \
@@ -417,6 +417,8 @@
result = SomeOOInstance(ootype.typeOf(x))
elif isinstance(x, (ootype._record, ootype._string)):
result = SomeOOInstance(ootype.typeOf(x))
+ elif isinstance(x, (ootype._object)):
+ result = SomeOOObject()
elif callable(x):
if hasattr(x, '__self__') and x.__self__ is not None:
# for cases like 'l.append' where 'l' is a global constant list
Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_interpreter.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_interpreter.py (original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_interpreter.py Sat May 3 17:17:07 2008
@@ -10,7 +10,7 @@
def run_generated(self, writer, generated, residualargs, **kwds):
if 'check_raises' not in kwds:
- res = generated(*residualargs)
+ res = generated.DynamicInvoke(residualargs)
else:
assert False, 'TODO'
return res
@@ -23,7 +23,6 @@
test_simple_opt_const_propagation1 = skip
test_simple_opt_const_propagation2 = skip
- test_simple_fixed = skip
test_red_switch = skip
test_merge = skip
test_loop_merging = skip
Modified: pypy/branch/oo-jit/pypy/translator/cli/dotnet.py
==============================================================================
--- pypy/branch/oo-jit/pypy/translator/cli/dotnet.py (original)
+++ pypy/branch/oo-jit/pypy/translator/cli/dotnet.py Sat May 3 17:17:07 2008
@@ -711,6 +711,7 @@
CLR._buildtree()
known_delegates = {
+ ootype.StaticMethod([], ootype.Signed): CLR.pypy.test.DelegateType_int__0,
ootype.StaticMethod([ootype.Signed, ootype.Float], ootype.Float): CLR.pypy.test.DelegateType_double_int_double,
ootype.StaticMethod([ootype.Float], ootype.Float): CLR.pypy.test.DelegateType_double__double_1,
ootype.StaticMethod([ootype.Signed], ootype.Void): CLR.pypy.test.DelegateType_void_int_1,
Modified: pypy/branch/oo-jit/pypy/translator/cli/src/pypylib.cs
==============================================================================
--- pypy/branch/oo-jit/pypy/translator/cli/src/pypylib.cs (original)
+++ pypy/branch/oo-jit/pypy/translator/cli/src/pypylib.cs Sat May 3 17:17:07 2008
@@ -82,6 +82,7 @@
}
}
+ public delegate double DelegateType_int__0();
public delegate double DelegateType_double__double_1(double a);
public delegate double DelegateType_double_int_double(int a, double b);
public delegate void DelegateType_void_int_1(int a);
More information about the Pypy-commit
mailing list