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

54063 Коммитов

Автор SHA1 Сообщение Дата
nobu 347f3f30d6 time.c: update error message for invalid utc_offset
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 13:58:51 +00:00
nobu 78d6e33702 Fix styles [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 13:58:49 +00:00
svn df0faba1ff * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 12:55:21 +00:00
kazu 730f2886b5 Follow behaviour of IO#ungetbyte
see r65802 and [Bug #14359]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 12:55:20 +00:00
nobu bc27f87889 Remove duplicate macro definition
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 08:43:50 +00:00
mrkn fc9e0302ea complex.c: optimize zero check for Float
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 07:05:37 +00:00
svn f7c0abeaea * 2019-01-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 19:22:11 +00:00
tenderlove 79c150f8a5 Mark array as "going to be modified" in `Array#reject!`
Before this patch, if `reject!` is called on a shared array it can
mutate the shared array rather than a copy.  This patch marks the array
as "going to be modified" so that the shared source array isn't
mutated.

[Bug #15479] [ruby-core:90781]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 19:22:05 +00:00
nobu e9dc6f6076 Check by #name [ruby-core:90853] [Bug #15497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 10:53:43 +00:00
svn 497075b3a1 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 09:08:37 +00:00
nobu 50784a0a44 Defer escaping control char in error messages
* eval_error.c (print_errinfo): defer escaping control char in
  error messages until writing to stderr, instead of quoting at
  building the message.  [ruby-core:90853] [Bug #15497]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 09:08:31 +00:00
nobu e52b102c36 Test for "%p" in Time.strptime
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 07:45:04 +00:00
mrkn bbd1e83e5a complex.c: replace misused UNLIKELY with LIKELY
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 04:53:06 +00:00
svn 1e87935958 * 2019-01-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 04:37:44 +00:00
mrkn 2b9c6e1a8a range.c (range_last): disable optimization when each is redefined
Do not use the optimized version of Range#last when Range#each is
redefined.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08 04:37:40 +00:00
nobu 8371a9a4ce time.c: support military time zone names
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 07:03:23 +00:00
nobu 4f9ab3a01a time.c: UTC and Z timezones should be utc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 06:59:46 +00:00
hsbt da1f9199bd Bump version to date-2.0.0.
I forgot to change it when Ruby 2.6.0 was released.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 06:01:49 +00:00
mrkn a288ff502e complex.c (f_divide): canonicalize a quotient
Cannonicalize resultant real and imaginary parts when complex number
divided by non-complex number.

[Fix GH-2065] [Bug #15505] [ruby-core:90891]

From: Joe Peric <peric.joe@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 04:49:34 +00:00
nobu 72ad092960 Time.strptime benchmarks
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 02:05:21 +00:00
nobu 9e3ffd41f5 Select ruby to run benchmarks with BENCH_RUBY
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 01:58:05 +00:00
svn 26ea03c04f * 2019-01-07
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 15:46:22 +00:00
mrkn d41fb6ce0b benchmark/range_last.yml: remove needless prelude
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 15:46:21 +00:00
k0kubun d8931259d0 internal.h: unify our own stdtbool.h implementation
because we had another one in missing/stdbool.h as well.
Assuming that _Bool does not exist when stdbool.h is absent, I'm in
favor of r57462 implementation rather than r61326.

Note that Visual Studio 2013 has stdbool.h and thus r57462's commit
message is somewhat misleading. This missing/stdbool.h is for Visual
Studio 2012 or older, and for Oracle Solaris Studio 12.2 or older because
it's added in 12.3 https://docs.oracle.com/cd/E24457_01/html/E21987/gkeza.html.

missing/stdbool.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 14:53:43 +00:00
duerst d9699fadf8 simplify filename-related code
(Thanks to Nobuyoshi Nakada for the hint!)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 11:41:12 +00:00
duerst b991ccc210 add logic to handle Unicode beta period file names
In downloader.rb, add logic to handle file names of the form
UnicodeData-12.0.0d6.txt. To find the right file, we download
the index of the directory. Then we download the files by finding
the file names from the index. Files are always checked for changes,
because changes might be frequent during the beta period.
We also check whether any index.html files are left when we are not
in the beta period. This would indicate that we might have stale
data from the beta period rather than the actual release data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 07:50:18 +00:00
nobu dd3ed41cd0 ast.c: argument must be a string
[ruby-core:90904] [Bug #15511]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 05:07:10 +00:00
nobu 6629588aa5 Fix mday overflow
[ruby-core:90897] [Bug #15506]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 04:36:56 +00:00
mrkn 6e1d498ac7 range.c: optimize rb_range_last for int renage
This change improves the performance of Range#last method for a range
of integer.  This optimization directly computes only required values
only in a range instead of converting all values in the range to an
array.  The optimized implementation is 129-16.7k times faster than
the previous one in the benchmark result given below.

=== Benchmark Result ===

```
$ make benchmark ITEM=range_last COMPARE_RUBY=/Users/mrkn/.rbenv/versions/2.6.0/bin/ruby
generating known_errors.inc
known_errors.inc unchanged
/Users/mrkn/src/github.com/ruby/ruby/revision.h unchanged
/Users/mrkn/.rbenv/shims/ruby --disable=gems -rrubygems -I/Users/mrkn/src/github.com/ruby/ruby/benchmark/lib /Users/mrkn/src/github.com/ruby/ruby/benchmark/benchmark-driver/exe/benchmark-driver \
                    --executables="compare-ruby::/Users/mrkn/.rbenv/versions/2.6.0/bin/ruby -I.ext/common --disable-gem" \
                    --executables="built-ruby::./miniruby -I/Users/mrkn/src/github.com/ruby/ruby/lib -I. -I.ext/common  -r/Users/mrkn/src/github.com/ruby/ruby/prelude --disable-gem" \
                    $(find /Users/mrkn/src/github.com/ruby/ruby/benchmark -maxdepth 1 -name '*range_last*.yml' -o -name '*range_last*.rb' | sort)
Warming up --------------------------------------
  (1..1_000_000).last(100)       35.600 i/s -      36.000 times in 1.011239s (28.09ms/i)
 (1..1_000_000).last(1000)       36.204 i/s -      39.000 times in 1.077240s (27.62ms/i)
(1..1_000_000).last(10000)       36.470 i/s -      39.000 times in 1.069386s (27.42ms/i)
Calculating -------------------------------------
                           compare-ruby  built-ruby
  (1..1_000_000).last(100)       36.477    609.196k i/s -     106.000 times in 2.905950s 0.000174s
 (1..1_000_000).last(1000)       35.936     50.350k i/s -     108.000 times in 3.005321s 0.002145s
(1..1_000_000).last(10000)       35.641      4.602k i/s -     109.000 times in 3.058233s 0.023685s

Comparison:
               (1..1_000_000).last(100)
                built-ruby:    609195.7 i/s
              compare-ruby:        36.5 i/s - 16700.87x  slower

              (1..1_000_000).last(1000)
                built-ruby:     50349.7 i/s
              compare-ruby:        35.9 i/s - 1401.08x  slower

             (1..1_000_000).last(10000)
                built-ruby:      4602.1 i/s
              compare-ruby:        35.6 i/s - 129.12x  slower
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 00:46:36 +00:00
mrkn bf6584b5d0 benchmark/range_last.yml: add benchmark cases
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06 00:46:35 +00:00
ko1 fc7f990666 fix last commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 22:41:59 +00:00
ko1 93583166c8 refactoring.
* hash.c (EQUAL, PTR_EQUAL): make corresponding inline functions
  ar_equal() and ar_ptr_equal().

* hash.c (SET_*): removed. set fields directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 22:40:32 +00:00
ko1 70caae18f2 add ar_ prefix for ar_table functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 22:23:54 +00:00
svn 89cbf307b5 * 2019-01-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 15:09:45 +00:00
mrkn 6ce2ef33b5 test/ruby/test_range.rb: add assertions
Add assertions of Range#first and Range#last to examine the type
conversion of the arguments and the negative value check.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 15:09:44 +00:00
nobu b6b4c7cbb4 compile.c: initialize to suppress false warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 14:31:12 +00:00
nobu 9cbb4dde74 parse.y: refactored symbol rules
* parse.y (symbol): turned into a node, as well as `numeric`, for
  a symbol literal, and includes `dsym` now.

* parse.y (ssym): previous `symbol`.  renamed as the counterpart
  of `dsym`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 13:15:07 +00:00
nobu 4783493236 parse.y: hoisted out qcall_branch_start and qcall_branch_end
* compile.c (qcall_branch_start, qcall_branch_end): hoisted out
  branch coverage traces generation for qcall.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 12:13:39 +00:00
nobu 59f59f82d4 parse.y: refine error messages
* parse.y: refine error messages for tSYMBEG and tSTRING_BEG, which
  can appear at invalid places.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 11:35:24 +00:00
mrkn 56a6dd66d4 benchmark/range_last.yml: add a benchmark of Range#last
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 10:07:40 +00:00
duerst 89e3d2f8d3 separate downloading of Unicode property files and auxiliary files
Separate downloading of Unicode property files in ucd and in ucd/auxiliary.
This is needed because we need information from separate index.html files
to discover the exact file names of property files during a beta period.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 09:47:55 +00:00
ko1 0c0d181e0f fix trivial indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 00:31:54 +00:00
ko1 2380111008 call functions directly.
* hash.c: ar_table only supports `objhash` so we can call compare/hash
  functions directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05 00:06:09 +00:00
ko1 3a144485fc refactoring usage of ar_lookup().
* hash.c (hash_stlike_lookup): introduce inline a function and use it
  instead of using ar_lookup()/st_lookup() directly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 23:48:33 +00:00
svn eca91625b2 * 2019-01-05
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 15:41:32 +00:00
k0kubun 6c1ed519ef win32/Makefile.sub: try to use __restrict on Visual Studio 2013
as well. Follows up r66598.

https://bugs.ruby-lang.org/issues/15347#note-7 is saying __restrict
is supported on Visual Studio 2013.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 15:41:29 +00:00
svn a2eb04f52d * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:14:18 +00:00
svn 6304c0c4d1 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:14:18 +00:00
normal 23444302d9 introduce rb_nogvl C-API to mark ubf as async-signal-safe
zlib and bignum both contain unblocking functions which are
async-signal-safe and do not require spawning additional
threads.

We can execute those functions directly in signal handlers
without incurring overhead of extra threads, so provide C-API
users the ability to deal with that.  Other C-API users may
have similar need.

This flexible API can supercede existing uses of
rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by
introducing a flags argument to control behavior.

Note: this API is NOT finalized.  It needs approval from other
committers.  I prefer shorter name than previous
rb_thread_call_without_gvl* functions because my eyes requires
big fonts.

[Bug #15499]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:14:11 +00:00
svn 16cfd26a57 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:11:02 +00:00