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

56680 Коммитов

Автор SHA1 Сообщение Дата
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
Koichi Sasada a1a198d03a File.realpath can raise ENOTDIR 2019-07-31 21:16:20 +01:00
Aaron Patterson 5ad2dfd8dc
Revert "Let prev EP move"
This reverts commit e352445863.

This is breaking CI and I'm not sure why yet, so I'll revert for now.
2019-07-31 10:34:23 -07:00
git 8d138e9702 * 2019-08-01 2019-08-01 01:43:23 +09:00
Aaron Patterson e352445863
Let prev EP move
This commit allows the previos EP pointer to move, then updates its
location
2019-07-31 09:42:43 -07:00
Nobuyoshi Nakada c94cc6d968
run single spec [ci skip] 2019-07-31 20:46:01 +09:00
Yusuke Endoh 835fa9e54a test/ruby/test_hash.rb: remove a unused vrible
to suppress a warning
2019-07-31 19:55:16 +09:00
Yusuke Endoh 4562c13093 lib/bundler/shared_helpers.rb: remove require "rubygems"
Because it causes circular require.
2019-07-31 19:51:58 +09:00
Benoit Daloze e432f5dafd Split in two spec examples 2019-07-31 11:06:54 +02:00
Benoit Daloze eab6c534ad Attempt to fix Hash#rehash spec 2019-07-31 11:04:35 +02:00
Kazuhiro NISHIYAMA 14eede6e53
Fix `Leaked thread`
Sometimes `Leaked thread: Rinda::TestRingServer#test_ring_server_ipv6_multicast` happens
because `Rinda::TupleSpace#start_keeper` runs after stopping `@keeper`.
2019-07-31 17:45:43 +09:00
Koichi Sasada 40651cf1f5 delete a check on bad assumption.
If object was modified, but there is a case that
hash values (#hash) are same between before modified
and after modified objects.
2019-07-31 15:14:51 +09:00
Koichi Sasada 5f95edb7af check SystemStackError
This recursive iteration test can cause SystemStackError so
check it correctly.
2019-07-31 15:14:51 +09:00
Koichi Sasada cac44def0b backtrace can be nil.
Surprisingly, on SystemStackError#backtrace can return nil.
2019-07-31 15:14:50 +09:00
Koichi Sasada efac0a2384 Revert "add debug code"
This reverts commit e83ec207cd.
2019-07-31 15:14:50 +09:00
Yusuke Endoh 06574ad945 test/ruby/test_float.rb: suppress an overflow warning
```
warning: Float 0xf.fp10000000000000... out of range
```
2019-07-31 14:35:54 +09:00
Koichi Sasada e83ec207cd add debug code 2019-07-31 12:46:34 +09:00
Yusuke Endoh 816e5055c9 test/ruby/test_io.rb (test_binmode_pipe): close all pipes explicitly
to suppress the leak checker.
2019-07-31 11:52:59 +09:00
Yusuke Endoh 1d02832bcf test/rdoc/test_rdoc_rubygems_hook.rb: suppress deprecation warning 2019-07-31 11:46:56 +09:00