boa icon indicating copy to clipboard operation
boa copied to clipboard

Transitive prototype inline caching

Open HalidOdat opened this issue 9 months ago • 1 comments

The current implementation of inline caching only works for properties that are in the object or in its direct prototype.

This is very limiting, as transitive properties (properties of prototype's prototype) are treated as a cache miss.

So code the code below always gives a cache miss:

class X {
   getX() {
      return 42;
   }
}

class Y extends X {
   getY() {
      return 42;
   }
}

let y = new Y();
y.getY() // cacheable

let y = new Y();
y.getX() // never cacheable with the current implementation :(

HalidOdat avatar Jun 02 '25 19:06 HalidOdat

I'll un-assign myself, currently not working on this if anyone is interested let me know 😄

HalidOdat avatar Jun 03 '25 02:06 HalidOdat