diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2022-12-08 16:48:48 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2022-12-15 10:06:04 -0800 |
commit | a3d552aedd190b0f21a4f6479f0ef1d2ce90189b (patch) | |
tree | 1a3b505b76c40a0bcb07535a21ccf126e5543d1e /README.EXT.ja | |
parent | f50aa19da63067c4b0de5964b6632df20202e71c (diff) | |
download | ruby-a3d552aedd190b0f21a4f6479f0ef1d2ce90189b.tar.gz |
Add variation_count on classes
Count how many "variations" each class creates. A "variation" is a a
unique ordering of instance variables on a particular class. This can
also be thought of as a branch in the shape tree.
For example, the following Foo class will have 2 variations:
```ruby
class Foo ; end
Foo.new.instance_variable_set(:@a, 1) # case 1: creates one variation
Foo.new.instance_variable_set(:@b, 1) # case 2: creates another variation
foo = Foo.new
foo.instance_variable_set(:@a, 1) # does not create a new variation
foo.instance_variable_set(:@b, 1) # does not create a new variation (a continuation of the variation in case 1)
```
We will use this number to limit the amount of shapes that a class can
create and fallback to using a hash iv lookup.
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Diffstat (limited to 'README.EXT.ja')
0 files changed, 0 insertions, 0 deletions