77264 Commits

Author SHA1 Message Date
Takashi Kokubun
2ce5cfa2be RJIT: Save PC on String#concat 2023-04-01 21:34:19 -07:00
Takashi Kokubun
e45ed2da50 RJIT: Rewind stack_size on CantCompile and side exits
so that we can take an exit whenever we want.

As a starter, this commit also pops blockarg earlier than some
CantCompile exits.
2023-04-01 21:30:42 -07:00
Takashi Kokubun
90cdc5b8ba RJIT: Let the caller of jit_push_frame handle stack_pop
because we want to do this way earlier for other types of calls.
2023-04-01 21:13:15 -07:00
Takashi Kokubun
28db75af66 RJIT: Check stackoverflow earlier for ISEQ 2023-04-01 21:03:10 -07:00
Takashi Kokubun
249fe18e8f RJIT: Remove unused counters 2023-04-01 17:24:45 -07:00
Takashi Kokubun
f42cf3fd1e RJIT: Migrate invokeblock to jit_call_iseq 2023-04-01 17:17:41 -07:00
Takashi Kokubun
cfea319772 RJIT: Migrate bmethod to jit_call_iseq 2023-04-01 17:03:45 -07:00
Takashi Kokubun
0973b93e49 RJIT: Start moving away from VM-like ISEQ handling 2023-04-01 16:56:05 -07:00
Takashi Kokubun
d71db90c68 Fix a test in typeprof
Revert "Skip typeprof for now"

This reverts commit bdbf663cef31e2194bf87ae5c11dfe5525316ca8.
2023-04-01 15:13:08 -07:00
Takashi Kokubun
bdbf663cef Skip typeprof for now
It started failing probably because ISEQ removed an unused field.
I'll have a look at fixing it on the typeprof side, but let me skip it
until it's fixed.
2023-04-01 11:04:53 -07:00
Takashi Kokubun
df1b007fbd Remove unused VM_CALL_BLOCKISEQ flag 2023-04-01 10:22:47 -07:00
Takashi Kokubun
175538e433 Improve explanation of FCALL and VCALL 2023-04-01 10:17:59 -07:00
Kazuki Tsujimoto
4ac8d11724
* in an array pattern should not be parsed as nil in ripper
After 6c0925ba7017efde6091e2ec4f1a6be268166696, it was impossible
to distinguish between the presence or absence of `*`.

    # Before the commit
    Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
    Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, [:var_field, nil], nil]

    # After the commit
    Ripper.sexp('0 in []')[1][0][2][1]  #=> [:aryptn, nil, nil, nil, nil]
    Ripper.sexp('0 in [*]')[1][0][2][1] #=> [:aryptn, nil, nil, nil, nil]

