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

56698 Коммитов

Автор SHA1 Сообщение Дата
David Rodríguez 1a4bb80cd7
[bundler/bundler] Skip specs that need coloring on Windows
ANSI codes don't work there.

https://github.com/bundler/bundler/commit/4f05417ca7
2019-08-03 09:29:55 +09:00
David Rodríguez 38df9e18da
[bundler/bundler] Add missing no-color source specs
For consistency.

https://github.com/bundler/bundler/commit/279603ab42
2019-08-03 09:29:55 +09:00
David Rodríguez 214e992556
[bundler/bundler] Be explicit about coloring in specs that need that
https://github.com/bundler/bundler/commit/a4d04506ab
2019-08-03 09:29:55 +09:00
David Rodríguez 580e165873
[bundler/bundler] Respect color option when instantiating shells
Thor's base shell will be memoized the first time it is set. So if we
instantiate a no-color shell first, further instantiations of a bundler
shell will be initialized with a no-color shell by default. This is
caused some sources specs to fail, depending on the order they run.

See for example https://travis-ci.org/bundler/bundler/builds/500328994.

What we do to fix it is to reset the shell unless no-color is explicitly
specified. That way, further instantiations will rerun thor's internal
logic to choose the default shell.

https://github.com/bundler/bundler/commit/786b5d9894
2019-08-03 09:29:55 +09:00
David Rodríguez b95756c7a9
[bundler/bundler] Remove unnecessary condition
The builtin thor's color shell already checks this before printing, and
if not a tty, prints just the string without added color codes.

