[Webkit-unassigned] [Bug 196392] New: [JSC] JSWrapperMap should not use Objective-C Weak map (NSMapTable with NSPointerFunctionsWeakMemory) for m_cachedObjCWrappers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 28 23:58:03 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196392

            Bug ID: 196392
           Summary: [JSC] JSWrapperMap should not use Objective-C Weak map
                    (NSMapTable with NSPointerFunctionsWeakMemory) for
                    m_cachedObjCWrappers
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ysuzuki at apple.com

We do not use Objective-C weak semantics here. Objective-C JSValue has a dealloc function, and JSValue is tightly coupled to JSContext (it has _context field).
So JSValue is only stored in one wrapper map held by JSContext (JSWrapperMap). So, we can manage lifetime just unregistering itself from JSWrapperMap in [JSValue dealloc].
Why we would like to avoid Objective-C weak semantics is that it allocates much memory. In very simple hello_world case, we create 4 JSValue wrappers, and it consumes 10KB for weak semantics.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190329/1c70b1cb/attachment.html>


More information about the webkit-unassigned mailing list