We have a bit to spare in XPCWrappedNative::mWrapperWord, and we can use this bit to create a larger wrapped native that caches the same-origin XOW. This is important for windows and any testcase that repeatedly bangs on eval() or uses |this| in a function that is called as |f()| (i.e., no stated 'this' object). This will bring the number of PreCreate return value to three: - Create slim wrappers. - Native anonymous content (i.e. chrome access only). - Same origin XOWs. fortunately, these are all mutually exclusive categories. Furthermore, we expect this category to go away when we start using object mutation instead of same origin wrapping to deal with windows changing their principals and suddenly needing access checks.
Oh, and as a point of reference: in the testcase attached to bug 566077, ClassNeedsXOW takes a full 25% of self time in XPC_WN_JSOp_ThisObject.
Created attachment 446618 [details] [diff] [review] wip This WIP bumps the time spent under js_ComputeThis from 15% to 4% on my testcase in bug 566077. I'm working through making the cache safe (i.e. making sure we don't hand out the wrong XOW once the window navigates).
Created attachment 446802 [details] [diff] [review] patch v1 I still have to test to make sure my cache invalidation/revalidation works the way I hope it does, but this does seem to work.
Created attachment 448098 [details] [diff] [review] patch v2 This actually passes try server.
http://hg.mozilla.org/tracemonkey/rev/19b57e20fd4d (note: actual push was a while ago)
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.