Commit graph

2698 commits

Author SHA1 Message Date
Nobuyoshi Nakada
6cca8a0ceb
Strip trailing spaces [ci skip] 2022-10-24 18:38:09 +09:00
Nobuyoshi Nakada
8873c420d3
Fix error when commit hash is removed [ci skip] 2022-10-24 18:12:25 +09:00
Sergey Fedorov
567725ed30
Fix and improve coroutines for Darwin (macOS) ppc/ppc64. (#5975) 2022-10-19 23:49:45 +13:00
Nobuyoshi Nakada
1654f88ca7
sync_default_gems.rb: commit all after replaced rdoc-ref [ci skip] 2022-10-19 09:11:11 +09:00
Nobuyoshi Nakada
e1ca90c2a4
sync_default_gems.rb: fold too long subject [ci skip]
Line with substituted issue references with URLs are often very long.
Although Git (and GitHub) recommends folding subject lines less than
50 columns, but many commits ignore this, so fold at 68 columns for
now.
2022-10-18 17:43:43 +09:00
Takashi Kokubun
134acf98d8
ruby/ruby-commit-hook has been renamed [ci skip]
to ruby/git.ruby-lang.org
2022-10-17 21:16:09 -07:00
Nobuyoshi Nakada
ab3b1b2381
sync_default_gems.rb: fix links to GitHub issues
- Substitute `GH-xxxx` which does not contain `#` too.
- Split each substitutions.
2022-10-18 11:37:12 +09:00
Aaron Patterson
e5058b58c2
Only expose Ruby Shape API if VM_CHECK_MODE is enabled 2022-10-13 13:11:01 -07:00
Nobuyoshi Nakada
c50623f093
Revert "FreeBSD make uses the target under srcdir [ci skip]"
This reverts commit 751ffb276f, which
caused build failures on other platforms.
2022-10-13 12:24:59 +09:00
Nobuyoshi Nakada
751ffb276f
FreeBSD make uses the target under srcdir [ci skip] 2022-10-13 12:10:10 +09:00
Nobuyoshi Nakada
80da7250c5
file2lastrev.rb: Refactor VCS directory search
Search VCS directory after other options are in effective, i.e.,
`--srcdir=nonexitent --suppress_not_found` options, as well as the
reverse order case, should print the current date only and exit
successfully.
2022-10-12 22:24:53 +09:00
Nobuyoshi Nakada
b57ecc3eb8
sync_default_gems: Replace the URIs to be redirected
The reference generated by using RDoc without the proper `--page-dir`
option (or `.rdoc_options`) file may contain `/doc/`.  Since these
URIs are redirected by the server now, replace such URIs with the
corresponding rdoc-refs too.
2022-10-12 13:24:53 +09:00
Nobuyoshi Nakada
2b5d4fe28d
sync_default_gems: Add rdoc-ref command to test 2022-10-12 12:27:40 +09:00
Nobuyoshi Nakada
df588440ee
sync_default_gems: Replace the external URIs to docs with rdoc-ref 2022-10-12 12:27:40 +09:00
Nobuyoshi Nakada
c67e496886
sync_default_gems: Should match with the beginning of the strings
`git status -z` result is NUL-separated, and can contain newline
characters.
2022-10-12 12:27:40 +09:00
Jemma Issroff
ad63b668e2
Revert "Revert "This commit implements the Object Shapes technique in CRuby.""
This reverts commit 9a6803c90b.
2022-10-11 08:40:56 -07:00
Aaron Patterson
9a6803c90b
Revert "This commit implements the Object Shapes technique in CRuby."
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-30 16:01:50 -07:00
Nobuyoshi Nakada
ab31d2e69f
Add --zone option to VCS
Which controls the timezone offset for `RUBY_RELEASE_DATE`.
2022-09-30 10:39:43 +09:00
Nobuyoshi Nakada
5a5644dadc
Introduce VCS::Null for fallback 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada
f70ba9cf80
Check for the availability of the command when detecting 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada
58b3a535cc
Pull up VCS.short_revision from VCS::SVN 2022-09-30 09:21:02 +09:00
Jemma Issroff
d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00
Nobuyoshi Nakada
247d598477
Install all file trees for lldb [ci skip]
It is no longer single lldb_cruby.py only.
2022-09-28 21:27:42 +09:00
Aaron Patterson
06abfa5be6
Revert this until we can figure out WB issues or remove shapes from GC
Revert "* expand tabs. [ci skip]"

This reverts commit 830b5b5c35.

Revert "This commit implements the Object Shapes technique in CRuby."

This reverts commit 9ddfd2ca00.
2022-09-26 16:10:11 -07:00
Jemma Issroff
9ddfd2ca00 This commit implements the Object Shapes technique in CRuby.
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects.  Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness").  Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree.  Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.

For example:

```ruby
class Foo
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

class Bar
  def initialize
    # Starts with shape id 0
    @a = 1 # transitions to shape id 1
    @b = 1 # transitions to shape id 2
  end
end

foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```

Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.

This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.

This commit also adds some methods for debugging shapes on objects.  See
`RubyVM::Shape` for more details.

For more context on Object Shapes, see [Feature: #18776]

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-26 09:21:30 -07:00
Takashi Kokubun
7588f21851
Allow changing conversion macro in MJIT bindgen
This is necessary for object shapes.
2022-09-24 00:02:21 +09:00
Takashi Kokubun
0c9dc01a2a Skip struct fields whose output differs
across different environments
2022-09-23 06:44:28 +09:00
Takashi Kokubun
dfc311c0b3 Swap the positions of offsetof and type 2022-09-23 06:44:28 +09:00
Takashi Kokubun
dc5b536468 Bindgen offsetof struct and union with builtin
except for bit fields.

I made a risky assumption on leading bit fields and just gave up
non-leading bit fields for now. I'll change it to let C code access bit
fields later.
2022-09-23 06:44:28 +09:00
Takashi Kokubun
2ce1460c65 Bindgen sizeof struct and union with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
4c6e1556b1 Bindgen immediate types with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
280ff1707e Drop c_64 and c_32 2022-09-23 06:44:28 +09:00
Takashi Kokubun
5cda5938f8 Bindgen enum with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
2f5b37533e Builtin needs to be baseruby-compatible 2022-09-23 06:44:28 +09:00
Takashi Kokubun
591c3c7a1a Automatically setup bundler of bindgen.rb
to easily use it with `tool/mjit/bindgen.rb BUILDDIR` instead of using
`make mjit-bindgen`.
2022-09-23 06:44:28 +09:00
Takashi Kokubun
4e0db2f753 mjit_c.rb doesn't need to be an erb 2022-09-23 06:44:28 +09:00
Takashi Kokubun
334b8bd459 Mix manual and auto-generated C APIs 2022-09-23 06:44:28 +09:00
Takashi Kokubun
00c441ce7a Bindgen macro with builtin 2022-09-23 06:44:28 +09:00
Takashi Kokubun
e81a612413 Auto-generate mjit_c.rb.erb 2022-09-23 06:44:28 +09:00
Takashi Kokubun
f2bea691cd Builtin RubyVM::MJIT::C 2022-09-23 06:44:28 +09:00
Takashi Kokubun
69130e1614
Expand paths used for dumper.rb
This seems to be needed on Samuel's environment
2022-09-22 21:07:22 +09:00
Aaron Patterson
ec93d09c94 add rb_execution_context 2022-09-21 22:20:35 -07:00
Aaron Patterson
083b4bb655 add rb_control_frame_t 2022-09-21 22:20:35 -07:00
卜部昌平
45741918e1 reserved_word: just use gperf 3.1 declaration
The reason why this was commented out was because of gperf 3.0 vs 3.1
differences (see [Feature #13883]).  Five years passed, I am pretty
confident that we can drop support of old versions here.

Ditto for uniname2ctype_p(), onig_jis_property(), and zonetab().
2022-09-21 11:44:09 +09:00
Nobuyoshi Nakada
9de11fe796
Quiet if the target is already linked the same source 2022-09-20 12:54:08 +09:00
Takashi Kokubun
b4546d26f2
Fix the trailing comma comment for builtin [ci skip]
so that it's clear why not args.last but args[1]
2022-09-20 09:43:50 +09:00
Takashi Kokubun
76a0e81f40
Support trailing commas in builtin
`foo(Primitive.cexpr!('Qnil'),)` causes SEGV without this change.
2022-09-20 07:38:58 +09:00
Nobuyoshi Nakada
cc533cb607
Downloader: Define long option aliases 2022-09-19 01:09:47 +09:00
Nobuyoshi Nakada
a0b0991eed
Downloader: Define per-class command line options
Move `Downloader::Unicode` specific options, and parse options after
the downloader specificier.
2022-09-19 01:09:47 +09:00
Takashi Kokubun
a988fe0b3e
Introduce --basedir to insns2vm.rb
and leverage that to preserve the directory structure under tool/ruby_vm/views
2022-09-18 14:39:53 +09:00