[#59445] [ruby-trunk - Bug #9335][Open] dynamic rescue regression in Ruby 2.1 — "fdr (Daniel Farina)" <daniel@...>
[#59462] [ruby-trunk - Bug #9342][Open] [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3 — "jsc (Justin Collins)" <redmine@...>
[#59466] [ruby-trunk - Bug #9343][Open] [PATCH] SizedQueue#max= wakes up waiters properly — "normalperson (Eric Wong)" <normalperson@...>
Issue #9343 has been updated by Eric Wong.
[#59498] [ruby-trunk - Bug #9352][Open] [BUG] rb_sys_fail_str(connect(2) for [fe80::1%lo0]:3000) - errno == 0 — "kain (Claudio Poli)" <claudio@...>
[#59516] [ruby-trunk - Bug #9356][Open] TCPSocket.new does not seem to handle INTR — "charliesome (Charlie Somerville)" <charliesome@...>
Issue #9356 has been updated by Shugo Maeda.
[#59517] [ruby-trunk - Bug #9357][Open] TracePoint's c_return traces return from call to 'trace' — "andhapp (Anuj Dutta)" <anuj@...>
[#59538] [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — "shyouhei (Shyouhei Urabe)" <shyouhei@...>
Intersting challenge.
On 01/06/2014 04:52 PM, SASADA Koichi wrote:
On 01/06/2014 06:11 PM, Urabe Shyouhei wrote:
(2014/01/06 23:10), Urabe Shyouhei wrote:
On 01/07/2014 07:36 AM, SASADA Koichi wrote:
Hi, I noticed a trivial typo in array.c, and it fails building struct.c
Eric Wong <normalperson@yhbt.net> wrote:
Btw, I just pushed a few trivial fixes up (a few more failures below):
OK, last update of the night :o I think everything is good on 32-bit...
Eric Wong <normalperson@yhbt.net> wrote:
Btw, I started working on cachelined-time branch on git://80x24.org/ruby
Eric Wong <normalperson@yhbt.net> wrote:
On 01/06/2014 12:02 PM, Eric Wong wrote:
Urabe Shyouhei <shyouhei@ruby-lang.org> wrote:
[#59564] [ruby-trunk - Bug #9365][Open] Sporadic TypeError (wrong argument type Thread (expected VM/thread)) from IO#close (via Net:HTTP) — "ggiesemann (Geoffrey Giesemann)" <geoffwa@...>
Issue #9365 has been updated by Geoffrey Giesemann.
[#59728] Ruby 2.1.0 in Production: known bugs and patches — Aman Gupta <ruby@...1.net>
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production.
Hello Aman,
[#59770] bug report did not propagate to ruby-core — Mean Login <meanlogin@...>
https://bugs.ruby-lang.org/issues/9416
[#59791] About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...>
A while ago I created a proof-of-concept that I intended to use in my
On 15 Jan 2014, at 11:58, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:
Em 15-01-2014 19:42, Eric Hodel escreveu:
On 16 Jan 2014, at 02:15, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:
Em 16-01-2014 19:43, Eric Hodel escreveu:
On 17 Jan 2014, at 04:22, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:
Em 17-01-2014 19:53, Eric Hodel escreveu:
On 18 Jan 2014, at 15:12, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:
Em 20-01-2014 21:51, Eric Hodel escreveu:
On 21 Jan 2014, at 02:01, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:
Em 21-01-2014 19:36, Eric Hodel escreveu:
[#59807] [ruby-trunk - misc #9421] [Open] [PATCH] doc/contributing.rdoc: allow/encourage other git hosts — normalperson@...
Issue #9421 has been reported by Eric Wong.
[#59882] [ruby-trunk - Feature #9428] [Rejected] Inline argument expressions and re-assignment — matz@...
Issue #9428 has been updated by Yukihiro Matsumoto.
On 2014/01/20 11:32, matz@ruby-lang.org wrote:
[#59909] [ruby-trunk - Feature #9425] [PATCH] st: use power-of-two sizes to avoid slow modulo ops — shyouhei@...
Issue #9425 has been updated by Shyouhei Urabe.
shyouhei@ruby-lang.org wrote:
[#60229] [ruby-trunk - Feature #9427] [Feedback] [PATCH] io.c: remove socket check for sendfile — akr@...
Issue #9427 has been updated by Akira Tanaka.
[#60377] Re: [ruby-cvs:51920] nobu:r44775 (trunk): socket.c: suppress warnings — Eric Wong <normalperson@...>
nobu@ruby-lang.org wrote:
[ruby-core:59494] Re: [ruby-trunk - misc #9188] r43870 make benchmark/bm_so_k_nucleotide.rb slow
Btw, I took some time to work on this further. Only _very_ lightly
tested (make check passes)
# GC::Profiler.report doesn't even show anything with this patch applied
# because GC never happens.
h = {}
GC::Profiler.enable
10000000.times do
h["HI"] = 0
h["HI"]
end
GC::Profiler.report
---------------------------8<-------------------------------
Subject: [PATCH] prefreeze literal strings for hash aset/aref
Based on a patch by Charlie Somerville and Aman Gupta:
http://mid.gmane.org/redmine.journal-43505.20131208105635@ruby-lang.org
---
The following changes since commit 12b09864056bfb961f06b0ef675b9fc2fabb9238:
* properties. (2014-01-03 01:51:05 +0000)
are available in the git repository at:
git://80x24.org/ruby.git opt_aref_aset_str
for you to fetch changes up to 2906ef4bf2aaa0873f198cc1a949c1cc7740be7f:
prefreeze literal strings for hash aset/aref (2014-01-03 03:44:51 +0000)
----------------------------------------------------------------
Eric Wong (1):
prefreeze literal strings for hash aset/aref
compile.c | 36 ++++++++++++++++++++++++++++++++++++
hash.c | 2 +-
insns.def | 41 +++++++++++++++++++++++++++++++++++++++++
test/ruby/test_hash.rb | 9 ++++++++-
4 files changed, 86 insertions(+), 2 deletions(-)
diff --git a/compile.c b/compile.c
index 5b28401..f12f40d 100644
--- a/compile.c
+++ b/compile.c
@@ -4330,6 +4330,23 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
break;
}
+ if (node->nd_mid == idAREF &&
+ node->nd_recv != (NODE *)1 &&
+ node->nd_args &&
+ nd_type(node->nd_args) == NODE_ARRAY &&
+ node->nd_args->nd_alen == 1 &&
+ nd_type(node->nd_args->nd_head) == NODE_STR)
+ {
+ VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
+ node->nd_args->nd_head->nd_lit = str;
+ COMPILE(ret, "recv", node->nd_recv);
+ ADD_INSN2(ret, line, opt_aref_str,
+ new_callinfo(iseq, idAREF, 1, 0, 0), str);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
case NODE_FCALL:
case NODE_VCALL:{ /* VCALL: variable or call */
/*
@@ -5300,6 +5317,25 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
VALUE flag = 0;
VALUE argc;
+ if (node->nd_mid == idASET &&
+ node->nd_recv != (NODE *)1 &&
+ node->nd_args &&
+ nd_type(node->nd_args) == NODE_ARRAY &&
+ node->nd_args->nd_alen == 2 &&
+ nd_type(node->nd_args->nd_head) == NODE_STR)
+ {
+ VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
+ node->nd_args->nd_head->nd_lit = str;
+ COMPILE(ret, "recv", node->nd_recv);
+ COMPILE(ret, "value", node->nd_args->nd_next->nd_head);
+ ADD_INSN2(ret, line, opt_aset_str,
+ new_callinfo(iseq, idASET, 2, 0, 0), str);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
argc = setup_args(iseq, args, node->nd_args, &flag);
diff --git a/hash.c b/hash.c
index 0eca4b9..3cf7d8d 100644
--- a/hash.c
+++ b/hash.c
@@ -2390,7 +2390,7 @@ static VALUE rb_hash_compare_by_id_p(VALUE hash);
* h1["a"] #=> 100
* h1.compare_by_identity
* h1.compare_by_identity? #=> true
- * h1["a"] #=> nil # different objects.
+ * h1["a".dup] #=> nil # different objects.
* h1[:c] #=> "c" # same symbols are all same.
*
*/
diff --git a/insns.def b/insns.def
index ad4bba6..616838d 100644
--- a/insns.def
+++ b/insns.def
@@ -1903,6 +1903,47 @@ opt_aset
/**
@c optimize
+ @e recv[str] = set
+ @j 最適化された recv[str] = set。
+ */
+DEFINE_INSN
+opt_aset_str
+(CALL_INFO ci, VALUE key)
+(VALUE recv, VALUE val)
+(VALUE val)
+{
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG)) {
+ rb_hash_aset(recv, key, val);
+ } else {
+ PUSH(recv);
+ PUSH(rb_str_resurrect(key));
+ PUSH(val);
+ CALL_SIMPLE_METHOD(recv);
+ }
+}
+
+/**
+ @c optimize
+ @e recv[str]
+ @j 最適化された recv[str]。
+ */
+DEFINE_INSN
+opt_aref_str
+(CALL_INFO ci, VALUE key)
+(VALUE recv)
+(VALUE val)
+{
+ if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG)) {
+ val = rb_hash_aref(recv, key);
+ } else {
+ PUSH(recv);
+ PUSH(rb_str_resurrect(key));
+ CALL_SIMPLE_METHOD(recv);
+ }
+}
+
+/**
+ @c optimize
@e optimized length
@j 最適化された recv.length()。
*/
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 70c0442..f5af4dd 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -209,6 +209,13 @@ class TestHash < Test::Unit::TestCase
assert_equal(256, h[z])
end
+ def test_ASET_fstring_key
+ a, b = {}, {}
+ a["abc"] = 1
+ b["abc"] = 1
+ assert_same a.keys[0], b.keys[0]
+ end
+
def test_NEWHASH_fstring_key
a = {"ABC" => :t}
b = {"ABC" => :t}
@@ -946,7 +953,7 @@ class TestHash < Test::Unit::TestCase
h = @cls[]
h.compare_by_identity
h["a"] = 1
- h["a"] = 2
+ h["a".dup] = 2
assert_equal(["a",1], h.assoc("a"))
end