Changeset 184860 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- May 26, 2015, 10:28:32 AM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r184859 r184860 1 2015-05-26 Andreas Kling <[email protected]> 2 3 Try to use StringView when comparing JSStrings for equality. 4 <https://webkit.org/b/145379> 5 6 Reviewed by Darin Adler. 7 8 Use JSString::view() when sending two JSStrings to WTF::equal() 9 for comparison. This avoids creating new objects in the case where 10 the strings are actually substrings. 11 12 * jit/JITOperations.cpp: 13 * runtime/JSCJSValueInlines.h: 14 (JSC::JSValue::equalSlowCaseInline): 15 (JSC::JSValue::strictEqualSlowCaseInline): 16 1 17 2015-05-26 Yusuke Suzuki <[email protected]> 2 18 -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r184828 r184860 924 924 NativeCallFrameTracer tracer(vm, exec); 925 925 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)); 927 927 #if USE(JSVALUE64) 928 928 return JSValue::encode(jsBoolean(result)); -
trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
r182205 r184860 787 787 bool s2 = v2.isString(); 788 788 if (s1 && s2) 789 return WTF::equal( *asString(v1)->value(exec).impl(), *asString(v2)->value(exec).impl());789 return WTF::equal(asString(v1)->view(exec), asString(v2)->view(exec)); 790 790 791 791 if (v1.isUndefinedOrNull()) { … … 857 857 858 858 if (v1.asCell()->isString() && v2.asCell()->isString()) 859 return WTF::equal( *asString(v1)->value(exec).impl(), *asString(v2)->value(exec).impl());859 return WTF::equal(asString(v1)->view(exec), asString(v2)->view(exec)); 860 860 if (v1.asCell()->isSymbol() && v2.asCell()->isSymbol()) 861 861 return asSymbol(v1)->privateName() == asSymbol(v2)->privateName();
Note:
See TracChangeset
for help on using the changeset viewer.