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

46780 Коммитов

Автор SHA1 Сообщение Дата
nobu 56abb12f8d lldb_cruby.py: eval outside frames
* misc/lldb_cruby.py (lldb_rp): evaluate without frames when no
  process is running, and show error messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-31 02:42:10 +00:00
svn e003725fc3 * 2017-05-31
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 18:17:56 +00:00
stomar 8bce215fa2 object.c: improve docs
* object.c: [DOC] add an example for Object#yield_self that
  better illustrates its purpose; other small improvements.
  Reported by Vitaly Tatarintsev (ck3g).  Patch by Marcus Stollsteimer.
  [Fix GH-1637]

* object.c: [DOC] improve docs for Object#{itself,tap}.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 18:17:55 +00:00
nobu e4cc791f87 enum.c: check if reentered
* enum.c (cmpint_reenter_check): extract from nmin_cmp and
  nmin_block_cmp.

* enum.c (nmin_cmp): check if reentered before rb_cmpint.
  [Feature #13437]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 13:12:22 +00:00
nobu 7cdb2840df enum.c: rb_check_funcall_default for fallback value
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 12:47:58 +00:00
nobu 76be4743ba test_rubyoptions.rb: ruby-runner sets $0 to install name now
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 11:59:26 +00:00
watson1978 cf02692f3e Improve performance of Enumerable#{sort_by,min_by,max_by,minmax_by}
This is totally same approach with r58964.

enum.c (sort_by_cmp): use OPTIMIZED_CMP() to compare the objects instead of
    `<=>' method dispatching for Fixnum/Float/String object.

enum.c (nmin_cmp): ditto.
enum.c (min_by_i): ditto.
enum.c (max_by_i): ditto.
enum.c (minmax_by_i_update): ditto.
enum.c (minmax_by_i): ditto.

    Enumerable#sort_by   -> 51 % up
    Enumerable#min_by(n) -> 34 % up
    Enumerable#min_by    -> 37 % up
    Enumerable#max_by(n) -> 61 % up
    Enumerable#max_by    -> 40 % up
    Enumerable#minmax_by -> 67 % up

    [ruby-core:80689] [Bug #13437] [Fix GH-1584]

### Before
  Enumerable#sort_by      5.692k (± 2.2%) i/s -     28.611k in   5.028861s
Enumerable#min_by(n)      8.496k (± 0.5%) i/s -     43.146k in   5.078394s
   Enumerable#min_by      8.678k (± 0.5%) i/s -     43.911k in   5.060128s
Enumerable#max_by(n)      3.306k (± 3.0%) i/s -     16.562k in   5.014727s
   Enumerable#max_by      8.322k (± 2.8%) i/s -     42.400k in   5.099400s
Enumerable#minmax_by      6.769k (± 2.6%) i/s -     34.100k in   5.041354s

### After
  Enumerable#sort_by      8.591k (± 3.0%) i/s -     43.316k in   5.046836s
Enumerable#min_by(n)     11.489k (± 1.2%) i/s -     57.732k in   5.025504s
   Enumerable#min_by     11.835k (± 2.7%) i/s -     60.150k in   5.086450s
Enumerable#max_by(n)      5.322k (± 1.1%) i/s -     26.650k in   5.008289s
   Enumerable#max_by     11.705k (± 0.6%) i/s -     59.262k in   5.062997s
Enumerable#minmax_by     11.323k (± 1.3%) i/s -     57.018k in   5.036565s

### Test code
require 'benchmark/ips'

Benchmark.ips do |x|
  enum = (1..1000).to_a.to_enum

  x.report "Enumerable#sort_by" do
    enum.sort_by { |a| a }
  end

  x.report "Enumerable#min_by(n)" do
    enum.min_by(2) { |a| a }
  end

  x.report "Enumerable#min_by" do
    enum.min_by { |a| a }
  end

  x.report "Enumerable#max_by(n)" do
    enum.max_by(2) { |a| a }
  end

  x.report "Enumerable#max_by" do
    enum.max_by { |a| a }
  end

  x.report "Enumerable#minmax_by" do
    enum.minmax_by { |a| a }
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 09:00:56 +00:00
ko1 492c88dc3b add parameter names.
* vm_core.h: add parameter names for rb_iseq_new*.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 07:05:58 +00:00
naruse 58d8d65281 Solaris 10 x86 raseis SEGV
http://rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20170527T221806Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 06:50:35 +00:00
duerst 11954049fa Change max byte length of UTF-8 to 4 bytes
In enc/utf_8.c, change maximum byte length of UTF-8 to 4 bytes (from 6)
to conform to definition of UTF-8. This closes issue #13590.
(This is a retry of r58954, after issue #13590 has been addressed.)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 05:43:41 +00:00
watson1978 ab3a40c103 Improve performance of Range#{min,max}
range.c (range_min): use OPTIMIZED_CMP() to compare the objects instead of
    `<=>' method dispatching for Fixnum/Float/String object inside Range object.

range.c (range_max): ditto.

    Range#min -> 34 % up
    Range#max -> 44 % up

    [ruby-core:80713] [Bug #13443] [Fix GH-1585]

### Before
           Range#min      8.428M (± 1.3%) i/s -     42.141M in   5.000952s
           Range#max      8.157M (± 1.3%) i/s -     40.852M in   5.009297s

### After
           Range#min     11.269M (± 1.2%) i/s -     56.388M in   5.004611s
           Range#max     11.764M (± 1.3%) i/s -     58.856M in   5.003820s

### Test code
require 'benchmark/ips'

Benchmark.ips do |x|
  x.report "Range#min" do |i|
    i.times { (1..100).min }
  end

  x.report "Range#max" do |i|
    i.times { (1..100).max }
  end
end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30 02:57:33 +00:00
svn afa0e3c972 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 17:56:47 +00:00
eregon f35c3a5498 Clean up a bit the Process.setpriority specs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 17:56:46 +00:00
eregon a578c375ad Enable Process.setpriority for a single process on more platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 17:56:34 +00:00
svn ab86387a35 * 2017-05-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 15:34:46 +00:00
nobu eee4dee0a2 Run in separate process/pgrp [Bug #13609]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 15:34:45 +00:00
eregon 01ebc04fa2 Simplify, avoid extra exceptions and add test for concurrent mspec mkdir_p
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 11:19:42 +00:00
k0kubun fc7241ffe2 rubyspec: Fix method redefinition warning
ruby/spec/rubyspec/library/erb/run_spec.rb:63: warning: method redefined; discarding old main
ruby/spec/rubyspec/library/erb/result_spec.rb:53: warning: previous definition of main was here
ruby/spec/rubyspec/library/erb/run_spec.rb:76: warning: method redefined; discarding old main1
ruby/spec/rubyspec/library/erb/result_spec.rb:67: warning: previous definition of main1 was here
ruby/spec/rubyspec/library/erb/run_spec.rb:81: warning: method redefined; discarding old main2
ruby/spec/rubyspec/library/erb/result_spec.rb:72: warning: previous definition of main2 was here

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 10:53:54 +00:00
k0kubun 26e32b7d65 test/erb/test_erb.rb: Fix unused variable warning
ruby/test/erb/test_erb.rb:575: warning: assigned but unused variable - foo

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 10:22:47 +00:00
duerst e07bff3ce3 revert r58954 temporarily
Revert change to maximum of 4 bytes for UTF-8 characters at r58954 temporarily.
This failed spec at https://travis-ci.org/ruby/ruby/builds/237086017, but it
is totally unclear why.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 08:59:41 +00:00
duerst a03690ae73 Change max byte length of UTF-8 to 4 bytes
In enc/utf_8.c, change maximum byte length of UTF-8 to 4 bytes (from 6)
to conform to definition of UTF-8. This closes issue #13590.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 08:41:23 +00:00
nobu 83ddb7c182 fix up r58952
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): rescue
  File.stat when the target does not exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 07:03:11 +00:00
nobu e0b0b923c6 fix race condition
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): fix race
  condition when multi_exec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 06:53:05 +00:00
nobu 5689f7c7e4 tool/runruby.rb: exec ruby-runner
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 06:39:42 +00:00
nobu d4408a3d8b ruby-runner.c: replace argv[0]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 06:39:41 +00:00
nobu f8fbb8bc11 default.mspec: remove useless flags
* spec/default.mspec: removed -I options for useless or non-
  existent paths from flags.  there is no library scripts and .ext
  directory in the source directory.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29 05:19:51 +00:00
naruse abbfc048c5 suppress warning: ambiguous first argument; put parentheses or a space even after `-' operator
Introduced at r58905
http://rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20170526T153003Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:41:31 +00:00
naruse dd0148007f Revert "Update to ruby/spec@2a047c8"
This reverts commit 2531a1013b.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:40:12 +00:00
svn 5fcbdd3d9e * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:29:05 +00:00
svn 8847d0b6ad * 2017-05-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:29:05 +00:00
naruse 0f9fa1ddab Revert r58939 and r58942
This reverts following commits because it breaks mswinci
* Update to ruby/spec@2a047c8
* Update to ruby/spec@ca32ae2

see also the result:
http://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20170528T140014Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:29:04 +00:00
nobu 1245a4a4fb lldb_cruby.py: constants from the target
* misc/lldb_cruby.py (lldb_init): get constants from
  ruby_dummy_gdb_enums in the target.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 14:17:25 +00:00
eregon 75adc77e7c Update to ruby/spec@ca32ae2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 12:02:08 +00:00
svn 135ed12ea6 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 11:30:57 +00:00
eregon 4c1403c3e7 Add tool to pull latest mspec/spec when commits have been synchronized
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 11:30:55 +00:00
eregon 2531a1013b Update to ruby/spec@2a047c8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 11:30:42 +00:00
nobu ab55cd9fb5 ruby.c: file in load_file argument
* ruby.c (load_file): move opened file to an argument, to reduce
  open/close calls in the near future.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 09:49:30 +00:00
nobu 3ade78fff6 ruby.c: shrink ruby_cmdline_options_t
* ruby.c (ruby_cmdline_options_t): reordered members and turned
  simple flags into bit fields to reduce the size (136->104 on
  LP64).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 09:49:29 +00:00
normal a028cfc597 test/ruby/test_io.rb: adjust CPU usage check to 10%
I miscalculated for r58934, since we sleep 100ms, and
the worst possible case is 100 Hz in the kernel meaning
we only have 10ms resolution.  So, we need to increase
our CPU percentage to >= 10% for this.

This should be more than enough for our CI machines which
have 300 Hz kernels [ruby-core:81429]:

 http://ci.rvm.jp/results/trunk-test@sasada-8core/1495942555

* test/ruby/test_io.rb (test_copy_stream_no_busy_wait):
  override default percentage

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 05:39:29 +00:00
k0kubun 253232c028 process.c: Use getrusage(2) in Process.times
if getrusage(2) is available, to improve precision of Process.times and
its user like lib/benchmark.rb.

On macOS, since getrusage(2) has better precision than times(3),
they are much improved like:

* Before

Process.times
=> #<struct Process::Tms utime=0.56, stime=0.35, cutime=0.04, cstime=0.03>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.340000   0.310000   0.650000 (  0.674025)

* After

Process.times
=> #<struct Process::Tms utime=0.561899, stime=0.35076, cutime=0.046483, cstime=0.038929>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.343223   0.310037   0.653260 (  0.674025)

On Linux, since struct rusage from getrusage(2) is used instead of struct tms
from times(2), they are slightly improved like:

* Before

Process.times
=> #<struct Process::Tms utime=0.43, stime=0.11, cutime=0.0, cstime=0.0>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.120000   0.040000   0.170000 (  0.171621)

* After

Process.times
=> #<struct Process::Tms utime=0.432, stime=0.116, cutime=0.0, cstime=0.0>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.124000   0.048000   0.172000 (  0.171621)

[ruby-dev:49471] [Feature #11952]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 01:48:11 +00:00
normal 109ccfdb2c tests: increase CPU percentage threshold for assert_cpu_usage_low
When sleeping for the tick rate of 100ms (defined in
thread_pthread.c) as we do in test/ruby/test_io.rb
(test_copy_stream_no_busy_wait), it may not be possible to
measure with <= 10ms resolution on 100HZ systems (CONFIG_HZ in
the Linux kernel).  So increase the threshold to 15ms (10ms +
5ms slack for slow systems).

* test/lib/test/unit/assertions.rb (assert_cpu_usage_low):
  increase pct default value [ruby-core:81427]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 01:43:38 +00:00
svn ddf2a1675d * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:55:03 +00:00
svn 33319b8833 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:55:03 +00:00
eregon ead4095935 Update to ruby/spec@2795010
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:55:02 +00:00
eregon 24db428785 Update to ruby/mspec@6c95759
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 21:54:38 +00:00
svn d97c171b90 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 17:04:32 +00:00
svn 67ffb0dcb6 * 2017-05-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 17:04:32 +00:00
naruse 4d177a1f40 Initial commit of LLDB port of debug utility
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 17:04:31 +00:00
k0kubun 1d9030a107 bootstraptest/test_insns.rb: Fix typo
on test message. "torexp" insn does not exist.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 13:54:09 +00:00
normal b3d126d5de rb_wait_for_single_fd: do not OOM or segfault with invalid FD on select()
Instead, match the poll() implementation used on Linux for now;
as the Linux poll(2) manpage describes using negative FD to
easily ignore an FD in a larger FD set while (sleeping the given
timeout).  I'm not entirely sure if matching poll() behavior
is a good idea for a single FD, but it's better than segfaulting
or NoMemoryError.

* thread.c (init_set_fd): ignore negative FD
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
  (test_wait_for_invalid_fd): check values which may trigger
  segfaults or OOM

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 08:26:47 +00:00