summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-16* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16Merge RubyGems 2.7.6 from upstream.hsbt
It fixed some security vulnerabilities. http://blog.rubygems.org/2018/02/15/2.7.6-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16non-constant aggregate initializer is a C99ismshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16compile.c: keep debug infonobu
* compile.c (iseq_peephole_optimize): keep freezestring insn with debug info. [Bug #14475] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16test_rubyoptions.rb: assert_same to check identitynobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16* 2018-02-16svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16test_rubyoptions.rb: show code in failure messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15Avoid using `@` in macro substitution that confuses FreeBSD makeknu
``` making mjit_config.h make: Unknown modifier ' ' make: Unclosed variable specification (expecting ')') for "Q" (value "") modifier /bin/sh: Syntax error: end of file unexpected (expecting "}") *** Error code 2 Stop. ``` The at sign probably conflicts the `:@temp@string@` modifier syntax supported by FreeBSD make. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15Array#values_at optimizationnobu
* array.c (rb_ary_values_at): optimization range argument case. bulk concatenation than pushing for each element. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15Benchmarks for Array#values_atnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15test/io/console/test_io_console.rb (test_oflush): Avoid race conditionmame
Add a ad-hoc wait. Follows test_ioflush2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15gc.c: force STACK_GROW_DIRECTION for emscriptenmame
The configure script fails to guess the direction on emscripten. Perhaps this is because of https://github.com/kripken/emscripten/issues/2093 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15thread_pthread.c: Use `getpagesize()` when `pthread_attr_getguardsize` is ↵mame
unavailable This is also for emscripten. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-15configure.ac: Use `pthread_create` to determine if pthread is availablemame
Instead of `pthread_kill`. This is because emscripten supports `pthread_create` but not `pthread_kill`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14compile.c: drop freezestring insn on String#-@normal
Followup to r62039 and remove the redundant freezestring insn which was preventing deduplication from String#-@ * compile.c (iseq_peephole_optimize): drop freezestring insn on String#-@ [ruby-core:85542] [Bug #14475] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14test/ruby/test_optimization.rb: fix compile kwargnormal
Fixes: r62177 ("compile.c: fix string Range optimization with FSL") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14* 2018-02-15svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14load.c: reduce memory usage of loaded_features_indextenderlove
Use integer hashsum instead of string as a key in loaded_features_index. Do not use ruby strings for substring operation, just plain pointer and length. [ruby-core:53688] Co-authored-by: Sokolov Yura aka funny_falcon <funny.falcon@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14appveyor.yml: refactor r62402k0kubun
We have good feature to share common configuration between branches: https://www.appveyor.com/docs/branches/#sharing-common-configuration-between-branches Let's try this. By the way, the intention of r62402 was excluding PR notifications while it wasn't written in the commit message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14appveyor.yml: notify slack only for trunkk0kubun
Using conditional build configuration. https://www.appveyor.com/docs/branches/#conditional-build-configuration This copy-pasting is so ugly, but AppVeyor doesn't have a feature to filter notification based on branch. https://github.com/appveyor/ci/issues/272 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14mjit.h: compare as pointernobu
* mjit.c (mjit_get_iseq_func), mjit.h (mjit_exec): do not compare a pointer as shorter type. by loosing the precision, different values can result in "equal" wrongly. enum type is an alias of `int`, and is often shorter than a pointer type nowadays. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-14skip "TestException#test_thread_signal_location" as a known bug [Bug #14474]ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13* 2018-02-14svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13mjit_compile.inc.erb: replace opt_key insnk0kubun
with opt_send_without_block insn if call cache has valid ISeq. If the receiver is not optimized target of opt_key (i.e. Hash or Array), it triggers JIT cancel and it would be slow. This change allows JIT to drop the check for Hash/Array and continue to execute JIT even if the receiver is not Hash or Array. See the following benchmark results. It's not improved so much, but it would be effective when we achieve Ruby method inlining in _mjit_compile_send.erb. * Micro benchmark Given the following bench.rb, ``` class HashWithIndifferentAccess < Hash def []=(key, value) super(key.to_s, value) end def [](key) super(key.to_s) end end indhash = HashWithIndifferentAccess.new indhash[:foo] = 'bar' key = 'foo' 100000000.times do indhash[key] end ``` ** before ``` $ time ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb JIT success (31.4ms): block in <main>@/tmp/bench.rb:15 -> /tmp/_ruby_mjit_p18206u0.c JIT success (669.3ms): []@/tmp/bench.rb:6 -> /tmp/_ruby_mjit_p18206u1.c Successful MJIT finish ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb 12.21s user 0.04s system 107% cpu 11.394 total ``` ** after ``` $ time ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb JIT success (41.0ms): block in <main>@/tmp/bench.rb:15 -> /tmp/_ruby_mjit_p17293u0.c JIT success (679.0ms): []@/tmp/bench.rb:6 -> /tmp/_ruby_mjit_p17293u1.c Successful MJIT finish ./ruby --disable-gems --jit-verbose=1 /tmp/bench.rb 11.54s user 0.06s system 108% cpu 10.726 total ``` The execution time is shortened. * optcarrot benchmark Optcarrot has no room to be improved by this change. Almost nothing is changed. fps: 59.54 (before) -> 59.51 (after) * discourse benchmark I expected this to be improved a little, but it isn't too. ** before (JIT) ``` categories_admin: 50: 12 75: 13 90: 14 99: 22 home_admin: 50: 12 75: 13 90: 16 99: 22 topic_admin: 50: 12 75: 13 90: 15 99: 21 categories: 50: 18 75: 19 90: 23 99: 27 home: 50: 3 75: 4 90: 4 99: 12 topic: 50: 11 75: 11 90: 14 99: 20 ``` ** after (JIT) ``` categories_admin: 50: 12 75: 12 90: 16 99: 24 home_admin: 50: 12 75: 12 90: 14 99: 21 topic_admin: 50: 12 75: 13 90: 16 99: 21 categories: 50: 17 75: 18 90: 23 99: 32 home: 50: 3 75: 4 90: 4 99: 10 topic: 50: 11 75: 12 90: 13 99: 20 ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13Fixing some minimal formating on enum.c examplesnobu
This will fix the formatting shown on detect|find and revese_arch generated by RDoc. [Fix GH-1816] From: Espartaco Palma <esparta@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13st.c: retry operations if rebuiltnormal
Calling the .eql? and .hash methods during a Hash operation can result in a thread switch or a signal handler to run: allowing one execution context to rebuild the hash table while another is still reading or writing the table. This results in a use-after-free bug affecting the thread_safe-0.3.6 test suite and likely other bugs. This bug did not affect users of commonly keys (String, Symbol, Fixnum) as those are optimized to avoid method dispatch for .eql? and .hash methods. A separate version of this change needs to be ported to Ruby 2.3.x which had a different implementation of st.c but was affected by the same bug. * st.c: Add comment about table rebuilding during comparison. (DO_PTR_EQUAL_CHECK): New macro. (REBUILT_TABLE_ENTRY_IND, REBUILT_TABLE_BIN_IND): New macros. (find_entry, find_table_entry_ind, find_table_bin_ind): Use new macros. Return the rebuild flag. (find_table_bin_ptr_and_reserve): Ditto. (st_lookup, st_get_key, st_insert, st_insert2): Retry the operation if the table was rebuilt. (st_general_delete, st_shift, st_update, st_general_foreach): Ditto. (st_rehash_linear, st_rehash_indexed): Use DO_PTR_EQUAL_CHECK. Return the rebuild flag. (st_rehash): Retry the operation if the table was rebuilt. [ruby-core:85510] [Ruby trunk Bug#14357] Thanks to Vit Ondruch for reporting the bug. From: Vladimir Makarov <vmakarov@redhat.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13variable.c: flags at autoloadingnobu
* variable.c (const_tbl_update): flags by deprecate_constant / private_constant set during autoloading should be preserved after required. [ruby-core:85516] [Bug #14469] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13vm_insnhelper.c: rb_autoloading_value flagnobu
* vm_insnhelper.c (vm_get_ev_const): add flag argument of `rb_autoloading_value`. * constant.h (rb_autoloading_value): moved the declaration from vm_core.h for `rb_const_flag_t`. [ruby-core:85516] [Bug #14469] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13revert r62392usa
check the declaration of `rb_autoloading_value()` in vm_core.h and the call in vm_insnhelper.c, and retry it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13variable.c: flags at autoloadingnobu
* variable.c (const_tbl_update): flags by deprecate_constant / private_constant set during autoloading should be preserved after required. [ruby-core:85516] [Bug #14469] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13process.c (try_with_sh): fix the wrong number of argumentsmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-13xmalloc never returns NULLkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12* 2018-02-13svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12vm_insnhelper.c: inline array aref with integerk0kubun
internal.h: define inlinable rb_ary_entry_internal. array.c: use rb_ary_entry_internal. * Benchmark ruby --jit mame/optcarrot/bin/optcarrot --benchmark mame/optcarrot/examples/Lan_Master.nes ** Before checksum: 59662 fps: 58.095175012159686 ** After fps: 59.874751599221526 checksum: 59662 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12insns.def: remove unnecessary sp motionk0kubun
This seems obsoleted after r62087. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12use <<- instead of <<~ for older baserubynobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12Makefile.in: drop obsoleted debug outputk0kubun
mjit_config.h errors are already fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12_mjit_compile_insn_body.erb: refactork0kubun
renamed from tool/ruby_vm/views/_mjit_compile_insn_line.erb. Basically this file should handle everything about macro on JIT. _mjit_compile_insn.erb: follow the refactoring common.mk: follow the rename git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12_mjit_compile_insn_line.erb: carve out macro expansionk0kubun
in _mjit_compile_insn.erb to this file. As I'm going to add macro expansions later, I want to separate such complex things from whole insn compilation. _mjit_compile_insn.erb: _mjit_compile_insn_line.erb part was removed. common.mk: updated build system for them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12mjit.c: print JIT failurek0kubun
mjit_compile.inc.erb: show unsupported insn name on --jit-verbose=1 too. Also, removed osboleted workaround. Now some insn-related functions are declared with MAYBE_UNUSED. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12test_jit.rb: prettify script in messagek0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12test_jit.rb: explicitly skip for unsupported onesk0kubun
MSP-Greg watches this metrics and this would be helpful for him. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12no --jit-ccnobu
* ruby.c (setup_mjit_options): removed --jit-cc option, since mjit header is affected by generated config.h which depends on the given compiler, so it cannot work with different compilers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12test_jit.rb: split test_compile_insnsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12* 2018-02-12svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12mjit_compile.c: fix invalid suffix on MinGWk0kubun
This commit fixes following error. $ RUBY_FORCE_TEST_JIT=1 ./ruby -I. -Ilib -Itest/lib --disable-gems test/ruby/test_jit.rb Run options: # Running tests: Environment variable changed: TestJIT#test_compile_insns : "TEMP" changed : "C:\\msys64\\tmp" -> "C:\\Users\\k0kubun\\AppData\\Local\\Temp" Environment variable changed: TestJIT#test_compile_insns : "TMP" changed : "C:\\msys64\\tmp" -> "C:\\Users\\k0kubun\\AppData\\Local\\Temp" Environment variable changed: TestJIT#test_compile_insns : "temp" deleted Environment variable changed: TestJIT#test_compile_insns : "tmp" deleted 1) Failure: TestJIT#test_jit_output [test/ruby/test_jit.rb:360]: Expected /^JIT success \(\d+\.\dms\): block in <main>@-e:1 -> .+_ruby_mjit_p\d+u\d+\.c$/ to match "C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p920u0.c: In function '_mjit0':\n" + "C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p920u0.c:11:61: error: invalid suffix \"CD6900\" on integer constant\n" + " static const VALUE *const original_body_iseq = (VALUE *)0000000004CD6900;\n" + " ^~~~~~~~~~~~~~~~\n" + "compilation terminated due to -Wfatal-errors.\n" + "Successful MJIT finish\n". 2) Failure: TestJIT#test_compile_insns [test/ruby/test_jit.rb:19]: Expected 1 times of JIT success, but succeeded 0 times. script: ``` p proc { nil rescue true }.call ``` stderr: ``` C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p10628u0.c: In function '_mjit0': C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p10628u0.c:11:61: error: invalid suffix "D05F10" on integer constant static const VALUE *const original_body_iseq = (VALUE *)0000000004D05F10; ^~~~~~~~~~~~~~~~ compilation terminated due to -Wfatal-errors. Successful MJIT finish ``` . <1> expected but was <0>. Finished tests in 3.028989s, 0.6603 tests/s, 1.9809 assertions/s. 2 tests, 6 assertions, 2 failures, 0 errors, 0 skips ruby -v: ruby 2.6.0dev (2018-02-11 trunk 62375) [x64-mingw32] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11Makefile.in: prevent from building `"",` macrok0kubun
Loop removal in r62373 caused the CI failure like: https://travis-ci.org/ruby/ruby/builds/340136977 mjit_config.h was: #ifndef RUBY_MJIT_CONFIG_H #define RUBY_MJIT_CONFIG_H 1 #define MJIT_CC_COMMON "gcc", #define MJIT_CFLAGS "-w", #define MJIT_OPTFLAGS "-O3", #define MJIT_DEBUGFLAGS "-ggdb3", #define MJIT_LDSHARED "gcc", "-shared", #define MJIT_DLDFLAGS "", #endif /* RUBY_MJIT_CONFIG_H */ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11Makefile.in: debug mjit_config.h againk0kubun
Somehow r62373 is failing on travis... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11Makefile.in: use "%s"nobu
* Makefile.in (mjit_config.h): use "%s" not to interprete % in arguments. and `set` and `loop` are not needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11Makefile.in: use printfk0kubun
`echo -n` is sometimes not available. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180211T132503Z.log.html.gz#miniruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e