Граф коммитов

443 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 74d95744bd
Add `--enable-devel` configure option
Since `RUBY_DEVEL` in cppflags has no effect in the configure script
and makefiles.
2022-08-11 11:34:52 +09:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Jakub Kulík 31bd79dda3
Add yjit.o to DTRACE_DEPENDENT_OBJS
In principle, we have a DTrace probe in yjit.c, so yjit.o should be
in DTRACE_DEPENDENT_OBJS for DTRACE_REBUILD=yes builds. This commit
adds to the list.

In practice DTRACE_REBUILD=yes implies the system has a Solaris-like
DTrace and YJIT doesn't support those systems. YJIT_OBJ expands to
nothing, and yjit.c isn't compiled.

I tested on OmniOS v11 r151034m with:

    $ ../src/configure --with-out-ext=psych MAKE=gmake AR=ar debugflags=-g
    $ gmake -j

It builds before and after this change.

[Bug #18480]
2022-05-30 18:30:57 -04:00
Nobuyoshi Nakada 11793f897c
Reduce duplicate replacements
Reduce duplicate replacements so that reflect macros in command lines
consitently.  So that reflect macros in command lines.  Others than
`nmake` have no problems with nested expansions.
2022-05-30 12:03:57 +09:00
Nobuyoshi Nakada cdfb027213
Run find in PATH [ci skip] 2022-05-25 18:26:24 +09:00
Nobuyoshi Nakada 0114c72df0
Clean intermediate files for update-deps [ci skip] 2022-05-25 15:06:47 +09:00
Nobuyoshi Nakada 97c12c5f69 Clean intermediate object files 2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 9a0f5a8edc Verbose mode on libyjit merge 2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 9b3ed5a23f Extract YJIT_LIBS directly without copying 2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 3db8db8a32 `AR` does not need the absolute path
Still use `find` to get rid of potential ARGV limit overflow, since
rustc-genrated object file names are mangled and very long.
2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 2411f0ad8c
Set `target_os` for a7577dbfd3 2022-05-17 12:14:32 +09:00
Alan Wu 99281f513c YJIT: Handle spaces in build dir path using find(1) `-exec`
Previously, we relied on shell word splitting, which leads
to passing the wrong arguments when there are white spaces
in the path.

Avoiding command substitution also makes this script more
likely to work under Solaris 10, where `/bin/sh` is not
POSIX compliant [1]. (Thanks you, `@znz` for fixing the syntax
error in 4210ae2158 though!)

The hack from c466f270b8
doesn't actually work so this commit reverts it. The shell
still needs to parse through all of the code, maybe because
make doesn't in fact send newlines to the shell.

By the way, we also use the `-exec` option in the `ext/distclean` task.

[1]: https://docs.oracle.com/cd/E26505_01/html/816-5165/sh-1.html
2022-04-28 19:02:26 -04:00
Kazuhiro NISHIYAMA 4210ae2158
Try to fix error on Solaris
https://rubyci.s3.amazonaws.com/solaris10-sunc/ruby-master/log/20220428T000004Z.fail.html.gz
```
linking static-library libruby-static.a
/bin/sh: syntax error at line 8: `(' unexpected
gmake: *** [Makefile:318: libruby-static.a] Error 2
exit 2
failed(make)
```
2022-04-28 09:44:38 +09:00
Alan Wu c466f270b8 Work around shell syntax error on Solaris
The shell in Solaris 10 has trouble understanding the syntax I used in
YJIT's library merging script.

This commit reduces the code the shell needs to parse before exiting on
non-YJIT builds to hopefully fix the error on Solaris.
2022-04-27 18:59:10 -04:00
Alan Wu f90549cd38 Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.

The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.

Because we want to be careful, YJIT is guarded behind a configure
option:

```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```

By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.

The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.

The CI tests have been updated and do not take any more resources than
before.

The development history of the Rust port is available at the following
commit for interested parties:
1fd9573d8b

Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.

[issue]: https://bugs.ruby-lang.org/issues/18481

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-27 11:00:22 -04:00
Alan Wu 5f1f8c244d
Fix fake.rb RUBY_DESCRIPTION faking for JITs
Previously, `make test-spec` was not printing the description with +YJIT
even when YJIT was indeed enabled. It was confusing on CI. `fake.rb` was
changing the `RUBY_DESCRIPTION` constant incorrectly.

I suppose `make test-spec` mostly needs the `mkmf` faking and not the
faking of `RUBY_.*` constants, so maybe there is an opportunity to simplify
in the future.
2022-04-11 13:28:07 -04:00
Nobuyoshi Nakada 21f006f5f7
Retrieve previously configured macros also other than `extensions` 2022-04-07 15:03:24 +09:00
Nobuyoshi Nakada 17ce0b9b84 Retrieve configured gems info 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada db3d111c1d Bundled gems are expanded under `.bundle/gems` now 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada 97ce030954 Load fake.rb at `BTESTRUBY`
So that `mkmf` checks work from `make run`, and also remove
duplicate `$(MINIRUBYOPT)` which is used in `$(MINIRUBY)`.
2022-04-05 22:35:40 +09:00
Nobuyoshi Nakada 26aff37466
Need to reconfigure and rebuild everything when abi.h changed 2022-03-23 00:58:46 +09:00
Yuta Saito 77f3f8a1d4 exts.mk.tmpl: propagate MINIRUBY to enc.mk even though invoking from exts.mk
This is another attempt to fix out-of-src build with
--with-static-linked-ext. The first attempt was
4f1888bda70981d9f5b1bf55ab692e0ce18e79f4 but reverted because it broke
out-of-src build from pre-generated sources via `make dist`.
This patch fixes the second trans C source gen, mentioned in the
previous commit message, by passing MINIRUBY as well as when invoking
from common.mk
2022-03-09 22:43:02 +09:00
Peter Zhu ffda21b7ba [Feature #18491] Drop support for HP-UX
IA64 support was dropped in ticket #15894, so we can drop support for
HP-UX.
2022-01-18 09:52:15 -05:00
Nobuyoshi Nakada 93591d31b0
Use rb_cObject instead of rb_cData 2021-12-31 10:53:54 +09:00
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Takashi Kokubun 11b8aaa26a
Rename --jit to --mjit (#5248)
* Rename --jit to --mjit

[Feature #18349]

* Fix a few more --jit references

* Fix MJIT Actions

* More s/jit/mjit/ and re-introduce --disable-jit

* Update NEWS.md

* Fix test_bug_reporter_add
2021-12-13 16:08:01 -08:00
Nobuyoshi Nakada 4a6ca12904
Remove unversioned phony target for pkgconfig file [Bug #18374]
It results in a circular dependency when `--with-ruby-pc=ruby.pc`
is given.  [ci skip]
2021-12-04 16:20:30 +09:00
Naohisa Goto a982a1f1e7 Update URL about DTrace static library glommed obj [ci skip]
The old URL
http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
pointed to the official archive of dtrace-discuss mailing list
in opensolaris.org, disappeared in 2013.
The new URL points to the MARC Mailing list ARChives.
2021-11-17 20:59:48 +09:00
Peter Zhu aeae6e2842 [Feature #18290] Remove all usages of rb_gc_force_recycle
This commit removes usages of rb_gc_force_recycle since it is a burden
to maintain and makes changes to the GC difficult.
2021-11-08 14:05:54 -05:00
Aaron Patterson 41f405c486 Remove the scraper
Now that we're using the jit function entry point, we don't need the
scraper.  Thank you for your service, scraper. ❤️
2021-10-20 18:19:38 -04:00
Aaron Patterson 30f20d7c38 Remove some MicroJIT vestiges
Just happened to run across this, so lets fix them
2021-10-20 18:19:36 -04:00
Jose Narvaez 4e2eb7695e Yet Another Ruby JIT!
Renaming uJIT to YJIT. AKA s/ujit/yjit/g.
2021-10-20 18:19:31 -04:00
Maxime Chevalier-Boisvert e4c65ec49c Refactor uJIT code into more files for readability 2021-10-20 18:19:26 -04:00
Alan Wu 3d87eadf16 Refactor ujit_examples.h generator. Remove dwarfdump dependency 2021-10-20 18:19:24 -04:00
Nobuyoshi Nakada d53493715c
Add the dependency of GNUmakefile itself [ci skip] 2021-10-06 15:42:37 +09:00
卜部昌平 5112a54846 include/ruby/encoding.h: convert macros into inline functions
Less macros == huge win.
2021-10-05 14:18:23 +09:00
Nobuyoshi Nakada bac6e8ca5d
Stop building extension gems for now
Extension gems will be installed by the installed standard
libraries.
2021-10-04 20:03:14 +09:00
Nobuyoshi Nakada 98c5907c65
Ripper source on mswin
* Get rid of command substitution for cmd.exe.
* Separate RM1 command to remove single file sans directory.
2021-09-21 13:05:27 +09:00
卜部昌平 789232f9fd template/Doxyfile.tmpl: modernise
applied doxygen -g for Doxygen 1.9.3.
2021-09-15 09:25:23 +09:00
卜部昌平 679f4b895b template/Doxyfile.tmpl: EXTRACT_ALL=NO
This prevents file-static functions/variables be listed in the CAPI
documents.  An entity shall be placed inside of a file that contains
`@file` doxygen comment, in order for it to be documented. [ci skip]
2021-09-10 20:00:06 +09:00
sonots 0e3dae78b3 template/Doxyfile.tmpl: EXTRACT_STATIC: YES [Bugs #14037]
I often feel that C API documents are lacked in C source codes,
especially for static functions. I propose to turn EXTRACT_STATIC = YES
flag of Doxygen to YES, and write document comments for static functions
as much as possible.

* template/Doxyfile.tmpl: EXTRACT_STATIC: YES [Bugs #14037]
2021-09-10 20:00:06 +09:00
卜部昌平 bbe7049813 template/Doxyfile.tmpl: rethink about exclusions
I guess we don't want documents for C API of extension libraries?  They
are never intended to provide C APIs anyways.

We could revisit this decision later. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 809138fe4b include/ruby/io.h: add doxyen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 0ea157136f postscript about rb_mutex_sleep
Asked ko1 about the design.  [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4881a3ed38 include/ruby/internal/fl_type.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 c3c0bf6823 include/ruby/internal/rgengc.h: add dosygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 e2a441bdd4 include/ruby/internal/value_type.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 28b7b0e13e include/ruby/internal/xmalloc.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 b6469c3aaf template/Doxyfile.tmpl: add alias
This enables me to write `@shyouhei` in C comments without complained by
doxygen that @shyouhei is an unknown special command. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 a08163fb24 template/Doxyfile.tmpl: use of += operator
It is easier to maintain (e.g. sort them). [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 f9af5c9542 template/Doxyfile.tmpl: quote spaces
The new Doxyfile.tmpl says:

> # Values that contain spaces should be placed between quotes (\" \").

[ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 85a737a1f9 template/Doxyfile.tmpl: increase DOT_GRAPH_MAX_NODES
`make capi` warned:

> warning: Included by graph for 'dllexport.h' not generated, too many nodes (85)

[ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 c9753f3f91 template/Doxyfile.tmpl: delete commented-out settings
Let our VCS manage old contents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 aa5dc3e297 template/Doxyfile.tmpl: modernize
Didn't question the current settings.  This changeset just re-applied
`doxygen -g` against:

doxygen 1.9.0 (1e72202d8fa0e9d2b3f2a29c88ec4f5790a0a4e2)

[ci skip]
2021-09-10 20:00:06 +09:00
Nobuyoshi Nakada 7487371eeb
Make ruby.pc from make
Expand variables undefined in configure.ac, RUBY_RELEASE_DATE and
so on.
2021-08-29 14:08:53 +09:00
Nobuyoshi Nakada 623736ae7f
Move DEFFILE to EXTDLDFLAGS
So that it is no longer needed in ruby.pc.in.
2021-08-29 13:04:42 +09:00
Nobuyoshi Nakada 323c0c392a
Reorder ruby.pc variables
Moved variables obviously independent from others first.
2021-08-29 12:50:24 +09:00
Nobuyoshi Nakada 2e49e4330d
Disable debug flag for executable files when LTO [ci skip]
Get rid of tons of linker warnings that it could not find object
file symbol for every symbols, when targeting darwin.
2021-08-14 23:22:04 +09:00
Nobuyoshi Nakada 6e60fc2945
Group commands on GitHub Actions 2021-08-07 18:32:24 +09:00
Yusuke Endoh 405644f38c Revert "Removed extinit.o from main programs"
This reverts commit ac86fcbfd0.

This change broke "--disable-shared --with-static-linked-ext".
2021-08-05 14:48:24 +09:00
Nobuyoshi Nakada ac86fcbfd0
Removed extinit.o from main programs
It is included in libruby, which is linked into the main programs.
2021-07-03 12:52:46 +09:00
Nobuyoshi Nakada 4b28fea6ee
Run ifchange with shell explicitly, workaround of noexec mount 2021-06-22 09:46:40 +09:00
Nobuyoshi Nakada 60eee3c3cb
Fix syntax error in generated code 2021-06-21 11:20:31 +09:00
Nobuyoshi Nakada 28933c1071
Adjust indents 2021-06-21 11:08:02 +09:00
Nobuyoshi Nakada 2e97240617
prelude.c.tmpl: strip comment-only or empty lines at the beginning 2021-06-06 22:45:37 +09:00
Benoit Daloze 68d6bd0873 Fix trivial -Wundef warnings
* See [Feature #17752]

Co-authored-by: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
2021-05-04 14:56:55 +02:00
Nobuyoshi Nakada c569c298fe just redirect preprocessed vm.c to mjit header [Bug #17787]
Not all preprocessors work with output option.
2021-04-10 16:05:01 +09:00
Nobuyoshi Nakada cb396d4214
Share variables defined in common GNUmakefile also in cygwin/mingw 2021-03-21 17:57:44 +09:00
Nobuyoshi Nakada 4ea9df0135
No longer aclocal is used [ci skip] 2021-03-20 09:12:08 +09:00
Nobuyoshi Nakada 07b4b1b1cb
Support coroutine on universal binary 2021-01-22 23:41:52 +09:00
Nobuyoshi Nakada dff74ee6db
Revert "Autoconf 2.70 no longer has -o option"
This reverts commit 331f0bc1cb.
It seems a mistake.
2021-01-18 21:15:47 +09:00
Nobuyoshi Nakada 331f0bc1cb
Autoconf 2.70 no longer has -o option 2021-01-18 16:22:17 +09:00
Takashi Kokubun e1fee7f949
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.

[Feature #17490]
2021-01-13 22:46:51 -08:00
Nobuyoshi Nakada 208192fdb6
Fixed wrong configure option 2020-12-29 17:50:14 +09:00
Nobuyoshi Nakada 2f42243bce Make more silent when -s on GNU make 2020-12-29 17:45:19 +09:00
Nobuyoshi Nakada d57c5a7b61 transcode-tblgen.rb: make silent a little when just -v 2020-12-29 17:45:19 +09:00
Nobuyoshi Nakada 260d626ef6
Ignore symbols declared in the platform header 2020-12-27 15:50:44 +09:00
Koichi Sasada aa6287cd26 fix inline method cache sync bug
`cd` is passed to method call functions to method invocation
functions, but `cd` can be manipulated by other ractors simultaneously
so it contains thread-safety issue.

To solve this issue, this patch stores `ci` and found `cc` to `calling`
and stops to pass `cd`.
2020-12-15 13:29:30 +09:00
Takashi Kokubun 8ce1711c25
Revert "Set VM_FRAME_FLAG_FINISH at once on MJIT"
This reverts commit 4d2c8edca6.

Unfortunately this seems to cause several issues:
https://github.com/ruby/ruby/runs/1462188376?check_suite_focus=true
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3272802
2020-11-26 22:41:15 -08:00
Takashi Kokubun 4d2c8edca6
Set VM_FRAME_FLAG_FINISH at once on MJIT
Performance is probably improved?

$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T04:37:47Z master 69e77e81dc) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-11-27T05:28:19Z master df6b05c6dd) +JIT [x86_64-linux]
last_commit=Set VM_FRAME_FLAG_FINISH at once
Calculating -------------------------------------
                                 before --jit           after --jit
Optcarrot Lan_Master.nes    80.89292998533379     82.19497327502751 fps
                            80.93130641142331     85.13943315260148
                            81.06214830270119     87.43757879797808
                            82.29172808453910     87.89942441487113
                            84.61206450455929     87.91309779491075
                            85.44545883567997     87.98026086648694
                            86.02923132404449     88.03081060383973
                            86.07411817365879     88.14650206137341
                            86.34348799602836     88.32791633649961
                            87.90257338977324     88.57599644892220
                            88.58006509876580     88.67426384743277
                            89.26611118140011     88.81669430874207

This should have no bad impact on VM because this function is ALWAYS_INLINE.
2020-11-26 21:32:14 -08:00
Nobuyoshi Nakada 75d48a533d
rubyspec-capiext: Use plain DLDFLAGS without flags for libruby 2020-11-22 19:09:58 +09:00
Nobuyoshi Nakada b958e2add8 Removed canonicalization for mathn 2020-11-10 11:14:15 +09:00
Koichi Sasada 07c03bc309 check isolated Proc more strictly
Isolated Proc prohibit to access outer local variables, but it was
violated by binding and so on, so they should be error.
2020-10-29 23:42:55 +09:00
Stefan Stüben 8c2e5bbf58 Don't redefine #rb_intern over and over again 2020-10-21 12:45:18 +09:00
卜部昌平 21b3bc10d3 DEPRECATED_TYPE: is deprecated
Nobody uses this macro any longer.
2020-08-27 15:02:52 +09:00
卜部昌平 5af983af4f template/prelude.c.tmpl: suppress clang-12 warning
Clang 12 warns "suspicious concatenation of string literals in an array
initialization", which is rather annoying than useful in this context.
2020-08-11 16:51:07 +09:00
卜部昌平 acd8ee8dbc tool/prelude.c.tmpl: use RubyVM::CEscape
Do not repeat yourself.
2020-08-11 16:51:07 +09:00
Nobuyoshi Nakada ec9a9aaa51
Ignore configurations in un-built extension libraries
Exclude linker flags for external libraries used by no longer
built extension libraries when static-linked-ext.
2020-06-23 00:25:36 +09:00
Nobuyoshi Nakada f3e081c6b6
Build configured extension libraries only
Consider the libraries, which remain exts.mk but not listed in
ext/configure-ext.mk, removed.
2020-06-19 15:35:14 +09:00
Nobuyoshi Nakada aa21a775a6
Configure only directories having extconf.rb 2020-06-19 15:13:59 +09:00
Nobuyoshi Nakada 1e7c0ccb0d
Now bundled gems are extracted under .bundle/gems 2020-06-19 14:02:46 +09:00
Nobuyoshi Nakada 0d38a51ec4
Clean exts.mk under each extension library 2020-06-19 12:07:19 +09:00
Nobuyoshi Nakada 1f1b62fb7b
Added install-dbg
Scripts to run the interpreter via debugger.
2020-06-13 08:22:06 +09:00
Nobuyoshi Nakada 0c00a4176b
Hash marks in Makefile need to be escaped [Bug #16935] 2020-06-06 16:46:05 +09:00
Nobuyoshi Nakada 1c4eb70654
Build auxiliary program files early 2020-05-12 23:19:20 +09:00
Nobuyoshi Nakada dd830fab69
Fixed a typo 2020-05-10 18:40:47 +09:00
Nobuyoshi Nakada 42e8de8db9
Fix for cross_compiling
`RubyVM.each_builtin` is not defined when cross compiling.
2020-05-10 17:28:03 +09:00
卜部昌平 4fca592e8c delete mk_builtin_binary.rb
To generate what is necessary via generic_erb.rb instead.
2020-05-10 16:51:10 +09:00
卜部昌平 191cfcc407 delete mk_call_iseq_optimized.rb
To generate what is necessary via generic_erb.rb instead.
2020-05-10 16:51:10 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00