mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
compile.c: true conditions
* compile.c (compile_branch_condition): add more always-true conditions to optimize away unreachable branch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
931581469f
commit
a170b76906
1 changed files with 12 additions and 0 deletions
12
compile.c
12
compile.c
|
@ -2784,6 +2784,18 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * cond,
|
|||
case NODE_LIT: /* NODE_LIT is always not true */
|
||||
case NODE_TRUE:
|
||||
case NODE_STR:
|
||||
case NODE_DSTR:
|
||||
case NODE_XSTR:
|
||||
case NODE_DXSTR:
|
||||
case NODE_DREGX:
|
||||
case NODE_DREGX_ONCE:
|
||||
case NODE_DSYM:
|
||||
case NODE_ARRAY:
|
||||
case NODE_ZARRAY:
|
||||
case NODE_HASH:
|
||||
case NODE_LAMBDA:
|
||||
case NODE_DEFN:
|
||||
case NODE_DEFS:
|
||||
/* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
|
||||
ADD_INSNL(ret, nd_line(cond), jump, then_label);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue