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
Burdette Lamar
e50b7bf784
[DOC] Globals doc ( #8445 )
2023-09-15 13:59:48 -04:00
Samuel Giddins
c423d6e0e4
[rubygems/rubygems] Stop allocating the same settings keys repeatedly
...
Running `bundle update --bundler` on a rails app locally:
```
==> memprof.after.txt <==
Total allocated: 301.90 kB (3794 objects)
Total retained: 73.24 kB (698 objects)
==> memprof.before.txt <==
Total allocated: 14.47 MB (196378 objects)
Total retained: 25.93 kB (202 objects)
```
So for a slight increase in retained memory (all keys are now retained),
we go from about 200k allocations in the settings file to under 4k
https://github.com/rubygems/rubygems/commit/e64debb6ae
2023-09-15 17:54:01 +00:00
Adam Hess
4d86d932fd
Free all heap pages at shutdown
...
previously heap_allocated_pages was decremented from heap_page_free causing only half the heap pages to be freed at shutdown
2023-09-15 13:24:32 -04:00
Aaron Patterson
a1dc1a3de9
Return line 0 for JIT frames
...
Frames pushed by YJIT have an unreliable PC. The PC could be garbage,
and if we try to read the line number with a garbage PC, then the
program can crash.
This commit returns line 0 for programs where there is a `jit_return`
function. If `jit_return` has been set then this frame was pushed by
the JIT, and we cannot trust the PC.
Here is a debugger session for a program that crashed due to a broken
PC:
```
(lldb) p ruby_current_vm_ptr->ractor.main_thread->ec->cfp->iseq->body->iseq_encoded
(VALUE *) $0 = 0x0000000118a30e00
(lldb) p/x ruby_current_vm_ptr->ractor.main_thread->ec->cfp->pc
(const VALUE *) $1 = 0x0000600000b02d00
(lldb) p/x ruby_current_vm_ptr->ractor.main_thread->ec->cfp->jit_return
(void *) $2 = 0x000000010622942c
```
You can see the PC is completely out of range, but there is a
`jit_return` pointer so we can avoid this crash.
2023-09-15 09:01:02 -07:00
Jean Boussier
efe2822708
Process.warmup: invoke `malloc_trim` if available
...
Similar to releasing free GC pages, releasing free malloc pages
reduce the amount of page faults post fork.
2023-09-15 17:45:21 +02:00
Kevin Newton
28fe88468d
[ruby/yarp] Add more tests for implicit hash values
...
https://github.com/ruby/yarp/commit/1ddd74dc11
2023-09-15 15:41:02 +00:00
Kevin Newton
5f9f2fd72e
[ruby/yarp] Add implicit nodes for ommitted hash values
...
https://github.com/ruby/yarp/commit/22130b3491
2023-09-15 15:41:02 +00:00
Kevin Newton
5a6eae0b0a
[ruby/yarp] Keep value for invalid local variable write in tree
...
https://github.com/ruby/yarp/commit/eaafc829db
2023-09-15 15:14:40 +00:00
Kevin Newton
fab25082c2
[ruby/yarp] Ensure owned constants are marked as shared when overtaken
...
https://github.com/ruby/yarp/commit/d73f7c9cfa
2023-09-15 15:14:38 +00:00
Kevin Newton
b5084877c0
[ruby/yarp] Disallow numbered parameters in multiple scopes
...
https://github.com/ruby/yarp/commit/5fd4d3b89a
2023-09-15 15:14:37 +00:00
Kevin Newton
a4b4ebc7c1
[ruby/yarp] Error when numbered parameters are written
...
https://github.com/ruby/yarp/commit/65b536ba12
2023-09-15 15:14:36 +00:00
Kevin Newton
6031ab18c7
[ruby/yarp] Support parsing numbered parameters
...
https://github.com/ruby/yarp/commit/ffc8f35e56
2023-09-15 15:14:34 +00:00
Kevin Newton
236fe914af
[ruby/yarp] Track explicit parameters on blocks
...
https://github.com/ruby/yarp/commit/99c91931e0
2023-09-15 15:14:33 +00:00
Kevin Newton
1badb09f61
[ruby/yarp] Properly handle missing method names
...
https://github.com/ruby/yarp/commit/4a30c69051
2023-09-15 15:14:19 +00:00
Nobuyoshi Nakada
89802078f9
[Bug #19882 ] Reject tokens invalid as symbols
2023-09-15 17:27:36 +09:00
dependabot[bot]
5a7f5bb0de
Bump actions/checkout from 3.6.0 to 4.0.0
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3.6.0 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](f43a0e5ff2...3df4ab11eb
)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-09-15 17:05:23 +09:00
Nobuyoshi Nakada
fe0225ff4d
[Bug #19778 ] Add `-I` options for opt-dir to `$INCFLAGS`
...
These options have been separated from `$CFLAGS` already in the
other places.
2023-09-15 13:27:19 +09:00
dependabot[bot]
74277f9998
Bump ruby/setup-ruby from 1.152.0 to 1.153.0
...
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby ) from 1.152.0 to 1.153.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases )
- [Commits](250fcd6a74...5311f05890
)
---
updated-dependencies:
- dependency-name: ruby/setup-ruby
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-09-15 12:20:35 +09:00