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

79692 Коммитов

Автор SHA1 Сообщение Дата
Jemma Issroff c492a7f877
[YARP] Miscellaneous bug fixes (#8453)
Miscellaneous bug fixes
2023-09-18 09:29:52 -04:00
Nobuyoshi Nakada c87f2a4f15
[Bug #19887] RUBYOPT should work without leading `-` 2023-09-18 10:14:46 +09:00
Nobuyoshi Nakada 5c6e00b090
Simplify restoring ENV 2023-09-18 09:55:07 +09:00
tomoya ishida 8b4e54f979 [ruby/irb] Test should not depend on user's irbrc file specified by
ENV['IRBRC']
(https://github.com/ruby/irb/pull/717)

https://github.com/ruby/irb/commit/1d2d35dd33
2023-09-17 21:25:49 +00:00
Nobuyoshi Nakada 88262875fd
Fix `git cat-file` condition
When multiple files changed in the same directory to be removed, the
first file only was removed from changed set.
2023-09-18 02:23:59 +09:00
Nobuyoshi Nakada 8d219a9bd7
Refactor test_sync_default_gems.rb 2023-09-18 02:11:48 +09:00
Nobuyoshi Nakada 5c94f3fe9d [ruby/fiddle] Suppress -Wundef warnings on arm64 macOS and Windows
(https://github.com/ruby/fiddle/pull/134)

```
In file included from ../../../../ext/fiddle/fiddle.h:46:
/opt/local/include/ffi.h:477:5: warning: 'FFI_GO_CLOSURES' is not defined, evaluates to 0 [-Wundef]
    ^
```

c.f. https://github.com/libffi/libffi/pull/796

https://github.com/ruby/fiddle/commit/d4feb57098
2023-09-17 22:42:50 +09:00
Nobuyoshi Nakada 72772a3caa [DOC] Mention "-" in ARGF 2023-09-17 22:05:58 +09:00
Nobuyoshi Nakada 2dffd36504
Move special patterns to the common pattern 2023-09-17 21:11:54 +09:00
Nobuyoshi Nakada bcb3247072
[Bug #19778] Pass additional include options to INCFLAGS in common.mk 2023-09-17 19:18:23 +09:00
Nobuyoshi Nakada e9a36f8abe
Tag `p_lparen` and `p_lbracket` as `tbl`
Remove tagging to the component for each reference.
2023-09-17 16:22:01 +09:00
Nobuyoshi Nakada 69d7871b02
ripper: Preprocess ripper-dispatchable types only
Keep the other types, which not having setter macros for ripper.
2023-09-17 16:22:01 +09:00
yui-knk df316be401 nd_aid of NODE_OP_ASGN_OR is not used then no need to set it 2023-09-17 16:04:42 +09:00
tomoya ishida cd67c0d204 [ruby/irb] Test should not depend on user's irbrc file
(https://github.com/ruby/irb/pull/714)

https://github.com/ruby/irb/commit/02703c46f9
2023-09-16 22:27:04 +00:00
John Hawthorn 380b42fe6a Fix comment for rb_enc_str_new [ci skip] 2023-09-16 11:29:40 -07:00
Peter Zhu 4aac7b1a9a Another try to fix build in emscripten
malloc_trim is defined in emscripten/emmalloc.h on emscripten.
2023-09-16 13:24:41 -04:00
Jeremy Evans 25711683e8 Fix regression when testing inclusion in unbounded ranges
Caused by 04a92a6764.  This treats
unbounded ranges of arbitrary objects the same as how unbounded
string ranges are treated:

  (..x)  === y  # (y <=> x) <= 0
  (...x) === y  # (y <=> x) <  0
  (x..)  === y  # (x <=> y) <= 0

Fixes [Bug #19864]
2023-09-16 16:02:31 +01:00
Haldun Bayhantopcu 8835ca23c1 [ruby/yarp] Fix a possible null pointer deference
https://github.com/ruby/yarp/commit/41f601b81b
2023-09-16 13:36:17 +00:00
Nobuyoshi Nakada e779465f19
Add comment markers in empty lines [ci skip] 2023-09-16 22:13:19 +09:00
Nobuyoshi Nakada e6ce490337
Align comments [ci skip] 2023-09-16 22:13:18 +09:00
Peter Zhu 209d5f8482 Fix malloc_trim on emscripten
```
gc.c:9746:5: error: implicit declaration of function 'malloc_trim' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    malloc_trim(0);
    ^
```

http://rubyci.s3.amazonaws.com/crossruby/crossruby-master-wasm32_emscripten/log/20230916T104311Z.fail.html.gz
2023-09-16 09:08:55 -04:00
Chad Schroeder a8afedce6d [ruby/irb] Handle Concurrent Sessions and Saving Readline::HISTORY
(https://github.com/ruby/irb/pull/651)

* handle concurrent sessions and saving Readline::HISTORY, fixes https://github.com/ruby/irb/pull/510

* separate tests

* don't mutate the HISTORY object on the class

* avoid repeated .to_i calls

* remove intermediary history array

* work with array, fix test comment

---------

https://github.com/ruby/irb/commit/1681ada328

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-09-16 12:48:32 +00:00
Nobuyoshi Nakada b4213a73b8 [Feature #19839] Fix `Range#overlap?` for empty ranges
Empty ranges do not overlap with any range.

Regarding benchmarks, PR#8242 is significantly faster in some cases,
but one of these two cases is a wrong result.

|                           |ActiveSupport| PR#8242|built-ruby|
|:--------------------------|------------:|-------:|---------:|
|(2..3).overlap?(1..1)      |       7.761M| 15.053M|   32.368M|
|                           |            -|   1.94x|     4.17x|
|(2..3).overlap?(2..4)      |      25.720M| 55.070M|   21.981M|
|                           |        1.17x|   2.51x|         -|
|(2..3).overlap?(4..5)      |       7.616M| 15.048M|   21.730M|
|                           |            -|   1.98x|     2.85x|
|(2..3).overlap?(2..1)      |      25.585M| 56.545M|   32.786M|
|                           |            -|   2.21x|     1.28x|
|(2..3).overlap?(0..1)      |       7.554M| 14.755M|   32.545M|
|                           |            -|   1.95x|     4.31x|
|(2..3).overlap?(...1)      |       6.681M|  5.843M|   32.255M|
|                           |        1.14x|       -|     5.52x|
|(2...3).overlap?(..2)      |       6.676M|  5.817M|   21.572M|
|                           |        1.15x|       -|     3.71x|
|(2...3).overlap?(3...)     |       7.392M| 14.755M|   31.805M|
|                           |            -|   2.00x|     4.30x|
|(2..3).overlap?('a'..'d')  |       3.675M|  3.482M|   17.009M|
|                           |        1.06x|       -|     4.89x|
2023-09-16 17:24:21 +09:00
Jean Boussier c3ef7a528b Fix malloc_trim() on wasm32
```
compiling gc.c
gc.c:9746:5: error: implicit declaration of function 'malloc_trim' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    malloc_trim(0);
    ^
1 error generated.
```
2023-09-16 09:52:46 +02:00
Shouichi Kamiya e9b503f1bb [Feature #19839] Add Range#overlap?
Add a method that returns true if two range overlap, otherwise false.

```
(0..10).overlap?(5..15) #=> true
(0..10).overlap?(20..30) #=> false
```
2023-09-16 14:57:19 +09:00
Kouhei Yanagita 7d08dbd015
Optimize Range#bsearch for beginless/endless ranges
On Range#bsearch for endless ranges, we try positions at `begin + 2**i` (i = 0, 1, 2, ...)
to find a point that satisfies a given condition.
Subsequently, we perform binary searching with the interval `[begin, begin + 2**n]`.

However, the interval `[begin + 2**(n-1), begin + 2**n]` is sufficient for binary search
because `begin + 2**(n-1)` does not satisfy the condition.

The same applies to beginless ranges.
2023-09-16 12:10:09 +09:00
Nobuyoshi Nakada 67dedf8cf6
Ignore changed files under removed paths
This fixes the issue commit 43ab2acf82
"Resurrect gem-specific patterns for sync" described.
2023-09-16 12:00:06 +09:00
Takashi Kokubun 9aeb6e72db
YJIT: Avoid creating a vector in get_temp_regs() (#8446)
* YJIT: Avoid creating a vector in get_temp_regs()

Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>

* Remove unused import

---------

Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2023-09-15 21:41:00 -04:00
git 1fbfd06628 Update default gems list at 7f96c9be9e [ci skip] 2023-09-16 00:34:07 +00:00
Kevin Newton 7f96c9be9e [ruby/yarp] Bump to version 0.12.0
https://github.com/ruby/yarp/commit/c71137377f
2023-09-16 00:32:52 +00:00
Takashi Kokubun 43ab2acf82 Resurrect gem-specific patterns for sync
Yet another partial revert of https://github.com/ruby/ruby/pull/8329,
similar to 00f263e6c4.

Repro: On ruby/ruby@1be64e34d0, `tool/sync_default_gems.rb yarp
162c2088eec6ec8f0558559e082cd661c18ee02a` should exist successfully, but
it doesn't without this gem-specific handling.
2023-09-15 16:54:20 -07:00
Kevin Newton cb686b9ccc [ruby/yarp] Handle missing clauses in case statement
https://github.com/ruby/yarp/commit/1ad7fba5ef
2023-09-15 23:32:05 +00:00
Kevin Newton 4c28a61e83 [ruby/yarp] Ensure multi targets are only in valid locations
https://github.com/ruby/yarp/commit/8bffb8a762
2023-09-15 23:21:36 +00:00
Nathan Froyd 8db3e3c3d2 [ruby/yarp] require constant pool capacity to be a power of 2
https://github.com/ruby/yarp/commit/dea8d3f29f
2023-09-15 23:08:27 +00:00
Alan Wu 7cec7d14c3
YJIT: Fix object movement bug in iseq guard for invokeblock
Since the compile-time iseq used in the guard was not marked and updated
during compaction, a runtime value reusing the address could falsely pass
the guard.

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-09-15 19:03:48 -04:00
Kevin Newton 1be64e34d0 [ruby/yarp] Alnum cannot be %-literal delimiters
https://github.com/ruby/yarp/commit/4ba6d5ca70
2023-09-15 22:59:48 +00:00
Kevin Newton 18780c22f6 [ruby/yarp] Properly handle invalid underscores in number literals
https://github.com/ruby/yarp/commit/35da3d1a4c
2023-09-15 22:38:58 +00:00
Kevin Newton b848700ccf [ruby/yarp] Extract test listener to its own class
https://github.com/ruby/yarp/commit/c8caa997c0
2023-09-15 22:36:22 +00:00
Vinicius Stock 35960ce65e [ruby/yarp] Add node event dispatcher
This commit changes the node template to create a dispatcher class,
which can be used to walk an AST an emit events to all registered
listeners

https://github.com/ruby/yarp/commit/03a45f85e6

Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
2023-09-15 22:36:22 +00:00
Jemma Issroff 89bd1ebcb9 [ruby/yarp] Fix unexpected { after method call with args
https://github.com/ruby/yarp/commit/fe279d2d16
2023-09-15 22:25:33 +00:00
Kevin Newton c2f7dae317 [ruby/yarp] Handle unterminated interpolated symbol
https://github.com/ruby/yarp/commit/9222faa1c6
2023-09-15 22:24:50 +00:00
Kevin Newton d2c75bb937 [ruby/yarp] Handle missing terminators in parenthesized expression
https://github.com/ruby/yarp/commit/a8b54e8ed0
2023-09-15 22:24:38 +00:00
Kevin Newton ffe77c022c [ruby/yarp] Handle infinite opt terms after missing case predicate
https://github.com/ruby/yarp/commit/d931e258d1
2023-09-15 22:24:25 +00:00
Andy Waite bbf9f11ce6 [ruby/yarp] Fix behaviour of locations for comments
https://github.com/ruby/yarp/commit/b1ced67fba
2023-09-15 22:22:24 +00:00
Martin Emde 010017d86d [rubygems/rubygems] Reduce array allocations and concatenations in Index
Remove the default nested hash in Index entirely
Index#search_all now yields or returns enum since that's what caller
needs.

https://github.com/rubygems/rubygems/commit/c45ea3bbe2
2023-09-15 22:01:11 +00:00
Samuel Giddins 2cf5fe58fb [rubygems/rubygems] Avoid allocating empty hashes in Index
Since the hashes have a default proc that returns a (new) empty hash, we
can avoid allocating those empty hashes when we are only doing lookups.

Test from running `bundle update --bundler` against a rails app I have
lying around:

```
==> memprof.after.txt <==
Total allocated: 9.71 MB (68282 objects)
Total retained:  4.87 MB (33791 objects)

==> memprof.before.txt <==
Total allocated: 10.83 MB (100596 objects)
Total retained:  5.02 MB (34721 objects)
```

https://github.com/rubygems/rubygems/commit/8f7c9cb23e
2023-09-15 22:01:10 +00:00
Tim Morgan 4e8869c663 [ruby/yarp] Use templated constants for Regexp options
https://github.com/ruby/yarp/commit/38e1769c2e
2023-09-15 21:47:28 +00:00
Tim Morgan 101ac364a5 [ruby/yarp] Return Regexp options that match MRI for e, u, s, and n
https://github.com/ruby/yarp/commit/17dbf4ec46
2023-09-15 21:47:27 +00:00
Alan Wu 0996cf5593 YJIT: Fix and enable the unused_imports warning 2023-09-15 16:15:15 -04:00
Jemma Issroff 4012ba4ecf [ruby/yarp] Fix string delimiter with "@" confused for embedded
variable
(https://github.com/ruby/yarp/pull/1521)

https://github.com/ruby/yarp/commit/3ec0699622
2023-09-15 18:02:04 +00:00