[JSC] Optimize leaf object creation in JSON.parse
Created attachment 438220 [details] Patch
Created attachment 438266 [details] Patch
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 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.
Committed r282468 (241716@main): <https://commits.webkit.org/241716@main>
<rdar://problem/83164908>