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

50380 Коммитов

Автор SHA1 Сообщение Дата
nobu 952b70e221 debugging SEGV on Solaris11s
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17 02:11:06 +00:00
svn 73b631ddd8 * 2018-03-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17 02:00:31 +00:00
k0kubun c91c62b674 mjit.c: add timeout for --jit-wait
Sometimes test hangs in `mjit_get_iseq_func` like this:
http://ci.rvm.jp/results/trunk-test@ruby-sky3/659391

It seems that a process waiting in `mjit_get_iseq_func` does no longer
have MJIT worker thread. We don't wait for JIT finish forever. So I
added timeout for the case. I'm not sure why there was no MJIT worker
thread in ruby-sky3 test process though.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17 02:00:30 +00:00
nobu 6cd5db8904 test_weakmap.rb: skip unstable assertion
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 14:12:39 +00:00
kazu 23358107f9 sample/timeout.rb: fix warnings
warning: Object#timeout is deprecated, use Timeout.timeout instead.
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 14:09:40 +00:00
nobu 8a8f542c43 re.c: do not escape terminator in Regexp.union
* re.c (rb_reg_str_with_term): change terminator.

* re.c (rb_reg_s_union): terminator in source string does not need
  to be escaped.  terminators are outside of regexp source itself.
  [ruby-core:86149] [Bug #14608]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 13:37:44 +00:00
nobu 0eddedbf5c debugging SEGV on Solaris11s
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 13:29:27 +00:00
nobu 915ca40f38 debugging SEGV on Solaris11s
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 12:22:33 +00:00
nobu 1d07bb84f8 test_iseq.rb: skip iseq with coverage
* test/ruby/test_iseq.rb (test_to_binary_with_objects): #to_binary
  does not support iseq compiled with coverage, just skip.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 12:06:55 +00:00
naruse 94c40622f5 Revert "Add direct marking on iseq operands"
This reverts commit r62706.

It causes SEGV on i686-linux (debian) and armv7l-linux-eabihf:
http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20180309T204300Z.diff.html.gz
http://rubyci.s3.amazonaws.com/scw-9d6766/ruby-trunk/log/20180309T211706Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 07:59:10 +00:00
naruse a14a679787 Revert "Fix error: implicit conversion loses integer precision"
This reverts commit r62708.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 07:59:09 +00:00
naruse b099c5e620 Revert "Fix warning: cast from pointer to integer of different size"
This reverts commit r62709.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 07:59:08 +00:00
nobu ddf295a26f compile.c: fix load_from_binary
* compile.c (ibf_load_iseq_each): realpath may be nil.  follow up
  r59709.  [fix https://github.com/Shopify/bootsnap/issues/132]

From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 02:27:50 +00:00
nobu d3c5746bbb gmake.mk: expand MJIT header rules
* defs/gmake.mk: expand MJIT header file rules for each
  architectures.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 02:07:43 +00:00
nobu dd543cd478 configure.ac: DLDFLAGS without arch flags
* configure.ac (DLDFLAGS): copy LDFLAGS before adding arch flags.
  multiple arch flags on universal binary make mjit_header.h
  failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 01:48:02 +00:00
naruse 0129fc8f58 Revert r62617 "compile.c: fix load_from_binary"
It breaks Solaris:
http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180301T012502Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 16:51:34 +00:00
svn 01b46043e4 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 16:51:32 +00:00
naruse 04883f12c8 Introduce URI::File to handle file URI scheme
* the default value of URI::File's authority is "" (localhost).
  Both nil and "localhost" is normalized to "" by default.
* URI::File ignores setting userinfo and port
[Feature #14035]
fix https://github.com/ruby/ruby/pull/1719
fic https://github.com/ruby/ruby/pull/1832

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 16:51:31 +00:00
svn 09fb624838 * 2018-03-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 15:20:08 +00:00
nobu ec45161c51 configure.ac: fix rb_cv_gcc_compiler_cas
* configure.ac (rb_cv_gcc_compiler_cas): do not use one variable
  for multiple AC_CACHE_CHECK.  in one check, select by different
  values.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 15:20:08 +00:00
mrkn b12d7f17d6 NEWS: add descriptions of [Feature #12732]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 12:01:08 +00:00
nobu 2258a97fe2 string.c: split with block
* string.c (rb_str_split_m): yield each split substrings if the
  block is given, instead of returing the array.  [Feature #4780]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 11:08:04 +00:00
nobu d13a2d498c test_array.rb (test_slice!): moved misplaced test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 09:58:50 +00:00
mrkn c6ab349855 Add `exception:` keyword in Kernel#Complex()
Support `exception:` keyword argument in `Kernel#Complex()`.
If `exception:` is `false`, `Kernel#Complex()` returns `nil` if the given
value cannot be interpreted as a complex value.
The default value of `exception:` is `true`.
This is part of [Feature #12732].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 07:19:48 +00:00
mrkn 0dc74b94c2 Add `exception:` keyword in Kernel#Rational()
Support `exception:` keyword argument in `Kernel#Rational()`.
If `exception:` is `false`, `Kernel#Rational()` returns `nil` if the given
value cannot be interpreted as a rational value.
The default value of `exception:` is `true`.
This is part of [Feature #12732].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 07:19:46 +00:00
mrkn 2993b4423d Add `exception:` keyword in Kernel#Float()
Support `exception:` keyword argument in `Kernel#Float()`.
If `exception:` is `false`, `Kernel#Float()` returns `nil` if the given
value cannot be interpreted as a float value.
The default value of `exception:` is `true`.
This is part of [Feature #12732].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 07:19:45 +00:00
mrkn 2cfc5b03da Add `exception:` keyword in Kernel#Integer()
Support `exception:` keyword argument in Kernel#Integer().
If `exception:` is `false`, `Kernel#Integer()` returns `nil` if the given
value cannot be interpreted as an integer value.
The default value of `exception:` is `true`.
This is part of [Feature #12732].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 07:19:43 +00:00
nobu 4691daccc1 variable.c: hoisted out overtaken cvar warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 07:15:26 +00:00
nobu 06af2865de enumerator.c: pretty kwags
* enumerator.c (append_method): pretty format for keyword
  arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 06:29:04 +00:00
ko1 38895e5c10 use SIGUSR2 to debug.
* test/ruby/test_io.rb: use SIGUSR2 instead of SIGUSR1 to confirm
  unknown SIGUSR1 exception. On parallel testing, sometime
  (1 per some days) SIGUSR1 exception. This fix will make clear which
  signal is a suspect.

  http://ci.rvm.jp/results/trunk-test@ruby-sky3/643893


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 03:55:33 +00:00
nobu 80e8b524d3 win32/configure.bat: stop when setup failed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 01:05:00 +00:00
nobu 421a73f51a vm.c: refined error message
* vm.c (kw_check_symbol): refined the error message for non-symbol
  key.  [Feature #14603]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 00:12:17 +00:00
svn d9abf6efbc * 2018-03-15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 23:27:11 +00:00
tenderlove cc7bd8e5ff Unconditionally define `TRACE_INSN_P`
`TRACE_INSN_P` doesn't need to know about encoded iseqs, it just needs
to look at decoded iseqs.  We have the decoded iseqs available, so no
reason to look at encoded ones.  This change allows us to clear
`original_iseq` from the iseq struct without any segvs (previously,
clearing `original_iseq` would cause the tests to crash).

* iseq.c (rb_iseq_trace_set): Only use decoded iseq with `TRACE_INSN_P`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 23:27:10 +00:00
nobu 999b58c1ff configure.ac: basic libs
* configure.ac: basic libraries like -lm are necessary for some
  extension libraries on some platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 14:07:00 +00:00
nobu e3c023337c test_weakmap.rb: fixing CI failures
* test/ruby/test_weakmap.rb (test_include?): create and release
  the object to be garbage-collected in deeper frame.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 11:55:07 +00:00
nobu c05fa459bb quote symbols
* sprintf.c (ruby__sfvextra): quote symbols as identifiers.

* string.c (rb_id_quote_unprintable): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 02:35:51 +00:00
svn 251c7892c1 * 2018-03-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 15:11:00 +00:00
kazu f01315a5cf Fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 15:10:59 +00:00
k0kubun 0e60fdc511 test/ripper/test_lexer.rb: add test for r62743
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 13:03:12 +00:00
k0kubun 67bb95936d Fix FrozenError on `Ripper.slice`
Currently `Ripper.slice` raises a FrozenError

```ruby
require 'ripper'
p Ripper.slice('foo', 'ident')
```

```
/path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `concat': can't modify frozen String (FrozenError)
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `block in compile'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `scan'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `compile'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:169:in `initialize'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `new'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `token_match'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:144:in `slice'
	from /tmp/tmp.kb4cnhvum2/test.rb:2:in `<main>'
```

This patch will fix the problem.

[Fix GH-1837]

From: Masataka Pocke Kuwabara <kuwabara@pocke.me>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 12:56:04 +00:00
k0kubun 2ba36c1e4a mjit_compile.c: remove unintended definition
Actually r62741 defined the macro... It wasn't intentional.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 12:32:31 +00:00
k0kubun d5e93cb582 mjit_compile.c: disable comment_id by default
Doing `rb_ary_aref` to `global_symbols.ids` is not thread-safe and
randomly causes SEGV.
https://gist.github.com/k0kubun/ab60727c6be7c0e777d2b4241f59173c

But it's convenient for development. So I keep it optionally available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 12:29:55 +00:00
watson1978 ccc2576514 Improve Pathname performance
If it will not use special variables (like $1, $&, $`...),
it can improve the performance by using Regexp#match? instead of Regexp#=~.
Because Regexp#=~ will generate the objects to special variables by pattern matching.

This patch will replace Regexp#=~ without special variables to Regexp#match?.
(Excludes https://github.com/ruby/ruby/blob/trunk/ext/pathname/lib/pathname.rb#L144-L153)

[Fix GH-1836] [ruby-core:86093] [Bug #14599]

## Environment
* OS : Ubuntu 17.10
* Compiler : gcc version 7.2.0
* CPU : Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
* Memory : 16 GB

## TL;DR
                            | Before | After  | Speed up
--------------------------- | ------ | ------ | --------
Pathname#absolute?          | 142836 | 198487 | 39.0%
Pathname#cleanpath          |  60706 |  79415 | 30.8%
Pathname#root?              | 603806 | 759157 | 25.7%
Pathname#absolute?          | 142592 | 197859 | 38.8%
Pathname#each_filename      | 115600 | 152982 | 32.3%
Pathname#ascend             |  50494 |  63606 | 26.0%
Pathname#+                  | 100550 | 130372 | 29.7%
Pathname#join               |  46673 |  60994 | 30.7%
Pathname#relative_path_from |  28362 |  37494 | 32.2%

## Before
```
Calculating -------------------------------------
  Pathname#absolute?    142.836k (± 0.1%) i/s -    722.304k in   5.056884s
  Pathname#cleanpath     60.706k (± 0.1%) i/s -    306.764k in   5.053305s
      Pathname#root?    603.806k (± 0.3%) i/s -      3.062M in   5.071696s
  Pathname#absolute?    142.592k (± 0.1%) i/s -    720.846k in   5.055301s
Pathname#each_filename
                        115.600k (± 0.1%) i/s -    586.818k in   5.076292s
     Pathname#ascend     50.494k (± 0.1%) i/s -    255.301k in   5.056049s
          Pathname#+    100.550k (± 0.1%) i/s -    509.630k in   5.068433s
       Pathname#join     46.673k (± 0.1%) i/s -    236.433k in   5.065696s
Pathname#relative_path_from
                         28.362k (± 0.0%) i/s -    143.728k in   5.067640s
```

## After
```
Calculating -------------------------------------
  Pathname#absolute?    198.487k (± 0.1%) i/s -    995.665k in   5.016272s
  Pathname#cleanpath     79.415k (± 0.1%) i/s -    404.406k in   5.092344s
      Pathname#root?    759.157k (± 0.0%) i/s -      3.800M in   5.005072s
  Pathname#absolute?    197.859k (± 0.1%) i/s -    995.720k in   5.032494s
Pathname#each_filename
                        152.982k (± 0.1%) i/s -    775.555k in   5.069607s
     Pathname#ascend     63.606k (± 0.0%) i/s -    320.862k in   5.044560s
          Pathname#+    130.372k (± 0.1%) i/s -    660.856k in   5.068991s
       Pathname#join     60.994k (± 0.1%) i/s -    305.068k in   5.001626s
Pathname#relative_path_from
                         37.494k (± 0.4%) i/s -    189.124k in   5.044146s
```

## Benchmark code
```ruby
require 'pathname'
require 'benchmark/ips'

Benchmark.ips do |x|
  root  = Pathname.new('/')
  path1 = Pathname.new('/path/to/some/file1.rb')
  path2 = Pathname.new('/path/to/some/file2.rb')

  x.report("Pathname#absolute?") do
    path1.absolute?
  end

  x.report("Pathname#cleanpath") do
    Pathname.new('/path/to/some/file.rb').cleanpath
  end

  x.report("Pathname#root?") do
    path1.root?
  end

  x.report("Pathname#absolute?") do
    path1.absolute?
  end

  x.report("Pathname#each_filename") do
    path1.each_filename { |file| }
  end

  x.report("Pathname#ascend") do
    path1.ascend { |path| }
  end

  x.report("Pathname#+") do
    path1 + path2
  end

  x.report("Pathname#join") do
    path1.join("../file3.rb")
  end

  x.report("Pathname#relative_path_from") do
    path1.relative_path_from(root)
  end
end
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 09:15:10 +00:00
mame d583ee266b Add FileUtils#cp_lr
* lib/fileutils.rb: Add FileUtils#cp_lr.  This method creates hard links
  of each file from directory to another directory recursively.
  This patch is based on Thomas Sawyers and Zachary Scott.
  [Feature #4189] [ruby-core:33820]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 08:18:03 +00:00
nobu dd3851d278 Rename test classes to allow stable test count when running test-all -j
[Fix GH-1763]

From: MSP-Greg <MSP-Greg@users.noreply.github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 06:29:02 +00:00
nobu 1032f093cc eval_error.c: reset attributes
* eval_error.c (print_errinfo): reset all attributes for each
  lines before newlines.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 03:48:56 +00:00
nobu b07e4af869 eval_error.c: last newline
* eval_error.c (print_errinfo): do not print an empty line at the
  end when the message ends with a newline.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 03:40:10 +00:00
nobu e537dc331e test_enumerator.rb: duplicate assertions
* test/ruby/test_enumerator.rb (test_uniq): remove assertions
  which ared duplicate of lazy enumerator tests in
  test_lazy_enumerator.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 02:43:04 +00:00
nobu 175c514a0d Add missing class FrozenError to Exception subclasses list documentation
[Fix GH-1818]

From: Miguel Landaeta <miguel@miguel.cc>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 02:00:42 +00:00