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

ruby-changes:41330

From: nobu <ko1@a...>
Date: Fri, 1 Jan 2016 12:06:00 +0900 (JST)
Subject: [ruby-changes:41330] nobu:r53402 (trunk): compile.c: remove unreferred label

nobu	2016-01-01 12:05:55 +0900 (Fri, 01 Jan 2016)

  New Revision: 53402

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

  Log:
    compile.c: remove unreferred label
    
    * compile.c (remove_unreachable_chunk): remove unreferred label
      to optimize away unreachable chunk.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53401)
+++ ChangeLog	(revision 53402)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jan  1 12:05:53 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (remove_unreachable_chunk): remove unreferred label
+	  to optimize away unreachable chunk.
+
 Fri Jan  1 11:42:57 2016  James Edward Gray II  <james@g...>
 
 	* lib/csv.rb (CSV): Add a liberal_parsing option.
Index: compile.c
===================================================================
--- compile.c	(revision 53401)
+++ compile.c	(revision 53402)
@@ -1968,6 +1968,9 @@ remove_unreachable_chunk(LINK_ELEMENT *i https://github.com/ruby/ruby/blob/trunk/compile.c#L1968
 		break;
 	    }
 	}
+	else if (i->type == ISEQ_ELEMENT_LABEL) {
+	    if (((LABEL *)i)->refcnt > 0) break;
+	}
 	else break;
 	REMOVE_ELEM(i);
 	removed = 1;

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

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