summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-22error.c: full_message optionsnobu
* error.c (exc_full_message): add highlight: and reverse: keyword options. [Bug #14324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22Factor out get_reg_grapheme_clusternaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22fix each_grapheme_cluster's size [Bug #14363]naruse
From: Hugo Peixoto <hugo.peixoto@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22Revert "each_grapheme_cluster shouldn't return size [Bug #14363]"naruse
This reverts commit r62887. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22each_grapheme_cluster shouldn't return size [Bug #14363]naruse
From: Stefan Schüßler <mail@stefanschuessler.de> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-22parse.y: reorder in the placenobu
* parse.y (new_args_tail): reorder required and optional keyword argument variable IDs in the place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21Docs and tests on URI.hierarchical?, URI.absolute?nobu
Improve code coverage and clarify meaning of hierarchical based on RFC text. [Fix GH-1846] From: Xavier Riley <xavriley@hotmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21Improve documentation for 'text '.splitnobu
The documentation didn't mention trailing spaces and the example only demonstrated the case with leading spaces. [Fix GH-1845] From: Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21* 2018-03-22svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21Remove outdated proc.c binding comment.nobu
Passing a proc as the second argument to eval is no longer supported. [Fix GH-1843] From: Tieg Zaharia <tieg.zaharia@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21parse.y: terminator at continued linenobu
* parse.y (here_document): a continuing line is not the terminator. [ruby-core:86283] [Bug #14621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21parse.y: unindent continued linenobu
* parse.y (tokadd_string): stop at continued line in dedented here documents, to dedent for each lines before removing escaped newlines. [ruby-core:86236] [Bug #14621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21test_iseq.rb: disable load_from_binarynobu
* test/ruby/test_iseq.rb (test_to_binary_with_objects): disable load_from_binary right now, r62851 seems having a trouble around get_insn_info_succinct_bitvector() yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21* 2018-03-21svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-21iseq.c: constfied validate_get_insn_info [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-20node.c: predicates for special NODEsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-20io.c: Methods of File should not invoke external commandsshugo
For security reasons, File.read, File.binread, File.write, File.binwrite, File.foreach, and File.readlines should not invoke external commands even if the path starts with the pipe character |. [ruby-core:84495] [Feature #14245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-20compile.c: fix ibf_load_codenobu
* compile.c (ibf_load_iseq_each): manage iseq_size to point loaded objects in iseq_encoded. now marking iseq scans iseq_encoded directly. * test/ruby/test_iseq.rb (test_to_binary_with_objects): skip for now, but fix argument order of assert_equal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19Reverting r62775, this should fix i686 buildstenderlove
We need to mark default values for kwarg methods. This also fixes Bootsnap. IBF iseq loading needed to mark iseqs as "having markable objects". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19* 2018-03-20svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19* win32/README.win32: `make up` is only necessary when building from SVN source.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: NUL-terminate ruby_sourcefilenobu
* parse.y (yycompile): in some cases (warning, error, dtrace,...), ruby_sourcefile is expected to be NUL-terminated, so ensure it. * template/prelude.c.tmpl (prelude_name): NUL-terminate to get rid of copying static data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19note that patch is required and need to run make up before makeusa
* win32/README.win32: patch(1) is required, and running `make up` before `make` is also required. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: push `do` token infonobu
* parse.y (k_rescue, k_ensure): revert r62838. * parse.y (k_do, k_do_LAMBDA, k_do_block): push token infos of `do`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: ignore do indentationsnobu
* parse.y (k_rescue, k_ensure): ignore indentations of `do`, it is not at the beginning of line usually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: mismatched indentations at middlenobu
* parse.y (k_rescue, k_ensure, k_when, k_else, k_elsif): warn mismatched indentations at keywords in middle of blocks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19compile.c: arg var indexnobu
* compile.c (iseq_set_arguments): determine argument variable indexes by the order, not by just IDs. arguments begin with `_` can be duplicate, so by-ID index may result in a wrong value. [ruby-core:86159] [Bug #14611] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19parse.y: fix duplicate kwrestnobu
* parse.y (f_kwrest): add the variable name as an argument, as well as an internal variable. * parse.y (new_args_tail): now keyword rest argument variable is always placed between keyword arguments and block argument, so so just reorder required and optional keyword arguments. no longer kwrest duplicates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19iseq.c: append local var index to namenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19* 2018-03-19svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-19iseq.c: mark kwrest argnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-18compile.c: fix function name [ci skip]nobu
* compile.c (ibf_dump_object_object): fix a probable typo in the function name, s/lbf/ibf/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-18Improve CSV performancewatson1978
If it will not use special variables (like $1, $&, $`...), it can improve the performance by using Regexp#match? or String#match? instead of Regexp#=~ or String#=~. This patch is same idea as https://github.com/ruby/ruby/pull/1836 [Fix GH-1842] ## 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 Methods | Before | After | Speed up ----------- | ------ | ------ | -------- CSV.foreach | 44.825 | 48.201 | 7.5% CSV#shift | 45.200 | 49.584 | 9.7% CSV.read | 42.968 | 46.853 | 9.0% CSV.table | 10.933 | 11.277 | 3.1% ## Before ``` Calculating ------------------------------------- CSV.foreach 44.825 (± 0.0%) i/s - 228.000 in 5.086576s CSV#shift 45.200 (± 0.0%) i/s - 228.000 in 5.044297s CSV.read 42.968 (± 0.0%) i/s - 216.000 in 5.027504s CSV.table 10.933 (± 0.0%) i/s - 55.000 in 5.031098s ``` ## After ``` Calculating ------------------------------------- CSV.foreach 48.201 (± 0.0%) i/s - 244.000 in 5.062256s CSV#shift 49.584 (± 0.0%) i/s - 248.000 in 5.001652s CSV.read 46.853 (± 0.0%) i/s - 236.000 in 5.037044s CSV.table 11.277 (± 0.0%) i/s - 57.000 in 5.054694s ``` ## Benchmark code ```ruby require 'csv' require 'benchmark/ips' CSV.open("/tmp/file.csv", "w") do |csv| csv << ["player", "gameA", "gameB"] 1000.times do csv << ['"Alice"', "84.0", "79.5"] csv << ['"Bob"', "20.0", "56.5"] end end Benchmark.ips do |x| x.report "CSV.foreach" do CSV.foreach("/tmp/file.csv") do |row| end end x.report "CSV#shift" do CSV.open("/tmp/file.csv") do |csv| while line = csv.shift end end end x.report "CSV.read" do CSV.read("/tmp/file.csv") end x.report "CSV.table" do CSV.table("/tmp/file.csv") end end ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-18Remove duplicated `,` [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-18IBF works only on x86 platforms nownobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17* 2018-03-18svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17If host of URI is omitted, make it with IP address. seki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17compile.c: resize to align offsetsnobu
* compile.c (ibf_dump_align): resize the dump buffer. rb_str_modify_expand expands the buffer but not set the length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17debugging SEGV on Solaris11snobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17Remove unused variablesk0kubun
This fixes following warning: ``` test/logger/test_logger.rb:329: warning: assigned but unused variable - read_read ``` [Fix GH-1840] From: yuuji.yaginuma <yuuji.yaginuma@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17Add doc for `opt` parameter of IO#reopen [ci skip]k0kubun
It can be specified from 2.0. Ref: https://bugs.ruby-lang.org/issues/7103 [Fix GH-1841] From: yuuji.yaginuma <yuuji.yaginuma@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17test_jit.rb: debug cc1 availabilityk0kubun
ENV didn't have any useful information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17compile.c: align offsetsnobu
* compile.c (ibf_dump_align): expand the buffer for alignment. * compile.c (ibf_dump_iseq_list, ibf_dump_object_list): align as ibf_offset_t. not all processors do not allow unaligned word, or larger, access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17string.c: [DOC] split with block [ci skip]nobu
* string.c (rb_str_split_m): [DOC] about split with block. [Feature #4780] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17misc/ruby-style.el: use spaces for indentationk0kubun
instead of hard tabs. [Bug #14246] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17transform_mjit_header.rb: read output and errorsnobu
* tool/transform_mjit_header.rb (MJITHeader.check_code): read output and errors than discarding errors. also cl.exe prints the source file name which is a garbage at this time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17debugging SEGV on Solaris11snobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17* 2018-03-17svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-17mjit.c: add timeout for --jit-waitk0kubun
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-16test_weakmap.rb: skip unstable assertionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e