summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-17 07:16:50 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-17 07:16:50 (GMT)
commite88fd0606b00c6f796d6ce341f400c9f90b90ca1 (patch)
tree34d8a99e6da9eb95e645116f0f27a14c04b1f60c /compile.c
parent1b43644edc85a93bfc9228588c065c87f975cd93 (diff)
Remove the level information from throw instruction
It is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index 12233ff..22a03ba 100644
--- a/compile.c
+++ b/compile.c
@@ -5361,7 +5361,7 @@ static int
compile_break(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
{
const int line = nd_line(node);
- unsigned long level = 0;
+ unsigned long throw_flag = 0;
if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
/* while/until */
@@ -5382,7 +5382,7 @@ compile_break(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, i
break_by_insn:
/* escape from block */
CHECK(COMPILE(ret, "break val (block)", node->nd_stts));
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_BREAK));
+ ADD_INSN1(ret, line, throw, INT2FIX(throw_flag | TAG_BREAK));
if (popped) {
ADD_INSN(ret, line, pop);
}
@@ -5401,13 +5401,11 @@ compile_break(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, i
break;
}
- level++;
if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- level = VM_THROW_NO_ESCAPE_FLAG;
+ throw_flag = VM_THROW_NO_ESCAPE_FLAG;
goto break_by_insn;
}
else if (ip->body->type == ISEQ_TYPE_BLOCK) {
- level <<= VM_THROW_LEVEL_SHIFT;
goto break_by_insn;
}
else if (ip->body->type == ISEQ_TYPE_EVAL) {
@@ -5426,7 +5424,7 @@ static int
compile_next(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
{
const int line = nd_line(node);
- unsigned long level = 0;
+ unsigned long throw_flag = 0;
if (ISEQ_COMPILE_DATA(iseq)->redo_label != 0) {
LABEL *splabel = NEW_LABEL(0);
@@ -5470,7 +5468,7 @@ compile_next(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, in
break;
}
- level = VM_THROW_NO_ESCAPE_FLAG;
+ throw_flag = VM_THROW_NO_ESCAPE_FLAG;
if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
/* while loop */
break;
@@ -5486,7 +5484,7 @@ compile_next(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, in
}
if (ip != 0) {
CHECK(COMPILE(ret, "next val", node->nd_stts));
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_NEXT));
+ ADD_INSN1(ret, line, throw, INT2FIX(throw_flag | TAG_NEXT));
if (popped) {
ADD_INSN(ret, line, pop);
@@ -5538,7 +5536,6 @@ compile_redo(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, in
}
else {
const rb_iseq_t *ip = iseq;
- const unsigned long level = VM_THROW_NO_ESCAPE_FLAG;
while (ip) {
if (!ISEQ_COMPILE_DATA(ip)) {
@@ -5560,7 +5557,7 @@ compile_redo(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, in
}
if (ip != 0) {
ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, throw, INT2FIX(level | TAG_REDO));
+ ADD_INSN1(ret, line, throw, INT2FIX(VM_THROW_NO_ESCAPE_FLAG | TAG_REDO));
if (popped) {
ADD_INSN(ret, line, pop);