[#46329] [ruby-trunk - Feature #7252][Assigned] version number of 2.0 release — "usa (Usaku NAKAMURA)" <usa@...>
>> 旧来の開発版/開発版とかもういらないんじゃないですかね。
前田です。
[#46344] Subversion repository breakage and rollback — "NARUSE, Yui" <naruse@...>
Sorry for this trouble,
[#46346] [ruby-trunk - Bug #7262][Open] module extension (#include/#prepend) in refinements — "matz (Yukihiro Matsumoto)" <matz@...>
[#46350] RubySpecメンテナ — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
On 11/01/2012 07:43 PM, Yukihiro Matsumoto wrote:
2012年11月2日 12:44 Urabe Shyouhei <shyouhei@ruby-lang.org>:
まつもと ゆきひろです
遠藤です。
まつもと ゆきひろです
On 11/02/2012 03:47 AM, Yukihiro Matsumoto wrote:
[#46414] [ruby-trunk - Bug #7287][Open] please rename atomic.h which conflicts with /usr/include/atomic.h in Solaris10 — "ngoto (Naohisa Goto)" <ngotogenome@...>
きしもとです
[#46434] トラップハンドラで許されない操作はなにか — KOSAKI Motohiro <kosaki.motohiro@...>
GyRCPi46aiRHJDkbKEIKCltCdWcgIzcxMzRdIBskQiRyRDQkWSRGJCQkRj88SiUkSjtFTU1MZEJq
近永と申します。
2012/11/9 Tomoyuki Chikanaga <nagachika00@gmail.com>:
[#46477] Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — SASADA Koichi <ko1@...>
refinement を導入するときの性能に対する excuse が「method cache に殆どあ
前田です。
ささだです.
前田です。
ささだです.
前田です。
(2012/11/12 18:20), Shugo Maeda wrote:
前田です。
なかだです。
前田です。
なかだです。
前田です。
(2012/11/16 17:22), Shugo Maeda wrote:
前田です。
[#46494] Refinement仕様 — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
[#46509] [ruby-trunk - Bug #7344][Open] gem pristine bigdecimal が失敗してしまう — "hsbt (Hiroshi SHIBATA)" <shibata.hiroshi@...>
[#46540] Re: [ruby-cvs:44900] kosaki:r37730 (trunk): * thread.c, vm_core.h: big rename th to cur_th when works only — SASADA Koichi <ko1@...>
こういう変更を,理由の説明や事前の連絡無く行われると混乱します.
2012/11/19 SASADA Koichi <ko1@atdot.net>:
(2012/11/19 21:57), KOSAKI Motohiro wrote:
[#46547] ベンチマークが終わらない — SASADA Koichi <ko1@...>
shugo さんの refinement の修正についてベンチマークを取ろうと,昨日からす
定点観測でもベンチマークがおわってないみたいですね…(タイムアウト処理入れているので気が付きませんでした)
(2012/11/20 8:04), Narihiro Nakamura wrote:
2012年11月20日 8:11 SASADA Koichi <ko1@atdot.net>:
(2012/11/21 16:05), NARUSE, Yui wrote:
[#46574] Re: [ruby-cvs:44880] tadf:r37710 (trunk): * bignum.c (rb_cstr_to_inum): should accept underscores of — "NARUSE, Yui" <naruse@...>
2012/11/18 <tadf@ruby-lang.org>:
[#46641] Fwd: [ruby-changes:25810] kosaki:r37867 (trunk): * thread.c (rb_mutex_trylock, rb_mutex_unlock, mutex_sleep): — SASADA Koichi <ko1@...>
Mutex#lock とかを,trap handler 中で出来ない,ってのは,すみません,どの
> Mutex#lock とかを,trap handler 中で出来ない,ってのは,すみません,どの
[#46647] [ruby-trunk - Bug #7452][Assigned] Main thread is stopped after running finalizers if the main thread has a finalizer — "mrkn (Kenta Murata)" <muraken@...>
[ruby-dev:46477] Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
refinement を導入するときの性能に対する excuse が「method cache に殆どあ
たるから,(refinement に関係無い部分の)性能低下はない」という話だった
と思うのですが,今回のコードを見ると,それなりにメソッド探索コストが増え
そうな気がするんですが,いかがでしょうか.
昨日相談させて頂いたとおり,実装としては refinement は
- メソッド探索から refinement 関係の処理を削除
- 探索したメソッドが refine されたメソッドだったら,
その時点で適切なメソッドを呼び出す
のが良いと思います.
ちょっと,現状のコードは受け入れられません.
-------- Original Message --------
Subject: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h
(rb_call_info_t::refinements), compile.c (new_callinfo):
Date: Sun, 11 Nov 2012 11:42:16 +0900 (JST)
From: shugo <ko1@atdot.net>
Reply-To: ruby-changes@quickml.atdot.net
To: ruby-changes@quickml.atdot.net
shugo 2012-11-11 11:42:04 +0900 (Sun, 11 Nov 2012)
New Revision: 37616
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37616
Log:
* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
add a new field for inline method cache.
* vm_insnhelper.c (vm_search_method): check rb_call_info_t::refinements
not to confuse inline method cache when module_eval is used with
refinements.
* test/ruby/test_refinement.rb: related test.
Modified files:
trunk/ChangeLog
trunk/compile.c
trunk/test/ruby/test_refinement.rb
trunk/vm_core.h
trunk/vm_insnhelper.c
Index: ChangeLog
===================================================================
--- ChangeLog (revision 37615)
+++ ChangeLog (revision 37616)
@@ -1,3 +1,14 @@
+Sun Nov 11 11:36:19 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
+ add a new field for inline method cache.
+
+ * vm_insnhelper.c (vm_search_method): check rb_call_info_t::refinements
+ not to confuse inline method cache when module_eval is used with
+ refinements.
+
+ * test/ruby/test_refinement.rb: related test.
+
Sun Nov 11 08:45:45 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
* ruby.c: removed a comma before "before"
Index: vm_core.h
===================================================================
--- vm_core.h (revision 37615)
+++ vm_core.h (revision 37616)
@@ -153,6 +153,7 @@
/* inline cache: keys */
VALUE vmstat;
VALUE klass;
+ VALUE refinements;
/* inline cache: values */
const rb_method_entry_t *me;
Index: compile.c
===================================================================
--- compile.c (revision 37615)
+++ compile.c (revision 37616)
@@ -954,6 +954,7 @@
}
}
ci->vmstat = 0;
+ ci->refinements = Qundef;
ci->blockptr = 0;
ci->recv = Qundef;
ci->call = 0; /* TODO: should set default function? */
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c (revision 37615)
+++ vm_insnhelper.c (revision 37616)
@@ -843,19 +843,30 @@
vm_search_method(rb_call_info_t *ci, VALUE recv)
{
VALUE klass = CLASS_OF(recv);
+ NODE *cref = rb_vm_cref();
+ VALUE refinements = Qnil;
+ if (cref && !NIL_P(cref->nd_refinements)) {
+ refinements = cref->nd_refinements;
+ }
+
#if OPT_INLINE_METHOD_CACHE
- if (LIKELY(GET_VM_STATE_VERSION() == ci->vmstat && klass ==
ci->klass)) {
+ if (LIKELY(GET_VM_STATE_VERSION() == ci->vmstat && klass ==
ci->klass &&
+ refinements == ci->refinements)) {
/* cache hit! */
}
else {
- ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class);
+ ci->me = rb_method_entry_get_with_refinements(refinements, klass,
+ ci->mid,
+ &ci->defined_class);
ci->klass = klass;
+ ci->refinements = refinements;
ci->vmstat = GET_VM_STATE_VERSION();
ci->call = vm_call_general;
}
#else
- ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class);
+ ci->me = rb_method_entry_get_with_refinements(refinements, klass,
ci->mid,
+ &ci->defined_class);
ci->call = vm_call_general;
ci->klass = klass;
#endif
Index: test/ruby/test_refinement.rb
===================================================================
--- test/ruby/test_refinement.rb (revision 37615)
+++ test/ruby/test_refinement.rb (revision 37616)
@@ -685,4 +685,28 @@
assert_equal("#<refinement:#{c.inspect}@#{m.inspect}>",
m.refinements[c].inspect)
end
+
+ module InlineMethodCache
+ class C
+ def foo
+ "original"
+ end
+ end
+
+ module M
+ refine C do
+ def foo
+ "refined"
+ end
+ end
+ end
+ end
+
+ def test_inline_method_cache
+ c = InlineMethodCache::C.new
+ f = Proc.new { c.foo }
+ assert_equal("original", f.call)
+ assert_equal("refined", InlineMethodCache::M.module_eval(&f))
+ assert_equal("original", f.call)
+ end
end
--
ML: ruby-changes@quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml/