Skip to content

Commit

Permalink
* insns.def (onceinlinecache): add exclusion control for a region
Browse files Browse the repository at this point in the history
  between onceinlinecache and setinlinecache.  [ruby-dev:39768]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
mame committed Apr 27, 2010
1 parent e02f7f7 commit e59b9d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue Apr 27 22:55:29 2010 Yusuke Endoh <[email protected]>

* 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 <[email protected]>

* iseq.c (set_relation): do not use top_wrapper as bottom of cref,
Expand Down
9 changes: 9 additions & 0 deletions bootstraptest/test_thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,12 @@ def m
'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
}
7 changes: 7 additions & 0 deletions insns.def
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,17 @@ onceinlinecache
()
(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;
Expand Down

0 comments on commit e59b9d3

Please sign in to comment.