summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2018-02-11Makefile.in: define macro in one linek0kubun
Having macro definition in multiple definitions makes compiler error output hard to read, like the commit message of r62367. Probably build failures will be fixed by r62370, but let me simplify the mjit_config.h content for future debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11mjit_config.h: moved backslashs outside quotesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11mjit.c: some flags are no longer for GCCk0kubun
Obviously they are for clang. For simplicity, just inlined them. Also another obsoleted commant was removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11_mjit_compile_send.erb: resolve warnings on clangk0kubun
/var/folders/tp/g1f_46nj7md_d5_j799rfb140000gn/T//_ruby_mjit_p17396u162.c:2920:143: warning: incompatible integer to pointer conversion passing 'long' to parameter of type 'const VALUE *' (aka 'const unsigned long *') [-Wint-conversion] ...| VM_ENV_FLAG_LOCAL, calling.recv, calling.block_handler, 0x7fc14ceee660, 0x7fc14c870c00, argv + 0, 2, 3); ^~~~~~~~~~~~~~ /Users/k0kubun/.rbenv/versions/ruby-svn/include/ruby-2.6.0/x86_64-darwin16/rb_mjit_min_header-2.6.0.h:21299:21: note: passing argument to parameter 'pc' here const VALUE *pc, ^ /var/folders/tp/g1f_46nj7md_d5_j799rfb140000gn/T//_ruby_mjit_p17396u162.c:3073:31: warning: incompatible integer to pointer conversion passing 'long' to parameter of type 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') [-Wint-conversion] vm_push_frame(ec, 0x7fc14c87d290, VM_FRAME_MAGIC_METHOD | VM_ENV_FLAG_LOCAL, calling.recv, ca... ^~~~~~~~~~~~~~ /Users/k0kubun/.rbenv/versions/ruby-svn/include/ruby-2.6.0/x86_64-darwin16/rb_mjit_min_header-2.6.0.h:21294:25: note: passing argument to parameter 'iseq' here const rb_iseq_t *iseq, ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11Makefile.in: add output to debug rubycik0kubun
build failure. From current output, I can't know what's wrong from current error log. https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos7/ruby-trunk/log/20180211T110003Z.log.html.gz#miniruby compiling mjit.c mjit.c:573:1: error: stray ‘\’ in program static const char *const CC_DEBUG_ARGS[] = {MJIT_DEBUGFLAGS NULL}; ^ mjit.c:573:1: error: stray ‘\’ in program mjit.c:574:1: error: stray ‘\’ in program static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL}; ^ mjit.c:574:1: error: stray ‘\’ in program mjit.c:584:5: error: stray ‘\’ in program MJIT_CC_COMMON MJIT_CFLAGS GCC_PIC_FLAGS ^ mjit.c:584:5: error: stray ‘\’ in program mjit.c:584:5: error: stray ‘\’ in program mjit.c:584:5: error: stray ‘\’ in program mjit.c:588:1: error: stray ‘\’ in program static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL}; ^ mjit.c:588:1: error: stray ‘\’ in program mjit.c:588:1: error: stray ‘\’ in program mjit.c:589:1: error: stray ‘\’ in program static const char *const CC_DLDFLAGS_ARGS[] = {MJIT_DLDFLAGS NULL}; ^ cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default] cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default] cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default] cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default] gmake: *** [mjit.o] Error 1 exit 2 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11win32/Makefile.sub: fix typo, missing commanobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11mjit.c: alwasy -fPIC flag to gccnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11appveyor.yml: finish notification testk0kubun
Now it succeeds to notify. Notifying all CI success would be noisy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11appveyor.yml: encrypt config with ruby's accountk0kubun
Currently it's encrypted with k0kubun's account and the notification is failing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11mjit_config.h: include trailing comma for empty listnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11.travis.yml: resurrect notification to #commitsk0kubun
I heard at least Shibata-san sees the channel for the notification. But I want #alets to have all CI failure notifications too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11appveyor.yml: send AppVeyor slack notificationk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11.travis.yml: send notification to #alertsk0kubun
instead of #commits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11NEWS: note about --jit [ci skip]k0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11common.mk: add comments about r62355 [ci skip]k0kubun
transform_mjit_header.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11mjit_config.h: more macrosnobu
* Makefie.in, win32/Makefile.sub: add more macros for compiler to mjit_config.h. * mjit.c: unification VC and GCC in progress. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11common.mk: define MJIT_HEADER earlierk0kubun
so that other predefined macros won't be removed by `MJITHeader.remove_predefined_macros!`. Currently macro like -DVM_CHECK_MODE=2 is removed when it's passed in configure. But it is needed during JIT compilation. gc.c: export rb_obj_info to let JIT succeed with VM_CHECK_MODE=2. ``` MJIT warning: failure in loading code from '/tmp/_ruby_mjit_p15631u0.so': /tmp/_ruby_mjit_p15631u0.so: undefined symbol: rb_obj_info ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11_mjit_compile_insn.erb: comment_idnobu
* tool/ruby_vm/views/_mjit_compile_insn.erb: comment ID of constant, calling method, and Symbol literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11_mjit_compile_{insn,send}.erb: suppress warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11Makefile.sub: cpp out for older VCnobu
* win32/Makefile.sub (CPPOUTFLAG, MJIT_HEADER_FLAGS): -Fi option is available since VC 10. redirect stdout on older versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11_mjit_compile_send.erb: PRI_SERIALT_PREFIXnobu
* tool/ruby_vm/views/_mjit_compile_send.erb: `printf` modifier for `rb_serial_t` which may not be `long long`, and '%ll' may not be supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-10insns.def: cache nil constnobu
* insns.def (getinlinecache): Qnil is a valid value as a constant. this can be observable when accessing a deprecated constant which is nil. non-nil constant is warned just once for each location, but every time if it is nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-10* 2018-02-11svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-10test_jit.rb: cover most insn compilationsk0kubun
test_compile_insns has only basic tests to improve coverage. Other severer tests should be added with different names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e