https://github.com/bundler/bundler/commit/4f62611c87
2019-08-03 09:29:55 +09:00
Hiroshi SHIBATA 4c2255fd5c
[bundler/bundler] Added Ruby 2.6 to dsl.
https://github.com/bundler/bundler/commit/1892626858
2019-08-03 09:29:55 +09:00
Yusuke Endoh c683763865 Use source_location instead of eval(__FILE__,binding) in Binding#irb
e9e17cbc05 (enabling the warning by
default) caused a warning in test-spec:
```
/data/chkbuild/tmp/build/20190802T213005Z/ruby/spec/ruby/core/binding/irb_spec.rb
Binding#irb
- creates an IRB session with the binding in scope/data/chkbuild/tmp/build/20190802T213005Z/ruby/spec/ruby/core/binding/fixtures/irb.rb:3: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190802T213005Z.log.html.gz

ref: [Bug #4352]
2019-08-03 07:44:44 +09:00
Takashi Kokubun 44ddfec0bd
Add missing backslash 2019-08-03 01:07:48 +09:00
git 60ac8ad194 * 2019-08-03 2019-08-03 00:55:56 +09:00
Takashi Kokubun 4eb54c49f7
Stop using homebrew addon
to control erros on our own.
2019-08-03 00:55:37 +09:00
Yusuke Endoh 536ba7c81e Revert "Remove opt_nil_p test to remove warning for now"
This reverts commit a1727e43af.
2019-08-02 23:29:58 +09:00
Yusuke Endoh 086ffe72c7 Revert "Revert "Add a specialized instruction for `.nil?` calls""
This reverts commit a0980f2446.

Retry for macOS Mojave.
2019-08-02 23:25:38 +09:00
Yusuke Endoh e9e17cbc05 parse.y: make a warning for __FILE__ in eval by default
[Bug #4352]
2019-08-02 23:17:19 +09:00
Takashi Kokubun 247b06d400
Revert "Give up `brew update` on Travis"
This reverts commit e05f397f08.
Failed... https://travis-ci.org/ruby/ruby/jobs/566961111

We should talk to Travis people instead...
2019-08-02 23:01:54 +09:00
Takashi Kokubun a1727e43af
Remove opt_nil_p test to remove warning for now 2019-08-02 22:46:15 +09:00
Hiroshi SHIBATA eb638b75b3
It can be share to use CoreAssertions for default gems.
ref. https://github.com/ruby/logger/pull/35
2019-08-02 21:09:43 +09:00
Nobuyoshi Nakada 9921b63ac4
Make float_decode_internal mantissa int 2019-08-02 19:04:38 +09:00
Nobuyoshi Nakada 6640eeb6db
Deduplicate common code 2019-08-02 18:11:05 +09:00
Nobuyoshi Nakada ee1334189b
Fix uplevel 2019-08-02 17:51:45 +09:00
Koichi Sasada e03b3b4ae0 add debug_counters to check details.
add debug_counters to check the Hash object statistics.
2019-08-02 15:59:47 +09:00
Yusuke Endoh a0980f2446 Revert "Add a specialized instruction for `.nil?` calls"
This reverts commit 9faef3113f.

It seemed to cause a failure on macOS Mojave, though I'm unsure how.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/osx1014/ruby-master/log/20190802T034503Z.fail.html.gz

This tentative revert is to check if the issue is actually caused by the
change or not.
2019-08-02 15:03:34 +09:00
Nobuyoshi Nakada 19006b711d
Expanded f_quo 2019-08-02 11:28:24 +09:00
Nobuyoshi Nakada f9a0492b76
Expanded f_ceil 2019-08-02 11:26:58 +09:00
Nobuyoshi Nakada ffe4a6ebf9
Use RB_INTEGER_TYPE_P 2019-08-02 11:26:58 +09:00
Nobuyoshi Nakada 6de61fb9ed
Expanded f_mod 2019-08-02 11:26:51 +09:00
git 8ba8ccc3cc * 2019-08-02 2019-08-02 00:55:03 +09:00
Jeremy Evans ef45a57801 Make attr* methods define public methods if self in caller is not same as receiver
Previously, attr* methods could be private even if not in the
private section of a class/module block.

This uses the same approach that ruby started using for define_method
in 1fc3319973.

Fixes [Bug #4537]
2019-08-01 08:52:15 -07:00
Yusuke Endoh b8e351a1b9 ext/-test-/bug-14834/bug-14384.c: fallback for MAYBE_UNUSED
__unused__ is unavailable on Sun C.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190801T112505Z.fail.html.gz
2019-08-01 21:09:59 +09:00
Nobuyoshi Nakada 8b162ce9d1
Fix assertion failure when VM_CHECK_MODE
Some VM frames (dummy and top pushed by `rb_vm_call_cfunc`) has
iseq but has no pc.
2019-08-01 20:55:03 +09:00
Kazuhiro NISHIYAMA 2eec526053
bootstraptest/test_insns.rb: test opt_nil_p 2019-08-01 20:34:31 +09:00
Takashi Kokubun 076f3fcf11
Extend sleep before sending USR1 in TestProcess
because the test seems to hang there forever:
https://travis-ci.org/ruby/ruby/jobs/566409880
2019-08-01 20:19:54 +09:00
Takashi Kokubun cb84824481
Add a test for opt_nil_p 2019-08-01 19:42:48 +09:00
Nobuyoshi Nakada 1549fbfda5
Use predefined idTo_proc 2019-08-01 16:40:03 +09:00
Nobuyoshi Nakada d488464106
Use predefined idOr 2019-08-01 16:35:43 +09:00
卜部昌平 fd0e3bd249 fix VC 2013 compile error
It seems the compiler does not support VLAs.
See also: https://ci.appveyor.com/project/ruby/ruby/builds/26392589/job/px6nuiuw4e78weg1
2019-08-01 16:19:49 +09:00
Koichi Sasada 3a6f51ee35 introduce ar_hint_t.
Hash hint for ar_array is 1 byte (unsigned char). This patch introduce
ar_hint_t which represents hint type.
2019-08-01 16:06:43 +09:00
git e18e785253 * expand tabs. 2019-08-01 16:04:09 +09:00
卜部昌平 19d3c80e81 calc_lineno(): add assertions
This function has a lot of assumptions.  Should make them sure.
2019-08-01 16:00:59 +09:00
卜部昌平 5d33f78716 fix tracepoint + backtrace SEGV
PC modification in gc_event_hook_body was careless.  There are (so
to say) abnormal iseqs stored in the cfp.  We have to check sanity
before we touch the PC.

This has not been fixed because there was no way to (ab)use the
setup from pure-Ruby.  However by using our official C APIs it is
possible to touch such frame(s), resulting in SEGV.

Fixes [Bug #14834].
2019-08-01 16:00:59 +09:00
git d2f8e03f34 * expand tabs. 2019-08-01 14:27:19 +09:00
Yusuke Endoh f45bb760fb signal.c: make signame_prefix a nul-terminated string
gcc 9.1.0 warns this.

```
signal.c:258:46: warning: '%.*s' directive argument is not a nul-terminated string [-Wformat-overflow=]
  258 |  rb_raise(rb_eArgError, "unsupported signal `%.*s%"PRIsVALUE"'",
      |                                              ^~~~
  259 |    prefix, signame_prefix, vsig);
      |            ~~~~~~~~~~~~~~
