[pypy-dev] pypy-jvm translating magic?

Nicholas Riley njriley at uiuc.edu
Sat Oct 6 02:29:33 CEST 2007


On Wed, Oct 03, 2007 at 08:01:21PM +0200, Armin Rigo wrote:
> * Antonio and Niko are doing some very good work on the Java backend.
>   With minor tweaks we can now build a pypy-jvm.  FWIW it seems to give
>   better performance than Jython.  It's not 100% comparable because
>   pypy-jvm is not thread-aware or thread-safe yet, while Jython gives
>   you free threading; OTOH pypy-jvm doesn't generate Java bytecodes
>   on-the-fly (although it might do so in the future).  All in all
>   pypy-jvm is still experimental, but stay tuned :-)

I've been doing some Jython performance investigation recently so I
was intrigued by the above statement.  I tried:

% python translate.py -b jvm --batch targetpypystandalone.py

which failed at:

Invoking jasmin on ['/tmp/usession-0/pypy/pypy/issubclass_3989.j', '/tmp/usession-0/pypy/pypy/_mm_int_intS0_perform_call_19609.j', '/tmp/usession-0/pypy/pypy/pypy/interpreter/astcompiler/ast/Sliceobj_meta_11152.j', '/tmp/usession-0/pypy/pypy/dict_mth_mm_items_perform_call_3231.j', '/tmp/usession-0/pypy/pypy/_mm_repr_sliceS0_perform_call_4133.j', '/tmp/usession-0/pypy/pypy/interp_w__AssTuple_27444.j', '/tmp/usession-0/pypy/pypy/hash_w_delegate_9102.j', '/tmp/usession-0/pypy/pypy/pypy/interpreter/gateway/BuiltinActivation_UwS_PyFrame_ObjSpace_W_Root_meta_20393.j', '/tmp/usession-0/pypy/pypy/str_mth_mm_ljust_perform_call_2415.j', '/tmp/usession-0/pypy/pypy/mod__Long_Long_25422.j', '/tmp/usession-0/pypy/pypy/all_delegate_1535.j', '/tmp/usession-0/pypy/pypy/pypy/interpreter/gateway/BuiltinActivation_UwS_ObjSpace_STType_int_meta_15329.j', '/tmp/usession-0/pypy/pypy/eq_w_delegate_18069.j', '/tmp/usession-0/pypy/pypy/and__delegate_16652.j', '/tmp/usession-0/pypy/pypy/boundmethod_int_w_star1_24850.j', '/tmp/usession-0/pypy/pypy/_mm_floordiv_floatS0_perform_call_5681.j', '/tmp/usession-0/pypy/pypy/descr_typecheck_fget_node_delegate_11750.j', '/tmp/usession-0/pypy/pypy/descr_typecheck_fset_else__0_delegate_11298.j', '/tmp/usession-0/pypy/pypy/pypy/rlib/rbigint/rbigint_63.j', '/tmp/usession-0/pypy/pypy/Function/descr_function_repr_27175.j', '/tmp/usession-0/pypy/pypy/_mm_pow_longS1_perform_call_delegate_20674.j', '/tmp/usession-0/pypy/pypy/descr_Compare_new_13737.j', '/tmp/usession-0/pypy/pypy/_mm_xor_longS1_perform_call_20791.j']
[translation:ERROR] Error:
[translation:ERROR]  Traceback (most recent call last):
[translation:ERROR]    File "translate.py", line 272, in main
[translation:ERROR]     drv.proceed(goals)
[translation:ERROR]    File "/home/zilles/njriley/zilles/pypy-dist/pypy/translator/driver.py", line 754, in proceed
[translation:ERROR]     return self._execute(goals, task_skip = self._maybe_skip())
[translation:ERROR]    File "/home/zilles/njriley/zilles/pypy-dist/pypy/translator/tool/taskengine.py", line 112, in _execute
[translation:ERROR]     res = self._do(goal, taskcallable, *args, **kwds)
[translation:ERROR]    File "/home/zilles/njriley/zilles/pypy-dist/pypy/translator/driver.py", line 265, in _do
[translation:ERROR]     res = func()
[translation:ERROR]    File "/home/zilles/njriley/zilles/pypy-dist/pypy/translator/driver.py", line 728, in task_compile_jvm
[translation:ERROR]     self.jvmsource.compile()
[translation:ERROR]    File "/home/zilles/njriley/zilles/pypy-dist/pypy/translator/jvm/genjvm.py", line 165, in compile
[translation:ERROR]     self._invoke(jascmd + files, False)
[translation:ERROR]    File "/home/zilles/njriley/zilles/pypy-dist/pypy/translator/jvm/genjvm.py", line 107, in _invoke
[translation:ERROR]     raise JvmSubprogramError(res, args, stdout, stderr)
[translation:ERROR]  JvmSubprogramError: Error code 0 running ['jasmin', '-d', '/tmp/usession-0/pypy', '/tmp/usession-0/pypy/pypy/issubclass_3989.j', '/tmp/usession-0/pypy/pypy/_mm_int_intS0_perform_call_19609.j', '/tmp/usession-0/pypy/pypy/pypy/interpreter/astcompiler/ast/Sliceobj_meta_11152.j', '/tmp/usession-0/pypy/pypy/dict_mth_mm_items_perform_call_3231.j', '/tmp/usession-0/pypy/pypy/_mm_repr_sliceS0_perform_call_4133.j', '/tmp/usession-0/pypy/pypy/interp_w__AssTuple_27444.j', '/tmp/usession-0/pypy/pypy/hash_w_delegate_9102.j', '/tmp/usession-0/pypy/pypy/pypy/interpreter/gateway/BuiltinActivation_UwS_PyFrame_ObjSpace_W_Root_meta_20393.j', '/tmp/usession-0/pypy/pypy/str_mth_mm_ljust_perform_call_2415.j', '/tmp/usession-0/pypy/pypy/mod__Long_Long_25422.j', '/tmp/usession-0/pypy/pypy/all_delegate_1535.j', '/tmp/usession-0/pypy/pypy/pypy/interpreter/gateway/BuiltinActivation_UwS_ObjSpace_STType_int_meta_15329.j', '/tmp/usession-0/pypy/pypy/eq_w_delegate_18069.j', '/tmp/usession-0/pypy/pypy/and__delegate_16652.j', '/tmp/usession-0/pypy/pypy/boundmethod_int_w_star1_24850.j', '/tmp/usession-0/pypy/pypy/_mm_floordiv_floatS0_perform_call_5681.j', '/tmp/usession-0/pypy/pypy/descr_typecheck_fget_node_delegate_11750.j', '/tmp/usession-0/pypy/pypy/descr_typecheck_fset_else__0_delegate_11298.j', '/tmp/usession-0/pypy/pypy/pypy/rlib/rbigint/rbigint_63.j', '/tmp/usession-0/pypy/pypy/Function/descr_function_repr_27175.j', '/tmp/usession-0/pypy/pypy/_mm_pow_longS1_perform_call_delegate_20674.j', '/tmp/usession-0/pypy/pypy/descr_Compare_new_13737.j', '/tmp/usession-0/pypy/pypy/_mm_xor_longS1_perform_call_20791.j']

I was able to translate targetnopstandalone to Java so it seems to
work a little, but obviously there is a big difference between that
and PyPy. :) Trawling the IRC logs I found:

[20:39] <antocuni> fijal: unfortunately pypy-jvm does not compile 
out of the box
[20:39] <antocuni> you have to manually patch two lines in rbigint 

Is this still true?  Is the patch available somewhere?

-- 
Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>



More information about the Pypy-dev mailing list