ruby-changes:15606
From: mame <ko1@a...>
Date: Tue, 27 Apr 2010 23:06:31 +0900 (JST)
Subject: [ruby-changes:15606] Ruby:r27515 (trunk): * insns.def (onceinlinecache): add exclusion control for a region
mame 2010-04-27 23:06:16 +0900 (Tue, 27 Apr 2010) New Revision: 27515 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27515 Log: * insns.def (onceinlinecache): add exclusion control for a region between onceinlinecache and setinlinecache. [ruby-dev:39768] Modified files: trunk/ChangeLog trunk/bootstraptest/test_thread.rb trunk/insns.def Index: ChangeLog =================================================================== --- ChangeLog (revision 27514) +++ ChangeLog (revision 27515) @@ -1,3 +1,8 @@ +Tue Apr 27 22:55:29 2010 Yusuke Endoh <mame@t...> + + * insns.def (onceinlinecache): add exclusion control for a region + between onceinlinecache and setinlinecache. [ruby-dev:39768] + Tue Apr 27 22:40:54 2010 Yusuke Endoh <mame@t...> * iseq.c (set_relation): do not use top_wrapper as bottom of cref, Index: insns.def =================================================================== --- insns.def (revision 27514) +++ insns.def (revision 27515) @@ -1199,10 +1199,17 @@ () (VALUE val) { + retry: if (ic->ic_vmstat) { val = ic->ic_value.value; JUMP(dst); } + else if (ic->ic_value.value == Qundef) + { + RUBY_VM_CHECK_INTS(); + rb_thread_schedule(); + goto retry; + } else { /* none */ ic->ic_value.value = Qundef; Index: bootstraptest/test_thread.rb =================================================================== --- bootstraptest/test_thread.rb (revision 27514) +++ bootstraptest/test_thread.rb (revision 27515) @@ -443,3 +443,12 @@ 'ok' end } + +assert_equal 'foo', %q{ + f = proc {|s| /#{ sleep 1; s }/o } + [ Thread.new { f.call("foo"); nil }, + Thread.new { sleep 0.5; f.call("bar"); nil }, + ].each {|t| t.join } + GC.start + f.call.source +} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/