[pypy-svn] r51390 - in pypy/dist/pypy: jit/codegen/cli jit/codegen/cli/test translator/cli/src

antocuni at codespeak.net antocuni at codespeak.net
Mon Feb 11 17:05:39 CET 2008


Author: antocuni
Date: Mon Feb 11 17:05:38 2008
New Revision: 51390

Modified:
   pypy/dist/pypy/jit/codegen/cli/rgenop.py
   pypy/dist/pypy/jit/codegen/cli/test/test_rgenop.py
   pypy/dist/pypy/translator/cli/src/pypylib.cs
Log:
more passing tests



Modified: pypy/dist/pypy/jit/codegen/cli/rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/cli/rgenop.py	(original)
+++ pypy/dist/pypy/jit/codegen/cli/rgenop.py	Mon Feb 11 17:05:38 2008
@@ -22,9 +22,11 @@
 
 def sigtoken2clitype(tok):
     if tok == (['<Signed>'], '<Signed>'):
-        return typeof(CLR.pypy.runtime.DelegateType_int__int)
+        return typeof(CLR.pypy.runtime.DelegateType_int__int_1)
     elif tok == (['<Signed>', '<Signed>'], '<Signed>'):
-        return typeof(CLR.pypy.runtime.DelegateType_int__int_int)
+        return typeof(CLR.pypy.runtime.DelegateType_int__int_2)
+    elif tok == (['<Signed>'] * 3, '<Signed>'):
+        return typeof(CLR.pypy.runtime.DelegateType_int__int_3)
     elif tok == (['<Signed>'] * 100, '<Signed>'):
         return typeof(CLR.pypy.runtime.DelegateType_int__int_100)
     else:
@@ -89,8 +91,12 @@
 
     @specialize.arg(1)
     def revealconst(self, T):
-        assert T is ootype.Signed
-        return self.value
+        if T is ootype.Signed:
+            return self.value
+        elif T is ootype.Bool:
+            return bool(self.value)
+        else:
+            assert False
 
     def getCliType(self):
         return typeof(System.Int32)
@@ -120,18 +126,22 @@
         il.Emit(OpCodes.Ldsfld, field)
 
 
-SM_INT__INT = ootype.StaticMethod([ootype.Signed], ootype.Signed)
-SM_INT__INT_INT = ootype.StaticMethod([ootype.Signed, ootype.Signed], ootype.Signed)
+SM_INT__INT_1 = ootype.StaticMethod([ootype.Signed], ootype.Signed)
+SM_INT__INT_2 = ootype.StaticMethod([ootype.Signed] * 2, ootype.Signed)
+SM_INT__INT_3 = ootype.StaticMethod([ootype.Signed] * 3, ootype.Signed)
 SM_INT__INT_100 = ootype.StaticMethod([ootype.Signed] * 100, ootype.Signed)
 class FunctionConst(BaseConst):
     
     @specialize.arg(1)
     def revealconst(self, T):
-        if T == SM_INT__INT:
-            DelegateType = CLR.pypy.runtime.DelegateType_int__int
+        if T == SM_INT__INT_1:
+            DelegateType = CLR.pypy.runtime.DelegateType_int__int_1
             return clidowncast(DelegateType, self.getobj())
-        elif T == SM_INT__INT_INT:
-            DelegateType = CLR.pypy.runtime.DelegateType_int__int_int
+        elif T == SM_INT__INT_2:
+            DelegateType = CLR.pypy.runtime.DelegateType_int__int_2
+            return clidowncast(DelegateType, self.getobj())
+        elif T == SM_INT__INT_3:
+            DelegateType = CLR.pypy.runtime.DelegateType_int__int_3
             return clidowncast(DelegateType, self.getobj())
         elif T == SM_INT__INT_100:
             DelegateType = CLR.pypy.runtime.DelegateType_int__int_100
@@ -171,6 +181,8 @@
         T = ootype.typeOf(llvalue)
         if T is ootype.Signed:
             return IntConst(llvalue)
+        elif T is ootype.Bool:
+            return IntConst(int(llvalue))
         elif isinstance(T, ootype.OOType):
             const = self.newconst(ObjectConst)
             const.setobj(llvalue)
@@ -360,6 +372,9 @@
     def appendreturn(self, retlabel, gv_returnvar):
         self.parent.appendreturn(retlabel, gv_returnvar)
 
+    def end(self):
+        self.parent.end()
+
     def replayops(self):
         assert not self.isOpen
         assert not self.parent.isOpen

Modified: pypy/dist/pypy/jit/codegen/cli/test/test_rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/cli/test/test_rgenop.py	(original)
+++ pypy/dist/pypy/jit/codegen/cli/test/test_rgenop.py	Mon Feb 11 17:05:38 2008
@@ -15,7 +15,8 @@
         'test_branching',
         'test_goto',
         'test_if',
-        # 'test_switch', # no promotion/flexswitch for now please :-)
+        # 'test_switch',              # no promotion/flexswitch for now please :-)
+        # 'test_defaultonly_switch',  # the same
         'test_fact',
         'test_calling_pause',
         'test_longwinded_and',
@@ -26,6 +27,21 @@
         'test_jump_to_block_with_many_vars',
         'test_same_as',
         'test_pause_and_resume',
+        'test_like_residual_red_call_with_exc',
+        'test_call_functions_with_different_signatures',
+        'test_bool_not_direct',
+        # 'test_read_frame_var',     # not for now
+        # 'test_write_frame_place',
+        # 'test_write_lots_of_frame_places_direct',
+        # 'test_read_frame_place_direct',
+        # 'test_read_frame_place_compile'
+        # 'test_frame_vars_like_the_frontend_direct',
+        'test_unaliasing_variables_direct',
+        # 'test_from_random_direct',  # mono crashes
+        'test_from_random_2_direct',
+        # 'test_from_random_3_direct', # we need yet another delegate type
+        'test_from_random_4_direct',
+        # 'test_from_random_5_direct', # we need yet another delegate type
         ]
 
     for p in prefixes:

Modified: pypy/dist/pypy/translator/cli/src/pypylib.cs
==============================================================================
--- pypy/dist/pypy/translator/cli/src/pypylib.cs	(original)
+++ pypy/dist/pypy/translator/cli/src/pypylib.cs	Mon Feb 11 17:05:38 2008
@@ -53,8 +53,9 @@
 
 namespace pypy.runtime
 {
-    public delegate int DelegateType_int__int(int a);
-    public delegate int DelegateType_int__int_int(int a, int b);
+    public delegate int DelegateType_int__int_1(int a);
+    public delegate int DelegateType_int__int_2(int a, int b);
+    public delegate int DelegateType_int__int_3(int a, int b, int c);
     public delegate int DelegateType_int__int_100(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15, int a16, int a17, int a18, int a19, int a20, int a21, int a22, int a23, int a24, int a25, int a26, int a27, int a28, int a29, int a30, int a31, int a32, int a33, int a34, int a35, int a36, int a37, int a38, int a39, int a40, int a41, int a42, int a43, int a44, int a45, int a46, int a47, int a48, int a49, int a50, int a51, int a52, int a53, int a54, int a55, int a56, int a57, int a58, int a59, int a60, int a61, int a62, int a63, int a64, int a65, int a66, int a67, int a68, int a69, int a70, int a71, int a72, int a73, int a74, int a75, int a76, int a77, int a78, int a79, int a80, int a81, int a82, int a83, int a84, int a85, int a86, int a87, int a88, int a89, int a90, int a91, int a92, int a93, int a94, int a95, int a96, int a97, int a98, int a99);
 
     public class Constants



More information about the Pypy-commit mailing list