[Webkit-unassigned] [Bug 191050] New: Convert StringBuilder to be templatized on an OverflowHandler.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 29 17:55:11 PDT 2018


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

            Bug ID: 191050
           Summary: Convert StringBuilder to be templatized on an
                    OverflowHandler.
           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: mark.lam at apple.com

https://bugs.webkit.org/show_bug.cgi?id=184883 introduced the ConditionalCrashOnOverflow handler which is used in StringBuilder so that it can do a runtime determination whether to crash on overflows or not.  Technically, StringBuilder can be templatized with an OverflowHandler template parameter instead (just like CheckedArithmetic) and produce more efficient code.  However, when I attempted this (to templatize StringBuilder), I ran into an issue of clang not exporting explicitly instantiated some StringBuilder methods (instantiated for CrashOnOverflow and for RecordOverflow handlers).  As a result, clients of JavaScriptCore were not able to link to those methods.

To work around this issue, I introduced the ConditionalCrashOnOverflow handler, thereby allowing StringBuilder to remain a plain class.  If we can find a way to make clang export explicitly instantiated template methods, we should convert StringBuilder into a template and do away with the runtime shouldCrashOnOverflow checks in ConditionalCrashOnOverflow.

-- 
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/20181030/17d78cc2/attachment.html>


More information about the webkit-unassigned mailing list