Summary: | Cache property access for JSC API static functions | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yi Shen <max.hong.shen> | ||||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | NEW --- | ||||||||
Severity: | Normal | CC: | cshu | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | OS X 10.8 | ||||||||
Attachments: |
|
Description
Yi Shen
2013-07-09 10:17:21 PDT
Created attachment 206339 [details]
Test case
No cache Cache result(ms) 1. 8000 6003 2. 7600 5947 3. 7987 5912 4. 8002 5886 5. 8155 5934 6. 7539 5953 7. 8562 5958 8. 7455 5952 9. 7936 5913 10. 7461 5910 ------------------------------ avg 7869 5937 Created attachment 206340 [details]
proposal patch
Comment on attachment 206340 [details]
proposal patch
I don't think this is correct.
Client functions are allowed to make arbitrary decisions, and we can't assume they'll make the same decision each time.
Thanks for review! Could you please explain a bit more about the 'arbitrary decisions' that you have mentioned? As I noticed that the JSCallbackObject<Parent>::staticFunctionGetter() always checks for cached or override property when it gets called. So, I added a similar check before calling staticFunctionGetter() and pass the cached property to the property slot only if it exists. By doing this, we can cache the property access through tryCacheGetByID() (JITStubs.cpp). (In reply to comment #4) > (From update of attachment 206340 [details]) > I don't think this is correct. > > Client functions are allowed to make arbitrary decisions, and we can't assume they'll make the same decision each time. |