summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2018-03-16sample/timeout.rb: fix warningskazu
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-16re.c: do not escape terminator in Regexp.unionnobu
* 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-16debugging SEGV on Solaris11snobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16debugging SEGV on Solaris11snobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16test_iseq.rb: skip iseq with coveragenobu
* 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-16Revert "Add direct marking on iseq operands"naruse
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-16Revert "Fix error: implicit conversion loses integer precision"naruse
This reverts commit r62708. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16Revert "Fix warning: cast from pointer to integer of different size"naruse
This reverts commit r62709. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16compile.c: fix load_from_binarynobu
* 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-16gmake.mk: expand MJIT header rulesnobu
* 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-16configure.ac: DLDFLAGS without arch flagsnobu
* 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-15Revert r62617 "compile.c: fix load_from_binary"naruse
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* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15Introduce URI::File to handle file URI schemenaruse
* 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* 2018-03-16svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15configure.ac: fix rb_cv_gcc_compiler_casnobu
* 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-15NEWS: add descriptions of [Feature #12732]mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15string.c: split with blocknobu
* 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-15test_array.rb (test_slice!): moved misplaced testnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15Add `exception:` keyword in Kernel#Complex()mrkn
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-15Add `exception:` keyword in Kernel#Rational()mrkn
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