[pypy-svn] r50605 - in pypy/branch/fixed-list-ootype/pypy/translator: jvm oosupport

atobe at codespeak.net atobe at codespeak.net
Mon Jan 14 17:25:31 CET 2008


Author: atobe
Date: Mon Jan 14 17:25:29 2008
New Revision: 50605

Modified:
   pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py
   pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py
   pypy/branch/fixed-list-ootype/pypy/translator/oosupport/constant.py
Log:
(cbolz, atobe, antocuni): Fixed problem with arrays in JVM backend.

Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py	(original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py	Mon Jan 14 17:25:29 2008
@@ -156,7 +156,7 @@
         elif desc == '[B':
             s = "newarray byte"
         else:
-            s = "anewarray"
+            s = "anewarray " + arraytype.element_type.descriptor
         self.cache[arraytype] = obj = Opcode(s)
         return obj
 

Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py	(original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py	Mon Jan 14 17:25:29 2008
@@ -69,8 +69,11 @@
     def int_class_name(self):
         """ Converts a descriptor like Ljava/lang/Object; to
         internal class name java/lang/Object """
-        assert self[0] == 'L' and self[-1] == ';'
-        return self[1:-1]
+        if self[0] == 'L' and self[-1] == ';':
+            return self[1:-1]
+        else:
+            assert self.startswith('[')
+            return self
     def type_width(self):
         """ Returns number of JVM words this type takes up.  JVM words
         are a theoretically abstract quantity that basically

Modified: pypy/branch/fixed-list-ootype/pypy/translator/oosupport/constant.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/oosupport/constant.py	(original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/oosupport/constant.py	Mon Jan 14 17:25:29 2008
@@ -670,7 +670,6 @@
             gen.dup(SELFTYPE)
             push_constant(self.db, ootype.Signed, idx, gen)
             push_constant(self.db, ITEM, item, gen)
-            gen.prepare_generic_argument(ITEM)
             gen.call_method(SELFTYPE, 'll_setitem_fast')
             print idx, item
 



More information about the Pypy-commit mailing list