1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* insns.def (opt_checkenv): remove unused instruction `opt_checkenv'.

* compile.c (iseq_compile_each): ditto.
* node.h: remove unused node `NODE_OPTBLOCK'.
* ext/objspace/objspace.c, gc.c (gc_mark_children): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2012-09-28 06:44:24 +00:00
parent 64f5b6aedc
commit e3990633cb
6 changed files with 10 additions and 39 deletions

View file

@ -1,3 +1,13 @@
Fri Sep 28 15:15:41 2012 Koichi Sasada <ko1@atdot.net>
* insns.def (opt_checkenv): remove unused instruction `opt_checkenv'.
* compile.c (iseq_compile_each): ditto.
* node.h: remove unused node `NODE_OPTBLOCK'.
* ext/objspace/objspace.c, gc.c (gc_mark_children): ditto.
Fri Sep 28 13:14:34 2012 Koichi Sasada <ko1@atdot.net>
* vm_core.h: now VM_DEBUG_BP_CHECK should be 1.

View file

@ -5131,20 +5131,6 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_OPTBLOCK:{
/* for optimize */
LABEL *redo_label = NEW_LABEL(0);
LABEL *next_label = NEW_LABEL(0);
iseq->compile_data->start_label = next_label;
iseq->compile_data->redo_label = redo_label;
ADD_LABEL(ret, redo_label);
COMPILE_(ret, "optblock body", node->nd_head, 1 /* pop */ );
ADD_LABEL(ret, next_label);
ADD_INSN(ret, 0, opt_checkenv);
break;
}
case NODE_PRELUDE:{
COMPILE_POPED(ret, "prelude", node->nd_head);
COMPILE_(ret, "body", node->nd_body, poped);

View file

@ -531,7 +531,6 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_ATTRASGN);
COUNT_NODE(NODE_PRELUDE);
COUNT_NODE(NODE_LAMBDA);
COUNT_NODE(NODE_OPTBLOCK);
#undef COUNT_NODE
default: node = INT2FIX(nodes[i]);
}

1
gc.c
View file

@ -2459,7 +2459,6 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
gc_mark(objspace, (VALUE)obj->as.node.u2.node, lev);
/* fall through */
case NODE_BLOCK: /* 1,3 */
case NODE_OPTBLOCK:
case NODE_ARRAY:
case NODE_DSTR:
case NODE_DXSTR:

View file

@ -1305,26 +1305,6 @@ opt_case_dispatch
}
}
/**
@c optimize
@e check environment
@j
*/
DEFINE_INSN
opt_checkenv
()
()
()
{
if (vm_base_ptr(reg_cfp) != GET_EP() + 1) {
VALUE *ep = vm_base_ptr(reg_cfp) - 1;
/* TODO: copy env and clean stack at creating env? */
*ep = *GET_EP();
SET_EP(ep);
}
}
/** simple functions */
/**

3
node.h
View file

@ -230,8 +230,6 @@ enum node_type {
#define NODE_PRELUDE NODE_PRELUDE
NODE_LAMBDA,
#define NODE_LAMBDA NODE_LAMBDA
NODE_OPTBLOCK,
#define NODE_OPTBLOCK NODE_OPTBLOCK
NODE_LAST
#define NODE_LAST NODE_LAST
};
@ -456,7 +454,6 @@ typedef struct RNode {
#define NEW_BMETHOD(b) NEW_NODE(NODE_BMETHOD,0,0,b)
#define NEW_ATTRASGN(r,m,a) NEW_NODE(NODE_ATTRASGN,r,m,a)
#define NEW_PRELUDE(p,b) NEW_NODE(NODE_PRELUDE,p,b,0)
#define NEW_OPTBLOCK(a) NEW_NODE(NODE_OPTBLOCK,a,0,0)
#define NEW_MEMO(a,b,c) NEW_NODE(NODE_MEMO,a,b,c)
#define roomof(x, y) ((sizeof(x) + sizeof(y) - 1) / sizeof(y))