m_context is no longer weak, so there is now a lot of dead code in in JSValue.mm, and a wasted message send on every API call. In the head of just about every method in JSValue.mm we're doing: JSContext *context = [self context]; if (!context) return nil; This is getting a retained copy of the context, which is no longer necessary now m_context is no longer weak. We can just delete all these lines from all functions doing this, and where they were referring to the local variable 'context', instead we can just access m_context directly.
<rdar://problem/13035927>
Created attachment 183254 [details] Patch
Comment on attachment 183254 [details] Patch Need to make some modifications.
Since we're already going to be modifying most of JSValue.mm, we'll also do the following: (1) context @property is no longer weak – the context property is declared as: @property(readonly, weak) JSContext *context; This is really only informative (since we're not presently synthesizing the ivar), but it is now misleading. We should change it to: @property(readonly, retain) JSContext *context; (2) the JSContext ivar and accessor can be automatically generated. Since we're no longer doing anything special with m_context, we can just let the compiler handle the ivar for us. We'll delete: JSContext *m_context; and: - (JSContext *)context { return m_context; } and find&replace "m_context" to "_context" in JSValue.mm.
Created attachment 183259 [details] Patch
Comment on attachment 183259 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=183259&action=review > Source/JavaScriptCore/ChangeLog:8 > + m_context is no longer weak, so there is now a lot of dead code in in JSValue.mm, and a wasted message send in in
Comment on attachment 183259 [details] Patch Clearing flags on attachment: 183259 Committed r140086: <http://trac.webkit.org/changeset/140086>
All reviewed patches have been landed. Closing bug.