読者です 読者をやめる 読者になる 読者になる

RPythonで書かれたRuby処理系Topazをコンパイルする(ただしbackend=jvm、残念な結果)

こんにちわ。最近Rubyを学習中でパイパニスト(語弊はない)のid:rokujyouhitomaです。

まず最初に

RPythonで書かれたRubyの処理系Topazの0.1がリリースされたので、コンパイルしてみました。

もう少し詳細を話すと、TopazではRPython Toolchain(旧名はPyPyまたはPyPy Toolchain。紛らわしい名前ですね...)が使われています。
RPython Toolchainが対応しているバックエンドとしては、ANSI Cをはじめ、JVM、.NET CLI、LLVM、Squeakなどがあります。

去年頃にPyPyをjvmバックエンドにコンパイルしたので、今回はTopazをjvmバックエンドにコンパイルしようと思います。jvmバックエンドにコンパイルした暁には当然の事ながらjvmで動くというご褒美つき。

コンパイルした後は、YARVJRubyと速度比較をしてみたかったのですが....

いきなり結論

現状、私の環境ではTopazはjvmバックエンドでコンパイルできなかった/(^o^)\

ログ

コンパイル中はマンデルブロ集合のいつものログが出力されました。
でstarting rtype_ootypeのフェーズ(型推論のフェーズ)でエラーが発生しpdb++が立ち上がってしまいました。無念。

