⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 184006 in webkit


Ignore:
Timestamp:
May 8, 2015, 12:23:25 PM (11 years ago)
Author:
akling@apple.com
Message:

Micro-optimize JSON serialization of string primitives.
<https://webkit.org/b/144800>

Reviewed by Sam Weinig.

Don't use the out-of-line JSValue::getString() to grab at string primitives
in serialization. Just check if it's a JSString and then downcast to grab at
the WTF::String inside.

2% progression on Kraken/json-stringify-tinderbox.

  • runtime/JSONObject.cpp:

(JSC::Stringifier::appendStringifiedValue):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r183988 r184006  
     12015-05-08  Andreas Kling  <akling@apple.com>
     2
     3        Micro-optimize JSON serialization of string primitives.
     4        <https://webkit.org/b/144800>
     5
     6        Reviewed by Sam Weinig.
     7
     8        Don't use the out-of-line JSValue::getString() to grab at string primitives
     9        in serialization. Just check if it's a JSString and then downcast to grab at
     10        the WTF::String inside.
     11
     12        2% progression on Kraken/json-stringify-tinderbox.
     13
     14        * runtime/JSONObject.cpp:
     15        (JSC::Stringifier::appendStringifiedValue):
     16
    1172015-05-08  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r183988 r184006  
    316316    }
    317317
    318     String stringValue;
    319     if (value.getString(m_exec, stringValue)) {
    320         builder.appendQuotedJSONString(stringValue);
     318    if (value.isString()) {
     319        builder.appendQuotedJSONString(asString(value)->value(m_exec));
    321320        return StringifySucceeded;
    322321    }
Note: See TracChangeset for help on using the changeset viewer.