Bug 167811 - OSR entry: try making the entry trigger a patchable nop instead of a branch
Summary: OSR entry: try making the entry trigger a patchable nop instead of a branch
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 167149
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-03 13:00 PST by JF Bastien
Modified: 2020-01-24 09:18 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2017-02-03 13:00:37 PST
Each loop has a jitCode->tierUpEntryTriggers which is checked by DFG code. When zero it's a nop, when non-zero it forces entry to tierUpCommon. After 167149 it can become non-zero in two ways:

* Code is done compiling.
* tierUpCommon decides that it wants to force compilation, but at a different location than the current one.

In both cases, we could avoid the branch in DFG code if we had a patchable nop instead. We could pass a "reason" argument when we patch which explains how we got there.


Maybe we can even just squash the counter check instead? And why do we have one counter per function, instead of one per location (I have an idea why, but it's worth understanding)? I could look into that too.