トップ «前の日記(2005-01-12) 最新 次の日記(2005-01-14)» 編集

日々の破片

著作一覧

2005-01-13

_ YARV

さて、せっかくPowerPC搭載のマシンがあるんだからやってみるか。

でも、さい先は良くないぞ。

$ cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src login
(Logging in to anonymous@cvs.ruby-lang.org)
CVS password: 
 
cvs [login aborted]: connect to cvs.ruby-lang.org:2401 failed: Connection refused

(で、何度もトライしたんでログに相当書かれてしまっただろうな)

あきらめてcvswebでtarballを取得。

でもって

$ mkdir save
$ cp eval.c save
$ patch <../yarv-0.1.0/evalc.patch 
(Stripping trailing CRs from patch.)
patching file eval.c
$ diff save/eval.c eval.c
20a21,59
> 
> /******************************************
>  * for YARV                               *
>  ******************************************/
 ...(snip)...

でauatoconfして、make。DESTDIRの設定をミスって/usr/local/binのrubyを更新しちゃったけどまあいいか。

$ ruby -v
ruby 1.9.0 (2005-01-12) [powerpc-darwin7.7.0]

で、おもむろに(と一応gccのオプションを表示したいのでコピペ)

$ ruby extconf.rb
checking for ulong... no
creating Makefile
$ make
/usr/local/bin/ruby ./rb/insns2vm.rb -I. -I/usr/local/lib/ruby/1.9/powerpc-darwin7.7.0 -I/usr/local/lib/ruby/1.9/powerpc-darwin7.7.0 -I. -DDISPATCH_THREADED_CODE -DDISPATCH_DIRECT_THREADED_CODE -DOPT_BASIC_OPERATIONS -DOPT_REGEXP_MATCH -DOPT_STACK_CACHING -DINLINE_METHOD_CACHE 
gcc -fno-common -g -O2 -pipe -fno-common  -I. -I/usr/local/lib/ruby/1.9/powerpc-darwin7.7.0 -I/usr/local/lib/ruby/1.9/powerpc-darwin7.7.0 -I. -DDISPATCH_THREADED_CODE -DDISPATCH_DIRECT_THREADED_CODE -DOPT_BASIC_OPERATIONS -DOPT_REGEXP_MATCH -DOPT_STACK_CACHING -DINLINE_METHOD_CACHE  -c compile.c
 ...(snip)...
cc -dynamic -bundle -undefined suppress -flat_namespace  -L"/usr/local/lib" -o yarvcore.bundle compile.o compiled.o debug.o disasm.o vm.o yarvcore.o yarvsubst.o  -ldl -lobjc  

ちなみにgccはXCodeにバンドルされてるやつ。

$ gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1640)

うん? どこにyarvcore.soはあるんだ? と思ったらOS X版ではyarvcore.bundleになるのか(実は今まで意識してなかったり)

$ ls -l yarvcore.bundle 
-rw-r--r--  1 arton  arton  461636 13 Jan 03:09 yarvcore.bundle

では、テストだ。

$ ruby test/runner.rb 
Loaded suite test
Started
.....*eval*:11: warning: already initialized constant C
*eval*:11: warning: already initialized constant C
*eval*:11: warning: already initialized constant C
<*YARV eval*>:14: warning: already initialized constant C
<*YARV eval*>:14: warning: already initialized constant C
<*YARV eval*>:14: warning: already initialized constant C
.........................................................................................
Finished in 2.895308 seconds.
 
94 tests, 246 assertions, 0 failures, 0 errors

できてるらしい。では、benchmarkを取ってみるか。

すごい量なので、結果はここ。とりあえず、ここまでで今日はおしまい。

_ YARVアセンブラ出力(PowerPC G4)

vm.asm.txtです。

本日のツッコミ(全3件) [ツッコミを入れる]
_ ささだ (2005-01-13 10:17)

おー,どうもありがとうございます.x86 といろいろと違いますね.<br>できれば,アセンブラ出力を出してもらえませんか.make vm.asm で vm.asm.txt というファイルができます.多分.

_ arton (2005-01-13 11:24)

できたけどサイズが大きいので夜になったら上げておきます。>vm.asm.txt

_ ささだ (2005-01-18 23:50)

遅くなってすみません。わざわざどうもありがとうございました。でも、正直、見てもわかりませんですた orz<br><br>rb/mixc-asm.rb というのをかけると、見やすくなるような気がしなくも無いです。


2003|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|

ジェズイットを見習え