[#11357] [PATCH] an analogue of `long long' — "Nobuyoshi.Nakada" <nobu.nakada@...>
なかだです。
まつもと ゆきひろです
えぐち@エスアンドイー です。
まつもと ゆきひろです
えぐち@エスアンドイー です。
まつもと ゆきひろです
>From: matz@zetabits.com (Yukihiro Matsumoto)
まつもと ゆきひろです
[#11440] class Character (was: Ruby I18N) — Yasushi Shoji <yashi@...>
[ruby-dev:11428] からの続きですが、threadは切りました。
高橋征義です。用語について。
At Wed, 8 Nov 2000 20:44:55 +0900,
高橋征義です。
At Thu, 9 Nov 2000 13:30:34 +0900,
まつもと ゆきひろです
[#11447] gets は secure? — Kazuhiro NISHIYAMA <zn@...>
出力がInsecureなのに入力はsecureなのでしょうか?
[#11467] debug write in regex.c? — "Nobuyoshi.Nakada" <nobu.nakada@...>
なかだです。
[#11500] rb_to_integer/rb_to_int — "Nobuyoshi.Nakada" <nobu.nakada@...>
なかだです。
[#11520] A problem of Socket methods on Windows — OKA Toshiyuki <oka@...>
岡と申します。
なかだです。
まつもと ゆきひろです
なかだです。
岡です。
なかだです。
なかだです。
岡です。
なかだです。
[#11569] blocking on socket? — Shugo Maeda <shugo@...>
前田です。
[#11591] object.c パッチ — Kazuhiro NISHIYAMA <zn@...>
使われてなかったnil_plusの削除とOBJ_INFECTへの変更です。
[#11611] return value of waitpid2 — Koji Arai <JCA02266@...>
新井です。
まつもと ゆきひろです
荒井です。いや、新井です。(よくあることさ)
まつもと ゆきひろです
新井です。
新井です。
[#11618] Re: class variable — "Koji Arai" <jca02266@...>
新井です
なかだです。
まつもと ゆきひろです
> まつもと ゆきひろです
まつもと ゆきひろです
まつもと ゆきひろです
新井です。
[#11641] eval too slow — Wakou Aoyama <wakou@...>
青山です。
[#11650] conflict of NODE_DREGX_ONCE — "Nobuyoshi.Nakada" <nobu.nakada@...>
なかだです。
まつもと ゆきひろです
[#11662] IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org>
In article <E140cR3-0002ls-00@ev.netlab.zetabits.co.jp>,
まつもと ゆきひろです
In article <E140fxW-0002u9-00@ev.netlab.zetabits.co.jp>,
In article <hvor93w5wb8.fsf@coulee.m17n.org>,
In article <hvoofz05uwz.fsf@coulee.m17n.org>,
まつもと ゆきひろです
新井です。
まつもと ゆきひろです
In article <E141eaC-0003w0-00@ev.netlab.zetabits.co.jp>,
まつもと ゆきひろです
In article <E142ZqF-0004rX-00@ev.netlab.zetabits.co.jp>,
まつもと ゆきひろです
In article <E143Zem-000271-00@ev.netlab.zetabits.co.jp>,
まつもと ゆきひろです
In article <E143amj-00028V-00@ev.netlab.zetabits.co.jp>,
[ruby-dev:11656] Re: conflict of NODE_DREGX_ONCE
なかだです。
At Mon, 27 Nov 2000 16:48:17 +0900
matz@zetabits.com (Yukihiro Matsumoto) wrote:
> | かなり苦しい例ですが、こんな風になります。
>
> <略>
>
> これはしょうがないと思うことにしました。
ありゃ、それは残念(^^;。
diff -pruPX ./.excludes current/eval.c devel/eval.c
--- current/eval.c Mon Nov 27 18:23:17 2000
+++ devel/eval.c Mon Nov 27 19:40:22 2000
@@ -1940,6 +1940,7 @@ call_trace_func(event, file, line, self,
if (state) JUMP_TAG(state);
}
+static int rb_thread_dead _((rb_thread_t th));
static void return_check _((void));
#define return_value(v) prot_tag->retval = (v)
@@ -2767,7 +2768,6 @@ rb_eval(self, n)
case NODE_DSTR:
case NODE_DXSTR:
case NODE_DREGX:
- case NODE_DREGX_ONCE:
{
VALUE str, str2;
NODE *list = node->nd_next;
@@ -2808,12 +2808,6 @@ rb_eval(self, n)
result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
node->nd_cflag);
break;
- case NODE_DREGX_ONCE: /* regexp expand once */
- result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
- node->nd_cflag);
- nd_set_type(node, NODE_LIT);
- node->nd_lit = result;
- break;
case NODE_DXSTR:
result = rb_funcall(self, '`', 1, str);
break;
@@ -2830,6 +2824,35 @@ rb_eval(self, n)
case NODE_LIT:
result = node->nd_lit;
+ break;
+
+ case NODE_DREGX_ONCE:
+ {
+ VALUE owner;
+ volatile NODE *nd = node;
+
+ while ((owner = nd->nd_owner) && !rb_thread_dead((rb_thread_t)RDATA(owner)->data)) {
+ rb_thread_schedule();
+ if (nd_type(nd) == NODE_LIT) {
+ RETURN(nd->nd_lit);
+ }
+ }
+ }
+
+ node->nd_owner = rb_thread_current();
+ PUSH_TAG(PROT_NONE);
+ if ((state = EXEC_TAG()) == 0) {
+ result = rb_eval(self, node->nd_next);
+ }
+ POP_TAG();
+ if (state) {
+ node->nd_owner = 0;
+ JUMP_TAG(state);
+ }
+ node->nd_lit = result;
+ node->nd_owner = 0;
+ node->nd_next = 0;
+ nd_set_type(node, NODE_LIT);
break;
case NODE_ATTRSET:
diff -pruPX ./.excludes current/gc.c devel/gc.c
--- current/gc.c Mon Nov 27 18:23:18 2000
+++ devel/gc.c Mon Nov 27 19:41:57 2000
@@ -438,6 +438,7 @@ rb_gc_mark(ptr)
case NODE_MASGN:
case NODE_RESCUE:
case NODE_RESBODY:
+ case NODE_DREGX_ONCE:
rb_gc_mark(obj->as.node.u2.node);
/* fall through */
case NODE_BLOCK: /* 1,3 */
@@ -446,7 +447,6 @@ rb_gc_mark(ptr)
case NODE_DXSTR:
case NODE_EVSTR:
case NODE_DREGX:
- case NODE_DREGX_ONCE:
case NODE_FBODY:
case NODE_ENSURE:
case NODE_CALL:
diff -pruPX ./.excludes current/node.h devel/node.h
--- current/node.h Tue Nov 21 23:26:23 2000
+++ devel/node.h Mon Nov 27 19:14:27 2000
@@ -227,6 +227,8 @@ typedef struct RNode {
#define nd_tag u1.id
#define nd_tval u2.value
+#define nd_owner u2.value
+
#define NEW_METHOD(n,x) rb_node_newnode(NODE_METHOD,x,n,0)
#define NEW_FBODY(n,i,o) rb_node_newnode(NODE_FBODY,n,i,o)
#define NEW_DEFN(i,a,d,p) rb_node_newnode(NODE_DEFN,p,i,NEW_RFUNC(a,d))
@@ -285,6 +287,7 @@ typedef struct RNode {
#define NEW_MATCH(c) rb_node_newnode(NODE_MATCH,c,0,0)
#define NEW_MATCH2(n1,n2) rb_node_newnode(NODE_MATCH2,n1,n2,0)
#define NEW_MATCH3(r,n2) rb_node_newnode(NODE_MATCH3,r,n2,0)
+#define NEW_DREGX_ONCE(n) rb_node_newnode(NODE_DREGX_ONCE,0,0,n)
#define NEW_LIT(l) rb_node_newnode(NODE_LIT,l,0,0)
#define NEW_STR(s) rb_node_newnode(NODE_STR,s,0,0)
#define NEW_DSTR(s) rb_node_newnode(NODE_DSTR,s,0,0)
diff -pruPX ./.excludes current/parse.y devel/parse.y
--- current/parse.y Mon Nov 27 18:23:22 2000
+++ devel/parse.y Mon Nov 27 19:35:20 2000
@@ -2397,8 +2397,11 @@ parse_regx(term, paren)
VALUE ss = rb_str_new(tok(), toklen());
list_append(list, NEW_STR(ss));
}
- nd_set_type(list, once?NODE_DREGX_ONCE:NODE_DREGX);
+ nd_set_type(list, NODE_DREGX);
list->nd_cflag = options | kcode;
+ if (once) {
+ list = NEW_DREGX_ONCE(list);
+ }
yylval.node = list;
return tDREGEXP;
}
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