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

79347 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton c666077182 [ruby/yarp] Add global variables to the constant pool
https://github.com/ruby/yarp/commit/b48067b067
2023-09-01 22:52:14 +00:00
Peter Zhu d1f83c37f8 Try to fix flaky test for Process.warmup
The test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2749]:
<0> expected but was
<1>.
```

I think there's a page with an object that needs finalization, so run
GC to clear that object.
2023-09-01 17:48:55 -04:00
Jemma Issroff 95308988b6
[YARP] Implement Compiling for And / Or / Operator Write Nodes (#8352) 2023-09-01 14:20:03 -07:00
Kevin Newton 7f9a2df02b [ruby/yarp] Update src/util/yp_string_list.c style
https://github.com/ruby/yarp/commit/e4af2b3bc2
2023-09-01 20:59:40 +00:00
Kevin Newton d99db1199d [ruby/yarp] Update src/util/yp_newline_list.c style
https://github.com/ruby/yarp/commit/bd7fc2c946
2023-09-01 20:59:40 +00:00
HParker d617b1b630 [ruby/yarp] remove reallocs preparing for custom memory management
https://github.com/ruby/yarp/commit/bd0b421504
2023-09-01 20:59:39 +00:00
git 570ebeaee2 Update default gems list at 1c622a6b58 [ci skip] 2023-09-01 20:57:36 +00:00
Kevin Newton 1c622a6b58 [ruby/yarp] Bump to v0.10.0
https://github.com/ruby/yarp/commit/b6164a76d9
2023-09-01 20:56:15 +00:00
Peter Zhu 95def300d2 Fix flaky test for Process.warmup
The test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_run_major_gc_and_compact [test/ruby/test_process.rb:2712]:
<2> expected but was
<3>.
```
2023-09-01 15:28:29 -04:00
Jemma Issroff e8b646fe91
[YARP] Implement BackReferenceReadNode, NumberedReferenceReadNode (#8344) 2023-09-01 11:30:22 -07:00
Jemma Issroff c0bf4029e3 [ruby/yarp] Print information about type, flags on AST templated
code
(https://github.com/ruby/yarp/pull/1380)

This commit adds the node type and the node flags as comments to
the AST templated code.

https://github.com/ruby/yarp/commit/f603f2037c
2023-09-01 18:12:55 +00:00
Mike Dalessio cfe1edddbf [ruby/yarp] fix: report syntax error for invalid hex escape
Closes https://github.com/ruby/yarp/pull/1367

https://github.com/ruby/yarp/commit/b1ab54f526
2023-09-01 17:04:37 +00:00
Mike Dalessio 512f8217cb [ruby/yarp] fix: double-counting of errors in parsing escaped strings
Essentially, this change updates `yp_unescape_calculate_difference` to
not create syntax errors, and we rely entirely on
`yp_unescape_manipulate_string` to report syntax errors.

To do that, this PR adds another (!) parameter to `unescape`:
`yp_list_t *error_list`. When present, `unescape` reports syntax
errors (and otherwise does not).

However, an edge case that needed to be addressed is reporting syntax
errors in this case:

    ?\u{1234 2345}

In a string context, it's possible to have multiple codepoints by
doing something like `"\u{1234 2345}"`; however, in the character
literal context, this is a syntax error -- only a single codepoint is
allowed.

Unfortunately, when `yp_unescape_manipulate_string` is called, there's
nothing to indicate that we are in a "character literal" context and
that only a single codepoint is valid.

To make this work, this PR:

- introduces a new static utility function in yarp.c,
  `yp_char_literal_node_create_and_unescape`, which is called when
  we're parsing `YP_TOKEN_CHARACTER_LITERAL`
- introduces a new (unexported) function,
  `yp_unescape_manipulate_char_literal` which does the same thing as
  `yp_unescape_manipulate_string` but tells `unescape` that only a
  single codepoint is expected

https://github.com/ruby/yarp/commit/f6a65840b5
2023-09-01 17:04:37 +00:00
Peter Zhu bead539650 Incrementally mark even if we have free pages
We move all pooled pages to free pages at the start of incremental
marking, so we shouldn't run incremental marking only when we have run
out of free pages. This causes incremental marking to always complete
in a single step.
2023-09-01 11:58:50 -04:00
Jemma Issroff 58e0a3699f
Fix YARP compiled send for popping (#8345)
Prior to this commit, we were incorrectly popping callers and receivers
on CallNodes. We shouldn't pop any of these as they might have
side effects.
2023-09-01 08:02:55 -07:00
Jemma Issroff 4f290bc328
[YARP] Small fixes for existing ConstantNodes (#8346)
Popped was slightly inaccurate for ConstantNodes and leading to issues
if there was content after a ConstantNode. This fix doesn't pop
any ConstantWriteNode values.
2023-09-01 08:02:37 -07:00
Peter Zhu 771576f021 Skip weak references to old objects in minor GC
If we are in a minor GC and the object to mark is old, then the old
object should already be marked and cannot be reclaimed in this GC cycle
so we don't need to add it to the weak refences list.
2023-09-01 09:31:59 -04:00
Benoit Daloze 7f6407c356 [ruby/yarp] Ensure node are present only once in the desugared AST
https://github.com/ruby/yarp/commit/7b090bc23d
2023-09-01 13:18:30 +00:00
Benoit Daloze a21b5a943f [ruby/yarp] Move name_loc before value for LocalVariableWriteNode
* Consistent with ClassVariableWriteNode, ConstantWriteNode, InstanceVariableWriteNode, GlobalVariableWriteNode.
* Fixes desugaring of local variable with operators.

https://github.com/ruby/yarp/commit/9a66737775
2023-09-01 13:18:30 +00:00
Benoit Daloze f1f6f1b39e [ruby/yarp] Make operator_loc the last field for GlobalVariableWriteNode
* Consistent with ClassVariableWriteNode, ConstantWriteNode, InstanceVariableWriteNode, LocalVariableWriteNode.
* Fixes desugaring of global variable with operators.

https://github.com/ruby/yarp/commit/fb5a53fc0b
2023-09-01 13:18:30 +00:00
Benoit Daloze 4172036bc6 [ruby/yarp] Do not desugar Foo::Bar {||,&&,+}= baz as it is incorrect without a temporary variable
* See https://github.com/ruby/yarp/pull/1329#discussion_r1310775433 for details.

https://github.com/ruby/yarp/commit/f0fdcba0c3
2023-09-01 13:18:29 +00:00
Benoit Daloze 7fb56df726 [ruby/yarp] Fix comments for methods using desugar_or_write_defined_node
https://github.com/ruby/yarp/commit/a39147736e
2023-09-01 13:18:29 +00:00
Hiroshi SHIBATA 2efd59e2eb [rubygems/rubygems] Use assertion message strictly
https://github.com/rubygems/rubygems/commit/98da5b9826
2023-09-01 07:04:43 +00:00
Nobuyoshi Nakada 4c040fe850
Copy compile options from AST directly without intermediate Hash 2023-09-01 14:06:42 +09:00
Nobuyoshi Nakada 1fbc8cdf06
Copy `rb_compile_option_t` only if needed
Use `COMPILE_OPTION_DEFAULT` if nothing to change.
2023-09-01 13:39:36 +09:00
Nobuyoshi Nakada 61f1657f68
Use macro argument not the variable directly 2023-09-01 13:36:15 +09:00
yui-knk 45cd011d73 [Bug #19281] Allow semicolon in parenthesis at the first argument of command call
Allow compstmt in the first argument of command call wrapped with parenthesis
like following arguments with parenthesis.
2023-09-01 12:55:09 +09:00
Mike Dalessio df4c77608e [ruby/yarp] fix: octal, hex, and unicode strings at the end of a
file
(https://github.com/ruby/yarp/pull/1371)

* refactor: move EOF check into yp_unescape_calculate_difference

parser_lex is a bit more readable when we can rely on that behavior

* fix: octal and hex digits at the end of a file

Previously this resulted in invalid memory access.

* fix: unicode strings at the end of a file

Previously this resulted in invalid memory access.

* Unterminated curly-bracket unicode is a syntax error

https://github.com/ruby/yarp/commit/21cf11acb5
2023-08-31 22:40:35 +00:00
Nobuyoshi Nakada 9930363aab [Bug-18878] Parse qualified const with brace block as method call 2023-09-01 04:26:31 +09:00
Matt Valentine-House 945945dad4 Remove gc_mark_values
Now that gc_mark_values and rb_gc_mark_values are identical, we should
remove one.
2023-08-31 19:31:18 +01:00
Matt Valentine-House 322548180d Prevent rb_gc_mark_values from pinning objects
This is an internal only function not exposed to the C extension API.
It's only use so far is from rb_vm_mark, where it's used to mark the
values in the vm->trap_list.cmd array.

There shouldn't be any reason why these cannot move.

This commit allows them to move by updating their references during the
reference updating step of compaction.

To do this we've introduced another internal function
rb_gc_update_values as a partner to rb_gc_mark_values.

This allows us to refactor rb_gc_mark_values to not pin
2023-08-31 19:31:18 +01:00
Burdette Lamar 84fa8ae84e
[DOC] RDoc for #spawn (#8342) 2023-08-31 14:02:09 -04:00
Nathan Froyd 8470acc1ec [ruby/yarp] add some `const` qualifiers to local variables
https://github.com/ruby/yarp/commit/eb3c6eb928
2023-08-31 17:43:50 +00:00
Mau Magnaguagno ace41c556a
[YARP] Avoid if-else in yp_compile_node (#8336)
Move last node case outside for loop.
2023-08-31 10:00:19 -07:00
Jemma Issroff b90457b210
[YARP] Implement SourceNodes (File, Line, Encoding) (#8328)
* [YARP] Implement SourceNodes (File, Line, Encoding)
2023-08-31 09:56:13 -07:00
Stan Lo 3678734fac [ruby/irb] Drop rdoc's version requirement
(https://github.com/ruby/irb/pull/704)

1. The newer versions of rdoc requires pysch 4.0+, which could break apps
   using Ruby 3.0 or 2.7. #703 has more detailed explanation on this.
2. We actually don't use any version-specific rdoc APIs. So having a version
    requirement is not necessary atm.

https://github.com/ruby/irb/commit/3e6ba78c42
2023-08-31 15:44:17 +00:00
John Hawthorn 43825fba6e YJIT: Handle getblockparamproxy with ifunc
getblockparamproxy for "ifunc" behaves identically to iseq, in just
pushing rb_block_param_proxy.
2023-08-31 10:46:24 -04:00
Jean Boussier 0270210e49 TestSocket_UNIXSocket: stop testing empty packets
OpenBSD and Solaris behave differently here.

Linux does deliver the empty packet, which is questionable
as it's undistinguishable from a closed connection.

It seems that OpenBSD and Solaris simply drop it.

We could test the platform before doing the assertion, but
it would likely be fragile, and the entire web recommend
to not ever send an empty packet, so the value of this
assertion is low.
2023-08-31 16:43:58 +02:00
Burdette Lamar b8e782c1b5
[DOC] Link fix (#8340) 2023-08-31 10:27:10 -04:00
Stan Lo 8804a70387 [ruby/irb] Require Reline 0.3.8+
(https://github.com/ruby/irb/pull/702)

Reline 0.3.8 reduces the chance of having a deadlock with the debugger
while using the new `irb:rdbg` integration.

https://github.com/ruby/irb/commit/9b8c56b7d4
2023-08-31 14:08:08 +00:00
Peter Zhu 4f0d58260a Correctly calculate initial pages
The old algorithm could calculate an undercount for the initial pages
due to two issues:

1. It did not take into account that some heap pages will have one less
   slot due to alignment. It assumed that every heap page would be able
   to be fully filled with slots. Pages that are unaligned with the slot
   size will lose one slot. The new algorithm assumes that every page
   will be unaligned.
2. It performed integer division, which truncates down. This means that
   the number of pages might not actually satisfy the number of slots.

This can cause the heap to grow in `gc_sweep_finish_size_pool` after
allocating all of the allocatable pages because the total number of
slots would be less than the initial configured number of slots.
2023-08-31 09:28:31 -04:00
Burdette Lamar eb3d94f4ba
[DOC] RDoc for Kernel#system (#8309) 2023-08-31 09:06:11 -04:00
Nobuyoshi Nakada c45176dbca
[Bug #19349] Respect `#to_int` of `base` argument 2023-08-31 16:49:58 +09:00
Nobuyoshi Nakada 24b2bb465f
Separate test for `Kernel#Integer` with `base` argument 2023-08-31 16:49:57 +09:00
Hiroshi SHIBATA 07ddb3589f [ruby/shellwords] omit blank line
https://github.com/ruby/shellwords/commit/b45de514ab
2023-08-31 07:35:45 +00:00
Nobuyoshi Nakada b7364069bf
[YARP] Remove Java templates [ci skip] 2023-08-31 14:37:22 +09:00
Nobuyoshi Nakada fa70e361e0
CodeQL: Increase memory size [ci skip]
Query evaluation ran out of Java heap frequently since CodeQL 2.14.3.
2023-08-31 14:06:35 +09:00
Nobuyoshi Nakada 2ce1b77ce0
sync_default_gems.rb: Discard some error messages
These messages are expected:
- `cat-file -e` at newly added entries.
- `commit --amend` when all changes removed.
2023-08-31 11:32:29 +09:00
Nobuyoshi Nakada cbe36ef6cc
sync_default_gems.rb: Remove the pattern for yarp
Changes to `ext/yarp/extconf.rb` are detected as conflicts now, and
ignored.
2023-08-31 11:32:21 +09:00
Nobuyoshi Nakada 3d2a83b909
sync_default_gems.rb: Remove the pattern for bundler
The "bundler" directory at the top-level will be removed by more
generic rule for top-level new entries.
2023-08-31 10:54:26 +09:00