% python ../pypy/rpython/bin/rpython --backend=jvm targettopaz.py 
[platform:msg] Set platform with 'host' cc=None, using cc='gcc'
[translation:info] Translating target as defined by targettopaz
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/gcctest
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_0.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_0.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_0.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_0
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_1.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_1.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_1.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_1
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_2.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_2.o
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_3.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_3.o
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_4.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_4.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_4.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_4
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_5.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_5.o
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_6.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_6.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_6.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_6
[translation] translate.py configuration:
[translation] [translate]
[translation]     targetspec = targettopaz
[translation] translation configuration:
[translation] [translation]
[translation]     backend = jvm
[translation]     [backendopt]
[translation]         clever_malloc_removal = False
[translation]         constfold = False
[translation]     continuation = False
[translation]     gc = boehm
[translation]     gcremovetypeptr = False
[translation]     gcrootfinder = n/a
[translation]     gctransformer = boehm
[translation]     list_comprehension_operations = True
[translation]     type_system = ootype
[translation]     withsmallfuncsets = 5
[translation:info] Annotating&simplifying...
[94] {translation-task
starting annotate
[translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_7.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_7.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_7.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_7
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_8.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_8.o
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_9.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_9.o
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_10.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_10.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_10.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_10
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_11.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_11.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_11.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_11
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_12.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_12.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_12.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_12
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_13.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_13.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_13.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_13
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_14.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_14.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_14.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_14
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_15.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_15.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_15.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_15
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_16.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_16.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_16.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_16
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic -I/work/topaz/pypy/rpython/translator/c /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_18.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_18.o
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic -I/work/topaz/pypy/rpython/translator/c /work/topaz/pypy/rpython/translator/c/src/thread.c -o /work/topaz/pypy/rpython/translator/c/src/thread.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_18.o /work/topaz/pypy/rpython/translator/c/src/thread.o -arch x86_64 -mmacosx-version-min=10.5 -Wl,-exported_symbols_list,/var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/dynamic-symbols-0 -I/work/topaz/pypy/rpython/translator/c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_18
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_19.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_19.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_19.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_19
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_20.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_20.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_20.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_20
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_21.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_21.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_21.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_21
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_22.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_22.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_22.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_22
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_23.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_23.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_23.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_23
[platform:execute] gcc -c -arch x86_64 -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_24.c -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_24.o
[platform:execute] gcc /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_24.o -arch x86_64 -mmacosx-version-min=10.5 -o /var/folders/9q/sb6ypcmd45n1flbf_s01jr1x6z5cvt/T/usession-default-23/platcheck_24
++++++++++++++***********************%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#############################################################################%%%%%%%%%***********
++++++++++++********************%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%##%%%############################################################################%%%%%%%%%%%%%%********
++++++++++*******************%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%###################################################################################%%%%%%%%%%%%%%%%%******
++++++++******************%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%###################################################################################%%%%%%%#%%%%%%%%%%***
++++++*****************%%%%%####%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%#######################################################################################%###%%%%%%%%%%%%*
+++++****************%%%%%%%%%##%%%%%%#%%%%%%%%#%%%%####################################################################################################################%%%%%%%%%%%%%
++++***************%%%%%%%%%%%%%%%##################################################################################################################################%%%%%%%%%%%%%%%%%
++***************%%%%%%%%%%%%%%%%%#################################################################################################################################%%%%%%%%%%%%%%%%%%
+***************%%%%%%%%%%%%%%%%#######################################################################################################################################%%%%%%%%%%%%%%
***************%%%%%%%%%%%%%#######################################################################################################################################%%%%%%%%%%%%%%%%%%
**************%%%##%%%%##############################################################################################################################################%%%%%%%%%%%%%%%%
************%%%%%%###############################################################################################################################################%%%%%%%%%%%%%%%%%%%%
%*********%%%%%%%################################################################################################################################################%%%
[annrpython:WARNING] <FunctionGraph of (topaz.ast:375)Case.compile at 0x10cfc98a0> block@114 op=1/ no precise annotation supplied for iter(SomePBC(can_be_None=True, const=None, subset_of=None),)
%*********%%%%%%%################################################################################################################################################%%%%%%%%%%%%%%%%%%%%
%%%%*****%%#%%%%###############################################################################################################################################%%%%%%%%%%%%%%%%%%%%%%
###############################################################################################[17f9] translation-task}

[translation:info] ootyping...
[17f9] {translation-task
starting rtype_ootype
[1838] translation-task}
[Timer] Timings:
[Timer] annotate                       --- 61.1 s
[Timer] rtype_ootype                   ---  0.7 s
[Timer] =========================================
[Timer] Total:                         --- 61.8 s
[translation:ERROR] Error:
[translation:ERROR]  Traceback (most recent call last):
[translation:ERROR]    File "../pypy/rpython/translator/goal/translate.py", line 317, in main
[translation:ERROR]     drv.proceed(goals)
[translation:ERROR]    File "../pypy/rpython/translator/driver.py", line 733, in proceed
[translation:ERROR]     return self._execute(goals, task_skip = self._maybe_skip())
[translation:ERROR]    File "../pypy/rpython/translator/tool/taskengine.py", line 116, in _execute
[translation:ERROR]     res = self._do(goal, taskcallable, *args, **kwds)
[translation:ERROR]    File "../pypy/rpython/translator/driver.py", line 284, in _do
[translation:ERROR]     res = func()
[translation:ERROR]    File "../pypy/rpython/translator/driver.py", line 360, in task_rtype_ootype
[translation:ERROR]     rtyper.specialize(dont_simplify_again=True)
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 210, in specialize
[translation:ERROR]     self.specialize_more_blocks()
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 253, in specialize_more_blocks
[translation:ERROR]     self.specialize_block(block)
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 405, in specialize_block
[translation:ERROR]     self.translate_hl_to_ll(hop, varmapping)
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 534, in translate_hl_to_ll
[translation:ERROR]     resultvar = hop.dispatch()
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 762, in dispatch
[translation:ERROR]     return translate_meth(self)
[translation:ERROR]    File "<345-codegen ../pypy/rpython/rtyper/rtyper.py:604>", line 4, in translate_op_len
[translation:ERROR]     return r_arg1.rtype_len(hop)
[translation:ERROR]    File "../pypy/rpython/rtyper/rlist.py", line 129, in rtype_len
[translation:ERROR]     return hop.gendirectcall(ll_func, v_lst)
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 800, in gendirectcall
[translation:ERROR]     return self.llops.gendirectcall(ll_function, *args_v)
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 970, in gendirectcall
[translation:ERROR]     self.rtyper.call_all_setups()  # compute ForwardReferences now
[translation:ERROR]    File "../pypy/rpython/rtyper/rtyper.py", line 347, in call_all_setups
[translation:ERROR]     r.setup()
[translation:ERROR]    File "../pypy/rpython/rtyper/rmodel.py", line 57, in setup
[translation:ERROR]     self._setup_repr()
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 205, in _setup_repr
[translation:ERROR]     allfields = self.baserepr.allfields.copy()
[translation:ERROR]    File "../pypy/rpython/rtyper/rmodel.py", line 103, in __getattr__
[translation:ERROR]     self.setup()
[translation:ERROR]    File "../pypy/rpython/rtyper/rmodel.py", line 57, in setup
[translation:ERROR]     self._setup_repr()
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 277, in _setup_repr
[translation:ERROR]     oovalue = classrepr.get_meta_instance()
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 77, in get_meta_instance
[translation:ERROR]     self.setup_meta_instance(self.meta_instance, self)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 105, in setup_meta_instance
[translation:ERROR]     assign(mangled_name, attrvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 94, in assign
[translation:ERROR]     llvalue = r.convert_desc_or_const(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rmodel.py", line 118, in convert_desc_or_const
[translation:ERROR]     return self.convert_const(desc_or_const.value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rpbc.py", line 436, in convert_const
[translation:ERROR]     return self.convert_desc(frozendesc)
[translation:ERROR]    File "../pypy/rpython/rtyper/rpbc.py", line 479, in convert_desc
[translation:ERROR]     llvalue = r_value.convert_const(thisattrvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 341, in convert_const
[translation:ERROR]     return self.convert_const_exact(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 350, in convert_const_exact
[translation:ERROR]     self.initialize_prebuilt_instance(value, self.classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 368, in initialize_prebuilt_instance
[translation:ERROR]     self.initialize_prebuilt_data(value, classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 539, in initialize_prebuilt_data
[translation:ERROR]     llattrvalue = self.allfields[mangled].convert_const(attrvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/rlist.py", line 85, in convert_const
[translation:ERROR]     result.ll_setitem_fast(i, r_item.convert_const(x))
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 338, in convert_const
[translation:ERROR]     result = rinstance.convert_const(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 341, in convert_const
[translation:ERROR]     return self.convert_const_exact(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 350, in convert_const_exact
[translation:ERROR]     self.initialize_prebuilt_instance(value, self.classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 368, in initialize_prebuilt_instance
[translation:ERROR]     self.initialize_prebuilt_data(value, classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 539, in initialize_prebuilt_data
[translation:ERROR]     llattrvalue = self.allfields[mangled].convert_const(attrvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rdict.py", line 212, in convert_const
[translation:ERROR]     llvalue = r_value.convert_const(dictvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 338, in convert_const
[translation:ERROR]     result = rinstance.convert_const(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 341, in convert_const
[translation:ERROR]     return self.convert_const_exact(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 350, in convert_const_exact
[translation:ERROR]     self.initialize_prebuilt_instance(value, self.classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 368, in initialize_prebuilt_instance
[translation:ERROR]     self.initialize_prebuilt_data(value, classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 539, in initialize_prebuilt_data
[translation:ERROR]     llattrvalue = self.allfields[mangled].convert_const(attrvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 341, in convert_const
[translation:ERROR]     return self.convert_const_exact(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 350, in convert_const_exact
[translation:ERROR]     self.initialize_prebuilt_instance(value, self.classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 368, in initialize_prebuilt_instance
[translation:ERROR]     self.initialize_prebuilt_data(value, classdef, result)
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 539, in initialize_prebuilt_data
[translation:ERROR]     llattrvalue = self.allfields[mangled].convert_const(attrvalue)
[translation:ERROR]    File "../pypy/rpython/rtyper/rlist.py", line 85, in convert_const
[translation:ERROR]     result.ll_setitem_fast(i, r_item.convert_const(x))
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 338, in convert_const
[translation:ERROR]     result = rinstance.convert_const(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 341, in convert_const
[translation:ERROR]     return self.convert_const_exact(value)
[translation:ERROR]    File "../pypy/rpython/rtyper/rclass.py", line 347, in convert_const_exact
[translation:ERROR]     self.setup()
[translation:ERROR]    File "../pypy/rpython/rtyper/rmodel.py", line 57, in setup
[translation:ERROR]     self._setup_repr()
[translation:ERROR]    File "../pypy/rpython/rtyper/ootypesystem/rclass.py", line 205, in _setup_repr
[translation:ERROR]     allfields = self.baserepr.allfields.copy()
[translation:ERROR]    File "../pypy/rpython/rtyper/rmodel.py", line 109, in __getattr__
[translation:ERROR]     self.__class__.__name__, name))
[translation:ERROR]  AttributeError: InstanceRepr instance has no attribute allfields
[translation] start debugger...
> /work/topaz/pypy/rpython/rtyper/rmodel.py(109)__getattr__()
-> self.__class__.__name__, name))
(Pdb+) 

まとめ

うーむ...コメントなし。

PyPy, RPythonアーキテクチャの詳細を知りたい方は

PyPyをjvmバックエンドにコンパイルした話に興味あるかたは次の記事を参照下さい。

RPythonに関するわかりやすい日本語の記事は@shibukawaさんの記事を参考にしてください。

またはPyPy Advent Calendar 2011 まとめから追って下さい。

Topazプロジェクトに関してコメント

Topazプロジェクトですが、コミッターをちらっと見たところ、PyPyやJRuby、CPythonのコミッター陣が名を連ねていました。彼らが本気でこのプロジェクトを育てる気があるのか見ものです。(今のところ一日に10件のコミット。頑張ってるなぁ...ちなみにPyPyは一日20件程度のコミット量)