Skip to content

Transitive prototype inline caching #4265

@HalidOdat

Description

@HalidOdat

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 :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-MediumMedium difficulty problemenhancementNew feature or requestexecutionIssues or PRs related to code execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions