* Makefile.in, win32/Makefile.sub (mjit_config.h): expand min
header name, including the version number and the suffix.
* mjit.c (init_header_filename): the version number and the suffix
are now included in the header name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (clean_so_file): removed unnecessary undef of `Sleep`
which is redfined as rb_w32_sleep. eventually, retry loop with
sleep has been removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (dlclose): use FreeLibrary to manage the reference count
on the loaded module properly.
* mjit.c (clean_so_file): clean shared object file after unloaded,
in-use files cannot be removed on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (CC_LIBS): MJIT_LIBS is used only on Windows.
* mjit.c (compile_c_to_so): moved source and shared object files
to simplify indexes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (ruby_init_loadpath_safe): store prefix and archlibdir
paths.
* mjit.c (compile_c_to_so, init_header_filename): use just one
library path on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
There's no reason to use CLOCK_REALTIME for any condvars in Ruby.
Indeed, we initialized all condvars with RB_CONDATTR_CLOCK_MONOTONIC
anyway; so simplify our code and reduce ifdefs.
[ruby-core:85639] [Misc #14497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for toplevel self.
Toplevel self's class is not `Object` but `#<Class:Object>`.
This commit allows to inline method call setup for toplevel methods.
I've thought r63053 works but it doesn't...
I actually want to add all singleton classes but I'm not sure what's the
good way for it. I assumed that using ObjectSpace.each_object is suboptimal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Without this change, we couldn't inline method call setup for methods
which are defined in the top level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sometimes test hangs in `mjit_get_iseq_func` like this:
http://ci.rvm.jp/results/trunk-test@ruby-sky3/659391
It seems that a process waiting in `mjit_get_iseq_func` does no longer
have MJIT worker thread. We don't wait for JIT finish forever. So I
added timeout for the case. I'm not sure why there was no MJIT worker
thread in ruby-sky3 test process though.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
`mjit_finish` may destroy mutex even while it's still locked by
`worker` by race condition. That would result in the following error:
[BUG] pthread_mutex_destroy: Device or resource busy (EBUSY)
Actually I couldn't get a core dump for it and reproduce it multiple
times. So I'm not sure this fixes the issue which I faced or not.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
in version output.
version.h: ditto
ruby.c: propagate option for it
common.mk: updated dependency for version.c
mjit.c: overwrites the RUBY_DESCRIPTION to have +JIT when --jit is passed
test/ruby/test_rubyoptions.rb: add test for them
Only `ruby --jit -v` will have "+JIT", but this is intentional.
This may not be convenient for debugging by ticket with `ruby -v`,
but it's convenient for benchmark tools that pass options (--jit)
when showing it. At least such behavior is planned for benchmark_driver.gem
and this behavior is designed for it. Other benchmark tools are
recommended to follow the behavior too if they show version.
RUBY_DESCRIPTION might be useful for it too.
The position of "+JIT" is changed from original proposal because other
platforms like JRuby and TruffleRuby end it with archtecture.
It's made similar to JRuby, but it's upper-cased because Matz made approval
for "+JIT" in the ticket.
Example:
$ ruby -v
ruby 2.6.0dev (2018-02-22 trunk 62529) [x86_64-linux]
$ ruby --jit -v
ruby 2.6.0dev (2018-02-22 trunk 62529) +JIT [x86_64-linux]
After --jit is made default in the future, this output may be removed.
So do not rely on this output if possible.
[Feature #14462]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (convert_unit_to_func): separate a function call from a
macro, which evaluates the argument multiple times.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (check_tmpdir): W_OK and S_ISDIR may not defined on
Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (system_tmpdir): prefer `$TMPDIR` and `$TMP` over system
defulat temporary directory, if exists, writable, and safe.
[ruby-core:85651] [Bug #14496]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Makefile.in, common.mk, win32/Makefile.sub: moved MJIT macros to
mjit_config.h from XCFLAGS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): pass pch file only when using
"-include-pch" option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): place DLDFLAGS at last, as compilers
other than cl.exee don't care the order of flag arguments,
usually.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (form_args): do not use va_copy, which cannot detect
appropriate way to simulate when cross compiling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): `CC_DLDFLAGS_ARGS` must be after `-link` for cl.exe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62460 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
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
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
* 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
* Makefie.in, win32/Makefile.sub: make mjit_config.h from
configured variables, including necessary options, e.g., `-m32`
for 32bit binary on 64bit platform.
* mjit.c: always use configured CC command. as config.h depends
on the compiler, different compilers cannot work.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): use append_str2() and pass the length of
so_name. append_str() uses the size of the 2nd argument, not the
length of it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (start_process): set umask so other users cannot access
generated files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): refactored.
* mjit.c (init_header_filename): xmalloc never returns NULL.
* mjit.c (init_header_filename): report the filename of the header if failed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): libs is not constant on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (init_header_filename): get version name from the
particular global variable, not from the macro in version.h.
to get rid of re-compilation for each revision.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mjit.c (compile_c_to_so): constified constat array and make
variable arrays local.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e