summaryrefslogtreecommitdiff
path: root/common.mk
AgeCommit message (Collapse)Author
2022-09-28This 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.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-28bootstraptest/runner: manage sub processes with the job serverNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6463
2022-09-26Revert 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.
2022-09-26This 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.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> Notes: Merged: https://github.com/ruby/ruby/pull/6386
2022-09-26Update `IO::Buffer` read/write to use rb_thread_io_blocking_region. (#6438)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-09-26Add several new methods for getting and setting buffer contents. (#6434)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-09-23Bindgen enum with builtinTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/6418
2022-09-23mjit_c.rb doesn't need to be an erbTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/6418
2022-09-23Builtin RubyVM::MJIT::CTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/6418
2022-09-20YJIT: Support MAKE=bmake for release buildAlan Wu
This add support for bmake, which should allow building with `configure --enable-yjit` for the BSDs. Tested on FreeBSD 13 and on macOS with `configure MAKE=bmake` on a case-sensitive file system. It works by including a fragment into the Makefile through the configure script, similar to common.mk. It uses the always rebuild approach to keep build system changes minimal. Notes: Merged: https://github.com/ruby/ruby/pull/6408
2022-09-20Try to ignore a noisy ASAN warning for continuationYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/6405
2022-09-19Extract UNICODE_DOWNLOADERNobuyoshi Nakada
2022-09-18Include lib/mjit/instruction.rb in a snapshotTakashi Kokubun
baseruby shouldn't be necessary once a snapshot is built.
2022-09-18Move mjit/instruction.rb rule to common.mkTakashi Kokubun
as suggested by nobu. We don't really need to generate this for Windows, but using common.mk whenever possible would probably make maintenance easier. Notes: Merged: https://github.com/ruby/ruby/pull/6398
2022-09-18Demote mjit_instruction.rb from builtin to stdlibTakashi Kokubun
2022-09-18Replace revision.tmp with the HAVE_BASERUBY trickTakashi Kokubun
but without relying on replacement. This seems to work on OpenBSD as well.
2022-09-17Always generate non-empty revision.hTakashi Kokubun
Non-GNU make seems to generate empty revision.h, but it doesn't make sense since https://github.com/ruby/ruby/pull/6382. Also the $(HAVE_BASERUBY:yes=tmp) hack doesn't seem to be working on OpenBSD. I'll remove it to focus on fixing RubyCI first, and then deal with baseruby-missing environments. At least a snapshot should have revision.h and it might work fine though.
2022-09-17Auto-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 <takashikkbn@gmail.com>
2022-09-17Move case-folding.rb to tooldir with enc-prefixNobuyoshi Nakada
2022-09-17Derive UNICODE_EMOJI_VERSION from UNICODE_VERSIONNobuyoshi Nakada
2022-09-16Now test-bundler nees fake.rbNobuyoshi Nakada
2022-09-15Add noarch-fake.rb targetNobuyoshi Nakada
`yes-fake` depends on it when `arch=noarch` is given, but the rule to generate it from fake.rb.in is ignored now.
2022-09-14Manage paths for bundler testsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6370
2022-09-14Pass job-server FDs to bundler testsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6370
2022-09-10Deprecate Encoding#replicateBenoit Daloze
* See [Feature #18949].
2022-09-10[MSWin] Get rid of single quotes in sed command linesNobuyoshi Nakada
GnuWin32 sed strips only double quotes, but not single quotes, and dies: ``` sed: -e expression #1, char 1: unknown command: `'' ```
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-07Define BOOTSTRAPRUBY from HAVE_BASERUBYNobuyoshi Nakada
2022-09-07Use BOOTSTRAPRUBY_COMMAND instead of fake.rb directlyNobuyoshi Nakada
2022-09-05Add mjit-bindgen workflow (#6327)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-09-04Ruby MJIT (#6028)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-09-04Ignore fake.rb for snapshotNobuyoshi Nakada
2022-09-04fake.rb needs id.hNobuyoshi Nakada
2022-09-03Fix potential target type confliction [ci skip]Nobuyoshi Nakada
2022-09-03Make sources by BASERUBY if available instead of minirubyNobuyoshi Nakada
2022-09-03Generate the prelude sources by common-srcsNobuyoshi Nakada
2022-09-03Exclude LIBPATHENV wrapper from PREPNobuyoshi Nakada
2022-09-03builtin.c includes mini_builtin.c when cross-compilingNobuyoshi Nakada
2022-09-03Move duplicate dependenciesNobuyoshi Nakada
2022-09-01New constant caching insn: opt_getconstant_pathJohn Hawthorn
Previously YARV bytecode implemented constant caching by having a pair of instructions, opt_getinlinecache and opt_setinlinecache, wrapping a series of getconstant calls (with putobject providing supporting arguments). This commit replaces that pattern with a new instruction, opt_getconstant_path, handling both getting/setting the inline cache and fetching the constant on a cache miss. This is implemented by storing the full constant path as a null-terminated array of IDs inside of the IC structure. idNULL is used to signal an absolute constant reference. $ ./miniruby --dump=insns -e '::Foo::Bar::Baz' == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE) 0000 opt_getconstant_path <ic:0 ::Foo::Bar::Baz> ( 1)[Li] 0002 leave The motivation for this is that we had increasingly found the need to disassemble the instructions between the opt_getinlinecache and opt_setinlinecache in order to determine the constant we are fetching, or otherwise store metadata. This disassembly was done: * In opt_setinlinecache, to register the IC against the constant names it is using for granular invalidation. * In rb_iseq_free, to unregister the IC from the invalidation table. * In YJIT to find the position of a opt_getinlinecache instruction to invalidate it when the cache is populated * In YJIT to register the constant names being used for invalidation. With this change we no longe need disassemly for these (in fact rb_iseq_each is now unused), as the list of constant names being referenced is held in the IC. This should also make it possible to make more optimizations in the future. This may also reduce the size of iseqs, as previously each segment required 32 bytes (on 64-bit platforms) for each constant segment. This implementation only stores one ID per-segment. There should be no significant performance change between this and the previous implementation. Previously opt_getinlinecache was a "leaf" instruction, but it included a jump (almost always to a separate cache line). Now opt_getconstant_path is a non-leaf (it may raise/autoload/call const_missing) but it does not jump. These seem to even out. Notes: Merged: https://github.com/ruby/ruby/pull/6187
2022-08-26Fixed typoHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6287
2022-08-26ruby-prof is now optionalHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6287
2022-08-26added test-syntax-suggest and prepare tasksHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6287
2022-08-22Added help entry for test-bundler-parallelHiroshi SHIBATA
2022-08-21Rename mjit_compile.c to mjit_compiler.cTakashi Kokubun
I'm planning to introduce mjit_compiler.rb, and I want to make this consistent with it. Consistency with compile.c doesn't seem important for MJIT anyway.
2022-08-21Use `rb_fork` to suppress deprecated-declarations warningsNobuyoshi Nakada
2022-08-17Update dependenciesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6239
2022-08-15Optimize Marshal dump/load for large (> 31-bit) FIXNUM (#6229)John Hawthorn
* Optimize Marshal dump of large fixnum Marshal's FIXNUM type only supports 31-bit fixnums, so on 64-bit platforms the 63-bit fixnums need to be represented in Marshal's BIGNUM. Previously this was done by converting to a bugnum and serializing the bignum object. This commit avoids allocating the intermediate bignum object, instead outputting the T_FIXNUM directly to a Marshal bignum. This maintains the same representation as the previous implementation, including not using LINKs for these large fixnums (an artifact of the previous implementation always allocating a new BIGNUM). This commit also avoids unnecessary st_lookups on immediate values, which we know will not be in that table. * Fastpath for loading FIXNUM from Marshal bignum * Run update-deps Notes: Merged-By: jhawthorn <john@hawthorn.email>
2022-08-14Update dependenciesNobuyoshi Nakada