-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[JSC] Implement JSON.parse source text access proposal #7057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSC] Implement JSON.parse source text access proposal #7057
Conversation
|
EWS run on previous version of this PR (hash a970078) Details |
a970078 to
45fdc27
Compare
|
EWS run on previous version of this PR (hash 45fdc27) Details |
|
Large performance regression in SP2 and JS2. I should try to make the default path fast and succinct by adding this mode to the template parameter of LiteralParser. |
45fdc27 to
8d3885f
Compare
|
EWS run on previous version of this PR (hash 8d3885f) Details |
|
@Constellation test262 tests are merged; any update? |
8d3885f to
a616664
Compare
|
EWS run on previous version of this PR (hash a616664) Details |
a616664 to
e92ce50
Compare
|
EWS run on previous version of this PR (hash e92ce50) Details |
e92ce50 to
b7c8969
Compare
|
EWS run on previous version of this PR (hash b7c8969) Details |
b7c8969 to
7c4843c
Compare
|
EWS run on previous version of this PR (hash 7c4843c) Details |
7c4843c to
6f3b774
Compare
|
EWS run on previous version of this PR (hash 6f3b774) Details |
kmiller68
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll look more later but at least copyright update has a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2024 not 2014
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
6f3b774 to
7bc565f
Compare
|
EWS run on previous version of this PR (hash 7bc565f) Details |
Safer C++ Build #14724 (7bc565f)❌ Found 3 new failures. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming.
|
7bc565f to
beda5fb
Compare
|
EWS run on previous version of this PR (hash beda5fb) Details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't see context.index and context.input. It seems they are not supported in this patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were originally proposed, but the final spec does not have that.
https://tc39.es/proposal-json-parse-with-source/#sec-internalizejsonproperty
hyjorc1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
Safer C++ Build #14802 (beda5fb)❌ Found 2 new failures. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
beda5fb to
81bb9ce
Compare
|
EWS run on previous version of this PR (hash 81bb9ce) Details |
81bb9ce to
41f8aef
Compare
|
EWS run on current version of this PR (hash 41f8aef) Details |
https://bugs.webkit.org/show_bug.cgi?id=248031 rdar://131579181 Reviewed by Yijia Huang. This patch implements JSON.parse source text access proposal[1], which is now stage-3. This patch implements two major things in the proposal. The most important part of this patch is not regressing the existing extremely optimized JSON implementation for the fast path. Thus this patch adds template parameter to LiteralParser and disable all the slight changes when we are using the fast path. 1. JSON.rawJSON mechaism. Now new object type is integrated, and JSON.rawJSON can wrap JSON text with this object, which is a tool to inject raw JSON text into JSON.stringify. JSON.stringify uses held string from rawJSON-created object. 2. JSON.parse collects source information during parsing, and offer substring of text as a third parameter of JSON.parse reviver function. [1]: https://github.com/tc39/proposal-json-parse-with-source * JSTests/stress/json-parse-source-text-access.js: Added. (shouldBe): * JSTests/stress/json-raw-json-stringify.js: Added. (shouldBe): (shouldBe.JSON.stringify): * JSTests/stress/json-raw-json.js: Added. (shouldBe): (shouldThrow): (SyntaxError.JSON.Parse.error.Single.quotes.shouldThrow): * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: * Source/JavaScriptCore/Sources.txt: * Source/JavaScriptCore/heap/Heap.cpp: * Source/JavaScriptCore/heap/Heap.h: * Source/JavaScriptCore/runtime/CommonIdentifiers.h: * Source/JavaScriptCore/runtime/JSGlobalObject.cpp: (JSC::createJSONProperty): (JSC::JSGlobalObject::init): * Source/JavaScriptCore/runtime/JSGlobalObject.h: (JSC::JSGlobalObject::rawJSONObjectStructure const): * Source/JavaScriptCore/runtime/JSONObject.cpp: (JSC::JSONObject::finishCreation): (JSC::Stringifier::appendStringifiedValue): (JSC::Walker::Walker): (JSC::Walker::callReviver): (JSC::Walker::walk): (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/JSONObject.h: * Source/JavaScriptCore/runtime/JSRawJSONObject.cpp: Added. (JSC::JSRawJSONObject::JSRawJSONObject): (JSC::JSRawJSONObject::finishCreation): (JSC::JSRawJSONObject::createStructure): (JSC::JSRawJSONObject::rawJSON): * Source/JavaScriptCore/runtime/JSRawJSONObject.h: Copied from Source/JavaScriptCore/runtime/JSONObject.h. * Source/JavaScriptCore/runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::tryJSONPParse): (JSC::LiteralParser<CharType>::parse): * Source/JavaScriptCore/runtime/LiteralParser.h: (JSC::JSONRanges::JSONRanges): (JSC::JSONRanges::root const): (JSC::LiteralParser::tryLiteralParse): (JSC::LiteralParser::tryLiteralParsePrimitiveValue): (JSC::LiteralParser::Lexer::Lexer): (JSC::LiteralParser::Lexer::start const): * Source/JavaScriptCore/runtime/OptionsList.h: Canonical link: https://commits.webkit.org/288223@main
41f8aef to
e2c5cd5
Compare
|
Committed 288223@main (e2c5cd5): https://commits.webkit.org/288223@main Reviewed commits have been landed. Closing PR #7057 and removing active labels. |
🧪 style
e2c5cd5
41f8aef
🧪 ios-wk2🧪 api-ios🛠 playstation