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
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
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
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
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
* 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
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
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
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
* 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
* 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
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
* 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
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
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
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
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
* 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
* 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
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
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
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
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
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
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