Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 299d0f154d7a21d6d68c8475065135a47490a647
      
https://github.com/WebKit/WebKit/commit/299d0f154d7a21d6d68c8475065135a47490a647
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-06-22 (Mon, 22 Jun 2026)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSONAtomStringCache.h
    M Source/JavaScriptCore/runtime/JSONAtomStringCacheInlines.h
    M Source/JavaScriptCore/runtime/JSONObject.cpp
    M Source/JavaScriptCore/runtime/LiteralParser.cpp

  Log Message:
  -----------
  [JSC] Optimize JSON related code for common cases
https://bugs.webkit.org/show_bug.cgi?id=317566
rdar://180265866

Reviewed by Yijia Huang.

This adds careful micro-optimizations to JSON related code.

1. __proto__ receiver does not matter when parsing normal JSON
   (StrictJSON, not SloppyJSON etc.). Thus we do not need to check
   structure transition.
2. Increase JSONAtomStringCache capacity to 512 to hit atomization more.
3. Increase JSONAtomStringCache's candidate string length to 16 as we
   can see these strings too.
4. Similar to (1). But in FastStringifier, we have no way to cause
   structure transition during iteration. Thus making the check as ASSERT.
5. Inline super common leaf value serialization, 8-bit string and Int32.

* Source/JavaScriptCore/runtime/JSONAtomStringCache.h:
* Source/JavaScriptCore/runtime/JSONAtomStringCacheInlines.h:
(JSC::JSONAtomStringCache::makeJSString):
* Source/JavaScriptCore/runtime/JSONObject.cpp:
(JSC::bufferMode>::append):
(JSC::bufferMode>::appendInt32Array):
* Source/JavaScriptCore/runtime/LiteralParser.cpp:
(JSC::requires):

Canonical link: https://commits.webkit.org/315620@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to