зеркало из https://github.com/github/ruby.git
Remove nd_entry from NODE_GASGN and NODE_GVAR
After a0f12a0258
NODE_GASGN and
NODE_GVAR hold same value on both nd_vid and nd_entry.
This commit stops setting value to nd_entry and makes to use only
nd_vid.
This commit is contained in:
Родитель
ff55238913
Коммит
00054de6b5
5
.gdbinit
5
.gdbinit
|
@ -689,11 +689,6 @@ define nd_stts
|
|||
end
|
||||
|
||||
|
||||
define nd_entry
|
||||
printf "%su3.entry%s: ", $color_highlite, $color_end
|
||||
p ($arg0).u3.entry
|
||||
end
|
||||
|
||||
define nd_vid
|
||||
printf "%su1.id%s: ", $color_highlite, $color_end
|
||||
p ($arg0).u1.id
|
||||
|
|
|
@ -5348,7 +5348,7 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
|
|||
case NODE_GVAR:
|
||||
ADD_INSN(ret, line_node, putnil);
|
||||
ADD_INSN3(ret, line_node, defined, INT2FIX(DEFINED_GVAR),
|
||||
ID2SYM(node->nd_entry), PUSH_VAL(DEFINED_GVAR));
|
||||
ID2SYM(node->nd_vid), PUSH_VAL(DEFINED_GVAR));
|
||||
return;
|
||||
|
||||
case NODE_CVAR:
|
||||
|
@ -9471,7 +9471,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const no
|
|||
if (!popped) {
|
||||
ADD_INSN(ret, node, dup);
|
||||
}
|
||||
ADD_INSN1(ret, node, setglobal, ID2SYM(node->nd_entry));
|
||||
ADD_INSN1(ret, node, setglobal, ID2SYM(node->nd_vid));
|
||||
break;
|
||||
}
|
||||
case NODE_IASGN:{
|
||||
|
@ -9601,7 +9601,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const no
|
|||
break;
|
||||
}
|
||||
case NODE_GVAR:{
|
||||
ADD_INSN1(ret, node, getglobal, ID2SYM(node->nd_entry));
|
||||
ADD_INSN1(ret, node, getglobal, ID2SYM(node->nd_vid));
|
||||
if (popped) {
|
||||
ADD_INSN(ret, node, pop);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
#define SIMPLE_FIELD1(name, ann) SIMPLE_FIELD(FIELD_NAME_LEN(name, ann), FIELD_NAME_DESC(name, ann))
|
||||
#define F_CUSTOM1(name, ann) SIMPLE_FIELD1(#name, ann)
|
||||
#define F_ID(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name)
|
||||
#define F_GENTRY(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name)
|
||||
#define F_INT(name, ann) SIMPLE_FIELD1(#name, ann) A_INT(node->name)
|
||||
#define F_LONG(name, ann) SIMPLE_FIELD1(#name, ann) A_LONG(node->name)
|
||||
#define F_LIT(name, ann) SIMPLE_FIELD1(#name, ann) A_LIT(node->name)
|
||||
|
@ -436,9 +435,9 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
|
|||
return;
|
||||
case NODE_GASGN:
|
||||
ANN("global variable assignment");
|
||||
ANN("format: [nd_entry](gvar) = [nd_value]");
|
||||
ANN("format: [nd_vid](gvar) = [nd_value]");
|
||||
ANN("example: $x = foo");
|
||||
F_GENTRY(nd_entry, "global variable");
|
||||
F_ID(nd_vid, "global variable");
|
||||
LAST_NODE;
|
||||
F_NODE(nd_value, "rvalue");
|
||||
return;
|
||||
|
@ -651,9 +650,9 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
|
|||
|
||||
case NODE_GVAR:
|
||||
ANN("global variable reference");
|
||||
ANN("format: [nd_entry](gvar)");
|
||||
ANN("format: [nd_vid](gvar)");
|
||||
ANN("example: $x");
|
||||
F_GENTRY(nd_entry, "global variable");
|
||||
F_ID(nd_vid, "global variable");
|
||||
return;
|
||||
|
||||
case NODE_NTH_REF:
|
||||
|
|
|
@ -59,7 +59,7 @@ code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2)
|
|||
#define NEW_ZLIST(loc) NEW_NODE(NODE_ZLIST,0,0,0,loc)
|
||||
#define NEW_HASH(a,loc) NEW_NODE(NODE_HASH,a,0,0,loc)
|
||||
#define NEW_MASGN(l,r,loc) NEW_NODE(NODE_MASGN,l,0,r,loc)
|
||||
#define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,v,loc)
|
||||
#define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,0,loc)
|
||||
#define NEW_LASGN(v,val,loc) NEW_NODE(NODE_LASGN,v,val,0,loc)
|
||||
#define NEW_DASGN(v,val,loc) NEW_NODE(NODE_DASGN,v,val,0,loc)
|
||||
#define NEW_IASGN(v,val,loc) NEW_NODE(NODE_IASGN,v,val,0,loc)
|
||||
|
@ -71,7 +71,7 @@ code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2)
|
|||
#define NEW_OP_ASGN_OR(i,val,loc) NEW_NODE(NODE_OP_ASGN_OR,i,val,0,loc)
|
||||
#define NEW_OP_ASGN_AND(i,val,loc) NEW_NODE(NODE_OP_ASGN_AND,i,val,0,loc)
|
||||
#define NEW_OP_CDECL(v,op,val,loc) NEW_NODE(NODE_OP_CDECL,v,val,op,loc)
|
||||
#define NEW_GVAR(v,loc) NEW_NODE(NODE_GVAR,v,0,v,loc)
|
||||
#define NEW_GVAR(v,loc) NEW_NODE(NODE_GVAR,v,0,0,loc)
|
||||
#define NEW_LVAR(v,loc) NEW_NODE(NODE_LVAR,v,0,0,loc)
|
||||
#define NEW_DVAR(v,loc) NEW_NODE(NODE_DVAR,v,0,0,loc)
|
||||
#define NEW_IVAR(v,loc) NEW_NODE(NODE_IVAR,v,0,0,loc)
|
||||
|
|
|
@ -146,7 +146,6 @@ enum node_type {
|
|||
|
||||
#define nd_stts u1.node
|
||||
|
||||
#define nd_entry u3.id
|
||||
#define nd_vid u1.id
|
||||
|
||||
#define nd_var u1.node
|
||||
|
|
Загрузка…
Ссылка в новой задаче