The current MJIT relies on SIGCHLD and fork(2) to be performant, and
it's something mswin can't offer. You could run Linux MJIT on WSL
instead.
[Misc #18968]
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which
is the ABI version. This value should be bumped whenever an ABI
incompatible change is introduced.
When loading dynamic libraries, Ruby will compare its own
`ruby_abi_version` and the `ruby_abi_version` of the loaded library. If
these two values don't match it will raise a `LoadError`. This feature
can also be turned off by setting the environment variable
`RUBY_RUBY_ABI_CHECK=0`.
This feature will prevent cases where previously installed native gems
fail in unexpected ways due to incompatibility of changes in header
files. This will force the developer to recompile their gems to use the
same header files as the built Ruby.
In Ruby, the ABI version is exposed through
`RbConfig::CONFIG["ruby_abi_version"]`.
* tool/transform_mjit_header.rb: insert GCC system_header pragma
to get rid of errors caused by the contents included from system
headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because r64849 seems to fix issues which we were confused about.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit r64829. I'll prepare another temporary fix, but I'll
separately commit that to make it easier to revert that later.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
not optimizing Array#& and Array#| because vm_insnhelper.c can't easily
inline it (large amount of array.c code would be needed in vm_insnhelper.c)
and the method body is a little complicated compared to Integer's ones.
So I thought only Integer#& and Integer#| have a significant impact,
and eliminating unnecessary branches would contribute to JIT's performance.
vm_insnhelper.c: ditto
tool/transform_mjit_header.rb: make sure these instructions are inlined
on JIT.
compile.c: compile vm_opt_and and vm_opt_or.
id.def: define id for them to be used in compile.c and vm*.c
vm.c: track redefinition of Integer#& and Integer#|
vm_core.h: allow detecting redefinition of & and |
test/ruby/test_jit.rb: test new insns
test/ruby/test_optimization.rb: ditto
* Optcarrot benchmark
This is a kind of experimental thing but I'm committing this since the
performance impact is significant especially on Optcarrot with JIT.
$ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems;before+JIT::before --disable-gems --jit;after::after --disable-gems;after+JIT::after --disable-gems --jit' -v --repeat-count 24
before: ruby 2.6.0dev (2018-09-24 trunk 64821) [x86_64-linux]
before+JIT: ruby 2.6.0dev (2018-09-24 trunk 64821) +JIT [x86_64-linux]
after: ruby 2.6.0dev (2018-09-24 opt_and 64821) [x86_64-linux]
last_commit=opt_or
after+JIT: ruby 2.6.0dev (2018-09-24 opt_and 64821) +JIT [x86_64-linux]
last_commit=opt_or
Calculating -------------------------------------
before before+JIT after after+JIT
Optcarrot Lan_Master.nes 51.460 66.315 53.023 71.173 fps
Comparison:
Optcarrot Lan_Master.nes
after+JIT: 71.2 fps
before+JIT: 66.3 fps - 1.07x slower
after: 53.0 fps - 1.34x slower
before: 51.5 fps - 1.38x slower
[close https://github.com/ruby/ruby/pull/1963]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
as well, to make CI succeed with VM_CHECK_MODE > 1.
vm_insnhelper.c: drop unnecessary MJIT_HEADER ifdef. This is intended to
be ignored by having `static inline`. Removing that by macro would be
helpful for minimizing compilation time, but the impact is not so big
and having many MJIT_HEADER check would be bad for maintainability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
between a type of return value and function identifier. Like:
```
rb_control_frame_t *
__attribute__ ((__fastcall__)) rb_vm_opt_struct_aref(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp)
{
...
}
```
[Bug #14949]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on r64031. Compiling vm_search_method_slowpath is very slow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb (MJITHeader.conflicting_types?):
Add workaround for Solaris 10 with old GCC (4.6.2), that is
essentially the same as for AIX (commit r62326), but probably
due to different GCC versions, different error message is shown.
[Bug #14751] [ruby-dev:50541]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb (MJITHeader.check_code): read
output and errors than discarding errors. also cl.exe prints
the source file name which is a garbage at this time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Now RubyCI is stable for this part. We no longer use this.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I heard `error: conflicting types for 'restrict'` can be solved by
adding `-std=c99`.
Ideally we should use the same cflags which are used to compile vm.c,
but let me try this and see what happens on AIX.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to generate MJIT header.
Even if we can't build MJIT header, Ruby's build should success. And
compilers which are not explicitly supported are likely to fail to
transform MJIT header.
Also you can pass only gcc or clang to --jit-cc=xxx for now. Thus
generating header does never make sense.
So I decided to conservatively give up MJIT header generation.
But please feel free to add your favorite compiler's macro if you think
it's working. (Another workaround is passing -D__GNUC__ :p)
[Bug #14447] [Bug #14446]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
AIX's header build is failing like:
./miniruby -I./lib -I. -I.ext/common ./tool/transform_mjit_header.rb "/usr/bin/gcc " rb_mjit_header.h .ext/include/powerpc-aix7.1.3.0/rb_mjit_min_header-2.6.0.h
error in initial header file:
/home/odaira/chkbuild/tmp/build/20180206T113302Z/tmp/20180206-15335556-aaiego.c:19:59: error: conflicting types for 'restrict'
extern size_t fread(void *restrict, size_t, size_t, FILE *restrict);
^
https://rubyci.org/logs/rubyci.s3.amazonaws.com/aix71_ppc/ruby-trunk/log/20180206T113302Z.log.html.gz#make
It's so hard to know the cause from current output. Let me add debug
output and see tomorrow's CI result.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Because `Regexp#to_s` add `(?-mix:)`, it is not unnecessary.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to whitelisted patterns. This fix is for NetBSD.
[Bug #14439]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
separating the macros. Applying the kept macros to code which is already
affected by the macros may cause errors in initial code.
This is hopefully the final fix for icc build failure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
semi-automatically.
This is basically for icc's __DATE__, __TIME__, and many other families.
It causes an error by predefined macro redefinition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb (MJITHeader.check_code!): open
temporary file in binary mode too, not to include extra CRs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb: read and write as ASCII-8BIT to
make single-byte-optimizable always.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb (separate_macro_and_code): return
macro and code separately as the name, and concat before output.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb: print non-error messages to
STDOUT instead of STDERR. exit with false or abort instead of
exit 1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/transform_mjit_header.rb: add word boundary anchors and
match whole word to get rid of false `static` declarations,
e.g., rb_str_new_static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e