Created attachment 215750 [details]
What do these functions do ?
(In reply to comment #2)
> What do these functions do ?
CodeBlock is an object that represents one compilation of a piece of code. Each piece of code that we load is represented by a ScriptExecutable, and that may have zero or more CodeBlocks. Zero CodeBlocks if the code hasn't even been parsed yet (we parse everything lazily - as late as at the time of first invocation for functions), one CodeBlock if we're just running baseline code (interpreting or baseline JIT), two CodeBlocks in the DFG case or in the FTL case but without OSR entry, or three Codeblocks in the FTL case if we have:
1) the FTL CodeBlock
2) the baseline Codeblock that we would exit to
3) the special FTL-for-OSR-entry CodeBlock for entering through some loop pre-header
> CodeBlock* baselineAlternative();
Given a CodeBlock, this returns the baseline version of the CodeBlock. In the FTL example above, each of the three CodeBlocks will return (2).
> CodeBlock* baselineVersion();
Short version: we need to remove this but I don't want to do it in this patch.
Long version: This is basically CodeBlock::replacement()->baselineAlternative(). replacement() returns the CodeBlock that the owning ScriptExecutable claims should be used for entry on future function calls to that code. This will return the same thing as baselineAlternative() except if we have deleted all code (this happens under memory pressure, for example - or when enabling the debugger), in which case baselineVersion() may return a newer CodeBlock. For example you may have A->baselineVersion() where A is from before when we deleted all code, in which case this may return a newer CodeBlock B, which is from after when we deleted all code.
Okay. I will add a comment after this patch goes it.
Landed in http://trac.webkit.org/changeset/158459