summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-01-09class.c: refactor class_instance_method_listnobu
* class.c (class_instance_method_list): gather singleton and extended methods first separately from ancestors. [ruby-core:90872] [Bug #15501] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09time.c: update error message for invalid utc_offsetnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09Fix styles [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09Follow behaviour of IO#ungetbytekazu
see r65802 and [Bug #14359] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09Remove duplicate macro definitionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09complex.c: optimize zero check for Floatmrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08* 2019-01-09svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08Mark array as "going to be modified" in `Array#reject!`tenderlove
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-08Check by #name [ruby-core:90853] [Bug #15497]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08Defer escaping control char in error messagesnobu
* 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-08Test for "%p" in Time.strptimenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08complex.c: replace misused UNLIKELY with LIKELYmrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08* 2019-01-08svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-08range.c (range_last): disable optimization when each is redefinedmrkn
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-07time.c: support military time zone namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07time.c: UTC and Z timezones should be utcnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07Bump version to date-2.0.0.hsbt
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-07complex.c (f_divide): canonicalize a quotientmrkn
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-07Time.strptime benchmarksnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07Select ruby to run benchmarks with BENCH_RUBYnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06* 2019-01-07svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06benchmark/range_last.yml: remove needless preludemrkn
[ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06internal.h: unify our own stdtbool.h implementationk0kubun
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-06simplify filename-related codeduerst
(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-06add logic to handle Unicode beta period file namesduerst
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-06ast.c: argument must be a stringnobu
[ruby-core:90904] [Bug #15511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06Fix mday overflownobu
[ruby-core:90897] [Bug #15506] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-06range.c: optimize rb_range_last for int renagemrkn
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-06benchmark/range_last.yml: add benchmark casesmrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05fix last commit.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05refactoring.ko1
* 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-05add ar_ prefix for ar_table functions.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05* 2019-01-06svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05test/ruby/test_range.rb: add assertionsmrkn
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-05compile.c: initialize to suppress false warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05parse.y: refactored symbol rulesnobu
* 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-05parse.y: hoisted out qcall_branch_start and qcall_branch_endnobu
* 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-05parse.y: refine error messagesnobu
* 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-05benchmark/range_last.yml: add a benchmark of Range#lastmrkn
[ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05separate downloading of Unicode property files and auxiliary filesduerst
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-05fix trivial indentation.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-05call functions directly.ko1
* 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-04refactoring usage of ar_lookup().ko1
* 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* 2019-01-05svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04win32/Makefile.sub: try to use __restrict on Visual Studio 2013k0kubun
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* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04introduce rb_nogvl C-API to mark ubf as async-signal-safenormal
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