<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/vm_dump.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>windows-arm64 support (#8995)</title>
<updated>2023-11-23T08:17:28+00:00</updated>
<author>
<name>Pierrick Bouvier</name>
<email>101587250+pbo-linaro@users.noreply.github.com</email>
</author>
<published>2023-11-23T08:17:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=784fdecc4c9f6ba9a8fc872518872ed6bdbc6670'/>
<id>784fdecc4c9f6ba9a8fc872518872ed6bdbc6670</id>
<content type='text'>
* [win32] fix compilation for windows-arm64

Credits to MSYS2 Ruby package using this patch.

* [win32] nm use full options

Fix compilation error when using MSYS2 environment.
Credits to MSYS2 Ruby package using this patch.

* [win32] detect llvm-windres (used for windows-arm64)

When adding preprocessor option for llvm-windres (using clang as
parameter), it fails. Thus, do not add this.

It's needed to be able to compile windows-arm64 version, because MSYS2
toolchain is LLVM based (instead of GCC/binutils).

* [win32] pioinfo detection for windows-arm64

This fixes "unexpected ucrtbase.dll" for native windows-arm64 ruby
binary. It does not solve issue with x64 version emulated on this
platform.

Value of pioinfo pointer can be found in ucrtbase.dll at latest adrp/add
sequence before return of _isatty function. This works for both release
and debug ucrt.

Due to the nature of aarch64 ISA (vs x86 or x64), it's needed to
disassemble instructions to retrieve offset value, which is a bit more
complicated than matching specific string patterns.

Details about adrp/add usage can be found in this blog post:
https://devblogs.microsoft.com/oldnewthing/20220809-00/?p=106955
For instruction decoding, the Arm documentation was used as a reference.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* [win32] fix compilation for windows-arm64

Credits to MSYS2 Ruby package using this patch.

* [win32] nm use full options

Fix compilation error when using MSYS2 environment.
Credits to MSYS2 Ruby package using this patch.

* [win32] detect llvm-windres (used for windows-arm64)

When adding preprocessor option for llvm-windres (using clang as
parameter), it fails. Thus, do not add this.

It's needed to be able to compile windows-arm64 version, because MSYS2
toolchain is LLVM based (instead of GCC/binutils).

* [win32] pioinfo detection for windows-arm64

This fixes "unexpected ucrtbase.dll" for native windows-arm64 ruby
binary. It does not solve issue with x64 version emulated on this
platform.

Value of pioinfo pointer can be found in ucrtbase.dll at latest adrp/add
sequence before return of _isatty function. This works for both release
and debug ucrt.

Due to the nature of aarch64 ISA (vs x86 or x64), it's needed to
disassemble instructions to retrieve offset value, which is a bit more
complicated than matching specific string patterns.

Details about adrp/add usage can be found in this blog post:
https://devblogs.microsoft.com/oldnewthing/20220809-00/?p=106955
For instruction decoding, the Arm documentation was used as a reference.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix leaked symbols on FreeBSD [ci skip]</title>
<updated>2023-10-12T06:07:42+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-10-12T06:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9859dbc7fdaef2073fecd062c7294ab4dbb86b27'/>
<id>9859dbc7fdaef2073fecd062c7294ab4dbb86b27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Dump backtraces to an arbitrary stream when using libprocstat</title>
<updated>2023-09-26T00:02:37+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-09-26T00:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5eef125afe0c2b02dd4fc92a393bad95768fd330'/>
<id>5eef125afe0c2b02dd4fc92a393bad95768fd330</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Labels cannot at the end of block</title>
<updated>2023-09-25T23:31:51+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-09-25T23:31:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d2cc4437a13c0eda8e1003131a1ceef7050d38b0'/>
<id>d2cc4437a13c0eda8e1003131a1ceef7050d38b0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a missing label</title>
<updated>2023-09-25T17:15:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-09-25T17:15:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ca2594535dd314086b5599fcd39cd80f863d80f4'/>
<id>ca2594535dd314086b5599fcd39cd80f863d80f4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Abort dumping when output failed</title>
<updated>2023-09-25T13:57:28+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-08-04T06:30:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=85984a53e87dfbccb52aba952367fddea4a77870'/>
<id>85984a53e87dfbccb52aba952367fddea4a77870</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Dump backtraces to an arbitrary stream</title>
<updated>2023-09-25T13:57:28+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-07-31T18:04:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ac244938e8b97c8bd42d1dc8ed820091e6ef5537'/>
<id>ac244938e8b97c8bd42d1dc8ed820091e6ef5537</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up OPT_STACK_CACHING (#8132)</title>
<updated>2023-07-28T00:27:05+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-07-28T00:27:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=38be9a9b72d606024eb94900ed834b08493a1518'/>
<id>38be9a9b72d606024eb94900ed834b08493a1518</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove __bp__ and speed-up bmethod calls  (#8060)</title>
<updated>2023-07-17T17:57:58+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-07-17T17:57:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f302e725e10ae05e613e2c24cae0741f65f2db91'/>
<id>f302e725e10ae05e613e2c24cae0741f65f2db91</id>
<content type='text'>
Remove rb_control_frame_t::__bp__ and optimize bmethod calls

This commit removes the __bp__ field from rb_control_frame_t. It was
introduced to help MJIT, but since MJIT was replaced by RJIT, we can use
vm_base_ptr() to compute it from the SP of the previous control frame
instead. Removing the field avoids needing to set it up when pushing new
frames.

Simply removing __bp__ would cause crashes since RJIT and YJIT used a
slightly different stack layout for bmethod calls than the interpreter.
At the moment of the call, the two layouts looked as follows:

                   ┌────────────┐    ┌────────────┐
                   │ frame_base │    │ frame_base │
                   ├────────────┤    ├────────────┤
                   │    ...     │    │    ...     │
                   ├────────────┤    ├────────────┤
                   │    args    │    │    args    │
                   ├────────────┤    └────────────┘&lt;─prev_frame_sp
                   │  receiver  │
    prev_frame_sp─&gt;└────────────┘
                     RJIT &amp; YJIT      interpreter

Essentially, vm_base_ptr() needs to compute the address to frame_base
given prev_frame_sp in the diagrams. The presence of the receiver
created an off-by-one situation.

Make the interpreter use the layout the JITs use for iseq-to-iseq
bmethod calls. Doing so removes unnecessary argument shifting and
vm_exec_core() re-entry from the interpreter, yielding a speed
improvement visible through `benchmark/vm_defined_method.yml`:

     patched:   7578743.1 i/s
      master:   4796596.3 i/s - 1.58x  slower

C-to-iseq bmethod calls now store one more VALUE than before, but that
should have negligible impact on overall performance.

Note that re-entering vm_exec_core() used to be necessary for firing
TracePoint events, but that's no longer the case since
9121e57a5f50bc91bae48b3b91edb283bf96cb6b.

Closes ruby/ruby#6428</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove rb_control_frame_t::__bp__ and optimize bmethod calls

This commit removes the __bp__ field from rb_control_frame_t. It was
introduced to help MJIT, but since MJIT was replaced by RJIT, we can use
vm_base_ptr() to compute it from the SP of the previous control frame
instead. Removing the field avoids needing to set it up when pushing new
frames.

Simply removing __bp__ would cause crashes since RJIT and YJIT used a
slightly different stack layout for bmethod calls than the interpreter.
At the moment of the call, the two layouts looked as follows:

                   ┌────────────┐    ┌────────────┐
                   │ frame_base │    │ frame_base │
                   ├────────────┤    ├────────────┤
                   │    ...     │    │    ...     │
                   ├────────────┤    ├────────────┤
                   │    args    │    │    args    │
                   ├────────────┤    └────────────┘&lt;─prev_frame_sp
                   │  receiver  │
    prev_frame_sp─&gt;└────────────┘
                     RJIT &amp; YJIT      interpreter

Essentially, vm_base_ptr() needs to compute the address to frame_base
given prev_frame_sp in the diagrams. The presence of the receiver
created an off-by-one situation.

Make the interpreter use the layout the JITs use for iseq-to-iseq
bmethod calls. Doing so removes unnecessary argument shifting and
vm_exec_core() re-entry from the interpreter, yielding a speed
improvement visible through `benchmark/vm_defined_method.yml`:

     patched:   7578743.1 i/s
      master:   4796596.3 i/s - 1.58x  slower

C-to-iseq bmethod calls now store one more VALUE than before, but that
should have negligible impact on overall performance.

Note that re-entering vm_exec_core() used to be necessary for firing
TracePoint events, but that's no longer the case since
9121e57a5f50bc91bae48b3b91edb283bf96cb6b.

Closes ruby/ruby#6428</pre>
</div>
</content>
</entry>
<entry>
<title>Add thread and ractor counts to bug reports</title>
<updated>2023-03-16T14:46:30+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2023-03-15T18:19:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f81bb793fd217374054ee78cb5cd595cfacf9fe'/>
<id>2f81bb793fd217374054ee78cb5cd595cfacf9fe</id>
<content type='text'>
This is useful for crash triaging. It also helps to hint extension
developers about the misuse of `rb_thread_call_without_gvl()`.

Example:

    $ ./miniruby -e 'Ractor.new{Ractor.receive};
        Thread.new{sleep}; Process.kill:SEGV,Process.pid'
    &lt;snip&gt;
    -- Threading information ---------------------------------------------------
    Total ractor count: 2
    Ruby thread count for this ractor: 2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is useful for crash triaging. It also helps to hint extension
developers about the misuse of `rb_thread_call_without_gvl()`.

Example:

    $ ./miniruby -e 'Ractor.new{Ractor.receive};
        Thread.new{sleep}; Process.kill:SEGV,Process.pid'
    &lt;snip&gt;
    -- Threading information ---------------------------------------------------
    Total ractor count: 2
    Ruby thread count for this ractor: 2
</pre>
</div>
</content>
</entry>
</feed>
