Changeset 201645 in webkit
- Timestamp:
- Jun 3, 2016 9:43:10 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201641 r201645 1 2016-06-03 Andreas Kling <akling@apple.com> 2 3 Eliminate two large sources of temporary StringImpl objects. 4 <https://webkit.org/b/158336> 5 6 Reviewed by Anders Carlsson. 7 8 We were jumping through some inefficient hoops when creating Identifiers due to the 9 convenience of our String(const char*) constructor. 10 11 This patch avoids just over 1 million temporary StringImpl objects on the PLUM benchmark. 12 13 * runtime/JSObject.h: 14 (JSC::makeIdentifier): Add an overload for string literals so we can stop creating a temporary 15 String just for passing to Identifier::fromString(). 16 17 * runtime/Lookup.h: 18 (JSC::reifyStaticProperties): Use the Identifier::fromString() that takes an LChar* and a length 19 instead of creating a temporary String. 20 1 21 2016-06-03 Mark Lam <mark.lam@apple.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r201562 r201645 1625 1625 COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment); 1626 1626 1627 template<unsigned charactersCount> 1628 ALWAYS_INLINE Identifier makeIdentifier(VM& vm, const char (&characters)[charactersCount]) 1629 { 1630 return Identifier::fromString(&vm, characters); 1631 } 1632 1627 1633 ALWAYS_INLINE Identifier makeIdentifier(VM& vm, const char* name) 1628 1634 { -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r201448 r201645 429 429 if (!value.m_key) 430 430 continue; 431 auto key = Identifier::fromString(&vm, value.m_key);431 auto key = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(value.m_key), strlen(value.m_key)); 432 432 reifyStaticProperty(vm, key, value, thisObj); 433 433 }
Note: See TracChangeset
for help on using the changeset viewer.