Changeset 35446 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Jul 30, 2008, 7:42:03 AM (17 years ago)
Author:
[email protected]
Message:

2008-07-29 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

Bug 20209: Atomize constant strings
<https://bugs.webkit.org/show_bug.cgi?id=20209>

Prevents significant performance degradation seen when a script contains multiple
identical strings that are used as keys to identify properties on objects.

No performance change on SunSpider.

  • kjs/nodes.cpp: Atomize constant strings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r35368 r35446  
    253253    if (dst == ignoredResult())
    254254        return 0;
    255     // FIXME: should we try to atomize constant strings?
    256     return generator.emitLoad(generator.finalDestination(dst), jsOwnedString(generator.globalExec(), m_value));
     255
     256    // We atomize constant strings, in case they're later used in property lookup.
     257    return generator.emitLoad(generator.finalDestination(dst), jsOwnedString(generator.globalExec(), Identifier(generator.globalExec(), m_value).ustring()));
    257258}
    258259
Note: See TracChangeset for help on using the changeset viewer.