把吉里吉里3 revision 3419中Risse的部分build了出来测试

把吉里吉里3 revision 3419中Risse的部分build了出来测试

[url=http://kikyou.info/tvp]吉里吉里3官网[/url]
需要kirikiri3源代码的,请在官网查找其SVN repository的地址。

嘛,吉里吉里3已经在revision 3419持续了几天。11月10日更新到revision 3414时,Dee氏把渐渐变得难以控制的Rina GDS代码给删了,然后这几天在慢慢摸索Rina该如何继续开发。看来最近的开发方向主要集中在Rina上,而Risse部分在上个月底之后就一直没怎么改动。于是想build一下现有的Risse部分,看看现在的实现的完成度有多高。

==================================================================

[b]Build的过程[/b]

开发环境:
kirikiri3-buildenv-2007-08-10.zip(包括MinGW 5.1.3,MSYS-1.0.11等。具体查看[url=https://sv.kikyou.info/trac/kirikiri/wiki/documents/kirikiri3/development/build_win32/discrete]这里[/url])
Ruby 1.8.6-26 Release Candidate 2
TortoiseSVN 1.4.5, Build 10425 - 32 Bit

安装包总大小:158 MB
安装后总大小:181 MB

MinGW和MSYS我原本也有装,不过要调整到跟Dee氏用的能兼容总觉得好麻烦,干脆直接用那个all-in-one的开发环境包了。

Build目标:
kirikiri3 trunk revision 3419

源代码大小:[color=red]481 MB[/color](包括SVN文件)
占用空间:[color=red]1.10 GB[/color] (包括SVN文件)

源代码中所有外部依赖都包含在SVN中,也不用分别去获取。比吉里吉里2的开发轻松多了。

Ok,把开发环境展开,配置好,马上来试试build。

首先要把外部依赖都build出来,包括Boost、Boehm GC、libogg、zlib等一堆。可是一开始build到gc那部分就囧了。某个makefile里有这么一句:
[code]svn export src src_temp || cp -pR src src_temp[/code]
我装的是TortoiseSVN,在命令行没有"svn"这个命令可用,当然就执行了后半部分的cp。一碰到SVN的那些.svn隐藏目录,这个cp就会失败。我想来想去没想出什么好办法解决,一怒,把整个repository跟SVN断开连接,也就是把那些.svn目录都删除掉,马上就OK了。
build外部依赖的过程大概用了3个小时吧。最后总算等到了那句"all done.",唉。以前不知道为什么连这些外部依赖也总是不能顺利build完。至少这次bjam的build完全没出错,一看到bjam成功build出来我就松了口气。

然后尝试去build一下吉里吉里3的核心部分。在src\core目录里现在基本上只有risse目录是能build完的。貌似因为Rina还没完成,所以src\core\base里的东西也没有被make。也好,反正我要的就是Risse部分。把Risse给build出来,得到librisse.a。

然后来到tests\rissetest目录,把测试Risse用的外壳程序给build出来。得到rissetest.exe。

这些都做完后,来看看吉里吉里3的工作区已经变到多大了:
整个k3目录:大小 4.54 GB;占用 [color=red]4.68 GB[/color]。
其中build_output\bin目录:大小 [color=red]348 MB[/color]。
其中rissetest.exe文件:大小 [color=red]23.7 MB[/color]。

这大小真够夸张的……难怪Dee氏在build指引中写了“要是有10G的剩余空间应该就没什么问题了吧” T T
build的过程用有用到-DDEBUG参数,不知道要是不加debug参数,然后加上优化参数(例如-O2)会怎样呢。

==================================================================

[b]测试过程[/b]

要运行rissetest.exe,必须附带两个外部dll:
gc.dll - Boehm GC
mingwm10.dll - MinGW的一个运行时

于是把这3个文件都复制到tests\rissetest目录里,以下面命令开始测试:
[code]for %f in (tests\*.rs) do "rissetest.exe" %f 2> "testlog\%f.testlog.txt" 1>"testlog\%f.result.txt"[/code]
这样,所有测试结果都保存到testlog目录中。不过一个个脚本文件+对应结果查看起来也挺麻烦的,所以先把所有原始脚本文件和测试结果都复制到另一个目录里放在一起,然后另外写了个程序来处理这些结果:
C#代码:
[code]using System;
using System.IO;
using System.Text.RegularExpressions;

namespace fx.meta.rissetest
{
public sealed class ExtractResult
{
public static void Main( string[ ] args ) {
if ( args.Length < 1 ) {
Usage( );
return;
} // if

bool isPrintContent = args[ 0 ].Contains( "c" );
bool isPrintResult = args[ 0 ].Contains( "r" );
bool isPrintStats = args[ 0 ].Contains( "s" );

switch ( args.Length ) {
case 1:
Console.WriteLine( "Missing dir_path." );
Usage( );
break;
case 2:
ExtractResults( args[ 1 ], null, isPrintContent, isPrintResult, isPrintStats );
break;
case 3:
ExtractResults( args[ 1 ], args[ 2 ], isPrintContent, isPrintResult, isPrintStats );
break;
default:
Console.WriteLine( "Too many arguments." );
Usage( );
break;
} // switch
} // Main

private static void ExtractResults(
string dirname,
string outname,
bool isPrintContent,
bool isPrintResult,
bool isPrintStats ) {

string[ ] filelist = Directory.GetFiles( dirname, "*.rs" );
StreamWriter writer = null;
int fileCount = 0;
int passCount = 0;
try {
if ( outname != null ) {
writer = File.CreateText( outname );
Console.SetOut( writer );
}

foreach ( string fname in filelist ) {
// get script text
FileInfo fiScript = new FileInfo( fname );
string content = null;
using ( StreamReader reader = fiScript.OpenText( ) ) {
content = reader.ReadToEnd( );
}

// get result text
FileInfo fiResult = new FileInfo( fname + ".result.txt" );
string result = null;
using ( StreamReader reader = fiResult.OpenText( ) ) {
result = reader.ReadToEnd( );
}

// extract expected result from script
MatchCollection matches = Regex.Matches( content, @"//=> (.+)$", RegexOptions.Multiline );
string expectedResult = null;
bool passed = false;
foreach ( Match match in matches ) {
expectedResult = match.Groups[ 1 ].Captures[ 0 ].Value;
}
if ( ( expectedResult != null ) && ( result != null ) && expectedResult.Trim( ).Equals( result.Trim( ) ) ) {
passed = true;
passCount++;
}

Console.WriteLine( "=========================================" );
Console.WriteLine( "Risse Test Script No.{0}: {1}", ++fileCount, fname );
Console.WriteLine( "Test: {0}", ( passed ) ? "Passed" : "Failed" );
if ( isPrintContent ) {
Console.WriteLine( "-----------------------------------------" );
Console.WriteLine( "Test Script: {0}{1}", Environment.NewLine, content );
}
if ( isPrintResult ) {
Console.WriteLine( "-----------------------------------------" );
Console.WriteLine( "Results: {0}", result );
}
Console.WriteLine( "=========================================" );
Console.WriteLine( );
} // foreach

if ( isPrintStats ) {
Console.WriteLine( "=========================================" );
Console.WriteLine( "{0} scripts tested, {1} passed, {2} failed.", fileCount, passCount, fileCount - passCount );
}
} finally {
if ( writer != null )
writer.Dispose( );
} // try-finally
} // ExtractResults

private static void Usage( ) {
Console.WriteLine( "Usage: ExtractResult.exe -options dir_path [out_path]" );
Console.WriteLine( "where" );
Console.WriteLine( "\tdir_path is the directory where the *.rs scripts" );
Console.WriteLine( "\tand their correspoding result files are." );
Console.WriteLine( "\tout_path is the output file. Optional." );
Console.WriteLine( "options is one or more of [crs]:" );
Console.WriteLine( "\tc - script [c]ontent" );
Console.WriteLine( "\tr - [r]esult" );
Console.WriteLine( "\ts - overall [s]tatistics" );
Console.WriteLine( "The options are case sensitive." );
} // Usage
}
}[/code]

运行
[quote]ExtractResult -rs tests log.txt[/quote]
得到的结果是:
[quote]=========================================
Risse Test Script No.1: tests\anonymous-call.rs
Test: Passed
-----------------------------------------
Results: 2
=========================================

=========================================
Risse Test Script No.2: tests\anonymous-class-define.rs
Test: Passed
-----------------------------------------
Results: "This is an instance of C"
=========================================

=========================================
Risse Test Script No.3: tests\arith-0.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.4: tests\arith-add.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.5: tests\arith-bitand.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.6: tests\arith-bitnot.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.7: tests\arith-bitor.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.8: tests\arith-bitxor.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.9: tests\arith-dec.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.10: tests\arith-div.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.11: tests\arith-idiv.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.12: tests\arith-inc.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.13: tests\arith-lognot.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.14: tests\arith-lshift.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.15: tests\arith-lt.rs
Test: Passed
-----------------------------------------
Results: "okok"
=========================================

=========================================
Risse Test Script No.16: tests\arith-lte.rs
Test: Passed
-----------------------------------------
Results: "okok"
=========================================

=========================================
Risse Test Script No.17: tests\arith-minus.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.18: tests\arith-mod.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.19: tests\arith-mul.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.20: tests\arith-plus.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.21: tests\arith-rbitshift.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.22: tests\arith-rshift.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.23: tests\arith-sub.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.24: tests\array-default.rs
Test: Passed
-----------------------------------------
Results: "tttt--"
=========================================

=========================================
Risse Test Script No.25: tests\array-filler.rs
Test: Passed
-----------------------------------------
Results: "vv!--!=="
=========================================

=========================================
Risse Test Script No.26: tests\array-iget-iset.rs
Test: Passed
-----------------------------------------
Results: "abcd"
=========================================

=========================================
Risse Test Script No.27: tests\array-length.rs
Test: Passed
-----------------------------------------
Results: 2
=========================================

=========================================
Risse Test Script No.28: tests\array-literal.rs
Test: Passed
-----------------------------------------
Results: ":1:2:3|:a:b:c|:1.5:2.5:3.5|"
=========================================

=========================================
Risse Test Script No.29: tests\array-new.rs
Test: Passed
-----------------------------------------
Results: "321"
=========================================

=========================================
Risse Test Script No.30: tests\array-push-pop.rs
Test: Passed
-----------------------------------------
Results: 10
=========================================

=========================================
Risse Test Script No.31: tests\array-swap.rs
Test: Passed
-----------------------------------------
Results: "4:5"
=========================================

=========================================
Risse Test Script No.32: tests\array-unshift-shift.rs
Test: Passed
-----------------------------------------
Results: 14
=========================================

=========================================
Risse Test Script No.33: tests\binding-modify-local-var.rs
Test: Passed
-----------------------------------------
Results: "1:2:5"
=========================================

=========================================
Risse Test Script No.34: tests\block-alternative-argument.rs
Test: Passed
-----------------------------------------
Results: "2y34x"
=========================================

=========================================
Risse Test Script No.35: tests\block-break-with-value.rs
Test: Passed
-----------------------------------------
Results: 5
=========================================

=========================================
Risse Test Script No.36: tests\block-break.rs
Test: Passed
-----------------------------------------
Results: 5
=========================================

=========================================
Risse Test Script No.37: tests\block-child-variable-conditional-wtite.rs
Test: Passed
-----------------------------------------
Results: 0
=========================================

=========================================
Risse Test Script No.38: tests\block-continue.rs
Test: Passed
-----------------------------------------
Results: 30
=========================================

=========================================
Risse Test Script No.39: tests\block-goto.rs
Test: Passed
-----------------------------------------
Results: 5
=========================================

=========================================
Risse Test Script No.40: tests\block-return.rs
Test: Passed
-----------------------------------------
Results: 5
=========================================

=========================================
Risse Test Script No.41: tests\block.rs
Test: Passed
-----------------------------------------
Results: 10
=========================================

=========================================
Risse Test Script No.42: tests\boolean-basic.rs
Test: Passed
-----------------------------------------
Results: "true:true:false:false"
=========================================

=========================================
Risse Test Script No.43: tests\branch-bug.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.44: tests\break-omit-brock.rs
Test: Passed
-----------------------------------------
Results: 30
=========================================

=========================================
Risse Test Script No.45: tests\call-block.rs
Test: Passed
-----------------------------------------
Results: 36
=========================================

=========================================
Risse Test Script No.46: tests\call-callback-function.rs
Test: Passed
-----------------------------------------
Results: 36
=========================================

=========================================
Risse Test Script No.47: tests\call-omit.rs
Test: Passed
-----------------------------------------
Results: "iiijjjkkk"
=========================================

=========================================
Risse Test Script No.48: tests\cast-boolean.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.49: tests\cast-integer.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.50: tests\cast-octet.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.51: tests\cast-real.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.52: tests\cast-string.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.53: tests\catch-BlockExitException.rs
Test: Passed
-----------------------------------------
Results: "this should not be caught"
=========================================

=========================================
Risse Test Script No.54: tests\class-default-initialize.rs
Test: Passed
-----------------------------------------
Results: "x:y:z"
=========================================

=========================================
Risse Test Script No.55: tests\class-define-inheritance-overwrite.rs
Test: Passed
-----------------------------------------
Results: "1"
=========================================

=========================================
Risse Test Script No.56: tests\class-define-inheritance.rs
Test: Passed
-----------------------------------------
Results: "C1D1"
=========================================

=========================================
Risse Test Script No.57: tests\class-define-shared-variable.rs
Test: Passed
-----------------------------------------
Results: 0
=========================================

=========================================
Risse Test Script No.58: tests\class-define.rs
Test: Passed
-----------------------------------------
Results: "C.m"
=========================================

=========================================
Risse Test Script No.59: tests\class-instance-new-toString.rs
Test: Passed
-----------------------------------------
Results: "Hey! This is an instance of class C"
=========================================

=========================================
Risse Test Script No.60: tests\class-name-instance-name.rs
Test: Passed
-----------------------------------------
Results: "C:xx:xx"
=========================================

=========================================
Risse Test Script No.61: tests\class-name.rs
Test: Passed
-----------------------------------------
Results: "T:T:Object:Class:Class:Module:Integer:Real:Primitive:Function:Integer:Real:String:"
=========================================

=========================================
Risse Test Script No.62: tests\class-new-inheritance-overwrite.rs
Test: Passed
-----------------------------------------
Results: "1"
=========================================

=========================================
Risse Test Script No.63: tests\class-new-inheritance.rs
Test: Passed
-----------------------------------------
Results: "This is C.m"
=========================================

=========================================
Risse Test Script No.64: tests\class-private-variable.rs
Test: Passed
-----------------------------------------
Results: 14
=========================================

=========================================
Risse Test Script No.65: tests\class-static-method-property.rs
Test: Passed
-----------------------------------------
Results: "static-variable:static-variable:instance-variable:instance-variable"
=========================================

=========================================
Risse Test Script No.66: tests\class-super.rs
Test: Passed
-----------------------------------------
Results: "A.m()B.m()"
=========================================

=========================================
Risse Test Script No.67: tests\class-super2.rs
Test: Passed
-----------------------------------------
Results: 2
=========================================

=========================================
Risse Test Script No.68: tests\closure.rs
Test: Passed
-----------------------------------------
Results: 6
=========================================

=========================================
Risse Test Script No.69: tests\coroutine-alive.rs
Test: Passed
-----------------------------------------
Results: "ftff"
=========================================

=========================================
Risse Test Script No.70: tests\coroutine-CoroutineException-dead-coroutine.rs
Test: Failed
-----------------------------------------
Results: "coroutine has already exited at tests\\coroutine-CoroutineException-dead-coroutine.rs:10"
=========================================

=========================================
Risse Test Script No.71: tests\coroutine-CoroutineException-illegal-yield.rs
Test: Failed
-----------------------------------------
Results: "coroutine has already exited at tests\\coroutine-CoroutineException-illegal-yield.rs:9"
=========================================

=========================================
Risse Test Script No.72: tests\coroutine-CoroutineException-illegal-yield2.rs
Test: Failed
-----------------------------------------
Results: "coroutine has not started yet at tests\\coroutine-CoroutineException-illegal-yield2.rs:9"
=========================================

=========================================
Risse Test Script No.73: tests\coroutine-CoroutineException-illegal-yield3.rs
Test: Failed
-----------------------------------------
Results: "coroutine is not running at tests\\coroutine-CoroutineException-illegal-yield3.rs:16"
=========================================

=========================================
Risse Test Script No.74: tests\coroutine-counter-gc.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.75: tests\coroutine-counter.rs
Test: Passed
-----------------------------------------
Results: "a:0 b:1 a:2 b:4 a:6 b:9 a:12 b:16 "
=========================================

=========================================
Risse Test Script No.76: tests\coroutine-exception-in-run.rs
Test: Passed
-----------------------------------------
Results: "[ok][ok]"
=========================================

=========================================
Risse Test Script No.77: tests\coroutine-run.rs
Test: Passed
-----------------------------------------
Results: "a:0 b:1 a:2 b:4 a:6 b:9 a:12 b:16 "
=========================================

=========================================
Risse Test Script No.78: tests\date-basic.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.79: tests\date-parser.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.80: tests\dead-block.rs
Test: Passed
-----------------------------------------
Results: 4
=========================================

=========================================
Risse Test Script No.81: tests\deep-shared-variable.rs
Test: Passed
-----------------------------------------
Results: "deadbeef"
=========================================

=========================================
Risse Test Script No.82: tests\deepchild.rs
Test: Passed
-----------------------------------------
Results: 23
=========================================

=========================================
Risse Test Script No.83: tests\deepchild2.rs
Test: Passed
-----------------------------------------
Results: 1
=========================================

=========================================
Risse Test Script No.84: tests\eval-object.rs
Test: Passed
-----------------------------------------
Results: 4
=========================================

=========================================
Risse Test Script No.85: tests\exception-BadArgumentCountException.rs
Test: Failed
-----------------------------------------
Results: "bad argument count (0 given, but 1 expected) at tests\\exception-BadArgumentCountException.rs:3"
=========================================

=========================================
Risse Test Script No.86: tests\exception-BadContextException.rs
Test: Failed
-----------------------------------------
Results: "given context is not compatible with this method/property at tests\\exception-BadContextException.rs:3"
=========================================

=========================================
Risse Test Script No.87: tests\exception-ClassDefinitionException.rs
Test: Failed
-----------------------------------------
Results: "the superclass is not a class at tests\\exception-ClassDefinitionException.rs:3"
=========================================

=========================================
Risse Test Script No.88: tests\exception-IllegalMemberAccessException-const.rs
Test: Failed
-----------------------------------------
Results: "member \"c\" is read-only at tests\\exception-IllegalMemberAccessException-const.rs:5"
=========================================

=========================================
Risse Test Script No.89: tests\exception-IllegalMemberAccessException-final-initialize.rs
Test: Failed
-----------------------------------------
Results: "member \"initialize\" is final, cannot be overridden at tests\\exception-IllegalMemberAccessException-final-initialize.rs:2"
=========================================

=========================================
Risse Test Script No.90: tests\exception-IllegalMemberAccessException-final.rs
Test: Failed
-----------------------------------------
Results: "member \"final_func\" is final, cannot be overridden at tests\\exception-IllegalMemberAccessException-final.rs:11"
=========================================

=========================================
Risse Test Script No.91: tests\exception-IllegalMemberAccessException-property-read.rs
Test: Failed
-----------------------------------------
Results: "property \"p\" cannot be read at tests\\exception-IllegalMemberAccessException-property-read.rs:8"
=========================================

=========================================
Risse Test Script No.92: tests\exception-IllegalMemberAccessException-property-write.rs
Test: Failed
-----------------------------------------
Results: "property \"p\" cannot be written at tests\\exception-IllegalMemberAccessException-property-write.rs:8"
=========================================

=========================================
Risse Test Script No.93: tests\exception-IllegalMemberAccessException-var-member-const.rs
Test: Failed
-----------------------------------------
Results: "member \"c\" is read-only at tests\\exception-IllegalMemberAccessException-var-member-const.rs:5"
=========================================

=========================================
Risse Test Script No.94: tests\exception-InstantiationException.rs
Test: Failed
-----------------------------------------
Results: "cannot create instance from this class at tests\\exception-InstantiationException.rs:3"
=========================================

=========================================
Risse Test Script No.95: tests\exception-NoSuchMemberException.rs
Test: Failed
-----------------------------------------
Results: "member \"v\" not found at tests\\exception-NoSuchMemberException.rs:3"
=========================================

=========================================
Risse Test Script No.96: tests\finally-except.rs
Test: Passed
-----------------------------------------
Results: "exception thrown, but n = -1"
=========================================

=========================================
Risse Test Script No.97: tests\finally-goto-from-try.rs
Test: Passed
-----------------------------------------
Results: -1
=========================================

=========================================
Risse Test Script No.98: tests\finally-no-except.rs
Test: Passed
-----------------------------------------
Results: -1
=========================================

=========================================
Risse Test Script No.99: tests\finally-try-in-finally.rs
Test: Passed
-----------------------------------------
Results: -1
=========================================

=========================================
Risse Test Script No.100: tests\function-local-recurse.rs
Test: Passed
-----------------------------------------
Results: 24
=========================================

=========================================
Risse Test Script No.101: tests\function-shared-variable-dependence.rs
Test: Passed
-----------------------------------------
Results: 0
=========================================

=========================================
Risse Test Script No.102: tests\function-shared-variable-scope.rs
Test: Passed
-----------------------------------------
Results: 4
=========================================

=========================================
Risse Test Script No.103: tests\function-shared-variable-scope2.rs
Test: Passed
-----------------------------------------
Results: 1
=========================================

=========================================
Risse Test Script No.104: tests\global-function.rs
Test: Passed
-----------------------------------------
Results: "hogehoge"
=========================================

=========================================
Risse Test Script No.105: tests\global-object.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.106: tests\global-variable.rs
Test: Passed
-----------------------------------------
Results: 10
=========================================

=========================================
Risse Test Script No.107: tests\goto.rs
Test: Passed
-----------------------------------------
Results: "abcdef"
=========================================

=========================================
Risse Test Script No.108: tests\incontextof-dynamic.rs
Test: Passed
-----------------------------------------
Results: "instance-global-global-global"
=========================================

=========================================
Risse Test Script No.109: tests\incontextof.rs
Test: Passed
-----------------------------------------
Results: 5
=========================================

=========================================
Risse Test Script No.110: tests\inheritance.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.111: tests\instance-by-new-method.rs
Test: Passed
-----------------------------------------
Results: "abc"
=========================================

=========================================
Risse Test Script No.112: tests\instanceof.rs
Test: Passed
-----------------------------------------
Results: "o...o.o..|oo..ooo..|o.o.oo.|.oo.oo.|...ooo.|o.|ooo..|ooo..|ooo..|ooo..|.oo.."
=========================================

=========================================
Risse Test Script No.113: tests\integer-new-times.rs
Test: Passed
-----------------------------------------
Results: 8
=========================================

=========================================
Risse Test Script No.114: tests\isA.rs
Test: Passed
-----------------------------------------
Results: "o...o.o..|oo..ooo..|o.o.oo.|.oo.oo.|...ooo.|o.|ooo..|ooo..|ooo..|ooo..|.oo.."
=========================================

=========================================
Risse Test Script No.115: tests\local-binding-deep-function.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.116: tests\local-binding-in-binding.rs
Test: Passed
-----------------------------------------
Results: 7
=========================================

=========================================
Risse Test Script No.117: tests\local-binding-local-variable-indirect.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.118: tests\local-binding-local-variable.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.119: tests\local-binding-var.rs
Test: Passed
-----------------------------------------
Results: 0
=========================================

=========================================
Risse Test Script No.120: tests\logical-and-or-shortcut.rs
Test: Passed
-----------------------------------------
Results: 2
=========================================

=========================================
Risse Test Script No.121: tests\logical-and-or-shortcut2.rs
Test: Passed
-----------------------------------------
Results: 11
=========================================

=========================================
Risse Test Script No.122: tests\logical-and.rs
Test: Passed
-----------------------------------------
Results: "ok:ok:ok:ok:ok"
=========================================

=========================================
Risse Test Script No.123: tests\logical-or.rs
Test: Passed
-----------------------------------------
Results: "ok:ok:ok:ok:ok"
=========================================

=========================================
Risse Test Script No.124: tests\member_decl.rs
Test: Passed
-----------------------------------------
Results: 0
=========================================

=========================================
Risse Test Script No.125: tests\module-define.rs
Test: Passed
-----------------------------------------
Results: "12M"
=========================================

=========================================
Risse Test Script No.126: tests\module-new.rs
Test: Passed
-----------------------------------------
Results: "12M"
=========================================

=========================================
Risse Test Script No.127: tests\native-binder-remove-reference.rs
Test: Passed
-----------------------------------------
Results: 1
=========================================

=========================================
Risse Test Script No.128: tests\number-isNaN.rs
Test: Passed
-----------------------------------------
Results: "nyynnnn"
=========================================

=========================================
Risse Test Script No.129: tests\object-new.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.130: tests\object-new2.rs
Test: Passed
-----------------------------------------
Results: 3
=========================================

=========================================
Risse Test Script No.131: tests\octet-lesser-compare.rs
Test: Passed
-----------------------------------------
Results: "false:true:false:false:true:false:true:true:false"
=========================================

=========================================
Risse Test Script No.132: tests\phi-coalescing-bug-multiple-use-of-vars.rs
Test: Passed
-----------------------------------------
Results: 1
=========================================

=========================================
Risse Test Script No.133: tests\phi-liveness-bug.rs
Test: Passed
-----------------------------------------
Results: "-+-+:2"
=========================================

=========================================
Risse Test Script No.134: tests\property-define-class.rs
Test: Passed
-----------------------------------------
Results: "result: -6,6"
=========================================

=========================================
Risse Test Script No.135: tests\property-define-global.rs
Test: Passed
-----------------------------------------
Results: "result: -6,6"
=========================================

=========================================
Risse Test Script No.136: tests\property-implicit-this.rs
Test: Passed
-----------------------------------------
Results: "str!"
=========================================

=========================================
Risse Test Script No.137: tests\return-omit-0.rs
Test: Passed
-----------------------------------------
Results: 9
=========================================

=========================================
Risse Test Script No.138: tests\return-omit-1.rs
Test: Passed
-----------------------------------------
Results: 9
=========================================

=========================================
Risse Test Script No.139: tests\return-omit-goto.rs
Test: Passed
-----------------------------------------
Results: "t"
=========================================

=========================================
Risse Test Script No.140: tests\return-omit-if.rs
Test: Passed
-----------------------------------------
Results: "false:true::true"
=========================================

=========================================
Risse Test Script No.141: tests\return-omit-loops.rs
Test: Passed
-----------------------------------------
Results: "void:B:void:B:void:B"
=========================================

=========================================
Risse Test Script No.142: tests\return-omit-switch.rs
Test: Passed
-----------------------------------------
Results: "ABC:ABC:ACC:ABC:CCC:AB"
=========================================

=========================================
Risse Test Script No.143: tests\return-omit-synchronized.rs
Test: Passed
-----------------------------------------
Results: "locking!"
=========================================

=========================================
Risse Test Script No.144: tests\return-omit-try-0.rs
Test: Passed
-----------------------------------------
Results: "a"
=========================================

=========================================
Risse Test Script No.145: tests\return-omit-try-1.rs
Test: Passed
-----------------------------------------
Results: "a"
=========================================

=========================================
Risse Test Script No.146: tests\return-omit-try-2.rs
Test: Passed
-----------------------------------------
Results: "bb"
=========================================

=========================================
Risse Test Script No.147: tests\return-omit-try-3.rs
Test: Passed
-----------------------------------------
Results: "a:void:void:a"
=========================================

=========================================
Risse Test Script No.148: tests\return-omit-try-goto.rs
Test: Passed
-----------------------------------------
Results: "t"
=========================================

=========================================
Risse Test Script No.149: tests\return-omit-var.rs
Test: Passed
-----------------------------------------
Results: "n!"
=========================================

=========================================
Risse Test Script No.150: tests\scope-local-function.rs
Test: Passed
-----------------------------------------
Results: "hogehoge"
=========================================

=========================================
Risse Test Script No.151: tests\string-charAt.rs
Test: Passed
-----------------------------------------
Results: "adffa--"
=========================================

=========================================
Risse Test Script No.152: tests\string-lesser-compare.rs
Test: Passed
-----------------------------------------
Results: "false:true:false:false:true:false:true:true:false"
=========================================

=========================================
Risse Test Script No.153: tests\string-literal-emb-expr.rs
Test: Passed
-----------------------------------------
Results: "abc45truefalse"
=========================================

=========================================
Risse Test Script No.154: tests\string-new-length.rs
Test: Passed
-----------------------------------------
Results: 9
=========================================

=========================================
Risse Test Script No.155: tests\string-newmethod.rs
Test: Passed
-----------------------------------------
Results: "ababababab"
=========================================

=========================================
Risse Test Script No.156: tests\string-substr.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.157: tests\switch-go-through.rs
Test: Passed
-----------------------------------------
Results: "*+-+--"
=========================================

=========================================
Risse Test Script No.158: tests\synchronized-break.rs
Test: Passed
-----------------------------------------
Results: "exited"
=========================================

=========================================
Risse Test Script No.159: tests\synchronized-break2.rs
Test: Passed
-----------------------------------------
Results: "exited"
=========================================

=========================================
Risse Test Script No.160: tests\synchronized-goto.rs
Test: Passed
-----------------------------------------
Results: "abcdef"
=========================================

=========================================
Risse Test Script No.161: tests\synchronized-goto2.rs
Test: Passed
-----------------------------------------
Results: 12
=========================================

=========================================
Risse Test Script No.162: tests\synchronized-return.rs
Test: Passed
-----------------------------------------
Results: "return by exception"
=========================================

=========================================
Risse Test Script No.163: tests\this-proxy.rs
Test: Passed
-----------------------------------------
Results: "global-a:class-b:instance-c:local-d:@:@:@:@"
=========================================

=========================================
Risse Test Script No.164: tests\thisproxy-optimization-bug.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.165: tests\thread-exception.rs
Test: Failed
-----------------------------------------
Results: "Exception! at tests\\thread-exception.rs:3"
=========================================

=========================================
Risse Test Script No.166: tests\thread-global-variable-as-a-flag.rs
Test: Passed
-----------------------------------------
Results: "end"
=========================================

=========================================
Risse Test Script No.167: tests\thread-synchronized-block.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.168: tests\thread-synchronized-function.rs
Test: Passed
-----------------------------------------
Results: "ok"
=========================================

=========================================
Risse Test Script No.169: tests\throw-toException.rs
Test: Passed
-----------------------------------------
Results: "4321!!"
=========================================

=========================================
Risse Test Script No.170: tests\try-break.rs
Test: Passed
-----------------------------------------
Results: "exited"
=========================================

=========================================
Risse Test Script No.171: tests\try-break2.rs
Test: Passed
-----------------------------------------
Results: "exited"
=========================================

=========================================
Risse Test Script No.172: tests\try-conditional-catch.rs
Test: Passed
-----------------------------------------
Results: "A:B:non caught exception"
=========================================

=========================================
Risse Test Script No.173: tests\try-continue.rs
Test: Passed
-----------------------------------------
Results: 12
=========================================

=========================================
Risse Test Script No.174: tests\try-goto.rs
Test: Passed
-----------------------------------------
Results: "abcdef"
=========================================

=========================================
Risse Test Script No.175: tests\try-goto2.rs
Test: Passed
-----------------------------------------
Results: 12
=========================================

=========================================
Risse Test Script No.176: tests\try-nest.rs
Test: Passed
-----------------------------------------
Results: 1
=========================================

=========================================
Risse Test Script No.177: tests\try-return.rs
Test: Passed
-----------------------------------------
Results: "return by exception"
=========================================

=========================================
Risse Test Script No.178: tests\try.rs
Test: Passed
-----------------------------------------
Results: "return by exception"
=========================================

=========================================
Risse Test Script No.179: tests\void-basic.rs
Test: Passed
-----------------------------------------
Results: "::void"
=========================================

=========================================
Risse Test Script No.180: tests\while-loop.rs
Test: Passed
-----------------------------------------
Results: 26
=========================================

=========================================
180 scripts tested, 164 passed, 16 failed.[/quote]

嗯,so far so good。所以可以看出现在Risse的进展还算可以,只有协程部分的测试fail了;虽然异常处理的那几个脚本也"fail"了,不过一看运行结果就知道那其实是正确行为。换句话说,Risse已经相当实用,即使就这么拿来嵌入到一个程序中实际使用也不成大问题。看来已经值得拿来研究了呢。
(<= 这人只是在找借口推脱掉继续研究吉里吉里2中TJS2部分的麻烦而已 T T)

随便抓出其中的一个脚本来研究下:
closure.rs
// スクリプト言語「りせ」テスト用スクリプト
{

var func = function() {
var a = 0;
return function () { return ++a; };
};
var la = func();
var la_1 = la(); // la_1 => 1
var la_2 = la(); // la_2 => 2
var la_3 = la(); // la_3 => 3
return la_1 + la_2 + la_3; //=> 6
}


然后来看看生成的代码:
[code]######################################
function anonymous function 42 nest level 2
######################################
========== VM block #2 (anonymous function 42) ==========
#(4) var func = function() {
#(5) var a = 0;
#(6) return function () { return ++a; };
00000 const %0, *0 // *0=1
00003 sread %1, [1:0]
00006 add %2, %1, %0
00010 swrite [1:0], %2
00013 return %2

######################################
function anonymous function 16 nest level 1
######################################
========== VM block #1 (anonymous function 16) ==========
#(3)
#(4) var func = function() {
#(5) var a = 0;
00000 const %0, *0 // *0=0
00003 swrite [1:0], %0
#(6) return function () { return ++a; };
00006 const %0, *1 // *1="<VM block #2>"
00009 sshare %0
00011 func %1, %0
00014 return %1

######################################
function toplevel nest level 0
######################################
========== VM block #0 (toplevel) ==========
#(2) {
#(3)
#(4) var func = function() {
00000 const %0, *0 // *0="<VM block #1>"
00003 sshare %0
00005 func %1, %0
#(5) var a = 0;
#(6) return function () { return ++a; };
#(7) };
#(8) var la = func();
00008 call %0, %1()
#(9) var la_1 = la(); // la_1 => 1
00013 call %1, %0()
#(10) var la_2 = la(); // la_2 => 2
00018 call %2, %0()
#(11) var la_3 = la(); // la_3 => 3
00023 call %3, %0()
#(12) return la_1 + la_2 + la_3; //=> 6
00028 add %0, %1, %2
00032 add %1, %0, %3
00036 return %1[/code]
注意到其中#(xxx)的是注释,xxx是源代码的行号,后面跟着的是对应源代码的内容。
Risse VM的指令集与TJS2 VM的相比变化不太大。不过中间增添了SSA形式的中间代码,让我颇感兴趣。另外,Risse中的函数终于能有正确的lexical scope,不会想TJS2那样允许嵌套函数定义却不按lexical scope来确定访问链。

明天考试之后再继续疯狂吧 XD
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值