<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/tool/mk_builtin_loader.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Use class methods of `File` over `Kernel.open` and `IO.read`</title>
<updated>2022-11-30T17:28:49+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-11-25T05:22:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d752cf7601adbe4bc2dc658effc2f61563a7dfb7'/>
<id>d752cf7601adbe4bc2dc658effc2f61563a7dfb7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MJIT: Use a String buffer in builtin compilers</title>
<updated>2022-11-28T05:11:33+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-27T23:15:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6844bcc6b4cdc50def1c0d30d4e8b5045fb43443'/>
<id>6844bcc6b4cdc50def1c0d30d4e8b5045fb43443</id>
<content type='text'>
instead of FILE*.

Using C.fprintf is slower than String manipulation on memory. I'm going
to change the way MJIT writes files, and this is a prerequisite for it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
instead of FILE*.

Using C.fprintf is slower than String manipulation on memory. I'm going
to change the way MJIT writes files, and this is a prerequisite for it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the trailing comma comment for builtin [ci skip]</title>
<updated>2022-09-20T00:43:50+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-09-20T00:43:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b4546d26f297d25c0e03f5f09864e7b371d65fa8'/>
<id>b4546d26f297d25c0e03f5f09864e7b371d65fa8</id>
<content type='text'>
so that it's clear why not args.last but args[1]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
so that it's clear why not args.last but args[1]
</pre>
</div>
</content>
</entry>
<entry>
<title>Support trailing commas in builtin</title>
<updated>2022-09-19T22:38:58+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-09-19T22:38:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=76a0e81f409baf810411677e115bce4f4b05ba5e'/>
<id>76a0e81f409baf810411677e115bce4f4b05ba5e</id>
<content type='text'>
`foo(Primitive.cexpr!('Qnil'),)` causes SEGV without this change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`foo(Primitive.cexpr!('Qnil'),)` causes SEGV without this change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support sub-library in builtin-loader</title>
<updated>2022-09-09T06:47:24+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-09-09T05:13:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9faa9ced9640d23fc5dc1efd635f6b8ebc1a3ceb'/>
<id>9faa9ced9640d23fc5dc1efd635f6b8ebc1a3ceb</id>
<content type='text'>
Previously, it was supported in prelude.c, but has not followed up the
builtin-loader system.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, it was supported in prelude.c, but has not followed up the
builtin-loader system.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ISEQ_BODY macro</title>
<updated>2022-03-24T14:03:51+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-03-23T19:19:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5f10bd634fb6ae8f74a4ea730176233b0ca96954'/>
<id>5f10bd634fb6ae8f74a4ea730176233b0ca96954</id>
<content type='text'>
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
</pre>
</div>
</content>
</entry>
<entry>
<title>`Primitive.mandatory_only?` for fast path</title>
<updated>2021-11-15T06:58:56+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2021-11-12T17:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b1b73936c15fd490159a9b30ab50b8d5dfea1264'/>
<id>b1b73936c15fd490159a9b30ab50b8d5dfea1264</id>
<content type='text'>
Compare with the C methods, A built-in methods written in Ruby is
slower if only mandatory parameters are given because it needs to
check the argumens and fill default values for optional and keyword
parameters (C methods can check the number of parameters with `argc`,
so there are no overhead). Passing mandatory arguments are common
(optional arguments are exceptional, in many cases) so it is important
to provide the fast path for such common cases.

`Primitive.mandatory_only?` is a special builtin function used with
`if` expression like that:

```ruby
  def self.at(time, subsec = false, unit = :microsecond, in: nil)
    if Primitive.mandatory_only?
      Primitive.time_s_at1(time)
    else
      Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
    end
  end
```

and it makes two ISeq,

```
  def self.at(time, subsec = false, unit = :microsecond, in: nil)
    Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
  end

  def self.at(time)
    Primitive.time_s_at1(time)
  end
```

and (2) is pointed by (1). Note that `Primitive.mandatory_only?`
should be used only in a condition of an `if` statement and the
`if` statement should be equal to the methdo body (you can not
put any expression before and after the `if` statement).

A method entry with `mandatory_only?` (`Time.at` on the above case)
is marked as `iseq_overload`. When the method will be dispatch only
with mandatory arguments (`Time.at(0)` for example), make another
method entry with ISeq (2) as mandatory only method entry and it
will be cached in an inline method cache.

The idea is similar discussed in https://bugs.ruby-lang.org/issues/16254
but it only checks mandatory parameters or more, because many cases
only mandatory parameters are given. If we find other cases (optional
or keyword parameters are used frequently and it hurts performance),
we can extend the feature.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compare with the C methods, A built-in methods written in Ruby is
slower if only mandatory parameters are given because it needs to
check the argumens and fill default values for optional and keyword
parameters (C methods can check the number of parameters with `argc`,
so there are no overhead). Passing mandatory arguments are common
(optional arguments are exceptional, in many cases) so it is important
to provide the fast path for such common cases.

`Primitive.mandatory_only?` is a special builtin function used with
`if` expression like that:

```ruby
  def self.at(time, subsec = false, unit = :microsecond, in: nil)
    if Primitive.mandatory_only?
      Primitive.time_s_at1(time)
    else
      Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
    end
  end
```

and it makes two ISeq,

```
  def self.at(time, subsec = false, unit = :microsecond, in: nil)
    Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
  end

  def self.at(time)
    Primitive.time_s_at1(time)
  end
```

and (2) is pointed by (1). Note that `Primitive.mandatory_only?`
should be used only in a condition of an `if` statement and the
`if` statement should be equal to the methdo body (you can not
put any expression before and after the `if` statement).

A method entry with `mandatory_only?` (`Time.at` on the above case)
is marked as `iseq_overload`. When the method will be dispatch only
with mandatory arguments (`Time.at(0)` for example), make another
method entry with ISeq (2) as mandatory only method entry and it
will be cached in an inline method cache.

The idea is similar discussed in https://bugs.ruby-lang.org/issues/16254
but it only checks mandatory parameters or more, because many cases
only mandatory parameters are given. If we find other cases (optional
or keyword parameters are used frequently and it hurts performance),
we can extend the feature.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use `VALUE` instead of `intptr_t`</title>
<updated>2021-08-16T06:36:37+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-08-16T04:52:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=54199a3f5f77f7aacfea37d2378e82f41c6a5510'/>
<id>54199a3f5f77f7aacfea37d2378e82f41c6a5510</id>
<content type='text'>
On emscripten `intptr_t`, `uintptr_t`, `ptrdiff_t` and so on are
defined as `long`, but `PRIdPTR` and so on defined as `int`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On emscripten `intptr_t`, `uintptr_t`, `ptrdiff_t` and so on are
defined as `long`, but `PRIdPTR` and so on defined as `int`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix trivial -Wundef warnings</title>
<updated>2021-05-04T12:56:55+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2021-04-29T12:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=68d6bd0873557c12bec6f8e0f8db622f1499d8a7'/>
<id>68d6bd0873557c12bec6f8e0f8db622f1499d8a7</id>
<content type='text'>
* See [Feature #17752]

Co-authored-by: xtkoba (Tee KOBAYASHI) &lt;xtkoba+ruby@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* See [Feature #17752]

Co-authored-by: xtkoba (Tee KOBAYASHI) &lt;xtkoba+ruby@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Method ID of call and fcall can be const not only ident</title>
<updated>2020-12-31T15:54:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-12-31T15:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=37e2a67a744f8cee8116663ebaac5b6acca2bd36'/>
<id>37e2a67a744f8cee8116663ebaac5b6acca2bd36</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
