summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-09Revert "Use hard-coded vesion number for CI broken."hsbt
This reverts commit f5fef0a80d597f40c2d1a8cc8079bf190039fd6f. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09align jmp_buf to VALUEshyouhei
This ec->machine.regs is marked by GC. However jmp_buf is not defined by us. There are chances of unaligned access. We should force it VALUE-aligned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Use hard-coded vesion number for CI broken.hsbt
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20180509T063003Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63374 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. Thanks to @mame we now have rb_imemo_alloc_auto_free_pointer so use it instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Rename imemo_alloc with imemo_tmpbufmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09gc.c (rb_imemo_alloc_new): split for each purposemame
imemo_alloc is used for three purposes: auto-free pointer (alternative of alloca), alloc_tmp_buffer, and heap allocation for bison. To make it clear, this change introduces three functions: rb_imemo_alloc_auto_free_pointer, rb_imemo_alloc_auto_free_maybe_mark_buffer, and rb_imemo_alloc_parser_heap. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09type func(); is different from type func(void);shyouhei
If a function declarator includes no parameter list, that doesn't mean the function takes zero parameter. rb_ast_new here does take zero parameter, so it should be explicitly prototypes as (void). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09gc.c (rb_imemo_alloc_new): improve the API interfacemame
rb_imemo_alloc_new returns rb_imemo_alloc_t*, but took VALUEs, which is inconsistent. To make the intention clear, it now takes only a pointer to the buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09RSTRING_PTR is not guaranteed to be VALUE-aligned (retry)shyouhei
Don't abuse struct RString to hold arbitrary memory region. Raw pointer should just suffice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Fixed file structure for csv.gemspec.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09* append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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