'What does the FeedbackSlot size(length) mean?

Some questions about Feedback:

  1. as the title asked

  2. A slot site that only encounters objects of a single hidden class is called monomorphic; if it encounters objects of two hidden classes, it is called polymorphic; if it is greater than 2, it is called megamorphic. Is that right? Then does the slot size have anything to do with polymorphic?

  3. What is the IC handler? Is it a <code>?



Solution 1:[1]

  1. I don't understand the question. The class FeedbackSlot has no size and no length. Maybe you mean FeedbackMetadata::GetSlotSize? ICs of different kinds need different numbers of entries in the feedback vector (usually 1 or 2).

  2. No, polymorphic state can handle more than two cases, currently up to 4 (but that could change over time). The number of feedback vector slots that an IC can use does not (and cannot!) change depending on its state. If more data needs to be stored, indirections must be used.

  3. No, often it's just a Smi encoding a bit field; when that isn't enough, it's a small data class, see e.g. class LoadHandler: it derives from DataHandler which derives from Struct.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jmrk