Skip to content

Question on call targets hint #9

Open

Description

@eqrion

For SpiderMonkey, we're working towards collecting the following lattice of call target information for indirect calls:

unknown
|
monomorphic(funcIndex)
|
polymorphic(funcIndex, funcIndex, ...)
|
megamorphic

unknown means that we have no information at all. megamorphic means that we've observed so many call targets that we don't believe it's worth tracking them.

Is this possible to encode into call target hints? If a call target hint is missing for a call instruction, is that interpreted as 'unknown' or 'megamorphic'? If I'm reading it right, a call target hint with an empty call target information vector inside of it seems like it could be interpreted as 'megamorphic'.

Activity

  1. ecmziegler commented on Jun 20, 2024

    @ecmziegler
    Collaborator

    Because information might be missing, there is no clear way of identifying megamorphic call sites. It is of course implementation specific, but the idea was that once we decided to tier up, we will not be collecting call frequencies anymore. So there is no difference in between unknown and megamorphic as both lead to no inlining and no feedback collection.

    This might be different in the future or for other engines. One way of dealing with that would be to allow for adding information to other targets. So, you could just attribute all the calls to this other category in case of megamorphic sites while truly unknown call information is simply omitted.

    Alternatively, we could encode this as having information but the vector of call targets simply being empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions