diff options
| author | Max Bernstein <tekknolagi@gmail.com> | 2026-06-02 11:53:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-02 15:53:09 +0000 |
| commit | f261909fa9b720a4dd5bd2989906048069060c96 (patch) | |
| tree | c17796d018a32c2d6a825a5e89563921b7f7e75a /benchmark/bm_hash_long.rb | |
| parent | 9feac5d10eeddb6d3138c3290287c2460ad9577b (diff) | |
If the ISEQ we're compiling is a `ISEQ_TYPE_METHOD` and it's defined on a
class that no immediate object's class inherits from (exclude
`BasicObject`, `Object`, `Numeric`, etc), and the allocator is the
default allocator, then we can assume the `self` is heap-allocated.
This lets us skip HeapBasicObject guards for a lot of instance variable
lookups, for example:
```ruby
class C
def foo = @foo
end
```
Thanks to @jhawthorn for the idea and @tenderlove for convincing me it was reasonable.
Diffstat (limited to 'benchmark/bm_hash_long.rb')
0 files changed, 0 insertions, 0 deletions
