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

ruby-changes:47537

From: nobu <ko1@a...>
Date: Fri, 25 Aug 2017 11:37:46 +0900 (JST)
Subject: [ruby-changes:47537] nobu:r59653 (trunk): compile.c: moved comments [ci skip]

nobu	2017-08-25 11:37:38 +0900 (Fri, 25 Aug 2017)

  New Revision: 59653

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

  Log:
    compile.c: moved comments [ci skip]
    
    * compile.c (iseq_peephole_optimize): moved comments inside proper
      blocks.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 59652)
+++ compile.c	(revision 59653)
@@ -2158,16 +2158,6 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2158
   again:
     if (IS_INSN_ID(iobj, jump)) {
 	INSN *niobj, *diobj, *piobj;
-	/*
-	 *  useless jump elimination:
-	 *     jump LABEL1
-	 *     ...
-	 *   LABEL1:
-	 *     jump LABEL2
-	 *
-	 *   => in this case, first jump instruction should jump to
-	 *      LABEL2 directly
-	 */
 	diobj = (INSN *)get_destination_insn(iobj);
 	niobj = (INSN *)get_next_insn(iobj);
 
@@ -2183,6 +2173,16 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2173
 	}
 	else if (iobj != diobj && IS_INSN_ID(diobj, jump) &&
 		 OPERAND_AT(iobj, 0) != OPERAND_AT(diobj, 0)) {
+	    /*
+	     *  useless jump elimination:
+	     *     jump LABEL1
+	     *     ...
+	     *   LABEL1:
+	     *     jump LABEL2
+	     *
+	     *   => in this case, first jump instruction should jump to
+	     *      LABEL2 directly
+	     */
 	    replace_destination(iobj, diobj);
 	    remove_unreachable_chunk(iseq, iobj->link.next);
 	    goto again;
@@ -2208,24 +2208,24 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2208
 	    INSERT_ELEM_NEXT(&iobj->link, &popiobj->link);
 	    goto again;
 	}
-	/*
-	 * useless jump elimination (if/unless destination):
-	 *   if   L1
-	 *   jump L2
-	 * L1:
-	 *   ...
-	 * L2:
-	 *
-	 * ==>
-	 *   unless L2
-	 * L1:
-	 *   ...
-	 * L2:
-	 */
 	else if ((piobj = (INSN *)get_prev_insn(iobj)) != 0 &&
 		 (IS_INSN_ID(piobj, branchif) ||
 		  IS_INSN_ID(piobj, branchunless))) {
 	    if (niobj == (INSN *)get_destination_insn(piobj)) {
+		/*
+		 * useless jump elimination (if/unless destination):
+		 *   if   L1
+		 *   jump L2
+		 * L1:
+		 *   ...
+		 * L2:
+		 *
+		 * ==>
+		 *   unless L2
+		 * L1:
+		 *   ...
+		 * L2:
+		 */
 		piobj->insn_id = (IS_INSN_ID(piobj, branchif))
 		  ? BIN(branchunless) : BIN(branchif);
 		replace_destination(piobj, iobj);

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

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