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

ruby-changes:5042

From: mame <ko1@a...>
Date: Thu, 22 May 2008 23:46:09 +0900 (JST)
Subject: [ruby-changes:5042] mame - Ruby:r16535 (trunk): * compile.c (get_destination_insn, get_next_insn, get_prev_insn):

mame	2008-05-22 23:45:54 +0900 (Thu, 22 May 2008)

  New Revision: 16535

  Modified files:
    trunk/ChangeLog
    trunk/bootstraptest/test_jump.rb
    trunk/compile.c

  Log:
    * compile.c (get_destination_insn, get_next_insn, get_prev_insn):
      peephole optimization should not ignore ISEQ_ELEMENT_ADJUST.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=16535&r2=16534&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_jump.rb?r1=16535&r2=16534&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16535&r2=16534&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16534)
+++ ChangeLog	(revision 16535)
@@ -1,3 +1,8 @@
+Thu May 22 23:45:17 2008  Yusuke Endoh  <mame@t...>
+
+	* compile.c (get_destination_insn, get_next_insn, get_prev_insn):
+	  peephole optimization should not ignore ISEQ_ELEMENT_ADJUST.
+
 Thu May 22 20:20:54 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* marshal.c (check_dump_arg, check_load_arg): check if reentered.
Index: bootstraptest/test_jump.rb
===================================================================
--- bootstraptest/test_jump.rb	(revision 16534)
+++ bootstraptest/test_jump.rb	(revision 16535)
@@ -248,3 +248,14 @@
     end
   end
 }, "[ruby-dev:31698]"
+
+assert_normal_exit %q{
+  f = 0
+  1.times do
+    begin
+      f += 1
+    ensure
+      redo unless f > 2
+    end
+  end
+}
Index: compile.c
===================================================================
--- compile.c	(revision 16534)
+++ compile.c	(revision 16535)
@@ -1362,7 +1362,7 @@
 
     list = lobj->link.next;
     while (list) {
-	if (list->type == ISEQ_ELEMENT_INSN) {
+	if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
 	    break;
 	}
 	list = list->next;
@@ -1376,7 +1376,7 @@
     LINK_ELEMENT *list = iobj->link.next;
 
     while (list) {
-	if (list->type == ISEQ_ELEMENT_INSN) {
+	if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
 	    return list;
 	}
 	list = list->next;
@@ -1390,7 +1390,7 @@
     LINK_ELEMENT *list = iobj->link.prev;
 
     while (list) {
-	if (list->type == ISEQ_ELEMENT_INSN) {
+	if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) {
 	    return list;
 	}
 	list = list->prev;

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

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