[pypy-dev] pypy-jvm translation, patch

Marek Paška paskma at gmail.com
Thu Aug 28 16:05:37 CEST 2008


Hi,

today, I tried to translate pypy-jvm, but the translation failed with
the trace below. The following patch makes the translation to be
completed:

Index: pypy/translator/jvm/metavm.py
===================================================================
--- pypy/translator/jvm/metavm.py       (revision 57667)
+++ pypy/translator/jvm/metavm.py       (working copy)
@@ -93,6 +93,7 @@
     (ootype.Signed,           ootype.UnsignedLongLong): jvm.I2L,
     (ootype.SignedLongLong,   ootype.Signed):           jvm.L2I,
     (ootype.UnsignedLongLong, ootype.SignedLongLong):   None,
+    (ootype.UnsignedLongLong, ootype.Unsigned):         jvm.L2I,
     }

 class _CastPrimitive(MicroInstruction):

However, I am not really sure whether the patch is really correct :-)
Pypy-jvm does not work anyway, it is the problem I reported several
weeks ago:

paskma at paskma:goal$ ./pypy-jvm
'import site' failed
Python 2.4.1 (pypy 1.0.0 build 100000) on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``nothing is true''
Error calling sys.excepthook:
debug: OperationError:
debug:  operror-type: ImportError
debug:  operror-value: cannot import name 'curdir'

(Don't be confused by the build number, I am using git-svn.)

Marek Paška

The traceback:

[translation:ERROR] Error:
[translation:ERROR]  Traceback (most recent call last):
[translation:ERROR]    File "translate.py", line 278, in main
[translation:ERROR]     drv.proceed(goals)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/driver.py", line
797, in proceed
[translation:ERROR]     return self._execute(goals, task_skip =
self._maybe_skip())
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/tool/taskengine.py",
line 116, in _execute
[translation:ERROR]     res = self._do(goal, taskcallable, *args, **kwds)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/driver.py", line
268, in _do
[translation:ERROR]     res = func()
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/driver.py", line
709, in task_source_jvm
[translation:ERROR]     self.jvmsource = self.gen.generate_source()
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/genjvm.py",
line 266, in generate_source
[translation:ERROR]     GenOO.generate_source(self)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/genoo.py",
line 68, in generate_source
[translation:ERROR]     self.gen_pendings()
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/genoo.py",
line 83, in gen_pendings
[translation:ERROR]     node.render(self.ilasm)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/node.py",
line 899, in render
[translation:ERROR]     method.render(gen)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/function.py",
line 129, in render
[translation:ERROR]     self.render_normal_block(block)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/node.py",
line 473, in render_normal_block
[translation:ERROR]     return OOFunction.render_normal_block(self, block)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/function.py",
line 218, in render_normal_block
[translation:ERROR]     self._render_op(op)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/node.py",
line 574, in _render_op
[translation:ERROR]     OOFunction._render_op(self, op)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/function.py",
line 351, in _render_op
[translation:ERROR]     instr_list.render(self.generator, op)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/metavm.py",
line 247, in render
[translation:ERROR]     instr.render(generator, op)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/metavm.py",
line 62, in render
[translation:ERROR]     jmethod.return_type, op.result)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/metavm.py",
line 21, in _invoke_method
[translation:ERROR]     gen.load(arg)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/generator.py",
line 495, in load
[translation:ERROR]     return render_sub_op(value, self.db, self)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/function.py",
line 24, in render_sub_op
[translation:ERROR]     instr_list.render(generator, op)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/oosupport/metavm.py",
line 247, in render
[translation:ERROR]     instr.render(generator, op)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/jvm/metavm.py",
line 102, in render
[translation:ERROR]     opcode = CASTS[(FROM, TO)]
[translation:ERROR]  KeyError: (<UnsignedLongLong>, <Unsigned>)



More information about the Pypy-dev mailing list