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

1953 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 1c083c4db0
Clean up files made by runnable in clean-runnable [ci skip] 2024-03-07 16:40:27 +09:00
Nobuyoshi Nakada 810779fab9
Clean up dump file generated by `--yjit-exit-locations` [ci skip] 2024-03-07 14:33:40 +09:00
Kevin Newton e13fd48f55 [PRISM] Update dependencies for prism diagnostics 2024-03-06 21:42:54 -05:00
Jean Boussier b4a69351ec Move FL_SINGLETON to FL_USER1
This frees FL_USER0 on both T_MODULE and T_CLASS.

Note: prior to this, FL_SINGLETON was never set on T_MODULE,
so checking for `FL_SINGLETON` without first checking that
`FL_TYPE` was `T_CLASS` was valid. That's no longer the case.
2024-03-06 13:11:41 -05:00
Peter Zhu a255b43ff1 Update common.mk 2024-02-23 17:17:12 -05:00
Takashi Kokubun 8a6740c70e
YJIT: Lazily push a frame for specialized C funcs (#10080)
* YJIT: Lazily push a frame for specialized C funcs

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>

* Fix a comment on pc_to_cfunc

* Rename rb_yjit_check_pc to rb_yjit_lazy_push_frame

* Rename it to jit_prepare_lazy_frame_call

* Fix a typo

* Optimize String#getbyte as well

* Optimize String#byteslice as well

---------

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2024-02-23 19:08:09 +00:00
Kevin Newton 9a09e27a73 [PRISM] Use new static literal comparisons 2024-02-23 13:25:31 -05:00
Kevin Newton 4016535404 [PRISM] Integrate new number parsing 2024-02-22 22:42:44 -05:00
Peter Zhu e65315a725 Extract imemo functions from gc.c into imemo.c 2024-02-22 11:35:09 -05:00
Nobuyoshi Nakada 01c7e16c0c Separate miniruby from dmyext.c 2024-02-21 23:37:20 +09:00
yui-knk e7ab5d891c Introduce NODE_REGX to manage regexp literal 2024-02-21 08:06:48 +09:00
Hiroshi SHIBATA cb9e0a4537
Don't exclude `test_gem_package_task.rb` explicitly.
3d4f5e7671 suppressed warnings.
2024-02-19 13:55:06 +09:00
Alan Wu fbe63047cb Fix PRISM build dependencies 2024-02-16 14:47:16 -05:00
Hiroshi SHIBATA 38cc9dacaa We can test bundled gems without default gems installation 2024-02-16 17:28:00 +09:00
Hiroshi SHIBATA 0da12fa34e Added singleton for prime 2024-02-15 20:34:52 +09:00
Benoit Daloze 8f926cb8d8 No need to extract bundled gems before test-spec
* Since https://github.com/ruby/ruby/pull/9977
2024-02-15 12:06:21 +01:00
Hiroshi SHIBATA 6958e88f29 Fix task dependency 2024-02-15 18:57:23 +09:00
Hiroshi SHIBATA 1e6fffaeeb Added new ruby/spec task for bundled gems 2024-02-15 18:57:23 +09:00
Kevin Newton 8e3eb8c9b4
[PRISM] Fix up common.mk dependencies 2024-02-13 20:32:19 -05:00
Benoit Daloze 39788e5888 Try prepare-gems instead of extract-gems
* `make install` uses prepare-gems.
2024-02-12 11:33:19 +01:00
Benoit Daloze 90a746d246 Always extract bundled gems before running ruby/spec
* Fixes 44d74f22c8 (r138276491)
2024-02-12 10:55:57 +01:00
KJ Tsanaktsidis 1d467f2255 Burn default ASAN options into the built Ruby
* We always need use_sigaltstack=0 because Ruby registers sigaltstack
  handlers
* We also need to disable leak detection (unless RUBY_FREE_AT_EXIT is
  set - I might experiment later with automatically enabling leak
  detection if RUBY_FREE_AT_EXIT is set).

Burning it into the built ruby binary in this way avoids people needing
to remember to start their Ruby program with these flags all the time.

We also need a small fix in mkmf to make sure that test programs also
don't have leak detection enabled (this is never desirable)

[Bug #20256]
2024-02-12 10:51:46 +11:00
Nobuyoshi Nakada 055615a473
Statically linking does not use shared libraries of encodings 2024-02-03 15:59:55 +09:00
Kevin Newton 610636fd6b [PRISM] Mirror iseq APIs
Before this commit, we were mixing a lot of concerns with the prism
compile between RubyVM::InstructionSequence and the general entry
points to the prism parser/compiler.

This commit makes all of the various prism-related APIs mirror
their corresponding APIs in the existing parser/compiler. This means
we now have the correct frame naming, and it's much easier to follow
where the logic actually flows. Furthermore this consolidates a lot
of the prism initialization, making it easier to see where we could
potentially be raising errors.
2024-01-31 13:41:36 -05:00
S.H f3df218f48
Introduced `rb_node_const_decl_val` function
Introduce `rb_node_const_decl_val` function to allow `rb_ary_join` and
`rb_ary_reverse` functions to be removed from Universal Parser.
2024-01-31 13:31:38 +09:00
Hiroshi SHIBATA 220f7c9d8e Re-use drb from bundled gems 2024-01-22 11:08:59 +09:00
Hiroshi SHIBATA c46d23cde7 Added dependencies rinda and drb 2024-01-19 20:02:19 +09:00
KJ Tsanaktsidis 61da90c1b8 Mark asan fake stacks during machine stack marking
ASAN leaves a pointer to the fake frame on the stack; we can use the
__asan_addr_is_in_fake_stack API to work out the extent of the fake
stack and thus mark any VALUEs contained therein.

[Bug #20001]
2024-01-19 09:55:12 +11:00
Nobuyoshi Nakada 01459f1644
Set `CHECK_LEAKS` in spec/default.mspec
Because of `.NOEXPORT:` in template/Makefile.in, variables in
common.mk will not be exported.
2024-01-16 20:29:06 +09:00
Hiroshi SHIBATA 26cf40aaa0 Always enabled leakchecker by ruby/mspec 2024-01-16 16:24:37 +09:00
yui-knk 5a471784ca Restore unknown case
This existed before 1b8d01136c.
2024-01-12 22:10:53 +09:00
KJ Tsanaktsidis 688a6ff510 Revert "Mark asan fake stacks during machine stack marking"
This reverts commit d10bc3a2b8.
2024-01-12 17:58:54 +11:00
KJ Tsanaktsidis d10bc3a2b8 Mark asan fake stacks during machine stack marking
ASAN leaves a pointer to the fake frame on the stack; we can use the
__asan_addr_is_in_fake_stack API to work out the extent of the fake
stack and thus mark any VALUEs contained therein.

[Bug #20001]
2024-01-12 17:29:48 +11:00
Kevin Newton 44d0c5ae3f [PRISM] Raise syntax errors when found 2024-01-11 14:59:37 -05:00
Peter Zhu 057df4379f Free environ when RUBY_FREE_AT_EXIT
The environ is malloc'd, so it gets reported as a memory leak. This
commit adds ruby_free_proctitle which frees it during shutdown when
RUBY_FREE_AT_EXIT is set.

    STACK OF 1 INSTANCE OF 'ROOT LEAK: <calloc in ruby_init_setproctitle>':
    5   dyld                                  0x18b7090e0 start + 2360
    4   ruby                                  0x10000e3a8 main + 100  main.c:58
    3   ruby                                  0x1000b4dfc ruby_options + 180  eval.c:121
    2   ruby                                  0x1001c5f70 ruby_process_options + 200  ruby.c:3014
    1   ruby                                  0x10035c9fc ruby_init_setproctitle + 76  setproctitle.c:105
    0   libsystem_malloc.dylib                0x18b8c7b78 _malloc_zone_calloc_instrumented_or_legacy + 100
2024-01-11 10:09:53 -05:00
Nobuyoshi Nakada 963131a2d9 outdate-bundled-gems.rb: Pass platform and version explicitly
For different version baseruby, use the target platform and version
instead of the info of baseruby.
2024-01-09 16:42:20 +09:00
S-H-GAMELINKS 1b8d01136c Introduce Numeric Node's 2024-01-07 09:24:34 +09:00
Nobuyoshi Nakada 9b78ef7552 [DOC] Load options and parse files from srcdir
RDoc options that do not change and can be written in `.rdoc_options`
file are moved, so that they match when called without `make`.

Get rid of parsing the files in `page_dir` twice (as relative paths
and absolute paths).
2024-01-06 21:19:51 +09:00
Nobuyoshi Nakada c945a849cb
Skip test depending on bundled gems
Because bundled gems cannot be loaded at test-all, this test which
depends on one of the bundled gems, `rake`, always does nothing except
print an expected warning.
2024-01-04 17:47:26 +09:00
Kevin Newton 29026404a6
Fix up common.mk targets for prism 2024-01-02 13:58:55 -05:00
yui-knk 7a050638b1 Introduce NODE_FILE
`__FILE__` was managed by `NODE_STR` with `String` object.
This commit introduces `NODE_FILE` and `struct rb_parser_string` so that

1. `__FILE__` is detectable from AST Node
2. Reduce dependency ruby object
2024-01-02 14:19:42 +09:00
yui-knk 1ade170a6c Introduce NODE_LINE
`__LINE__` was managed by `NODE_LIT` with `Integer` object.
This commit introduces `NODE_LINE` so that

1. `__LINE__` is detectable from AST Node
2. Reduce dependency ruby object
2023-12-29 18:32:27 +09:00
Peter Zhu 824ff48adc Move internal ST functions to internal/st.h
st_replace and st_init_existing_table_with_size are functions used
internally in Ruby and should not be publicly visible.
2023-12-25 10:41:12 -05:00
Nobuyoshi Nakada f6e9899e8a
Make rbconfig.rb loadable from exe/ruby
So that it can run without `--disable=gems` option.
2023-12-23 18:03:31 +09:00
Nobuyoshi Nakada 8c03bdacd1
Control the precheck for test-all by `PRECHECK_TEST_ALL` 2023-12-23 18:03:30 +09:00
Nobuyoshi Nakada 7a60196a8e
Fix ext/socket/constdefs.c dependency [ci skip] 2023-12-17 20:14:41 +09:00
Nobuyoshi Nakada e0914ed267
Add `undocumnted` target [ci skip] 2023-12-17 20:00:29 +09:00
HParker 55326a915f Introduce --parser runtime flag
Introduce runtime flag for specifying the parser,

```
ruby --parser=prism
```

also update the description:

```
$ ruby --parser=prism --version
ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384c9f) +PRISM [x86_64-darwin23]
```

[Bug #20044]
2023-12-15 13:42:19 -05:00
Satoshi Tagomori e51f9e9f75 rb_ext_resolve_symbol: C API to resolve and return externed symbols [Feature #20005]
This is a C API for extensions to resolve and get function symbols of other extensions.
Extensions can check the expected symbol is correctly loaded and accessible, and
use it if it is available.
Otherwise, extensions can raise their own error to guide users to setup their
environments correctly and what's missing.
2023-12-14 17:39:42 +09:00
Nobuyoshi Nakada 655aacc43a Use dedicated functions to check terminators 2023-12-11 16:51:46 +09:00