Bug 167008 - Reserve capacity for StringBuilder in unescape
Summary: Reserve capacity for StringBuilder in unescape
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
: 167020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-13 09:59 PST by Yusuke Suzuki
Modified: 2017-01-14 08:21 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.73 KB, patch)
2017-01-13 10:01 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (4.88 KB, patch)
2017-01-13 10:02 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2017-01-13 09:59:37 PST
Reserve capacity for StringBuilder in unescape
Comment 1 Yusuke Suzuki 2017-01-13 10:01:27 PST
Created attachment 298766 [details]
Patch
Comment 2 Yusuke Suzuki 2017-01-13 10:02:50 PST
Created attachment 298767 [details]
Patch
Comment 3 Sam Weinig 2017-01-13 10:05:53 PST
Comment on attachment 298767 [details]
Patch

Sweet.
Comment 4 Yusuke Suzuki 2017-01-13 10:06:48 PST
Comment on attachment 298767 [details]
Patch

Thanks :)
Comment 5 Mark Lam 2017-01-13 10:07:25 PST
Very nice indeed.
Comment 6 WebKit Commit Bot 2017-01-13 10:31:15 PST
Comment on attachment 298767 [details]
Patch

Clearing flags on attachment: 298767

Committed r210735: <http://trac.webkit.org/changeset/210735>
Comment 7 WebKit Commit Bot 2017-01-13 10:31:18 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Ryan Haddad 2017-01-13 16:59:37 PST
It appears that this change caused flakiness in LayoutTest js/dom/encode-URI-test.html and JSC test mozilla-tests.yaml/ecma/GlobalObject/15.1.2.5-2.js

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

https://build.webkit.org/builders/Apple%20El%20Capitan%20Release%20JSC%20%28Tests%29/builds/11637
Comment 9 Ryan Haddad 2017-01-13 17:04:24 PST
Reverted r210735 for reason:

This change introduced LayoutTest and JSC test flakiness.

Committed r210752: <http://trac.webkit.org/changeset/210752>
Comment 10 Ryan Haddad 2017-01-13 17:04:39 PST
*** Bug 167020 has been marked as a duplicate of this bug. ***
Comment 11 Yusuke Suzuki 2017-01-14 02:15:46 PST
Ah, i see. I changed k and length to unsigned. Previously, it was `int`.
I thought it is not intentional. But it is intentional because we would like to check the condition like `k <= length - 6` even if `length` is less than 6.
I'll change this part, add comment about it, and land this patch.
Comment 12 Yusuke Suzuki 2017-01-14 08:21:06 PST
Committed r210766: <http://trac.webkit.org/changeset/210766>