* get CREF in this function.
* cbase is no longer needed (CREF_CLASS(cref) is enough).
* compile.c: RubyVM::FrozenCore.define_method only accept 2 args.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
but check CREF in environment or methods. Methods defined in methods
should be public.
[Bug #11571]
* vm_method.c (rb_scope_module_func_check): check CREF in env or me.
if CREF is contained by `me', then return FALSE.
* test/ruby/test_method.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
optimization bug of Oracle Solaris Studio 12.4 on Solaris
with -xO4 optimization option. [Bug #11684]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_unless): optimize constant condition for `unless`
as well as `if`. [Fix GH-1092]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_yylex): ANDDOT at the head of the line denote
line continuation from previous one to support fluent interface,
as well as single dot.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
this version includes #1367 , #1373 , #1375
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* benchmark/bm_io_nonblock_noex2.rb: new benchmark based
on bm_io_nonblock_noex.rb
* io.c (io_read_nonblock): move documentation to prelude.rb
(io_write_nonblock): ditto
(Init_io): private, internal methods for prelude.rb use only
* prelude.rb (IO#read_nonblock): wrapper + documentation
(IO#write_nonblock): ditto
[ruby-core:71439] [Feature #11339]
rb_scan_args and hash lookups for kwargs in the C API are clumsy and
slow. Instead of improving the C API for performance, use Ruby
instead :)
Implement IO#read_nonblock and IO#write_nonblock in prelude.rb
to avoid argument parsing via rb_scan_args and hash lookups.
This speeds up IO#write_nonblock and IO#read_nonblock benchmarks
in both cases, including the original non-idiomatic case where
the `exception: false' hash is pre-allocated to avoid GC pressure.
Now, writing the kwargs in natural, idiomatic Ruby is fastest.
I've added the noex2 benchmark to show this.
2015-11-12 01:41:12 +0000
target 0: a (ruby 2.3.0dev (2015-11-11 trunk 52540) [x86_64-linux])
target 1: b (ruby 2.3.0dev (2015-11-11 avoid-kwarg-capi 52540)
-----------------------------------------------------------
benchmark results:
minimum results in each 10 measurements.
Execution time (sec)
name a b
io_nonblock_noex 2.508 2.382
io_nonblock_noex2 2.950 1.882
Speedup ratio: compare with the result of `a' (greater is better)
name b
io_nonblock_noex 1.053
io_nonblock_noex2 1.567
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sprintf.c (rb_str_format): look up the key, then get default
value and raise KeyError if the returned value is nil.
[ruby-dev:49338] [Ruby trunk - Bug #11677]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c (local_var_list_add): skip internal local variable
name by its type but not if it has a name. internal local
variable names are just unique per frame, not globally.
[ruby-core:71437] [Bug #11674]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
default now. The default mode can be changed by
Net::FTP.default_passive=.
* lib/net/ftp.rb (default_passive=, default_passive): new methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/-ext-/time/test_new.rb (test_timespec_new): fix for r52519.
swap utc and localtime.
* test/-ext-/time/test_new.rb (test_timespec_now): fix method name
typo which has overwritten test_timespec_new.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sprintf.c (rb_str_format): respect default value of a hash. no
longer raises KeyError unless the default value of the hash is
nil. [ruby-core:71354] [Bug #11661]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e