From d907cbc81d6aa67502695df21a6f31c55325db0c Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 13 Nov 2007 22:13:04 +0000 Subject: * blockinlining.c, compile.c, compile.h, debug.c, debug.h, id.c, insnhelper.h, insns.def, thread.c, thread_pthread.ci, thread_pthread.h, thread_win32.ci, thread_win32.h, vm.h, vm_dump.c, vm_evalbody.ci, vm_opts.h: fix comments and copyright year. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 +++ blockinlining.c | 2 +- compile.c | 14 ++--- compile.h | 2 +- debug.c | 2 +- debug.h | 2 +- id.c | 2 +- insnhelper.h | 2 +- insns.def | 170 ++++++++++++++++++++++++++++-------------------------- thread.c | 2 +- thread_pthread.ci | 2 +- thread_pthread.h | 2 +- thread_win32.ci | 2 +- thread_win32.h | 2 +- vm.h | 2 +- vm_dump.c | 2 +- vm_evalbody.ci | 2 +- vm_opts.h | 2 +- 18 files changed, 115 insertions(+), 107 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d20540346..4e2eff37c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Nov 14 07:09:48 2007 Koichi Sasada + + * blockinlining.c, compile.c, compile.h, debug.c, debug.h, + id.c, insnhelper.h, insns.def, thread.c, thread_pthread.ci, + thread_pthread.h, thread_win32.ci, thread_win32.h, vm.h, + vm_dump.c, vm_evalbody.ci, vm_opts.h: fix comments and + copyright year. + Wed Nov 14 07:07:51 2007 Koichi Sasada * tool/makedocs.rb, template/insnstbl.html: removed. diff --git a/blockinlining.c b/blockinlining.c index 35a9d6199f..3c6fda4a6b 100644 --- a/blockinlining.c +++ b/blockinlining.c @@ -5,7 +5,7 @@ $Author$ $Date$ - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ diff --git a/compile.c b/compile.c index 810fb0e59e..141e55e156 100644 --- a/compile.c +++ b/compile.c @@ -6,7 +6,7 @@ $Date$ created at: 04/01/01 03:42:15 JST - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ @@ -252,7 +252,6 @@ iseq_translate_threaded_code(rb_iseq_t *iseq) /* definition of data structure for compiler */ /*********************************************/ - static void * compile_data_alloc(rb_iseq_t *iseq, size_t size) { @@ -336,8 +335,7 @@ ADD_ELEM(LINK_ANCHOR *anchor, LINK_ELEMENT *elem) verify_list("add", anchor); } -/*******************************************/ -#if 0 +#if 0 /* unused */ /* * elem1, elemX => elem1, elem2, elemX */ @@ -369,8 +367,6 @@ INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2) } #endif -/*******************************************/ - /* * elemX, elem1, elemY => elemX, elem2, elemY */ @@ -402,13 +398,13 @@ FIRST_ELEMENT(LINK_ANCHOR *anchor) return anchor->anchor.next; } -/* +#if 0 /* unused */ static LINK_ELEMENT * LAST_ELEMENT(LINK_ANCHOR *anchor) { return anchor->last; } - */ +#endif static LINK_ELEMENT * POP_ELEMENT(LINK_ANCHOR *anchor) @@ -501,7 +497,7 @@ INSERT_LIST(LINK_ANCHOR *anc1, LINK_ANCHOR *anc2) verify_list("append", anc1); } -#if 0 +#if 0 /* unused */ /* * anc1: e1, e2, e3 * anc2: e4, e5 diff --git a/compile.h b/compile.h index ca3c1c96d9..5581a7af2e 100644 --- a/compile.h +++ b/compile.h @@ -6,7 +6,7 @@ $Date$ created at: 04/01/01 23:36:57 JST - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ diff --git a/debug.c b/debug.c index 25b233d661..5dc5c86a39 100644 --- a/debug.c +++ b/debug.c @@ -6,7 +6,7 @@ $Date$ created at: 04/08/25 02:31:54 JST - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ diff --git a/debug.h b/debug.h index 8020cfa569..782173ca9d 100644 --- a/debug.h +++ b/debug.h @@ -6,7 +6,7 @@ $Date$ created at: 04/08/25 02:33:49 JST - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ diff --git a/id.c b/id.c index 034c0fdd0a..6fa00a66b3 100644 --- a/id.c +++ b/id.c @@ -6,7 +6,7 @@ $Date$ created at: Thu Jul 12 04:37:51 2007 - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ diff --git a/insnhelper.h b/insnhelper.h index 4516a5525a..574c5e00b4 100644 --- a/insnhelper.h +++ b/insnhelper.h @@ -6,7 +6,7 @@ $Date$ created at: 04/01/01 15:50:34 JST - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ diff --git a/insns.def b/insns.def index 374445d38b..50d357d8a2 100644 --- a/insns.def +++ b/insns.def @@ -5,7 +5,7 @@ $Date: $ created at: 04/01/01 01:17:55 JST - Copyright (C) 2004-2006 Koichi Sasada + Copyright (C) 2004-2007 Koichi Sasada */ /** ##skip @@ -47,7 +47,7 @@ nop /** @c variable - @e get local variable(which is pointed by idx). + @e get local variable value (which is pointed by idx). @j idx で指定されたローカル変数をスタックに置く。 */ DEFINE_INSN @@ -61,8 +61,8 @@ getlocal /** @c variable - @e get local variable (which is pointed by idx) as val. - @j idx で指定されたローカル変数を val にする。 + @e set local variable value (which is pointed by idx) as val. + @j idx で指定されたローカル変数を val に設定する。 */ DEFINE_INSN setlocal @@ -75,8 +75,8 @@ setlocal /** @c variable - @e get special local variable ($~, $_, ..) - @j 特殊なローカル変数の値を得る + @e get special local variable ($~, $_, ..) value. + @j 特殊なローカル変数($~, $_, ...)の値を得る。 */ DEFINE_INSN getspecial @@ -89,8 +89,8 @@ getspecial /** @c variable - @e set special local variables - @j 特別なローカル変数を設定する + @e set special local variable ($~, $_, ...) value as obj. + @j 特別なローカル変数($~, $_, ...)の値をを設定する。 */ DEFINE_INSN setspecial @@ -147,8 +147,7 @@ setdynamic @c variable @e get instance variable id of obj. if is_local is not 0, search as class local variable. - @j obj のインスタンス変数 id を得る。 - もし is_local が !0 ならクラスローカル変数を得る + @j self のインスタンス変数 id の値を得る。 */ DEFINE_INSN getinstancevariable @@ -163,8 +162,7 @@ getinstancevariable @c variable @e set instance variable id of obj as val. if is_local is not 0, search as class local variable. - @j obj のインスタンス変数を val にする。 - もし is_local が !0 ならクラスローカル変数を得る + @j self のインスタンス変数 id を val にする。 */ DEFINE_INSN setinstancevariable @@ -178,7 +176,7 @@ setinstancevariable /** @c variable @e get class variable id of klass as val. - @j klass のクラス変数 id を得る。 + @j 現在のスコープのクラス変数 id の値を得る。 */ DEFINE_INSN getclassvariable @@ -211,9 +209,9 @@ setclassvariable are searched in current scope. if klass is Qfalse, constant as top level constant. otherwise, get constant under klass class or module. - @j - 定数を得る。klass が Qnil なら、そのスコープで得られ - る定数を得る。Qfalse なら、トップレベルスコープを得る。 + @j 定数 id の値を得る。 + klass が Qnil なら、そのスコープで得られる定数の値を得る。 + Qfalse なら、トップレベルスコープを得る。 それ以外なら、klass クラスの下の定数を得る。 */ DEFINE_INSN @@ -233,11 +231,10 @@ getconstant top level constant. otherwise, set constant under klass class or module. - @j - 定数 id を val にする。klass が Qfalse なら、そのスコープ - で得られる定数を設定 id を設定する。Qnil なら、トップレベ - ルスコープを設定、それ以外なら、klass クラスの下の定数を - 設定する。 + @j 定数 id の値を val にする。 + klass が Qfalse なら、そのスコープで得られる定数 id の値を設定する。 + Qnil なら、トップレベルスコープの値を設定する。 + それ以外なら、klass クラスの下の定数を設定する。 */ DEFINE_INSN setconstant @@ -270,7 +267,7 @@ setconstant /** @c variable @e get global variable id. - @j グローバル変数 id を得る。 + @j グローバル変数 id の値を得る。 */ DEFINE_INSN getglobal @@ -284,7 +281,7 @@ getglobal /** @c variable @e set global variable id as val. - @j グローバル変数 id を得る。 + @j グローバル変数 id の値を設定する。 */ DEFINE_INSN setglobal @@ -302,8 +299,8 @@ setglobal /** @c put - @e put nil - @j put nil + @e put nil to stack. + @j スタックに nil をプッシュする。 */ DEFINE_INSN putnil @@ -317,7 +314,7 @@ putnil /** @c put @e put self. - @j self を置く。 + @j スタックに self をプッシュする。 */ DEFINE_INSN putself @@ -332,7 +329,8 @@ putself @c put @e put some object. i.e. Fixnum, true, false, nil, and so on. - @j オブジェクトを置く。i.e. Fixnum, true, false, nil, and so on. + @j オブジェクト val をスタックにプッシュする。 + i.e. Fixnum, true, false, nil, and so on. */ DEFINE_INSN putobject @@ -346,9 +344,8 @@ putobject /** @c put @e put string val. string will be copied. - @j 文字列を置く。文字列はコピーしとく。 + @j 文字列ををコピーしてスタックにプッシュする。 */ - DEFINE_INSN putstring (VALUE str) @@ -361,7 +358,7 @@ putstring /** @c put @e put concatenate strings - @j 文字列を連結して置く。 + @j スタックトップの文字列を n 個連結し,結果をスタックにプッシュする。 */ DEFINE_INSN concatstrings @@ -383,7 +380,7 @@ concatstrings /** @c put @e to_str - @j to_str + @j to_str の結果をスタックにプッシュする。 */ DEFINE_INSN tostring @@ -397,22 +394,23 @@ tostring /** @c put @e to Regexp - @j to Regexp + @j 文字列 str を正規表現にコンパイルしてスタックにプッシュする。 + コンパイル時,opt を正規表現のオプションとする。 */ DEFINE_INSN toregexp -(rb_num_t flag) +(rb_num_t opt) (VALUE str) (VALUE val) { volatile VALUE tmp = str; /* for GC */ - val = rb_reg_new(str, flag); + val = rb_reg_new(str, opt); } /** @c put @e put new array. - @j 新しい配列をスタック上の num 個の値で初期化して置く。 + @j 新しい配列をスタック上の num 個の値で初期化して生成しプッシュする。 */ DEFINE_INSN newarray @@ -427,7 +425,7 @@ newarray /** @c put @e dup array - @j 配列を dup してスタックに置く + @j 配列 ary を dup してスタックにプッシュする。 */ DEFINE_INSN duparray @@ -462,7 +460,7 @@ expandarray /** @c put @e concat two arrays - @j 二つの配列をとってきてくっつける + @j 二つの配列 ary1, ary2 を連結しスタックへプッシュする。 */ DEFINE_INSN concatarray @@ -491,7 +489,7 @@ concatarray /** @c put @e splat array - @j splat array + @j 配列 ary に対して to_splat を呼び出す。 */ DEFINE_INSN splatarray @@ -509,7 +507,7 @@ splatarray /** @c put @e check value is included in ary - @j 配列に要素が入っているかどうかチェック。case/when で使う + @j 配列 ary に要素 obj が入っているかどうかチェック。case/when で利用する。 */ DEFINE_INSN checkincludearray @@ -549,7 +547,8 @@ checkincludearray /** @c put @e put new Hash. - @j Hash.new + @j 新しいハッシュをスタックトップの n 個を初期値として生成する。 + n はキーと値のペアなので 2 の倍数でなければならない。 */ DEFINE_INSN newhash @@ -572,7 +571,7 @@ newhash /** @c put @e put new Range object.(Range.new(low, high, flag)) - @j Range.new(low, high, flag) のようなオブジェクトを置く。 + @j Range.new(low, high, flag) のようなオブジェクトを生成しスタックにプッシュする。 */ DEFINE_INSN newrange @@ -586,7 +585,7 @@ newrange /** @c put @e put !val. - @j !val であるオブジェクトを置く。 + @j !val の結果をスタックにプッシュする。 */ DEFINE_INSN putnot @@ -625,7 +624,7 @@ pop /** @c stack @e duplicate stack top. - @j スタックトップをコピーしてスタックにおく + @j スタックトップをコピーしてスタックにプッシュする。 */ DEFINE_INSN dup @@ -639,7 +638,7 @@ dup /** @c stack @e duplicate stack top n elements - @j スタックトップから n 個をコピーしてスタックにおく + @j スタックトップの n 個をコピーしてスタックにプッシュする。 */ DEFINE_INSN dupn @@ -659,7 +658,7 @@ dupn /** @c stack @e swap top 2 vals - @j スタックトップの2つを交換する。 + @j スタックトップの 2 つの値を交換する。 */ DEFINE_INSN swap @@ -672,8 +671,8 @@ swap /** @c stack - @e - @j + @e for stack caching. + @j スタックキャッシングの状態を調整するために必要な命令。 */ DEFINE_INSN reput @@ -687,7 +686,7 @@ reput /** @c stack @e get nth stack value from stack top - @j スタックトップから n 個目をスタックトップにコピー + @j スタックトップから n 個目をスタックにプッシュする。 */ DEFINE_INSN topn @@ -715,7 +714,7 @@ setn /** @c stack @e empt current stack - @j current stack を空にする + @j current stack を空にする。 */ DEFINE_INSN emptstack @@ -734,7 +733,7 @@ emptstack /** @c setting @e define (singleton) method id as body - @j (特異)メソッド m を body として定義する。 + @j (特異)メソッド id を body として定義する。 */ DEFINE_INSN definemethod @@ -749,7 +748,7 @@ definemethod /** @c setting @e make alias (if v_p is Qtrue, make valias) - @j alias を作る。もし v_p が Qtrue なら、valias (global variable) を作る + @j alias を作る。もし v_p が Qtrue なら、valias (global variable) を作る。 */ DEFINE_INSN alias @@ -771,7 +770,7 @@ alias /** @c setting @e undef - @j undef + @j undef を行う。 */ DEFINE_INSN undef @@ -787,7 +786,7 @@ undef /** @c setting @e defined? - @j defined? + @j defined? を行う。 */ DEFINE_INSN defined @@ -896,7 +895,7 @@ defined /** @c setting @e END{} - @j END{} + @j END{} に対応するためにブロックを登録する。 */ DEFINE_INSN postexe @@ -918,7 +917,7 @@ postexe /** @c setting @e trace - @j trace + @j trace 用の命令。 */ DEFINE_INSN trace @@ -939,9 +938,9 @@ trace @e enter class definition scope. if super is Qfalse, and clsas "klass" is defined, it's redefine. otherwise, define "klass" class. - @j - クラス定義スコープへ移行する。もし super が Qfalse で klassクラスが - 定義されていれば、再定義である。そうでなければ、klass クラスを定義する。 + @j クラス定義スコープへ移行する。 + もし super が Qfalse で klassクラスが定義されていれば再定義である。 + そうでなければ、klass クラスを定義する。 */ DEFINE_INSN defineclass @@ -1041,11 +1040,13 @@ defineclass /** @c method/iterator @e obj.send(id, args..) # args.size => num - @j obj.send(id, args..) # args.size => num - flag & VM_CALL_ARGS_SPLAT_BIT != 0 -> splat last arg - flag & VM_CALL_ARGS_BLOCKARG_BIT != 0 -> Proc as Block - flag & VM_CALL_FCALL_BIT != 0 -> FCALL ( func() ) - flag & VM_CALL_VCALL_BIT != 0 -> VCALL ( func ) + @j メソッド呼び出しを行う。 + obj.send(id, args..) # args.size => num + flag & VM_CALL_ARGS_SPLAT_BIT != 0 -> splat last arg + flag & VM_CALL_ARGS_BLOCKARG_BIT != 0 -> Proc as Block + flag & VM_CALL_FCALL_BIT != 0 -> FCALL ( func() ) + flag & VM_CALL_VCALL_BIT != 0 -> VCALL ( func ) + ... */ DEFINE_INSN send @@ -1056,7 +1057,8 @@ send NODE *mn; VALUE recv, klass; rb_block_t *blockptr = 0; - rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag, op_argc, (rb_iseq_t *)blockiseq, &blockptr); + rb_num_t num = caller_setup_args(th, GET_CFP(), op_flag, op_argc, + (rb_iseq_t *)blockiseq, &blockptr); rb_num_t flag = op_flag; ID id = op_id; @@ -1076,7 +1078,9 @@ send /** @c method/iterator @e super(args) # args.size => num - @j super(args) # args.size => num + @j super を実行する。 + super(args) # args.size => num + flag 等オペランドの意味は send と同じ。 */ DEFINE_INSN invokesuper @@ -1101,7 +1105,8 @@ invokesuper /** @c method/iterator @e yield(args) # args.size => num, flag shows expand argument or not - @j yield(args) # args.size => num + @j yield を実行する。 + yield(args) # args.size => num */ DEFINE_INSN invokeblock @@ -1142,7 +1147,7 @@ leave /** @c method/iterator @e return from this vm loop - @j VM loop から抜ける + @j VM loop から抜ける。 */ DEFINE_INSN finish @@ -1165,7 +1170,7 @@ finish /** @c exception @e longjump - @j longjump + @j 大域ジャンプを行う。 */ DEFINE_INSN throw @@ -1240,7 +1245,7 @@ branchunless /** @c optimize @e inline cache - @j inline cache + @j インラインキャッシュが有効なら、値をスタックにプッシュして dst へジャンプする。 */ DEFINE_INSN getinlinecache @@ -1261,7 +1266,7 @@ getinlinecache /** @c optimize @e inline cache (once) - @j inline cache (once) + @j once を実現する。 */ DEFINE_INSN onceinlinecache @@ -1282,7 +1287,7 @@ onceinlinecache /** @c optimize @e set inline cache - @j set inline cahce + @j インラインキャッシュの値を設定する。 */ DEFINE_INSN setinlinecache @@ -1299,7 +1304,7 @@ setinlinecache /** @c optimize @e case dispatcher - @j case dispatcher + @j case 文で、可能なら表引きでジャンプする。 */ DEFINE_INSN opt_case_dispatch @@ -1308,7 +1313,7 @@ opt_case_dispatch () // inc += -1; { if (0) { - /* if some === method is overrided */ + /* TODO: if some === method is overrided */ } else { VALUE val; @@ -1324,7 +1329,7 @@ opt_case_dispatch /** @c optimize @e check environment - @j check environment + @j 将来の拡張用。 */ DEFINE_INSN opt_checkenv @@ -1343,7 +1348,6 @@ opt_checkenv /** simple functions */ - /** @c optimize @e optimized X+Y. @@ -1830,7 +1834,7 @@ opt_ge /** @c optimize @e << - @j << + @j 最適化された X<