signal.c:200:19: note: referenced argument declared here
  200 | static const char signame_prefix[3] = "SIG";
      |                   ^~~~~~~~~~~~~~
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20190801T033009Z.log.html.gz
2019-08-01 14:25:15 +09:00
Koichi Sasada 7463867106 use internal_id.
"hash_iter_lev" can be exported by Marshal.dump and it will
introduce inconsistency. To avoid this issue, use internal_id
instead of normal ID. This issue is pointed out by Chikanaga-san.
2019-08-01 11:22:43 +09:00
Kazuhiro NISHIYAMA 67f7e5a224
Compact ensure clause and rename variables to fix alignment 2019-08-01 09:12:08 +09:00
Aaron Patterson 31ec475ad8
Update object.c
Co-Authored-By: Takashi Kokubun <takashikkbn@gmail.com>
2019-07-31 16:36:25 -07:00
git 714924fd34 * expand tabs. 2019-08-01 08:21:58 +09:00
Aaron Patterson 9faef3113f
Add a specialized instruction for `.nil?` calls
This commit adds a specialized instruction for called to `.nil?`.  It is
about 27% faster than master in the case where the object is nil or not
nil.  In the case where an object implements `nil?`, I think it may be
slightly slower.  Here is a benchmark:

```ruby
require "benchmark/ips"

class Niller
  def nil?; true; end
end

not_nil = Object.new
xnil = nil
niller = Niller.new

Benchmark.ips do |x|
  x.report("nil?")    { xnil.nil? }
  x.report("not nil") { not_nil.nil? }
  x.report("niller")   { niller.nil? }
end
```

On Ruby master:

```
[aaron@TC ~/g/ruby (master)]$ ./ruby compil.rb
Warming up --------------------------------------
                nil?   429.195k i/100ms
             not nil   437.889k i/100ms
              niller   437.935k i/100ms
Calculating -------------------------------------
                nil?     20.166M (± 8.1%) i/s -    100.002M in   5.002794s
             not nil     20.046M (± 7.6%) i/s -     99.839M in   5.020086s
              niller     22.467M (± 6.1%) i/s -    112.111M in   5.013817s
[aaron@TC ~/g/ruby (master)]$ ./ruby compil.rb
Warming up --------------------------------------
                nil?   449.660k i/100ms
             not nil   433.836k i/100ms
              niller   443.073k i/100ms
Calculating -------------------------------------
                nil?     19.997M (± 8.8%) i/s -     99.375M in   5.020458s
             not nil     20.529M (± 7.0%) i/s -    102.385M in   5.020689s
              niller     21.796M (± 8.0%) i/s -    108.110M in   5.002300s
[aaron@TC ~/g/ruby (master)]$ ./ruby compil.rb
Warming up --------------------------------------
                nil?   402.119k i/100ms
             not nil   438.968k i/100ms
              niller   398.226k i/100ms
Calculating -------------------------------------
                nil?     20.050M (±12.2%) i/s -     98.519M in   5.008817s
             not nil     20.614M (± 8.0%) i/s -    102.280M in   5.004531s
              niller     22.223M (± 8.8%) i/s -    110.309M in   5.013106s

```

On this branch:

```
[aaron@TC ~/g/ruby (specialized-nilp)]$ ./ruby compil.rb
Warming up --------------------------------------
                nil?   468.371k i/100ms
             not nil   456.517k i/100ms
              niller   454.981k i/100ms
Calculating -------------------------------------
                nil?     27.849M (± 7.8%) i/s -    138.169M in   5.001730s
             not nil     26.417M (± 8.7%) i/s -    131.020M in   5.011674s
              niller     21.561M (± 7.5%) i/s -    107.376M in   5.018113s
[aaron@TC ~/g/ruby (specialized-nilp)]$ ./ruby compil.rb
Warming up --------------------------------------
                nil?   477.259k i/100ms
             not nil   428.712k i/100ms
              niller   446.109k i/100ms
Calculating -------------------------------------
                nil?     28.071M (± 7.3%) i/s -    139.837M in   5.016590s
             not nil     25.789M (±12.9%) i/s -    126.470M in   5.011144s
              niller     20.002M (±12.2%) i/s -     98.144M in   5.001737s
[aaron@TC ~/g/ruby (specialized-nilp)]$ ./ruby compil.rb
Warming up --------------------------------------
                nil?   467.676k i/100ms
             not nil   445.791k i/100ms
              niller   415.024k i/100ms
Calculating -------------------------------------
                nil?     26.907M (± 8.0%) i/s -    133.755M in   5.013915s
             not nil     25.319M (± 7.9%) i/s -    125.713M in   5.007758s
              niller     19.569M (±11.8%) i/s -     96.286M in   5.008533s
```

Co-Authored-By: Ashe Connor <kivikakk@github.com>
2019-07-31 16:21:25 -07:00
Koichi Sasada 117241b3c7 make inline functions from macros. 2019-08-01 05:59:04 +09:00
Koichi Sasada bd1052d55d use hash_ar_table_set() directly 2019-07-31 21:50:58 +01:00
Koichi Sasada deddc80476 HASH_ASSERT() respects HASH_DEBUG 2019-07-31 21:48:22 +01:00
Koichi Sasada 43d74776a1 check hash_hint is different. 2019-08-01 05:21:42 +09:00