Bug 230298 - [JSC] Optimize leaf object creation in JSON.parse
Summary: [JSC] Optimize leaf object creation in JSON.parse
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: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-15 00:25 PDT by Yusuke Suzuki
Modified: 2021-09-15 13:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch (35.78 KB, patch)
2021-09-15 00:25 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (42.70 KB, patch)
2021-09-15 11:32 PDT, Yusuke Suzuki
keith_miller: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2021-09-15 00:25:29 PDT
[JSC] Optimize leaf object creation in JSON.parse
Comment 1 Yusuke Suzuki 2021-09-15 00:25:50 PDT
Created attachment 438220 [details]
Patch
Comment 2 Yusuke Suzuki 2021-09-15 11:32:18 PDT
Created attachment 438266 [details]
Patch
Comment 3 Keith Miller 2021-09-15 12:05:34 PDT
Comment on attachment 438266 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438266&action=review

r=me

> Source/JavaScriptCore/runtime/LiteralParser.cpp:1413
> +            case TokRBracket:
> +                m_parseErrorMessage = "Unexpected token ']'"_s;
> +                return { };

It seems like a lot of the error messages are the same whenever we create an error message for that token. Should we just make a helper, `setErrorMessageForToken` that sets the m_parseErrorMessage when we error on a given token?
Comment 4 Yusuke Suzuki 2021-09-15 12:09:46 PDT
Comment on attachment 438266 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438266&action=review

>> Source/JavaScriptCore/runtime/LiteralParser.cpp:1413
>> +                return { };
> 
> It seems like a lot of the error messages are the same whenever we create an error message for that token. Should we just make a helper, `setErrorMessageForToken` that sets the m_parseErrorMessage when we error on a given token?

Sounds good! Changed.
Comment 5 Yusuke Suzuki 2021-09-15 13:17:15 PDT
Committed r282468 (241716@main): <https://commits.webkit.org/241716@main>
Comment 6 Radar WebKit Bug Importer 2021-09-15 13:18:22 PDT
<rdar://problem/83164908>