Граф коммитов

41823 Коммитов

Автор SHA1 Сообщение Дата
nobu 7d0b7fb4cf enumerator.c: lazy_grep_v
* enumerator.c (lazy_grep_v): add Enumerator::Lazy#grep_v as well
  as Enumerable, to enumerate lazily.
  [ruby-core:71845] [Feature #11773]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 07:23:43 +00:00
nobu 506b25aabf error.c: name_err_local_variables
* error.c (name_err_local_variables): new method
  NameError#local_variables for internal use only.
  [Feature #11777]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 05:27:10 +00:00
marcandre cb3b463a50 * array.c: Improve and fix documentation for Array#dig
[#11776]

* hash.c: ditto

* struct.c: ditto

* test_hash.rb: Add basic test for user defined `dig`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 05:21:11 +00:00
nobu 1fadd43881 marshal.c: skip internal names
* marshal.c (w_objivar): skip internal instance variables in
  T_OBJECT too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 05:20:41 +00:00
nobu 9518406544 test_io_console.rb: separate master and slave
* test/io/console/test_io_console.rb (test_getpass): separate
  master side and slave side in each threads.  r52937 deadlocked
  on OS X.  [Bug #11780] [ruby-dev:49412]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 05:12:15 +00:00
normal f2a7ca746f compile.c (iseq_build_from_ary_body): avoid rb_ary_dup for CDHASH
This reverts r16587
("compile.c (iseq_build_body): remove side effect from
  VM::InstructionSequence.load."
as that change was obsoleted by r48705 ("mostly fix rb_iseq_load")

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 04:32:23 +00:00
ngoto 14c46e5f1a * test/io/console/test_io_console.rb (test_getpass): s.getpass
should be tested. Narrow ensure block. This reverts r52911.
  [Bug #11780] [ruby-dev:49412]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 04:03:53 +00:00
usa be801955e9 * tool/merger.rb: get user's attention by using colored message when requiring operation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 03:20:07 +00:00
nobu 10952d16e6 NEWS: indented heredoc [ci skip]
* NEWS: mention about indented here document.  [Feature #9098]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 03:08:33 +00:00
svn 45a6f6374a * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 01:47:15 +00:00
normal 4ebab10bf5 compile optimized case dispatch for nil/true/false
nil/true/false are special literals just like floats, integers,
literal strings, and symbols.  Optimize when statements with
them by using a jump table, too.

target 0: a (ruby 2.3.0dev (2015-12-08 trunk 52928) [x86_64-linux]) at "/home/ew/rrrr/b/ruby"
target 1: b (ruby 2.3.0dev (2015-12-08 master 52928) [x86_64-linux]) at "/home/ew/ruby/b/ruby"

benchmark results:
minimum results in each 5 measurements.
Execution time (sec)
name	a	b
loop_whileloop2	0.102	0.103
vm2_case_lit*	1.657	0.549

Speedup ratio: compare with the result of `a' (greater is better)
name	b
loop_whileloop2	0.988
vm2_case_lit*	3.017

* benchmark/bm_vm2_case_lit.rb: new benchmark
* compile.c (case_when_optimizable_literal): add nil/true/false
* insns.def (opt_case_dispatch): ditto
* vm.c (vm_redefinition_check_flag): ditto
* vm.c (vm_init_redefined_flag): ditto
* vm_core.h: ditto
* object.c (InitVM_Object): define === explicitly for nil/true/false
* test/ruby/test_case.rb (test_deoptimize_nil): new test
* test/ruby/test_optimization.rb (test_opt_case_dispatch): update
  (test_eqq): new test
  [ruby-core:71923] [Feature #11769]
  Original patch by Aaron Patterson <tenderlove@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 01:46:45 +00:00
nobu c84e62cd32 optparse.rb: Fix typo [ci skip]
* lib/optparse.rb: fix double word typo in the document.
  [Misc #10608] [Fix GH-1126]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 01:19:04 +00:00
nobu 08753137de date_core.c: missing argument check
* ext/date/date_core.c (d_lite_lshift): should check the argument
  before negation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 00:03:21 +00:00
normal 4d2ce0cbff insns.def (opt_case_dispatch): check Float#=== redefinition
The missing check for Float#=== redefinition was noticed while
working on enhancing optimized case dispatch for nil/true/false
in [ruby-core:71818] https://bugs.ruby-lang.org/issues/11769

So no, I don't normally redefine core classes like this :P

* insns.def (opt_case_dispatch): check Float#=== redefinition
* test/ruby/test_optimization.rb (test_opt_case_dispatch): new
  [ruby-core:71920] [Bug #11784]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 23:56:57 +00:00
svn d0ea0389e4 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 19:01:42 +00:00
ko1 7476be4def * test/lib/iseq_loader_checker.rb: add iseq dumper/loader checker.
If you enable this checker (remove `#' in test/runner.rb),
  you can see comparison results between an original iseq disassembed
  result and dumped and loaded iseq disassembed result.

  There are several bugs around there, because of inexact stack depth
  calculation. Now, I leave these bugs because they are not critical
  and difficult to solve completely.

* test/runner.rb: require test/lib/iseq_loader_checker.rb but
  disabled at default (commented out).




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 19:01:29 +00:00
normal b401937c62 doc/extension.rdoc: warn about kwargs performance in C [ci skip]
This existing API seems doomed performance-wise, and writing
things in Ruby is nicer anyways.  So discourage folks from
using it.

[Feature #11339]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 18:49:49 +00:00
ko1 8dce6b15cc * iseq.c (iseq_load): disable peephole optimization option
because apply it multiple times change the sequence.
  (iseq != peephole_optimize(load(iseq.to_a)))




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 18:46:27 +00:00
ko1 21366b17a5 * compile.c (rb_iseq_build_from_ary): do not allocate table
if table_size is 0.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 18:44:45 +00:00
normal 889f50227c socket: expand docs+tests for recv_io/send_io
* ext/socket/unixsocket.c (unix_send_io): document args
  (unix_recv_io): ditto
* test/socket/test_unix.rb (test_fd_passing_class_mode): added

I was working on these when I encountered the problem in
with BasicSocket.for_fd not handling mode args:
https://bugs.ruby-lang.org/issues/11778

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 18:39:47 +00:00
ko1 6757d13ee1 * iseq.c (iseq_translate): at the end of constructing an iseq,
call RubyVM::InstructionSequence.translate(iseq) if this method
  is defined. If the return value is also an object of
  RubyVM::InstructionSequence, then use it instead of created one.

  For example, this method is useful to test iseq dumper/loader
  such as RubyVM::InstructionSequence#to_a and rb_iseq_load().

  Because this method is for such internal experimental usage,
  the interface is not matured. For example, this interface has
  no extensibility. Two or more translaters can not run
  simultaneously.

  So that we don't guarantee future compatibility of this method.
  Basically, do not use this method.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 17:23:18 +00:00
tenderlove a34e45fd54 * ext/psych/*: update psych to 2.0.16
* test/psych/*: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 16:58:10 +00:00
ko1 56367e25ee add a NEWS entry for r52917
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 16:30:31 +00:00
svn 59c3a2f8a9 * 2015-12-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 15:10:52 +00:00
ko1 6d8bf54c44 * string.c: introduce String#+@ and String#-@ to control
String mutability.
  [Feature #11782]




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 15:10:00 +00:00
nobu 9a28a29b87 parse.y: indented hereoc
* parse.y: add heredoc <<~ syntax.  [Feature #9098]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 14:39:52 +00:00
kazu 9f51e95fc1 fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 14:14:28 +00:00
kazu f373be86e3 add missing options to call-seq of IO#read_nonblock
* prelude.rb (IO#read_nonblock): [DOC] add missing options to
  call-seq.  [ruby-core:71627] [Bug #11730]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 14:08:44 +00:00
duerst e924e657b6 .gitignore: added cygwin*.def for Cygwin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 06:50:52 +00:00
svn 5243976041 * 2015-12-07
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 03:12:11 +00:00
naruse b5c0ca497e temporally remove prompt to pass the test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 03:11:53 +00:00
nobu 51cb462f42 test_io_console.rb: wait
* test/io/console/test_io_console.rb (test_getpass): wait slave
  thread.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 12:41:47 +00:00
normal a2e025a7d0 introduce rb_autoload_str to replace rb_autoload
rb_autoload_str may be safer by preventing premature GC.  It
can also be more efficient by passing a pre-frozen string that
can be deduped using rb_fstring.  Common autoload callers (e.g.
rubygems, rdoc) already use string literals as the file
argument.

There seems to be no reason to expose rb_autoload_str to the
public C API since autoload is not performance-critical.
Applications may declare autoloads in Ruby code or via
rb_funcall; so merely deprecate rb_autoload without exposing
rb_autoload_str to new users.

Running: valgrind -v ruby -rrdoc -rubygems -e exit
shows a minor memory reduction (32-bit userspace)

before:

  in use at exit: 1,600,621 bytes in 28,819 blocks
total heap usage: 55,786 allocs, 26,967 frees, 6,693,790 bytes allocated

after:

  in use at exit: 1,599,778 bytes in 28,789 blocks
total heap usage: 55,739 allocs, 26,950 frees, 6,692,973 bytes allocated

* include/ruby/intern.h (rb_autoload): deprecate
* internal.h (rb_autoload_str): declare
* load.c (rb_mod_autoload): use rb_autoload_str
* variable.c (rb_autoload): become compatibility wrapper
  (rb_autoload_str): hoisted out from old rb_autoload
  [ruby-core:71369] [Feature #11664]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 12:28:09 +00:00
nobu f534bc2ed9 hash.c: fix rubyspec failure
* hash.c (env_fetch): yield coerced string.

* hash.c (env_assoc): return coerced string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 12:13:25 +00:00
kazu dfe923cd69 * configure.in: add missing x.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 10:04:19 +00:00
kazu 80b3529f8d fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 09:38:36 +00:00
usa 52047a145b * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): gave up the test
of binary path info test on Windows because the test had passed
  occasionally as the comment said.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 09:28:02 +00:00
usa 9fc965eeba * test/fileutils/test_fileutils.rb: add debug output to investigate the error that occur at random on Windows CI.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 07:22:17 +00:00
nobu 1ad0d8ecad console.c: prompt to stderr
* ext/io/console/console.c (console_getpass): print prompt to
  stderr when reading from stdin.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 06:30:11 +00:00
nobu 187de9240a console.c: console_getpass
* ext/io/console/console.c (console_getpass): add IO#getpass
  method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 06:25:10 +00:00
nobu 33a05904bb test_env.rb: escape
* test/ruby/test_env.rb (TestEnv#test_utf8): escape non-ASCII
  string with \u explicitly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06 03:12:28 +00:00
svn 8f91b46db9 * 2015-12-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 23:41:02 +00:00
hsbt 1f1e3d1297 * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
upstream changes.
  4d059bf9f5
  d4c99de789
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 23:40:24 +00:00
nobu bf52a8b6c4 Fix cross build
* tool/fake.rb: Fix cross build when srcdir is an absolute path.
* Makefile.in: PREP dependency is needed when cross build too, not
  "-r$(arch)-fake" to be  used before created.  [Fix GH-1125]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 08:48:28 +00:00
nobu 80bedec6c2 assertions.rb: fallback encoding error
* test/lib/test/unit/assertions.rb (message): fallback when
  outputs from different encoding commands mixed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 08:33:38 +00:00
nobu 5e3467c441 hash.c: env encoding fallback on Windows
* hash.c (env_str_new, env_path_str_new): make default string
  UTF-8 for the case conversion is not possible.  [Bug #8822]
* hash.c (get_env_cstr): convert non-ASCII string to UTF-8 string.
* hash.c (ruby_setenv): use wide char version to put environment
  variable to deal with non-ASCII value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 08:26:26 +00:00
nobu 613737eee9 node.c: NODE_QCALL
* node.c (dump_node): dump NODE_QCALL.  [Feature #11537]
  http://twitter.com/watson1978/status/673042429931446272

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 07:58:11 +00:00
nobu b8172ec972 Makefile.in: set CONFIGURE_TTY directly
* Makefile.in (reconfig-exec-0): set CONFIGURE_TTY without
  intermediate variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 02:57:39 +00:00
nobu e65f38b97d ruby_atomic.h: fix old value type of ATOMIC_CAS
* ruby_atomic.h (ATOMIC_CAS): old value to be swapped should be
  same as the destination.  immediate value may need type
  promotion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 00:56:52 +00:00
nobu c5d2ef80a4 ruby_atomic.h: fix the argument order
* ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
  InterlockedCompareExchange64.  new value and then old value is
  the last.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 00:25:43 +00:00