Search code examples
javascriptnode.jsv8

ClosureFeedbackCellArray vs. FeedbackVector in V8


What is the difference between ClosureFeedbackCellArray and FeedbackVector in V8?

How to trigger the transition from ClosureFeedbackCellArray to FeedbackVector?

What done the InterruptBudget attribute in FeedbackCell means?


Solution

  • What is the difference between ClosureFeedbackCellArray and FeedbackVector in V8?

    A FeedbackVector holds the type feedback for a function.

    The function's ClosureFeedbackCellArray holds the FeedbackVectors for any closures created by that function (i.e. for nested functions).

    How to trigger the transition from ClosureFeedbackCellArray to FeedbackVector?

    FeedbackVectors are allocated lazily, when a function has been executing for a bit.

    What does the InterruptBudget attribute in FeedbackCell mean?

    The InterruptBudget is the remaining budget for unoptimized code execution of the given function until the next interrupt is triggered (which could potentially decide to kick off optimized compilation of that function).