Ignore:
Timestamp:
Apr 14, 2014, 1:46:27 AM (11 years ago)
Author:
[email protected]
Message:

[JSC] Improve the call site of string comparison in some hot path
https://bugs.webkit.org/show_bug.cgi?id=131605

Reviewed by Darin Adler.

Source/JavaScriptCore:

When resolved, the String of a JSString is never null. It can be empty but not null.
The null value is reserved for ropes but those would be resolved when getting the value.

Consequently, we should use the equal() operation that do not handle null values.
Using the StringImpl directly is already common in StringPrototype but it was not used here for some reason.

  • jit/JITOperations.cpp:
  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::equalSlowCaseInline):
(JSC::JSValue::strictEqualSlowCaseInline):
(JSC::JSValue::pureStrictEqual):

Source/WebCore:

  • dom/NodeRareData.h:

(WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
We should use the right comparison operation depending on the Hash Traits.

Source/WTF:

  • wtf/text/StringImpl.cpp:

(WTF::stringImplContentEqual):
Inline that function to reduce the call overhead for JSC.
This is only inlined twice, it is not catastrophic for our binary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167199 r167220  
     12014-04-14  Benjamin Poulain  <[email protected]>
     2
     3        [JSC] Improve the call site of string comparison in some hot path
     4        https://bugs.webkit.org/show_bug.cgi?id=131605
     5
     6        Reviewed by Darin Adler.
     7
     8        When resolved, the String of a JSString is never null. It can be empty but not null.
     9        The null value is reserved for ropes but those would be resolved when getting the value.
     10
     11        Consequently, we should use the equal() operation that do not handle null values.
     12        Using the StringImpl directly is already common in StringPrototype but it was not used here for some reason.
     13
     14        * jit/JITOperations.cpp:
     15        * runtime/JSCJSValueInlines.h:
     16        (JSC::JSValue::equalSlowCaseInline):
     17        (JSC::JSValue::strictEqualSlowCaseInline):
     18        (JSC::JSValue::pureStrictEqual):
     19
    1202014-04-08  Oliver Hunt  <[email protected]>
    221
Note: See TracChangeset for help on using the changeset viewer.