Bug 130755

Summary: Repatch should inline trivial getters into the stub by doing pattern recognition to realize that it will behave trivially
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: NEW ---    
Severity: Normal CC: barraclough, ggaren, mark.lam, mhahnenberg, msaboff, oliver, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 129588    

Description Filip Pizlo 2014-03-25 16:26:13 PDT
If you have a getter like:

    function() { return this._f; }

Then inside the getter stub we know the structure of 'this' - because we just checked it - so we can inspect what _f is and if it's a simple field then we can prove that the outcome of executing this function is exactly equivalent to just loading the field from 'this'.

The only hard parts are:

- Proving that the getter is what you thought it was.  The structure doesn't tell you that so this will be an extra check.

- Inspecting the getter to recognize this pattern.  This should hopefully be relatively easy.