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

79692 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton 719f834466 [ruby/yarp] Mark flags as private
The flags integer is an implementation detail. We want people to
use the query methods to access the individual fields so we are
freed from having to maintain a specific order. As such, this
commit changes the Ruby API to mark all flags fields as private
attr_readers.

The only one that has a clear use case is returning the set of
options given to regular expressions, to mirror the Regexp#options
API. So, to support this use case, this commit introduces
RegularExpressionNode#options and InterpolatedRegularExpressionNode#options.
These APIs provide back the same integer so that they can be used
interchangeably.

https://github.com/ruby/yarp/commit/4e6d5dd99f
2023-09-11 16:18:32 +00:00
Tim Morgan 05a853c2f2 [ruby/yarp] Update fixtures
https://github.com/ruby/yarp/commit/884f2ca8e4
2023-09-11 15:25:06 +00:00
Tim Morgan 5a8767ed6c [ruby/yarp] Fix order of Regexp flags
https://github.com/ruby/yarp/commit/e421305ea2
2023-09-11 15:25:06 +00:00
Tim Morgan 689dffc857 [ruby/yarp] Add failing test for Regexp flags
https://github.com/ruby/yarp/commit/16fe179c5f
2023-09-11 15:25:05 +00:00
Nobuyoshi Nakada b1f0d009cb
Use the keyword for output and omit default arguments [ci skip] 2023-09-11 12:23:57 +09:00
Nobuyoshi Nakada 05046b8955
Add `modencs` target to build encodings/transcoders as modules 2023-09-11 11:06:49 +09:00
Nobuyoshi Nakada 2cc32ad67c
Split commit recipe and pass more macros 2023-09-11 11:04:33 +09:00
Nobuyoshi Nakada b8d0ab80bb
Declare `k_class` and `k_module` as `ctxt`
So that it is not ncessary to specify the type each time.
2023-09-10 21:37:44 +09:00
Yuichiro Kaneko 16882d4ebb
Add a new line between function definitions [ci skip] 2023-09-10 19:46:12 +09:00
yui-knk b5914a72a9 Refactor to use same logic with other assignment nodes 2023-09-10 19:45:33 +09:00
kudojp 0e49f8173a [DOC] Fix method docs of scheduler#io_read and scheduler#io_write
Each of Fiber::Scheduler#io_read and io_write takes the "offset" as the fourth argument, which is not doucmented.
2023-09-10 19:39:28 +09:00
Herwin b926ac51cc
[DOC] Fix a typo in "Open Options" section of IO
The word "and" was missing.
2023-09-10 19:33:48 +09:00
Nobuyoshi Nakada f2102e4015
Set ripper_init.c.tmpl to C mode [ci skip] 2023-09-10 19:20:31 +09:00
Stan Lo b635a66e95
[DOC] Update Reline and IRB's maintainers list (#8406)
Update Reline and IRB's maintainers list

Maintainers' order follows the same order they appear in the projects'
contributors list as of the time this commit is made.
2023-09-08 16:08:32 -07:00
Sutou Kouhei 90dad2b128 memory_view: Avoid using bit field
Bit field's memory layout is implementation-defined.

See also:
https://wiki.sei.cmu.edu/confluence/display/c/EXP11-C.+Do+not+make+assumptions+regarding+the+layout+of+structures+with+bit-fields

