summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-09Merge csv-1.0.2 from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09revert r63362 due to test failure. Sorry!shyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09RSTRING_PTR is not guaranteed to be VALUE-alignedshyouhei
Don't abuse struct RString to hold arbitrary memory region. use rb_alloc_tmp_buffer for that purpose. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08* 2018-05-09svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08_mjit_compile_pc_and_sp.erb: make sure no uninitializedk0kubun
area on VM stack to prevent SEGV on GC. GC may mark every value in VM stack. Unfortunately I couldn't write a test for it... So let me explain the situation. SEGV example: https://gist.github.com/k0kubun/c7cea2b5761ffdff29ec79ea1a8f7f91 ``` $ ruby --dump=insns -e 'def oct(num, len); "%0#{len}o" % num; end' == disasm: #<ISeq:oct@-e:1 (1,0)-(1,41)> (catch: FALSE) local table (size: 2, argc: 2 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 2] num@0<Arg> [ 1] len@1<Arg> 0000 putobject "%0" ( 1)[LiCa] 0002 getlocal_WC_0 len@1 0004 dup 0005 checktype T_STRING 0007 branchif 14 0009 dup 0010 opt_send_without_block <callinfo!mid:to_s, argc:0, FCALL|ARGS_SIMPLE>, <callcache> 0013 tostring 0014 putobject "o" 0016 concatstrings 3 0018 getlocal_WC_0 num@0 0020 opt_mod <callinfo!mid:%, argc:1, ARGS_SIMPLE>, <callcache> 0023 leave [Re] ``` Prior to this commit, after arguments are pushed on 0010, stacks were: VM stack: [uninitialized, uninitialized, len] JIT stack: ["%0", len, len] And then, when GC is invoked on 0016, VM stack will be [uninitialized, uninitialized] and those uninitialized values will be marked by GC. With this commit, after arguments are pushed on 0010, stacks will be: VM stack: [len] JIT stack: ["%0", len, len] And VM stack will be [] on 0016. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08vm_eval.c: eval_string_protect wrappernobu
* vm_eval.c (eval_string_protect): cast data instead of the function pointer, to suppress "cast between incompatible function types" warning by gcc 8.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08rb_ary_dig, rb_hash_dig: nobody is using them outside.shyouhei
mark them static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08fix type mismatch.ko1
* cont.c (fiber_context_create): `func` should accept variable args. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Merge rdoc-6.0.4 from upstream.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08cont.c: host out context setupnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Remove unreachable breakkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Modify spaces [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07cont.c: wrapper functionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07cont.c: refined error messagenobu
* cont.c (fiber_machine_stack_alloc): refined the error message on failure at setting a guard page. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07_mjit_compile_send.erb: inline recursive callk0kubun
mjit_compile.c: propagate funcname to compile_insn test_jit.rb: add test covering this behavior * Benchmark ``` require 'benchmark_driver' Benchmark.driver(runner: :time, repeat_count: 4) do |x| x.prelude %{ def fib(x) return x if x == 0 || x == 1 fib(x-1) + fib(x-2) end } x.report 'fib(40)' x.loop_count 1 x.rbenv( 'before,--jit', 'before', 'after,--jit', 'after', ) x.verbose end ``` ``` before,--jit: ruby 2.6.0dev (2018-05-08 trunk 63349) +JIT [x86_64-linux] before: ruby 2.6.0dev (2018-05-08 trunk 63349) [x86_64-linux] after,--jit: ruby 2.6.0dev (2018-05-08 trunk 63349) +JIT [x86_64-linux] last_commit=_mjit_compile_send.erb: inline recursive call after: ruby 2.6.0dev (2018-05-08 trunk 63349) [x86_64-linux] last_commit=_mjit_compile_send.erb: inline recursive call Calculating ------------------------------------- before,--jit before after,--jit after fib(40) 2.886 8.685 2.562 8.800 s - 1.000 times Comparison: fib(40) after,--jit: 2.6 s before,--jit: 2.9 s - 1.13x slower before: 8.7 s - 3.39x slower after: 8.8 s - 3.44x slower ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07Remove needless require [ci skip]kazu
already require on top git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07* 2018-05-08svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07Use `&.` instead of modifier if and remove needless closed?kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07Fix a typo [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07* 2018-05-07svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07cont.c: machine stack cache conditionnobu
* cont.c (fiber_store, rb_fiber_terminate): separate the condition to cache machine stacks, which is not directly restricted to the platforms, and may be used on Windows too in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-06* 2018-05-06svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-06optparse: Suppress warningsnobu
Ruby warns "instance variable `@version` not initialized" for optparse when it receives `--version` option. `test.rb` ```ruby require 'optparse' Version = '1' OptionParser.new.parse(ARGV) ``` ``` $ ruby -w test.rb --version /home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1168: warning: instance variable @version not initialized /home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1175: warning: instance variable @release not initialized test 1 ``` This change will suppress the warnings. [Fix GH-1871] From: Masataka Pocke Kuwabara <kuwabara@pocke.me> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-05securerandom.rb: [DOC] require in examplesnobu
* lib/securerandom.rb: added `require 'securerandom'` to each example, to state these methods are defined in this library and require it explicitly. [ruby-core:85933] [Bug #14576] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04forgot to add INT2FIX (sorry!)shyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04passing rb_thread_sleep to rb_protect is IMHO dangerousshyouhei
rb_thread_sleep's argument is int, while rb_protect expects the function to take VALUE. Depending on ABI this could be a problem. We should wrap rb_thread_sleep here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04* 2018-05-05svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04nobody is using the return value of rb_io_fptr_finalizeshyouhei
However this function is listed in ruby/io.h. We cannot but define a new, void-returning variant to use instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04* 2018-05-04svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04object.c: raise on long invalid float stringnobu
* object.c (rb_cstr_to_dbl_raise): check long invalid float string more precisely when truncating insignificant part. [ruby-core:86800] [Bug #14729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03_mjit_compile_send.erb: retry inlining attr_readerk0kubun
This reverts r63249 (revert r63212) and fixes a bug in it. The test to prevent the bug is added as well. vm_insnhelper.c: add `index` argument to vm_getivar. The argument is created so that MJIT can pass the value of `cc->aux.index` on compilation time. The cache invalidation in _mjit_compile_send_guard.erb is only working for the cache value on compilation time. Note: As `index` is always passed as constant and it's force-inlined, the performance of `vm_getivar` won't be degraded in VM. _mjit_compile_send_guard.erb: New. Used to invalidate inlined values of cc. common.mk: update dependencies for _mjit_compile_send_guard.erb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03mjit_compile.c: skip generating unnecessary gotok0kubun
after return or longjmp. This is mainly for skipping the check of stack size in such cases, which shouldn't be checked because it does never happen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03mjit_compile.c: verify stack size agreementk0kubun
between branches. mjit_compile.inc.erb: move the compiled_for_pos reference to mjit_compile.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03Revert "ext/cgi/escape: preserve String subclass in result"normal
This reverts commit 6afea14043b0c0e603f26c89ae0d043f65852668 r63328 I misread the original bug report and got results flipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03mjit_compile.inc.erb: verify stack consistencyk0kubun
on JIT compilation. r63092 was risky without this check. mjit_compile.c: update comment about stack consistency check git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02ext/cgi/escape: preserve String subclass in resultnormal
* ext/cgi/escape/escape.c (optimized_escape_html): use rb_str_new_with_class (optimized_unescape_html): ditto (optimized_escape): ditto (optimized_unescape): ditto * test/cgi/test_cgi_util.rb (test_escape_string_subclass): new test [ruby-core:86847] [Bug #14732] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: test local variablesk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: test opt_aref_with againk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: make it possible to automatically findk0kubun
untested insns. Resolved some warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02* 2018-05-03svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: verify tested insnsk0kubun
and fix some untested insns git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02object.c: fix exponent with underscorenobu
* object.c (rb_cstr_to_dbl_raise): do not ignore exponent part when the input string longer than internal buffer contains underscore(s). [ruby-core:86836] [Bug #14731] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: add missing dependencyk0kubun
The test works with make test-all, but I sometimes want to do a thing like: `.ruby-svn/ruby -Itest/lib test/ruby/test_jit.rb -n test_clean_so` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02compile.c: mark catch_except_p of iseqk0kubun
which has throw insn, not only ancestor iseqs of it. I think we should remove catch_except_p flag and try to simplify the catch table itself, to prevent similar bugs in the future. test_jit.rb: add test to prevent the bug git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02common.mk: Update dependencies on tool/ruby_vm scriptsmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02tool/ruby_vm/views/_insn_name_info.erb: Auto-detect the longest insn namemame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02iseq.c (rb_iseq_disasm_insn): Change the width of insn namesmame
Currently "trace_opt_send_without_block" (28 letters) is the longest insn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-01* 2018-05-02svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-01cont.c: cleanup needless castnormal
It seems like leftover development step from r59557 ("refactoring Fiber status"). I will make fiber_status use BITFIELD macro in a future commit. * cont.c (struct rb_fiber_struct): drop const from fiber_status (fiber_status_set): remove cast [ruby-core:86788] [Misc #14720] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e