Граф коммитов

1738 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 5716c0f1f8
MSVS lacks `touch` [ci skip] 2022-12-20 17:53:41 +09:00
Nobuyoshi Nakada 0ccc498e6e
loadpath.c does not depend on revision.h since 947ebd0ac5 2022-12-20 16:06:32 +09:00
Hiroshi SHIBATA 5e5f3f6bd1
Followed up ad18d1297e with tool/update-deps --fix 2022-12-16 13:59:04 +09:00
Peter Zhu c505448cdb Move definition of SIZE_POOL_COUNT back to gc.h
SIZE_POOL_COUNT is a GC macro, it should belong in gc.h and not shape.h.
SIZE_POOL_COUNT doesn't depend on shape.h so we can have shape.h depend
on gc.h.

Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
2022-12-15 16:33:46 -05:00
Alan Wu 258ac07907
YJIT: Generate debug info in release builds (#6910)
* YJIT: Generate debug info in release builds

They are helpful in case we need to do core dump debugging.

* Remove Cirrus DOC skip rule

The syntax for this is weird, and escaping [ and ] cause parse failures.
Cirrus' docs said to surround with .*, but then that seems to skip
everything. Revert e0a4205eb7 for now.
2022-12-12 15:59:29 -05:00
Nobuyoshi Nakada 7a976c1060
[Bug #19181] Separate the rule for unicode_normalize/tables.rb timestamp
It should depends on only existing data files (except for the tools),
unless `ALWAYS_UPDATE_UNICODE=yes`.
2022-12-10 13:58:20 +09:00
Jean Boussier 73771e4b19 ObjectSpace.dump_all: dump shapes as well
I see several arguments in doing so.

First they use a non trivial amount of memory, so for various memory
profiling/mapping tools it is relevant to have visibility of the space
occupied by shapes.

Then, some pathological code can create a tons of shape, so it is
valuable to have a way to have a way to observe shapes without having
to compile Ruby with `SHAPE_DEBUG=1`.

And additionally it's likely much faster to dump then this way than
to use `RubyVM::Shape`.

There are however a few open questions:

- Shapes can't respect the `since:` argument. Not sure what to do when
  it is provided. Would probably make sense to not dump them.
- Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`?
- Maybe instead `dump_all` should take a `shapes: false` argument?

Additionally, `ObjectSpace.dump_shapes` is added for the use case of
debugging the evolution of the shape tree.
2022-12-08 18:46:16 +01:00
Aaron Patterson edc7af48ac Stop transitioning to UNDEF when undefining an instance variable
Cases like this:

```ruby
obj = Object.new
loop do
  obj.instance_variable_set(:@foo, 1)
  obj.remove_instance_variable(:@foo)
end
```

can cause us to use many more shapes than we want (and even run out).
This commit changes the code such that when an instance variable is
removed, we'll walk up the shape tree, find the shape, then rebuild any
child nodes that happened to be below the "targetted for removal" IV.

This also requires moving any instance variables so that indexes derived
from the shape tree will work correctly.

Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Co-authored-by: John Hawthorn <jhawthorn@github.com>
2022-12-07 09:57:11 -08:00
Daniel Colson 64cdf8bae7 Update dependencies 2022-12-06 12:37:23 -08:00
Nobuyoshi Nakada e9a0f45dc4
[Bug #19180] rbconfig.rb depends on common.mk 2022-12-06 11:06:15 +09:00
Martin Dürst f82a38be26 change Unicode version to 15.0.0 2022-12-06 10:11:33 +09:00
Nobuyoshi Nakada 30379e33c3
Handle depend files on nmake 2022-12-05 17:09:49 +09:00
Nobuyoshi Nakada facb5cd4d5
Clean compiler intermediate files more 2022-12-05 17:09:49 +09:00
S-H-GAMELINKS 1a64d45c67 Introduce encoding check macro 2022-12-02 01:31:27 +09:00
Takashi Kokubun a1d70f5b12 MJIT: Rename mjit_compile_attr to mjit_sp_inc
There's no mjit_compile.inc, so no need to use this prefix anymore.
2022-11-29 21:45:34 -08:00
Takashi Kokubun 7a2b1364ef MJIT: Merge mjit_unit.h into mjit_c.h
The distinction doesn't make much difference today.
2022-11-29 21:34:46 -08:00
Takashi Kokubun ecc15bc94a MJIT: Rename mjit_compiler.c to mjit_c.c
It's no longer about the compiler logic itself.
2022-11-29 21:26:59 -08:00
Nobuyoshi Nakada ed4b5c4f21
Extract outdate-bundled-gems.rb 2022-11-29 18:12:43 +09:00
Nobuyoshi Nakada 8e3ac264df
Fix dependencies of outdate-bundled-gems
Extract new gems then remove outdated gem directories.
2022-11-29 18:12:43 +09:00
Nobuyoshi Nakada aacaa2ec5e
Refine outdate-bundled-gems 2022-11-29 18:12:43 +09:00
Takashi Kokubun acb76663ba MJIT: Rename mjit_compiler.h to mjit_c.h
because it exists primarily for generating mjit_c.rb.
2022-11-28 21:23:14 -08:00
Nobuyoshi Nakada b649850d4a
Force to update revision.h after the source updated [ci skip] 2022-11-28 23:36:58 +09:00
Takashi Kokubun b2dcde839d MJIT: Merge mjit_compiler.rb into mjit.rb
There are too many mjit_compiler.* files. It was hard to find files.
2022-11-26 15:31:38 -08:00
zverok eaf2b6c439 Add Time#deconstruct_keys 2022-11-22 23:10:46 +02:00
Nobuyoshi Nakada 65e31402ae
Use double quotes for nmake [ci skip] 2022-11-21 16:35:28 +09:00
Nobuyoshi Nakada 166598a6eb
Add outdate-bundled-gems target [ci skip] 2022-11-21 15:10:29 +09:00
Nobuyoshi Nakada 01bc2fc514
Update fake.rb for test-spec
spec/ruby/command_line/dash_v_spec.rb needs it.
2022-11-20 01:10:40 +09:00
Nobuyoshi Nakada 24cbc50c76 Remove duplicate `.rbinc` on `.rb` dependencies 2022-11-16 20:47:23 +09:00
Takashi Kokubun fca50abb7c
Let mjit-bindgen use BASERUBY and bundle/inline (#6740) 2022-11-15 23:42:41 -08:00
Takashi Kokubun e7443dbbca
Rewrite Symbol#to_sym and #intern in Ruby (#6683) 2022-11-15 21:34:30 -08:00
Nobuyoshi Nakada ac063fd4c4
Depending on revision.h with VPATH 2022-11-16 00:44:34 +09:00
Nobuyoshi Nakada 1221c77489
Clean YJIT libraries [ci skip] 2022-11-14 22:41:59 +09:00
Nobuyoshi Nakada 3fae53a343
[Bug #19127] Fix revision.h dependency when no baseruby
Disconnect the dependency of revision.h on the timestamp file if no
baseruby is available
2022-11-14 18:59:06 +09:00
Nobuyoshi Nakada 2f7d2662dd
Control non-parallel parts with `.WAIT` if available 2022-11-13 23:54:43 +09:00
Jemma Issroff 5246f4027e Transition shape when object's capacity changes
This commit adds a `capacity` field to shapes, and adds shape
transitions whenever an object's capacity changes. Objects which are
allocated out of a bigger size pool will also make a transition from the
root shape to the shape with the correct capacity for their size pool
when they are allocated.

This commit will allow us to remove numiv from objects completely, and
will also mean we can guarantee that if two objects share shapes, their
IVs are in the same positions (an embedded and extended object cannot
share shapes). This will enable us to implement ivar sets in YJIT using
object shapes.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-11-10 10:11:34 -05:00
Nobuyoshi Nakada b7504af8fc Preprocess for older bison is no longer needed 2022-11-10 09:51:50 +09:00
Nobuyoshi Nakada 9627aab825
`--disable-jit-support` should disable YJIT successfully
Even if `rustc` is available, it should not be an error unless
`--enable-yjit` is explicitly given.
2022-11-06 17:07:44 +09:00
Nobuyoshi Nakada 1454f8f219 Add `--target` option to RUSTC when cross-compiling 2022-11-06 06:47:38 +09:00
Nobuyoshi Nakada 6b90910973
Update dependencies 2022-11-05 00:18:02 +09:00
Takashi Kokubun 1956fb9b78
Bump benchmark-driver version
https://github.com/benchmark-driver/benchmark-driver/pull/75 is useful
for quickly benchmarking a single method in CRuby.
2022-11-03 17:27:37 -07:00
Nobuyoshi Nakada 265a96b005 Manage the timestamp for revision.h 2022-11-02 11:10:00 +09:00
Nobuyoshi Nakada 37593c7950
Ignore failure at moving revision.h [ci skip]
The source directory may be read-only.
2022-10-30 20:35:41 +09:00
Takashi Kokubun 120b747b7d
YJIT: Lazily enable YJIT after prelude (#6597)
* YJIT: Lazily enable YJIT after prelude

* Update dependencies

* Use a bit field for opt->yjit
2022-10-24 12:20:44 -04:00
Takashi Kokubun e7c71c6c92
Make mjit_cont sharable with YJIT (#6556)
* Make mjit_cont sharable with YJIT

* Update dependencies

* Update YJIT binding
2022-10-17 09:27:59 -07:00
Samuel Williams ced1d17280
Improvements to IO::Buffer implementation and documentation. (#6525) 2022-10-12 12:59:05 +13: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
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 09bce061af bootstraptest/runner: manage sub processes with the job server 2022-09-28 23:18:55 +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