aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* node.c: predicates for special NODEsnobu2018-03-205-12/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: Methods of File should not invoke external commandsshugo2018-03-203-8/+9
| | | | | | | | | 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
* compile.c: fix ibf_load_codenobu2018-03-203-6/+10
| | | | | | | | | | | * 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
* Reverting r62775, this should fix i686 buildstenderlove2018-03-197-73/+189
| | | | | | | | 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-20svn2018-03-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/README.win32: `make up` is only necessary when building from SVN source.usa2018-03-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: NUL-terminate ruby_sourcefilenobu2018-03-192-8/+7
| | | | | | | | | | * 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
* note that patch is required and need to run make up before makeusa2018-03-191-3/+6
| | | | | | | | * 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
* parse.y: push `do` token infonobu2018-03-191-6/+16
| | | | | | | | | * 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
* parse.y: ignore do indentationsnobu2018-03-191-2/+4
| | | | | | | * 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
* parse.y: mismatched indentations at middlenobu2018-03-192-13/+58
| | | | | | | * 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
* compile.c: arg var indexnobu2018-03-192-31/+90
| | | | | | | | | * 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
* parse.y: fix duplicate kwrestnobu2018-03-191-6/+6
| | | | | | | | | | | | * 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
* iseq.c: append local var index to namenobu2018-03-191-2/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-03-19svn2018-03-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c: mark kwrest argnobu2018-03-191-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix function name [ci skip]nobu2018-03-181-2/+2
| | | | | | | * 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
* Improve CSV performancewatson19782018-03-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove duplicated `,` [ci skip]kazu2018-03-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* IBF works only on x86 platforms nownobu2018-03-181-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-03-18svn2018-03-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* If host of URI is omitted, make it with IP address. seki2018-03-171-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: resize to align offsetsnobu2018-03-171-1/+11
| | | | | | | * 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
* debugging SEGV on Solaris11snobu2018-03-171-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove unused variablesk0kubun2018-03-171-2/+2
| | | | | | | | | | | | | | 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
* Add doc for `opt` parameter of IO#reopen [ci skip]k0kubun2018-03-171-2/+3
| | | | | | | | | | 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
* test_jit.rb: debug cc1 availabilityk0kubun2018-03-171-3/+10
| | | | | | ENV didn't have any useful information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: align offsetsnobu2018-03-171-4/+19
| | | | | | | | | | * 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
* string.c: [DOC] split with block [ci skip]nobu2018-03-171-1/+5
| | | | | | | * 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
* misc/ruby-style.el: use spaces for indentationk0kubun2018-03-171-1/+1
| | | | | | | | instead of hard tabs. [Bug #14246] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* transform_mjit_header.rb: read output and errorsnobu2018-03-171-2/+2
| | | | | | | | * 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
* debugging SEGV on Solaris11snobu2018-03-171-7/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-03-17svn2018-03-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c: add timeout for --jit-waitk0kubun2018-03-172-2/+16
| | | | | | | | | | | | 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
* test_weakmap.rb: skip unstable assertionnobu2018-03-161-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sample/timeout.rb: fix warningskazu2018-03-161-8/+8
| | | | | | | 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
* re.c: do not escape terminator in Regexp.unionnobu2018-03-162-12/+24
| | | | | | | | | | * 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
* debugging SEGV on Solaris11snobu2018-03-161-0/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* debugging SEGV on Solaris11snobu2018-03-161-0/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iseq.rb: skip iseq with coveragenobu2018-03-161-1/+6
| | | | | | | * 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
* Revert "Add direct marking on iseq operands"naruse2018-03-167-171/+72
| | | | | | | | | | 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
* Revert "Fix error: implicit conversion loses integer precision"naruse2018-03-163-4/+4
| | | | | | This reverts commit r62708. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Fix warning: cast from pointer to integer of different size"naruse2018-03-161-5/+5
| | | | | | This reverts commit r62709. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix load_from_binarynobu2018-03-162-6/+13
| | | | | | | | | * 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
* gmake.mk: expand MJIT header rulesnobu2018-03-162-1/+6
| | | | | | | * 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
* configure.ac: DLDFLAGS without arch flagsnobu2018-03-161-1/+3
| | | | | | | | * 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
* Revert r62617 "compile.c: fix load_from_binary"naruse2018-03-152-6/+6
| | | | | | | 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
* * properties.svn2018-03-150-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce URI::File to handle file URI schemenaruse2018-03-154-1/+169
| | | | | | | | | | | * 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-16svn2018-03-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e