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

ruby-changes:42701

From: nobu <ko1@a...>
Date: Tue, 26 Apr 2016 16:41:44 +0900 (JST)
Subject: [ruby-changes:42701] nobu:r54775 (trunk): compile.c: true conditions

nobu	2016-04-26 17:38:20 +0900 (Tue, 26 Apr 2016)

  New Revision: 54775

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

  Log:
    compile.c: true conditions
    
    * compile.c (compile_branch_condition): add more always-true
      conditions to optimize away unreachable branch.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 54774)
+++ compile.c	(revision 54775)
@@ -2784,6 +2784,18 @@ compile_branch_condition(rb_iseq_t *iseq https://github.com/ruby/ruby/blob/trunk/compile.c#L2784
       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;

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

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