[前][次][番号順一覧][スレッド一覧]

ruby-changes:40032

From: nobu <ko1@a...>
Date: Mon, 12 Oct 2015 11:48:44 +0900 (JST)
Subject: [ruby-changes:40032] nobu:r52113 (trunk): node.h: no attrset ID in NODE

nobu	2015-10-12 11:48:37 +0900 (Mon, 12 Oct 2015)

  New Revision: 52113

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52113

  Log:
    node.h: no attrset ID in NODE
    
    * compile.c (iseq_compile_each), node.h (NEW_OP_ASGN22): attrset
      ID no longer needs to be stored in a NODE, create at byte code
      generation.

  Modified files:
    trunk/compile.c
    trunk/node.h
Index: compile.c
===================================================================
--- compile.c	(revision 52112)
+++ compile.c	(revision 52113)
@@ -4315,6 +4315,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4315
       }
       case NODE_OP_ASGN2:{
 	ID atype = node->nd_next->nd_mid;
+	ID vid = node->nd_next->nd_vid, aid = rb_id_attrset(vid);
 	VALUE asgnflag;
 	LABEL *lfin = NEW_LABEL(line);
 	LABEL *lcfin = NEW_LABEL(line);
@@ -4362,7 +4363,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4363
 
 	asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
 	ADD_INSN(ret, line, dup);
-	ADD_SEND(ret, line, node->nd_next->nd_vid, INT2FIX(0));
+	ADD_SEND(ret, line, vid, INT2FIX(0));
 
 	if (atype == 0 || atype == 1) {	/* 0: OR or 1: AND */
 	    ADD_INSN(ret, line, dup);
@@ -4376,7 +4377,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4377
 	    COMPILE(ret, "NODE_OP_ASGN2 val", node->nd_value);
 	    ADD_INSN(ret, line, swap);
 	    ADD_INSN1(ret, line, topn, INT2FIX(1));
-	    ADD_SEND_WITH_FLAG(ret, line, node->nd_next->nd_aid, INT2FIX(1), INT2FIX(asgnflag));
+	    ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
 	    ADD_INSNL(ret, line, jump, lfin);
 
 	    ADD_LABEL(ret, lcfin);
@@ -4397,7 +4398,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4398
 		ADD_INSN(ret, line, swap);
 		ADD_INSN1(ret, line, topn, INT2FIX(1));
 	    }
-	    ADD_SEND_WITH_FLAG(ret, line, node->nd_next->nd_aid, INT2FIX(1), INT2FIX(asgnflag));
+	    ADD_SEND_WITH_FLAG(ret, line, aid, INT2FIX(1), INT2FIX(asgnflag));
 	    ADD_INSN(ret, line, pop);
 	}
 	break;
Index: node.h
===================================================================
--- node.h	(revision 52112)
+++ node.h	(revision 52113)
@@ -395,7 +395,7 @@ typedef struct RNode { https://github.com/ruby/ruby/blob/trunk/node.h#L395
 #define NEW_CVDECL(v,val) NEW_NODE(NODE_CVDECL,v,val,0)
 #define NEW_OP_ASGN1(p,id,a) NEW_NODE(NODE_OP_ASGN1,p,id,a)
 #define NEW_OP_ASGN2(r,i,o,val) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o))
-#define NEW_OP_ASGN22(i,o) NEW_NODE(NODE_OP_ASGN2,i,o,rb_id_attrset(i))
+#define NEW_OP_ASGN22(i,o) NEW_NODE(NODE_OP_ASGN2,i,o,0)
 #define NEW_OP_ASGN_OR(i,val) NEW_NODE(NODE_OP_ASGN_OR,i,val,0)
 #define NEW_OP_ASGN_AND(i,val) NEW_NODE(NODE_OP_ASGN_AND,i,val,0)
 #define NEW_OP_CDECL(v,op,val) NEW_NODE(NODE_OP_CDECL,v,val,op)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]