If memory layout is implementation-defined, it's difficult to use from
FFI library such as Ruby-FFI.
2023-09-09 07:30:04 +09:00
Jemma Issroff d9ede18154
[YARP] Extract YP_COMPILE helper (#8403) 2023-09-08 16:33:05 -04:00
git 1f35789ffe Update default gems list at f4443f3b1c [ci skip] 2023-09-08 19:52:16 +00:00
Kevin Newton f4443f3b1c [ruby/yarp] Increment version
https://github.com/ruby/yarp/commit/2b41ceb754
2023-09-08 19:50:47 +00:00
Kevin Newton c0f162caab [ruby/yarp] Template out a comment_targets method
https://github.com/ruby/yarp/commit/a94af7c4c8
2023-09-08 19:38:17 +00:00
Kevin Newton 5d73c0f3df [ruby/yarp] Move parse result mutations into their own files
https://github.com/ruby/yarp/commit/3be8272fa2
2023-09-08 19:38:17 +00:00
Jemma Issroff 7fc4db35ee
[YARP] Implement compilation for RationalNodes, fix other num types (#8404) 2023-09-08 15:33:51 -04:00
Vinicius Stock 6050b5a4e8 [ruby/yarp] Add ParseResult#attach_comments! to tie comments to their locations
https://github.com/ruby/yarp/commit/ddc699156f

Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
2023-09-08 18:10:26 +00:00
Matt Valentine-House 7f53da94fb Fix weak_references count test
This test creates a lot of Objects held in an array, and a set of weak
references to them using WeakMap. It then clears the array and frees it
and asserts that all the weak references to it are also gone.

This test is failing because one of the dummy objects in our weakmap is
ending up on the stack, and so is being marked, even though we thought
that we'd removed the only reference to it.

This behaviour has changed since this commit:

5b5ae3d9e0

which rewrites `Integer#times` from C into Ruby. This change is somehow
causing the last object we append to our array to consistently end up on
the stack during GC.

This commit fixes the specific weakmap test by using an enumerator and
each, instead of `Integer#times`, and thus avoids having our last object
created end up on the stack.
2023-09-08 17:45:00 +01:00
Alan Wu 60ef156b14 [DOC] Kernel#{proc,lambda} don't issue warnings anymore
They've been raising since 3.0.0.
2023-09-08 12:33:58 -04:00
Jemma Issroff af5df9ee5e
[YARP] Implement compilation for Regex / InterpolatedRegex (#8396) 2023-09-08 12:09:30 -04:00
Jemma Issroff 8807b0dc96
[YARP] Implement compilation for InterpolatedXStringNode (#8395)
* [YARP] Implemented compilation for InterpolatedXStringNode

* Extract common function for interpolated nodes
2023-09-08 10:40:07 -04:00
Kevin Newton c7d61181d0 [ruby/yarp] Flatten multitarget into multiwrite
https://github.com/ruby/yarp/commit/1021dac372
2023-09-08 13:40:28 +00:00
Kevin Newton f39b576e76 [ruby/yarp] Multi target nodes
https://github.com/ruby/yarp/commit/fa53fe88e4
2023-09-08 13:40:28 +00:00
Samuel Williams be21a056d2
Try default `gcc` 9.4.0 to see if it exhibits the same compiler bugs. (#8394)
* Revert "Extract `do_mutex_lock_check_interrupts` to try and fix `ppc64le`. (#8393)"

This reverts commit 5184b40dd4.

* .travis.yml: Try default gcc 9.4.0 instead of gcc-10 in ppc64le and s390x.

Use gcc 9.4.0 instead of gcc-10 to avoid the current failures by a possible GCC
10 compiler bug in the Travis ppc64le and s390x cases. And it also aligns with
RubyCI Ubuntu ppc64le and s390x where the default gcc is used.

---------

Co-authored-by: Jun Aruga <jaruga@ruby-lang.org>
2023-09-08 20:44:46 +12:00
dependabot[bot] 15fd897629 Bump actions/cache from 3.3.1 to 3.3.2
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](88522ab9f3...704facf57e)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 12:26:50 +09:00
Nobuyoshi Nakada b6df6f911c
Continue even if addr or rnglists headers not found
Fix up commit 31d1226, "Avoid aborting inside addr2line.c".
Source code informations did not appear in C level backtrace since
that change.
2023-09-08 12:22:55 +09:00
Ian Candy 78233e8352
Add `String#getbyte` YJIT implementation (#8397)
* Add getbyte JIT implementation

Adds an implementation for String#getbyte for YJIT, along with a
bootstrap test. This should be helpful for pure Ruby implementations
and to avoid unneeded allocations.

Co-authored-by: John Hawthorn <jhawthorn@github.com>

* Skip the getbyte test for RJIT for now

---------

Co-authored-by: John Hawthorn <jhawthorn@github.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-09-07 23:15:24 -04:00
Takashi Kokubun 89edce4321
YJIT: Decrease IVAR_MAX_DEPTH to 8 (#8398) 2023-09-07 23:15:08 -04:00
John Hawthorn 094f336a27 GC: Only force alloc slowpath for NEWOBJ hook
Previously, configuring any GC event hook would cause all allocations to
go through the newobj slowpath. We should only need to do that when the
newobj specifically is subscribed to.

This renames flags.has_hook to flags.has_newobj_hook, to make this new
usage clear. newobj_of0 was the only place which previously checked this
flag.
2023-09-07 13:51:56 -07:00
Matthew Draper aed5215104 Optimize handle_interrupt(Exception => ..) as a common case
When interrupt behavior is configured for all possible exceptions using
'Exception', there's no need to iterate the pending exception's
ancestors for hash lookups.

More significantly, by storing the catch-all timing symbol directly in
the mask stack, we can skip allocating the hash we would otherwise need.
2023-09-07 13:51:15 -07:00
Matthew Draper ed712e0e9d Skip allocation if handle_interrupt arg is already usable
If the supplied hash is already frozen and compare-by-identity, we can
use it directly (still checking its contents are valid symbols), without
making a new copy.
2023-09-07 13:51:15 -07:00
Takashi Kokubun fcdedf7f47
YJIT: Decrease SEND_MAX_DEPTH to 5 (#8390) 2023-09-07 14:22:34 -04:00
Mike Dalessio 60a52caf87 [ruby/yarp] Avoid an extra "stop" parameter to yp_strspn_whitespace_newlines
and use yp_strspn_inline_whitespace instead.

Partially reverts implementation details from #1152

https://github.com/ruby/yarp/commit/c8f9f4cfde
2023-09-07 18:13:51 +00:00
Takashi Kokubun 5b5ae3d9e0
Rewrite Integer#times in Ruby (#8388) 2023-09-07 10:57:52 -07:00
Mike Dalessio 4efcaf956e [ruby/yarp] Extract error messages into diagnostic.c and use canonical message IDs
The parser now passes around `yp_diagnostic_id_t` for diagnostic
messages instead of character strings, and we rely on the function
`diagnostic_message()` to resolve that to a string.

In addition, many messages were edited so that the parser expresses
coordinate ideas in similar form [1] using consistent voice and
typographic conventions.

Closes https://github.com/ruby/yarp/pull/1379, and makes progress on #941.

  [1] Strunk & White rule 19

https://github.com/ruby/yarp/commit/0b6dd85bf1
2023-09-07 16:36:56 +00:00
Jean Boussier 2d37b44603 Document that thread event hooks are called without the GVL
Except for the `RESUMED` event.
2023-09-07 18:31:16 +02:00
Jemma Issroff 7adc38b895
[YARP] Miscellaneous small bug fixes (#8387) 2023-09-07 10:59:51 -04:00
Nathan Froyd 630e49010c [ruby/yarp] remove now-redundant `YP_TOKEN_NOT_PROVIDED_VALUE`
https://github.com/ruby/yarp/commit/8f9a3c2345
2023-09-07 14:02:40 +00:00
Nathan Froyd 44b52c5416 [ruby/yarp] use `YP_LOCATION_*_VALUE` macros more consistently
https://github.com/ruby/yarp/commit/bcad93e2fc
2023-09-07 14:02:40 +00:00
Kevin Newton 194584f202 [ruby/yarp] Introduce owned constants
Before this commit, constants in the constant pool were assumed to
be slices of the source string. This works in _almost_ all cases.

There are times, however, when a string needs to be synthesized.
This can occur when passing in locals that need to be scoped through
eval, or when generating method names like `foo=`.

After this commit, there is a single bit `owned` boolean on
constants in the pool that indicates whether or not it is a slice
of the source string. If it is not, it is assumed to be allocated
memory that should be freed by the constant pool when the constant
pool is freed.

When serializing, the most significant bit in the location of the
contents of the constant indicates whether or not it is owned.
When it is, instead of 4 bytes for the source offset and 4 bytes
for the length it is instead 4 bytes for the buffer offset and 4
bytes the length. The contents of the owned constants are embedded
into the buffer after the constant pool itself.

https://github.com/ruby/yarp/commit/461c047365
2023-09-07 14:01:21 +00:00
Aaron Patterson 0adca625ee
Remove function call for String#bytesize (#8389)
* Remove function call for String#bytesize

String size is stored in a consistent location, so we can eliminate the
function call.

* Update yjit/src/codegen.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

---------

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-09-07 09:54:05 -04:00
Kevin Newton 0c8928721e
[YARP] Use the correct field for the name on classes and modules 2023-09-07 09:10:50 -04:00
Kevin Newton 14970cfc8d [ruby/yarp] Constants and def nodes
https://github.com/ruby/yarp/commit/6b2421ce1b
2023-09-07 12:42:02 +00:00
Kevin Newton 9343ef2504 [ruby/yarp] Constants on rest parameter nodes
https://github.com/ruby/yarp/commit/a6fdb8aae9
2023-09-07 12:42:02 +00:00
Kevin Newton 3f78eec44a [ruby/yarp] Constants on keyword rest parameters
https://github.com/ruby/yarp/commit/5e1a8fbc54
2023-09-07 12:42:01 +00:00