[pypy-svn] r54790 - in pypy/branch/oo-jit/pypy/jit/codegen/cli: . test

antocuni at codespeak.net antocuni at codespeak.net
Fri May 16 14:20:59 CEST 2008


Author: antocuni
Date: Fri May 16 14:20:57 2008
New Revision: 54790

Modified:
   pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py
   pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py
   pypy/branch/oo-jit/pypy/jit/codegen/cli/test/test_interpreter.py
Log:
two more test passes; a lot of tests are skipped for various good
reasons



Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py	Fri May 16 14:20:57 2008
@@ -165,7 +165,16 @@
     def __init__(self, builder, gv_obj, fieldname):
         self.builder = builder
         self.gv_obj = gv_obj
-        self.fieldname = fieldname
+        clitype = gv_obj.getCliType()
+        self.fieldinfo = clitype.GetField(fieldname)
+
+    def restype(self):
+        return self.fieldinfo.FieldType
+
+    def emit(self):
+        self.gv_obj.load(self.builder)
+        self.builder.graphbuilder.il.Emit(OpCodes.Ldfld, self.fieldinfo)
+        self.storeResult()
 
 
 def opcode2attrname(opcode):

Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py	Fri May 16 14:20:57 2008
@@ -7,6 +7,7 @@
 from pypy.jit.codegen.cli import operation as ops
 from pypy.jit.codegen.cli.dumpgenerator import DumpGenerator
 from pypy.translator.cli.dotnet import CLR, typeof, new_array, box, unbox, clidowncast, classof
+from pypy.translator.cli import dotnet
 System = CLR.System
 Utils = CLR.pypy.runtime.Utils
 DelegateHolder = CLR.pypy.runtime.DelegateHolder
@@ -158,6 +159,12 @@
     def __init__(self, obj):
         self.obj = obj
 
+    def getCliType(self):
+        if self.obj == ootype.NULL:
+            return cObject
+        cliobj = dotnet.cast_to_native_object(self.obj)
+        return cliobj.GetType()
+
     def getobj(self):
         return self.obj
 
@@ -271,10 +278,7 @@
             return cString
         elif T is ootype.Char:
             return cChar
-        elif isinstance(T, (ootype.Instance,
-                            ootype.Record,
-                            ootype.Dict,
-                            ootype.List)):
+        elif isinstance(T, ootype.OOType):
             return cObject # XXX?
         else:
             assert False
@@ -368,6 +372,9 @@
     def genop_same_as(self, gv_x):
         return self.branches[0].genop_same_as(gv_x)
 
+    def genop_oogetfield(self, fieldtoken, gv_obj):
+        return self.branches[0].genop_oogetfield(fieldtoken, gv_obj)
+
     def end(self):
         # render all the pending branches
         for branchbuilder in self.branches:
@@ -440,10 +447,12 @@
         self.appendop(op)
         return op.gv_res()
 
-##    def genop_getfield(self, fieldtoken, gv_ptr):
-##        pass
+    def genop_oogetfield(self, fieldtoken, gv_obj):
+        op = ops.GetField(self, gv_obj, fieldtoken)
+        self.appendop(op)
+        return op.gv_res()
 
-##    def genop_setfield(self, fieldtoken, gv_ptr, gv_value):
+##    def genop_oosetfield(self, fieldtoken, gv_obj, gv_value):
 ##        pass
 
     def enter_next_block(self, args_gv):

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	Fri May 16 14:20:57 2008
@@ -48,22 +48,26 @@
     test_complex_struct = skip
     test_degenerate_with_voids = skip
     test_green_with_side_effects = skip
+    test_direct_oosend_with_green_self = skip
+    test_simple_red_meth_vars_around = skip
 
     # tests still bound to lltype
     test_simple_array = skip
     test_arraysize = skip
     test_setarrayitem = skip
-    
-    test_green_deepfrozen_oosend = skip
-    test_direct_oosend_with_green_self = skip
+
+    # these tests use oogetfield, which can't be supported without
+    # translation
+    test_simple_meth = skip
+
+    # these tests involve promotion
     test_residual_red_call = skip
     test_residual_red_call_with_exc = skip
-    test_simple_meth = skip
-    test_simple_red_meth = skip
-    test_simple_red_meth_vars_around = skip
     test_simple_indirect_call = skip
     test_normalize_indirect_call = skip
     test_normalize_indirect_call_more = skip
+
+
     test_green_char_at_merge = skip
     test_self_referential_structures = skip
     test_known_nonzero = skip



More information about the Pypy-commit mailing list