summaryrefslogtreecommitdiff
path: root/mjit_worker.c
AgeCommit message (Collapse)Author
2018-10-20add disabling MJIT features option.ko1
* configure.ac: introduce new configure option `--enable-mjit` and `--disable-mjit`. Default is "enable". `--disable-mjit` disables all of MJIT features so that `ruby --jit` can't enable MJIT. This option affect a macro `USE_MJIT`. This change remove `--enable/disable-install-mjit-header` option. * Makefile.in: introduce the `ENABLE_MJIT` variable. * common.mk: use `ENABLE_MJIT` option. * internal.h: respect `USE_MJIT`. Same as other *.c, *.h. * test/ruby/test_jit.rb: check `ENABLE_MJIT` key of rbconfg.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19mjit_worker.c: don't compile more than max_cache_sizek0kubun
Prior to this commit, max_cache_size + 1 methods could be active. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-12mjit_worker.c: suppress child process's output properlyk0kubun
Prior to this commit, some of parent process's output was unintentionally suppressed. We couldn't suppress only child process's output with spawnvp. Instead of that, this commit uses CreateProcess directly to redirect stdout and stderr only for child process. As it's dealing with HANDLE returned from CreateProcess, now waitpid macro needs to CloseHandle it. win32/win32.c: Introduce rb_w32_start_process which is designed for MJIT worker. Other similar functions can't be used since they are using ALLOCV that may trigger GC, which should be avoided on MJIT worker. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-11win32/Makefile.sub: generate MJIT header pdbk0kubun
in the MJIT-header-specific path, not default path like vc140.pdb. mjit_worker.c: specify the MJIT-header-specific pdb path. tool/rbinstall.rb: install MJIT header pdb as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07mjit_worker.c: clean up all unnecessary files on mswink0kubun
test_jit.rb: passed all MJIT tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07mjit_worker.c: don't suppress cl.exe logsk0kubun
on --jit-verbose=2+. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07mjit_worker.c: print warning if FreeLibrary failsk0kubun
because somehow AppVeyor fails to remove so file by Permission Deined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07mjit_worker.c: clean up .obj file on mswink0kubun
prior to this commit, .obj file is generated on current directory and nobody deletes that. This changes it to make sure it's generated to temporary directory and removes that. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21Remove -Wno-parentheses flag.nobu
[Fix GH-1958] From: Jun Aruga <jaruga@redhat.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-11mjit_worker.c: atomically print main message and \nk0kubun
To attempt to fix CI failure on rubyci freebsd: https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/log/20180911T123001Z.fail.html.gz ``` JIT success (68.7ms): mjit9@(eval):1 -> /usr/home/hsbt/chkbuild/tmp/build/20180911T123001Z/tmp/jit_test_unload_units_20180911-96427-13cagj9/_ruby_mjit_p99188u9.c JIT compaction (25.1ms): Compacted 10 methods -> /usr/home/hsbt/chkbuild/tmp/build/20180911T123001Z/tmp/jit_test_unload_units_20180911-96427-13cagj9/_ruby_mjit_p99188u10.soToo many JIT code -- 1 units unloaded JIT success (68.2ms): mjit10@(eval):1 -> /usr/home/hsbt/chkbuild/tmp/build/20180911T123001Z/tmp/jit_test_unload_units_20180911-96427-13cagj9/_ruby_mjit_p99188u11.c ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18mjit_worker.c: revert r64322 and r64323k0kubun
I gave up to introduce the optimization that skips pc motion by checking C code's line number. The same code can often be shared by multiple program counters and it's so hard to achieve the optimization in MJIT's architecture. Reverting to improve performance by removing -g1 and to remove so file when it becomes not necessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13Makefile.in: drop MJIT_DLDFLAGS_NOCOMPRESSk0kubun
which is obsoleted by r64331 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-12configure.ac: MJIT_DLDFLAGS_NOCOMPRESSk0kubun
is configured now, to force -Wl,--compress-debug-sections=no for MJIT only when the option is used in MJIT_DLDFLAGS. This needs to be done in configure.ac to resolve build failure like https://travis-ci.org/ruby/ruby/builds/415120662. Makefile.in: define it in mjit_config.h mjit_worker.c: replace hard-coded flag to MJIT_DLDFLAGS_NOCOMPRESS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-12mjit_worker.c: lazily delete so filek0kubun
on ELF. I need symbol name and line number to lazily create program counter for optimization on ELF binary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-12mjit_worker.c: allow showing line numberk0kubun
on addr2line.c, if --jit-save-temps is specified. I'm going to use the line number to lazily create program counter to improve the performance degraded in r64283. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: remove redundant cast for calloc/allocak0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: handle calloc failurek0kubun
Unlike ZALLOC, it's not automatically handled. mjit.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: never trigger GC on MJIT workerk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: don't use ruby_strdupk0kubun
on MJIT worker. That may trigger GC. And handled strdup failure instead. mjit_compile.c: update comment about GC git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: share MJIT warning logick0kubun
as mjit_warning(). mjit.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: resurrect more static declarationsk0kubun
and remove old mjit_ prefixes again. mjit.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: reorder functions and variablesk0kubun
so that related things are placed closely. Sorry for mixing them in previous commits... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit.c: make some variables static againk0kubun
and remove redundant mjit_ prefixes. mjit_worker.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit.c: include mjit_worker.ck0kubun
instead of linking functions with mjit_worker.o. In the r64285's structure, we needed to publish some variables with mjit_ prefix. But ideally those variables should be completely private in mjit.o (or old mjit_worker.o), and it was hard. So I chose an approach similar to vm*.c for mjit.c and mjit_worker.c. I believe mjit_compile.c is still nice to be separated. After this commit, I'll remove the mjit_ prefix again... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit.c: exclude mjit_valid_class_serial_pk0kubun
from mjit.c because it's executed only on MJIT worker thread. Instead of that, `valid_class_serials` is shared with mjit_ prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: prefix mjit_ to pch_statusk0kubun
which was just forgotten. mjit.c: ditto mjit_internal.h: moved some macros only used by mjit_worker.c to it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11mjit_worker.c: carve out worker-related codek0kubun
The motivation of this change is to make sure rb_funcall or GC-related functions are not called on worker-related code. Currently such functions are used in some places and I believe it's partly because it's hard to identify which part is called on MJIT worker thread. Now, mjit.c is safe to use them but we know we need to safely deal with mjit_compile.c, mjit_worker.c and mjit_internal.h. mjit_compile.c: update the comment about it git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e