WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
191050
Convert StringBuilder to be templatized on an OverflowHandler.
https://bugs.webkit.org/show_bug.cgi?id=191050
Summary
Convert StringBuilder to be templatized on an OverflowHandler.
Mark Lam
Reported
2018-10-29 17:55:11 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug