[pypy-svn] r68372 - pypy/branch/gc-hash/pypy/translator/jvm

arigo at codespeak.net arigo at codespeak.net
Tue Oct 13 13:32:41 CEST 2009


Author: arigo
Date: Tue Oct 13 13:32:41 2009
New Revision: 68372

Modified:
   pypy/branch/gc-hash/pypy/translator/jvm/builtin.py
   pypy/branch/gc-hash/pypy/translator/jvm/opcodes.py
   pypy/branch/gc-hash/pypy/translator/jvm/typesystem.py
Log:
Try to fix the JVM backend.  Working in the dark as I cannot test it.


Modified: pypy/branch/gc-hash/pypy/translator/jvm/builtin.py
==============================================================================
--- pypy/branch/gc-hash/pypy/translator/jvm/builtin.py	(original)
+++ pypy/branch/gc-hash/pypy/translator/jvm/builtin.py	Tue Oct 13 13:32:41 2009
@@ -84,6 +84,9 @@
     (ootype.StringBuilder.__class__, "ll_build"):
     jvm.Method.v(jStringBuilder, "toString", (), jString),
 
+    (ootype.String.__class__, "ll_hash"):
+    jvm.Method.v(jString, "hashCode", (), jInt),
+
     (ootype.String.__class__, "ll_streq"):
     jvm.Method.v(jString, "equals", (jObject,), jBool),
 

Modified: pypy/branch/gc-hash/pypy/translator/jvm/opcodes.py
==============================================================================
--- pypy/branch/gc-hash/pypy/translator/jvm/opcodes.py	(original)
+++ pypy/branch/gc-hash/pypy/translator/jvm/opcodes.py	Tue Oct 13 13:32:41 2009
@@ -82,8 +82,7 @@
     'instanceof':               [CastTo, StoreResult],
     'subclassof':               [PushAllArgs, jvm.SWAP, jvm.CLASSISASSIGNABLEFROM, StoreResult],
     'classof':                  [PushAllArgs, jvm.OBJECTGETCLASS, StoreResult],
-    'ooidentityhash':           [PushAllArgs, jvm.OBJHASHCODE, StoreResult], 
-    'oohash':                   [PushAllArgs, jvm.OBJHASHCODE, StoreResult], 
+    'identityhash':             [PushAllArgs, jvm.SYSTEMIDENTITYHASH, StoreResult], 
     'oostring':                 [OOString, StoreResult],
     'oounicode':                [OOUnicode, StoreResult],
     'ooparse_float':            jvm.PYPYOOPARSEFLOAT,

Modified: pypy/branch/gc-hash/pypy/translator/jvm/typesystem.py
==============================================================================
--- pypy/branch/gc-hash/pypy/translator/jvm/typesystem.py	(original)
+++ pypy/branch/gc-hash/pypy/translator/jvm/typesystem.py	Tue Oct 13 13:32:41 2009
@@ -888,6 +888,7 @@
 OBJHASHCODE =           Method.v(jObject, 'hashCode', (), jInt)
 OBJTOSTRING =           Method.v(jObject, 'toString', (), jString)
 OBJEQUALS =             Method.v(jObject, 'equals', (jObject,), jBool)
+SYSTEMIDENTITYHASH =    Method.s(jSystem, 'identityHashCode', (jObject,), jInt)
 SYSTEMGC =              Method.s(jSystem, 'gc', (), jVoid)
 INTTOSTRINGI =          Method.s(jIntegerClass, 'toString', (jInt,), jString)
 LONGTOSTRINGL =         Method.s(jLongClass, 'toString', (jLong,), jString)



More information about the Pypy-commit mailing list