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

74789 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada ffc6c5d056 [Bug #18971] Add precheck to enumerator 2022-11-25 16:11:17 +09:00
Nobuyoshi Nakada 67d0f4821f [Bug #19145] `volatile` on an argument may not be effective 2022-11-25 15:50:06 +09:00
Nobuyoshi Nakada 45bad8c7b8 The mode flags may be clobbered by tag jumps 2022-11-25 15:50:06 +09:00
yui-knk e29d9e9fba Add examples to error_tolerant option in NEWS [ci skip] 2022-11-25 15:36:00 +09:00
Koichi Sasada 67766cd55c add debug context APIs for debuggers (frame depth)
The following new debug context APIs are for implementing debugger's
`next` (step over) and similar functionality.

* `rb_debug_inspector_frame_depth(dc, index)` returns `index`-th
  frame's depth.
* `rb_debug_inspector_current_depth()` returns current frame depth.

The frame depth is not related to the frame index because debug
context API skips some special frames but proposed `_depth()` APIs
returns the count of all frames (raw depth).
2022-11-25 14:01:36 +09:00
Jeremy Evans 571d21fd4a Make String#rstrip{,!} raise Encoding::CompatibilityError for broken coderange
It's questionable whether we want to allow rstrip to work for strings
where the broken coderange occurs before the trailing whitespace and
not after, but this approach is probably simpler, and I don't think
users should expect string operations like rstrip to work on broken
strings.

In some cases, this changes rstrip to raise
Encoding::CompatibilityError instead of ArgumentError.  However, as
the problem is related to an encoding issue in the receiver, and due
not due to an issue with an argument, I think
Encoding::CompatibilityError is the more appropriate error.

Fixes [Bug #18931]
2022-11-24 18:24:42 -08:00
Nobuyoshi Nakada c6330cd32b [ruby/fileutils] [Feature #18925] Add `ln_sr` method and `relative:` option to `ln_s`
https://github.com/ruby/fileutils/commit/5116088d5c
2022-11-25 01:03:57 +00:00
Nobuyoshi Nakada 1a47521c44
Use `rb_sprintf` instead of deprecated `sprintf` 2022-11-25 08:51:14 +09:00
Takashi Kokubun bcdfe12919 [ruby/erb] Allow requiring erb/escape.so alone
(https://github.com/ruby/erb/pull/37)

Prior to this commit, requiring erb/escape first and then requiring erb
did not work as expected.
2022-11-24 23:49:15 +00:00
Takashi Kokubun 8ac4081aa8 [ruby/erb] Split erb.rb into files for each module under ERB
(https://github.com/ruby/erb/pull/36)

https://github.com/ruby/erb/commit/f74833cc07
2022-11-24 23:40:53 +00:00
Takashi Kokubun c480f589c2 [ruby/erb] Rename erb.so to erb/escape.so
(https://github.com/ruby/erb/pull/35)

https://github.com/ruby/erb/commit/1280046952
2022-11-24 23:22:00 +00:00
Jeremy Evans 04a92a6764 Raise TypeError for endless non-numeric range include?
Beginless ranges previously raised TypeError for this case,
except for string ranges, which had unexpected behavior:

  ('a'..'z').include?('ww') # false
  (..'z').include?('ww') # previously true, now TypeError

Use of include? with endless ranges could previously result
in an infinite loop.

This splits off a range_string_cover_internal function from
range_include_internal.

Fixes [Bug #18580]
2022-11-24 15:18:44 -08:00
Takashi Kokubun d15de2f0d7 Add a NEWS entry about erb -S removal [ci skip] 2022-11-24 14:55:07 -08:00
Takashi Kokubun 1c0c1c8098 [ruby/erb] Drop deprecated -S option from erb command
We attempted to remove things like this and reverted all of them, but I
think nobody relies on this unlike the positional arguments of
`ERB#initialize`.

https://github.com/ruby/erb/commit/92fde7e403
2022-11-24 22:49:21 +00:00
Takashi Kokubun e5a0abc5de [ruby/erb] Suppress warnings to fix ruby-head CI
(https://github.com/ruby/erb/pull/34)

There seems to be no way to fix this. It doesn't happen in an installed
directory, so it's likely a false positive and/or a bug in rubygems.

  | <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85: warning: loading in progress, circular require considered harmful - /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb
  | 	from /home/runner/work/erb/erb/libexec/erb:0:in  `require'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in  `<top (required)>'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/setup.rb:3:in  `require_relative'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in  `<top (required)>'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/shared_helpers.rb:8:in  `require_relative'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in  `<top (required)>'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/bundler/rubygems_integration.rb:3:in  `require'
  | 	from /home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems.rb:1352:in  `<top (required)>'
  | 	from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in  `require'
  | 	from <internal:/home/runner/.rubies/ruby-head/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:85:in  `require'
2022-11-24 22:35:33 +00:00
Jeremy Evans 1340195e79 Reduce duplication in pack by sharing code for some cases
s/S, i/I, l/L, and q/Q had the same code in both cases, so
combine the cases.

Alternatively, we could actually the size of the unsigned type,
but I doubt there are any platforms where the unsigned type is
a different size than the signed type.
2022-11-24 14:27:19 -08:00
Jeremy Evans f5d73da806 Fix the position of rescue clause without exc_list
If the rescue clause has only exc_var and not exc_list, use the
exc_var position instead of the rescue body position.

This issue appears to have been introduced in
688169fd83 when "opt_list" was split
into "exc_list exc_var".

Fixes [Bug #18974]
2022-11-24 14:26:08 -08:00
Maxime Chevalier-Boisvert 07169fd824
Update YJIT section of `NEWS.md` (#6803)
* Update YJIT section of `NEWS.md`

* Update NEWS.md
2022-11-24 16:37:04 -05:00
Alan Wu a81c89b7c8
YJIT: Make sure rustc's target matches before enabling (#6804)
For people using Rosetta 2 on ARM Macs, it can happen that the
rustc in the PATH compiles for x86_64 while clang is targeting
ARM. We were enabling YJIT in these situations because the test
program compiled fine, but caused linking failure later due to
the architecture mismatch.

Adjust the test program to fail when rustc's target arch is different
from ruby's target arch.

[Bug #19146]
2022-11-24 14:58:41 -05:00
Jean Boussier 656f25987c [ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older rubies
https://github.com/ruby/cgi/commit/05f0c58048
2022-11-24 18:32:19 +00:00
Maxime Chevalier-Boisvert d2fa67de81
YJIT: rename `InsnOpnd` => `YARVOpnd` (#6801)
Rename InsnOpnd => YARVOpnd

Make it more clear this refers to YARV insn/vm operands rather
than backend IR, x86 or ARM insn operands.
2022-11-24 10:30:28 -05:00
Yusuke Endoh 66e5200ba4 Relax the timeout of TestRegexp#test_cache_optimization_square
It fails on riscv (QEmu)

http://rubyci.s3.amazonaws.com/debian-riscv64/ruby-master/log/20221124T000021Z.fail.html.gz
```
  1) Error:
TestRegexp#test_cache_optimization_square:
Regexp::TimeoutError: regexp match timeout
    /home/rubyci/chkbuild/tmp/build/20221124T000021Z/ruby/test/ruby/test_regexp.rb:1693:in `<main>'
    /home/rubyci/chkbuild/tmp/build/20221124T000021Z/ruby/test/ruby/test_regexp.rb:1688:in `test_cache_optimization_square'
```
2022-11-24 15:13:00 +09:00
Alan Wu d92054e371 YJIT: Use a Box for branch targets to save memory
We frequently make branches that only have one target but we used to
always allocate space for two branch targets. This patch moves all the
information a branch target has into a struct and refer to them using
Option<Box<BranchTarget>>, this way when the second branch target is not
present it only takes 8 bytes.

Retained heap size on railsbench went from 16.17 MiB to 14.57 MiB, a
ratio of about 1.1.
2022-11-23 18:00:12 -05:00
Aaron Patterson e788215125 Add next_shape_id to vm stats
We need to track this number in CI.  It's important to know how changes
to the codebase impact the number of shapes in the system, so lets add
the number to the VM stat hash
2022-11-23 14:18:10 -08:00
Takashi Kokubun a50aabde9c
YJIT: Simplify Insn::CCall to obviate Target::FunPtr (#6793) 2022-11-23 12:14:43 -05:00
BurdetteLamar 5ee947314e [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
https://github.com/ruby/net-http/commit/86b0514239
2022-11-23 17:12:35 +00:00
BurdetteLamar 4b32ed6e33 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
https://github.com/ruby/net-http/commit/ef0ef53b0c
2022-11-23 17:12:34 +00:00
BurdetteLamar 79a9280aa5 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
https://github.com/ruby/net-http/commit/0af9fb94a9
2022-11-23 17:12:33 +00:00
BurdetteLamar c6dc126641 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
https://github.com/ruby/net-http/commit/995ff356b4
2022-11-23 17:12:33 +00:00
BurdetteLamar 66be0922b7 [ruby/net-http] Enhanced RDoc for Net::HTTPHeader
https://github.com/ruby/net-http/commit/e924f1205b
2022-11-23 17:12:32 +00:00
Takashi Kokubun d88adaad7e
YJIT: Use NonNull pointer for CodePtr (#6792) 2022-11-23 12:02:05 -05:00
Takashi Kokubun 9c36de3c48 YJIT: Stop passing target1 to gen_return_branch 2022-11-23 11:59:50 -05:00
Takashi Kokubun fe2bed6778
YJIT: Simplify code for RB_SPECIAL_CONST_P (#6795) 2022-11-23 11:59:02 -05:00
Jemma Issroff e82b15b660
Fix YJIT backend to account for unsigned int immediates (#6789)
YJIT: x86_64: Fix cmp with number where sign bit is set

Before this commit, we were unconditionally treating unsigned ints as
signed ints when counting the number of bits required for representing
the immediate in machine code. When the size of the immediate matches
the size of the other operand, no sign extension happens, so this was
incorrect. `asm.cmp(opnd64, 0x8000_0000)` panicked even though it's
encodable as `CMP r/m32, imm32`. Large shape ids were impacted by this
issue.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Alan Wu <alanwu@ruby-lang.org>

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2022-11-23 10:48:17 -05:00
Aaron Patterson aedf682bfa
Free the IV table after estimation
We need to make sure the name table is freed otherwise we have a memory
leak.
2022-11-22 13:54:30 -08:00
Peter Zhu 003f8ea809 Remove dead code in rb_obj_copy_ivar
The removed code is a duplicate of the code above.
2022-11-22 13:49:46 -08:00
Maxime Chevalier-Boisvert c4e99ac454
Update yjit.md 2022-11-22 16:18:31 -05:00
zverok eaf2b6c439 Add Time#deconstruct_keys 2022-11-22 23:10:46 +02:00
Takashi Kokubun 63f4a7a1ec
YJIT: Skip padding jumps to side exits on Arm (#6790)
YJIT: Skip padding jumps to side exits

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

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2022-11-22 15:57:17 -05:00
Jemma Issroff 9c5e3671eb
Increment max_iv_count on class based on number of set_iv in initialize (#6788)
We can loosely predict the number of ivar sets on a class based on the
number of iv set instructions in the initialize method. This should give
us a more accurate estimate to use for initial size pool allocation,
which should in turn give us more cache hits.
2022-11-22 15:28:14 -05:00
Nobuyoshi Nakada 20b9d7b9fd
Use `enum` over `int` 2022-11-22 14:20:45 +09:00
Nobuyoshi Nakada 8c02084ac8
Use dedicated assertions for warnings 2022-11-22 14:07:21 +09:00
Nobuyoshi Nakada 77f963004f
Avoid unnecessary use of global variables 2022-11-22 13:58:56 +09:00
Nobuyoshi Nakada 36f297e621
Use valid tokens as cookie names 2022-11-22 11:32:28 +09:00
git 32d202eb93 Update default gems list at 805d70f716 [ci skip] 2022-11-22 02:13:26 +00:00
Hiroshi SHIBATA 805d70f716 [ruby/cgi] Bump up 0.3.5
https://github.com/ruby/cgi/commit/daf88c2a75
2022-11-22 02:12:50 +00:00
Nobuyoshi Nakada 58682b6980 [ruby/cgi] Relax domain label restrictions
https://github.com/ruby/cgi/commit/b46d41c363
2022-11-22 02:12:50 +00:00
git 5304b3bd85 Update default gems list at 3f960cf445 [ci skip] 2022-11-22 02:01:14 +00:00
Hiroshi SHIBATA 3f960cf445 [ruby/cgi] Bump up 0.3.4
https://github.com/ruby/cgi/commit/3649a27bf4
2022-11-22 02:00:11 +00:00
Yusuke Endoh 0e75b2f2e6 [ruby/cgi] Prevent CRLF injection
Throw a RuntimeError if the HTTP response header contains CR or LF to
prevent HTTP response splitting.

https://hackerone.com/reports/1204695

https://github.com/ruby/cgi/commit/64c5045c0a
2022-11-22 02:00:11 +00:00