path: root/tool
AgeCommit message (Collapse)Author
22 hoursRevert this until we can figure out WB issues or remove shapes from GCAaron Patterson
Revert "* expand tabs. [ci skip]" This reverts commit 830b5b5c351c5c6efa5ad461ae4ec5085e5f0275. Revert "This commit implements the Object Shapes technique in CRuby." This reverts commit 9ddfd2ca004d1952be79cf1b84c52c79a55978f4.
28 hoursThis commit implements the Object Shapes technique in CRuby.Jemma Issroff
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` has shape id 2 bar = # `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 <> Co-Authored-By: Eileen M. Uchitelle <> Co-Authored-By: John Hawthorn <> Notes: Merged:
4 daysAllow changing conversion macro in MJIT bindgenTakashi Kokubun
This is necessary for object shapes.
5 daysSkip struct fields whose output differsTakashi Kokubun
across different environments Notes: Merged:
5 daysSwap the positions of offsetof and typeTakashi Kokubun
Notes: Merged:
5 daysBindgen offsetof struct and union with builtinTakashi Kokubun
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. Notes: Merged:
5 daysBindgen sizeof struct and union with builtinTakashi Kokubun
Notes: Merged:
5 daysBindgen immediate types with builtinTakashi Kokubun
Notes: Merged:
5 daysDrop c_64 and c_32Takashi Kokubun
Notes: Merged:
5 daysBindgen enum with builtinTakashi Kokubun
Notes: Merged:
5 daysBuiltin needs to be baseruby-compatibleTakashi Kokubun
Notes: Merged:
5 daysAutomatically setup bundler of bindgen.rbTakashi Kokubun
to easily use it with `tool/mjit/bindgen.rb BUILDDIR` instead of using `make mjit-bindgen`. Notes: Merged:
5 daysmjit_c.rb doesn't need to be an erbTakashi Kokubun
Notes: Merged:
5 daysMix manual and auto-generated C APIsTakashi Kokubun
Notes: Merged:
5 daysBindgen macro with builtinTakashi Kokubun
Notes: Merged:
5 daysAuto-generate mjit_c.rb.erbTakashi Kokubun
Notes: Merged:
5 daysBuiltin RubyVM::MJIT::CTakashi Kokubun
Notes: Merged:
5 daysExpand paths used for dumper.rbTakashi Kokubun
This seems to be needed on Samuel's environment
6 daysadd rb_execution_contextAaron Patterson
Notes: Merged:
6 daysadd rb_control_frame_tAaron Patterson
Notes: Merged:
7 daysreserved_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(). Notes: Merged:
8 daysQuiet if the target is already linked the same sourceNobuyoshi Nakada
8 daysFix the trailing comma comment for builtin [ci skip]Takashi Kokubun
so that it's clear why not args.last but args[1]
8 daysSupport trailing commas in builtinTakashi Kokubun
`foo(Primitive.cexpr!('Qnil'),)` causes SEGV without this change.
9 daysDownloader: Define long option aliasesNobuyoshi Nakada
9 daysDownloader: Define per-class command line optionsNobuyoshi Nakada
Move `Downloader::Unicode` specific options, and parse options after the downloader specificier.
10 daysIntroduce --basedir to insns2vm.rbTakashi Kokubun
and leverage that to preserve the directory structure under tool/ruby_vm/views
10 daysRevert "Preserve the directory structure under tool/ruby_vm/views"Takashi Kokubun
This reverts commit 62ec621f8c7457374d1f08aec97138ac1b7bdf2a. will revisit this once fixing non-MJIT targets
10 daysPreserve the directory structure under tool/ruby_vm/viewsTakashi Kokubun
for nested target directories
10 daysDemote mjit_instruction.rb from builtin to stdlibTakashi Kokubun
10 daysRemove git command existence check againTakashi Kokubun
With 33c6dd2cc89c27bbf406508ec39038a181fb99bc, it's no longer necessary. This is what I got on openbsd-current: ``` -bash-5.1$ git -v unknown option: -v usage: git [--version] [--help] [-C <path>] [-c <name>=<value>] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] [--super-prefix=<path>] [--config-env=<name>=<envvar>] <command> [<args>] -bash-5.1$ git version git version 2.35.1 ```
10 daysFallback to VCS.release_date on VCS::NotFoundErrorTakashi Kokubun
when -q is given. One of the RubyCI servers, freebsd12, had a broken git environment: ``` $ git show fatal: detected dubious ownership in repository at '/usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby' To add an exception for this directory, call: git config --global --add /usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby ``` tool/lib/vcs.rb doesn't work normally for that server. Even for such cases, we'd like to generate a usable revision.h. So this patch lets revision.h fallback to default VCS.release_date when VCS::NotFoundError is raised.
10 daysAuto-generate the release date on version.h from git CommitDate (#6382)Takashi Kokubun
* Auto-generate the release date on version.h from git CommitDate * Generate revision.h on mswin Notes: Merged-By: k0kubun <>
11 daysMove case-folding.rb to tooldir with enc-prefixNobuyoshi Nakada
11 daysEmoji files header changed at 15.0 againNobuyoshi Nakada
11 daysFollow emoji data files header changeNobuyoshi Nakada
The header of emoji data files in UCD, which were moved at 13.0.0, has been changed since 14.0.0. It seems to be the same as other files in UCD.
13 days[rubygems/rubygems] Also added x86_64-darwin-21Hiroshi SHIBATA
13 days[rubygems/rubygems] Added arm64-darwin-22 to lockfiles for testingHiroshi SHIBATA
14 daysReplace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip]Nobuyoshi Nakada
Use the same regexp to replace "(#NNNN)" and "GH-NNNN" style references in vcs.rb, too.
2022-09-10Enable deprecation warnings for test-allBenoit Daloze
* So deprecated methods/constants/functions are dealt with early, instead of many tests breaking suddenly when removing a deprecated method/constant/function. * Follows Notes: Merged:
2022-09-09Support sub-library in builtin-loaderNobuyoshi Nakada
Previously, it was supported in prelude.c, but has not followed up the builtin-loader system. Notes: Merged:
2022-09-09More robust macro parser (#6343)Aaron Patterson
I want to use more complicated macros with MJIT. For example: ``` # define SHAPE_MASK (((unsigned int)1 << SHAPE_BITS) - 1) ``` This commit adds a simple recursive descent parser that produces an AST and a small visitor that converts the AST to Ruby. Notes: Merged-By: k0kubun <>
2022-09-09Ignore EACCES on WindowsNobuyoshi Nakada
2022-09-08Process token IDs from id.def without id.hNobuyoshi Nakada
Fixes id.h error during updating ripper.c by `make after-update`. While it used to update id.h in the build directory, but was trying to update ripper.c in the source directory. In principle, files in the source directory can or should not depend on files in the build directory.
2022-09-07Dump cross.rb only when verbose [ci skip]Nobuyoshi Nakada
2022-09-05Add mjit-bindgen workflow (#6327)Takashi Kokubun
Notes: Merged-By: k0kubun <>
2022-09-05Fix warnings from private_constantTakashi Kokubun
`private_constant *constants` seems to be warned for some reason
2022-09-05Merge ↵Hiroshi SHIBATA Notes: Merged:
2022-09-04Ruby MJIT (#6028)Takashi Kokubun
Notes: Merged-By: k0kubun <>
2022-09-05Debugging snapshot [ci skip]Nobuyoshi Nakada