Ignore:
Timestamp:
May 26, 2015, 10:28:32 AM (10 years ago)
Author:
[email protected]
Message:

Try to use StringView when comparing JSStrings for equality.
<https://webkit.org/b/145379>

Reviewed by Darin Adler.

Use JSString::view() when sending two JSStrings to WTF::equal()
for comparison. This avoids creating new objects in the case where
the strings are actually substrings.

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r184828 r184860  
    924924    NativeCallFrameTracer tracer(vm, exec);
    925925
    926     bool result = WTF::equal(*asString(left)->value(exec).impl(), *asString(right)->value(exec).impl());
     926    bool result = WTF::equal(asString(left)->view(exec), asString(right)->view(exec));
    927927#if USE(JSVALUE64)
    928928    return JSValue::encode(jsBoolean(result));
Note: See TracChangeset for help on using the changeset viewer.