[pypy-svn] r46304 - pypy/dist/pypy/translator/jvm
antocuni at codespeak.net
antocuni at codespeak.net
Tue Sep 4 14:28:55 CEST 2007
Author: antocuni
Date: Tue Sep 4 14:28:54 2007
New Revision: 46304
Modified:
pypy/dist/pypy/translator/jvm/constant.py
pypy/dist/pypy/translator/jvm/generator.py
pypy/dist/pypy/translator/jvm/opcodes.py
pypy/dist/pypy/translator/jvm/typesystem.py
Log:
these are needed for pypy-jvm to compile
Modified: pypy/dist/pypy/translator/jvm/constant.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/constant.py (original)
+++ pypy/dist/pypy/translator/jvm/constant.py Tue Sep 4 14:28:54 2007
@@ -95,6 +95,8 @@
self.hash_jcls = self.db.record_delegate_standalone_func_impl(
self.value._dict.key_hash.graph)
+ CustomDictConst.record_dependencies(self)
+
def create_pointer(self, gen):
gen.new_with_jtype(self.eq_jcls)
gen.new_with_jtype(self.hash_jcls)
Modified: pypy/dist/pypy/translator/jvm/generator.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/generator.py (original)
+++ pypy/dist/pypy/translator/jvm/generator.py Tue Sep 4 14:28:54 2007
@@ -10,7 +10,7 @@
jObject, jByteArray, jPyPyExcWrap, jIntegerClass, jLongClass, \
jDoubleClass, jCharClass, jStringBuilder, JvmScalarType, jArrayList, \
jObjectArray, jPyPyInterlink, jPyPyCustomDict, jPyPyEquals, \
- jPyPyHashCode, jMap, jWeakRef
+ jPyPyHashCode, jMap, jWeakRef, jSystem
# ___________________________________________________________________________
# Miscellaneous helper functions
@@ -359,6 +359,7 @@
OBJHASHCODE = Method.v(jObject, 'hashCode', (), jInt)
OBJTOSTRING = Method.v(jObject, 'toString', (), jString)
OBJEQUALS = Method.v(jObject, 'equals', (jObject,), jBool)
+SYSTEMGC = Method.s(jSystem, 'gc', (), jVoid)
INTTOSTRINGI = Method.s(jIntegerClass, 'toString', (jInt,), jString)
LONGTOSTRINGL = Method.s(jLongClass, 'toString', (jLong,), jString)
DOUBLETOSTRINGD = Method.s(jDoubleClass, 'toString', (jDouble,), jString)
@@ -1070,7 +1071,8 @@
def push_null(self, OOTYPE):
self.emit(ACONST_NULL)
- DEFINED_INT_SYMBOLICS = {'MALLOC_ZERO_FILLED':1}
+ DEFINED_INT_SYMBOLICS = {'MALLOC_ZERO_FILLED':1,
+ '0 /* we are not jitted here */': 0}
def push_primitive_constant(self, TYPE, value):
if TYPE is ootype.Void:
Modified: pypy/dist/pypy/translator/jvm/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/opcodes.py (original)
+++ pypy/dist/pypy/translator/jvm/opcodes.py Tue Sep 4 14:28:54 2007
@@ -67,7 +67,7 @@
'cast_ptr_to_weakadr': [CastPtrToWeakAddress],
'cast_weakadr_to_ptr': CastWeakAddressToPtr,
- #'gc__collect': 'call void class [mscorlib]System.GC::Collect()',
+ 'gc__collect': jvmgen.SYSTEMGC,
'resume_point': Ignore,
'debug_assert': [], # TODO: implement?
Modified: pypy/dist/pypy/translator/jvm/typesystem.py
==============================================================================
--- pypy/dist/pypy/translator/jvm/typesystem.py (original)
+++ pypy/dist/pypy/translator/jvm/typesystem.py Tue Sep 4 14:28:54 2007
@@ -165,6 +165,7 @@
jIterator = JvmClassType('java.util.Iterator')
jClass = JvmClassType('java.lang.Class')
jStringBuilder = JvmClassType('java.lang.StringBuilder')
+jSystem = JvmClassType('java.lang.System')
jPrintStream = JvmClassType('java.io.PrintStream')
jMath = JvmClassType('java.lang.Math')
jList = JvmInterfaceType('java.util.List')
More information about the Pypy-commit
mailing list