This commit reverts it.
2023-04-01 16:35:24 +09:00
Takashi Kokubun
3a238eff88 gdb: Fix a command example
It was actually harder to type `cfp + 1`. `cfp 1` also works and is more
useful.
2023-04-01 00:23:35 -07:00
Takashi Kokubun
a3074c1256 gdb: Fix specval
Somehow my gdb stopped recognizing VM_BLOCK_HANDLER_NONE (macro) today.
Just changing it to a safer code.
2023-04-01 00:19:43 -07:00
Takashi Kokubun
1da77539da gdb: Don't dump params and locals for C frames 2023-04-01 00:19:27 -07:00
Koichi Sasada
9720f5ac89 use sleep_forever() on thread_join_sleep()
because it does same thing.
2023-04-01 09:48:37 +09:00
Stan Lo
23892d95f5 [ruby/irb] Drop unnecessary pends for truffleruby
https://github.com/ruby/irb/commit/2517039812
2023-03-31 22:02:58 +00:00
Alan Wu
8938f146ab YJIT: Remove unused variable [ci skip] 2023-03-31 15:19:02 -04:00
Takashi Kokubun
a9b6b25de5 gdb: Visualize register positions on the left 2023-03-31 09:13:37 -07:00
Nobuyoshi Nakada
9e678cdbd0
YJIT: Suppress unnecessary unsafe block (#7634) 2023-03-31 10:15:39 -04:00
Koichi Sasada
1d19776c7f cosmetic change
reorder `sleep_forever()` and so on.
2023-03-31 19:26:47 +09:00
Takashi Kokubun
185f39df79 gdb: Always show actual values in cfp 2023-03-31 03:20:40 -07:00
Takashi Kokubun
0f368bfb7b gdb: Show params and locals in cfp 2023-03-31 03:05:30 -07:00
Takashi Kokubun
98347c251a gdb: Dump env data in cfp command 2023-03-31 02:54:56 -07:00
Koichi Sasada
f803bcfc87 pass th to thread_sched_to_waiting()
for future extension
2023-03-31 18:50:10 +09:00
Koichi Sasada
4c0f82eb5b remove "\n" for RUBY_DEBUG_LOG()
because `RUBY_DEBUG_LOG()` add "\n" at the end of message.
2023-03-31 18:15:04 +09:00
Koichi Sasada
ad7362db07 rename rb_thread_t::locking_native_thread
to `rb_thread_t::has_dedicated_nt`
2023-03-31 18:10:00 +09:00
Koichi Sasada
95dafb53cd relax assertion
`ec` can be NULL in future.
2023-03-31 18:08:34 +09:00
Koichi Sasada
369bdff9ca add debug log to rb_ractor_thread_switch 2023-03-31 18:08:34 +09:00
Koichi Sasada
fdfd50d006 reorder thread_pthread.c functions 2023-03-31 18:08:21 +09:00
Koichi Sasada
66755164aa add RUBY_DEBUG_LOG fo each_machine_stack_value 2023-03-31 17:27:56 +09:00
Takashi Kokubun
a57270a848 Expand tabs in .gdbinit 2023-03-31 00:52:47 -07:00
Takashi Kokubun
9f426491ca Put misc/gdb.py [experimental]
This works like:

```
(gdb) cfp
CFP (count=3, addr=0x7ffff73fef50):
$1 = {pc = 0x555556bf7818, sp = 0x7ffff72ff078, iseq = 0x7ffff2603270, self = 140737344619296, ep = 0x7ffff72ff058, block_code = 0x0,
  __bp__ = 0x7ffff72ff060, jit_return = 0x555558c2b000}

Stack (size=3):
[0] FIXNUM: 1
[1] T_STRING: "" bytesize:0 (embed) encoding:1 coderange:7bit $2 = (struct RString *) 0x7ffff249ea80
[2] [PROMOTED] T_OBJECT: $3 = {flags = 21474844769, klass = 140737344040416}
$4 = {0x24, 0x24, 0x24}

(gdb) cfp + 1
CFP (count=3, addr=0x7ffff73fef90):
$5 = {pc = 0x5555567a78f8, sp = 0x7ffff72ff040, iseq = 0x7ffff26032d0, self = 140737344619296, ep = 0x7ffff72ff038, block_code = 0x0,
  __bp__ = 0x7ffff72ff040, jit_return = 0x555558c2b000}

Stack (size=0):
```
2023-03-31 00:20:40 -07:00
Takashi Kokubun
f500df097f Fix ivar dump for RVARGC in .gdbinit
It was crashing with:
No symbol "ROBJECT_EMBED_LEN_MAX" in current context.
2023-03-30 23:58:09 -07:00
Koichi Sasada
fbc6661a72 Revert "dump RUBY_DEBUG_LOG logs into /dev/null"
This reverts commit 83667008b925c32b3ab70fb6ec70f7398e960d1e.

because not stable yet.
2023-03-31 14:23:37 +09:00
Hiroshi SHIBATA
bc0a7a641b [ruby/net-http] typofix
https://github.com/ruby/net-http/commit/4d31bde125
2023-03-31 03:47:56 +00:00
NAKAMURA Usaku
eedcd696a5 [ruby/net-http] Fix previous commit
https://github.com/ruby/net-http/commit/1b276e2654
2023-03-31 03:22:41 +00:00
NAKAMURA Usaku
d8b8294c28 [ruby/net-http] Limit header length
https://github.com/ruby/net-http/commit/c245f7f9c8
2023-03-31 03:22:40 +00:00
Koichi Sasada
2093e4c2db nt->serial for RUBY_DEBUG_LOG
Show native thread's serial on `RUBY_DEBUG_LOG`.
`nt->serial` is also stored into `ruby_nt_serial` if the compiler
supports `RB_THREAD_LOCAL_SPECIFIER`.
2023-03-31 11:28:18 +09:00
Koichi Sasada
83667008b9 dump RUBY_DEBUG_LOG logs into /dev/null
to test debug printing.
2023-03-31 11:28:02 +09:00
Nobuyoshi Nakada
bccdc04166
Check if Bundler::EnvironmentPreserver is defined
Only `Bundler` might be defined.  `EnvironmentPreserver` and its
`BUNDLER_PREFIX` would be defined together in the same file.
2023-03-31 11:11:45 +09:00
Nobuyoshi Nakada
5116e8bdf8 [ruby/rdoc] Read generated files in binary mode
So that fixes crash with "invalid byte sequence in US-ASCII" on
ci.rvm.jp and some RubyCIs.

https://github.com/ruby/rdoc/commit/4b416644f0
2023-03-31 01:14:34 +00:00
Nobuyoshi Nakada
cd65e4adca [ruby/rdoc] Use File.binread
https://github.com/ruby/rdoc/commit/987c609df9
2023-03-31 01:14:34 +00:00
dependabot[bot]
8523892d08 Bump ossf/scorecard-action from 2.1.2 to 2.1.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](e38b1902ae...80e868c13c)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-31 09:56:32 +09:00
yui-knk
3488eda41d Fix gc_verify_internal_consistency error for pattern_matching in ripper
`gc_verify_internal_consistency` reports "found internal inconsistency"
for "test_pattern_matching.rb".

http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-docker/4501173

Ruby's parser manages objects by two different ways.

1. For parser

* markable node holds objects
* call `RB_OBJ_WRITTEN` with `p->ast` as parent
* `mark_ast_value` marks objects

2. For ripper

* unmarkable node, NODE_RIPPER/NODE_CDECL, holds objects
* call `rb_ast_add_mark_object`. This function calls `rb_hash_aset` then
  `RB_OBJ_WRITTEN` is called with `mark_hash` as parent
* `mark_hash` marks objects

However in current pattern_matching implementation

* markable node holds objects
* call `rb_ast_add_mark_object`

This commit fix it to be #2.

This was inconsistency however always `mark_hash` is
made young by `rb_ast_add_mark_object` call then objects
are not collected.
2023-03-31 09:38:34 +09:00
Jimmy Miller
a8782c454c YJIT: Test more kw and rest cases and change exit name 2023-03-30 18:01:26 -04:00
Matt Valentine-House
dabeec8034 [ci skip] LLDB: Fix rp for arrays 2023-03-30 22:38:30 +01:00
Takashi Kokubun
9a617c067f
YJIT: Generate side exits as late as possible (#7612)
* YJIT: Generate side exits late as possible

* YJIT: s/for_stack_size/with_stack_size/

* YJIT: s/get_counter/exit_counter/
2023-03-30 14:15:59 -07:00
Nobuyoshi Nakada
339295dd7c
Fix missing receiver [ci sip] 2023-03-31 01:16:44 +09:00