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

ruby-changes:33925

From: nagachika <ko1@a...>
Date: Mon, 19 May 2014 00:54:46 +0900 (JST)
Subject: [ruby-changes:33925] nagachika:r46006 (ruby_2_1): merge revision(s) r45553, r45554, r45557, r45558, r45561, r45566, r45567: [Backport #9718]

nagachika	2014-05-19 00:54:39 +0900 (Mon, 19 May 2014)

  New Revision: 46006

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

  Log:
    merge revision(s) r45553,r45554,r45557,r45558,r45561,r45566,r45567: [Backport #9718]
    
    * array.c (rb_ary_modify): remember shared array owner if a shared
      array owner is promoted and a shared array is not promoted.
      Now, shared array is WB-unprotected so that shared arrays are not
      promoted.  All objects referred from shared array should be marked
      correctly.
      [ruby-core:61919] [ruby-trunk - Bug #9718]
    
    * test/ruby/test_array.rb: add a test for above.
    
    * test/ruby/test_array.rb: remove useless `assert'.

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/array.c
    branches/ruby_2_1/test/ruby/envutil.rb
    branches/ruby_2_1/test/ruby/test_array.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/array.c
===================================================================
--- ruby_2_1/array.c	(revision 46005)
+++ ruby_2_1/array.c	(revision 46006)
@@ -343,6 +343,11 @@ rb_ary_modify(VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/array.c#L343
             ARY_SET_CAPA(ary, len);
             ARY_SET_PTR(ary, ptr);
         }
+
+	/* TODO: age2 promotion, OBJ_PROMOTED() checks not infant. */
+	if (OBJ_PROMOTED(ary) && !OBJ_PROMOTED(shared)) {
+	    rb_gc_writebarrier_remember_promoted(ary);
+	}
     }
 }
 
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 46005)
+++ ruby_2_1/ChangeLog	(revision 46006)
@@ -1,3 +1,20 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon May 19 00:47:00 2014  Koichi Sasada  <ko1@a...>
+
+	* test/ruby/test_array.rb: remove useless `assert'.
+
+Mon May 19 00:47:00 2014  Koichi Sasada  <ko1@a...>
+
+	* array.c (rb_ary_modify): remember shared array owner if a shared
+	  array owner is promoted and a shared array is not promoted.
+
+	  Now, shared array is WB-unprotected so that shared arrays are not
+	  promoted.  All objects referred from shared array should be marked
+	  correctly.
+
+	  [ruby-core:61919] [ruby-trunk - Bug #9718]
+
+	* test/ruby/test_array.rb: add a test for above.
+
 Mon May 19 00:26:53 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_yylex): only a newline after label should be
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 46005)
+++ ruby_2_1/version.h	(revision 46006)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
 #define RUBY_RELEASE_DATE "2014-05-19"
-#define RUBY_PATCHLEVEL 103
+#define RUBY_PATCHLEVEL 104
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 5
Index: ruby_2_1/test/ruby/test_array.rb
===================================================================
--- ruby_2_1/test/ruby/test_array.rb	(revision 46005)
+++ ruby_2_1/test/ruby/test_array.rb	(revision 46006)
@@ -2389,7 +2389,7 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_array.rb#L2389
     assert_equal([], a.rotate!(13))
     assert_equal([], a.rotate!(-13))
     a = [].freeze
-    assert_raise_with_message(RuntimeError, /can't modify frozen/) {a.rotate!}
+    assert_raise_with_message(RuntimeError, /can\'t modify frozen/) {a.rotate!}
     a = [1,2,3]
     assert_raise(ArgumentError) { a.rotate!(1, 1) }
   end
@@ -2428,4 +2428,28 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_array.rb#L2428
 
     assert_include([4, 7], a.bsearch {|x| (2**100).coerce((1 - x / 4) * (2**100)).first })
   end
+
+  def test_shared_marking
+    reduce = proc do |s|
+      s.gsub(/(verify_internal_consistency_reachable_i:\sWB\smiss\s\S+\s\(T_ARRAY\)\s->\s)\S+\s\((proc|T_NONE)\)\n
+             \K(?:\1\S+\s\(\2\)\n)*/x) do
+        "...(snip #{$&.count("\n")} lines)...\n"
+      end
+    end
+    begin
+      assert_normal_exit(<<-EOS, '[Bug #9718]', timeout: 5, stdout_filter: reduce)
+      queue = []
+      50.times do
+        10_000.times do
+          queue << lambda{}
+        end
+        GC.start(full_mark: false, immediate_sweep: true)
+        GC.verify_internal_consistency
+        queue.shift.call
+      end
+    EOS
+    rescue Timeout::Error => e
+      skip e.message
+    end
+  end
 end
Index: ruby_2_1/test/ruby/envutil.rb
===================================================================
--- ruby_2_1/test/ruby/envutil.rb	(revision 46005)
+++ ruby_2_1/test/ruby/envutil.rb	(revision 46006)
@@ -30,7 +30,9 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/envutil.rb#L30
   LANG_ENVS = %w"LANG LC_ALL LC_CTYPE"
 
   def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = false,
-                  encoding: nil, timeout: 10, reprieve: 1, **opt)
+                  encoding: nil, timeout: 10, reprieve: 1,
+                  stdout_filter: nil, stderr_filter: nil,
+                  **opt)
     in_c, in_p = IO.pipe
     out_p, out_c = IO.pipe if capture_stdout
     err_p, err_c = IO.pipe if capture_stderr && capture_stderr != :merge_to_stdout
@@ -84,6 +86,8 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/envutil.rb#L86
       err_p.close if capture_stderr && capture_stderr != :merge_to_stdout
       Process.wait pid
       status = $?
+      stdout = stdout_filter.call(stdout) if stdout_filter
+      stderr = stderr_filter.call(stderr) if stderr_filter
       return stdout, stderr, status
     end
   ensure

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r45553-45554,45557-45558,45561,45566-45567


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

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