⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 175416 in webkit


Ignore:
Timestamp:
Oct 31, 2014, 12:28:12 PM (12 years ago)
Author:
akling@apple.com
Message:

Make writes to RegExpObject.lastIndex cacheable.
<https://webkit.org/b/138255>

Reviewed by Geoffrey Garen.

We were neglecting to IC the puts to RegExpObject.lastIndex on Octane/regexp,
and ended up spending 4.5% of a time profile in operationPutByIdNonStrict.

~3% progression on Octane/regexp.

  • runtime/RegExpObject.cpp:

(JSC::regExpObjectSetLastIndexStrict):
(JSC::regExpObjectSetLastIndexNonStrict):
(JSC::RegExpObject::put):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r175411 r175416  
     12014-10-31  Andreas Kling  <akling@apple.com>
     2
     3        Make writes to RegExpObject.lastIndex cacheable.
     4        <https://webkit.org/b/138255>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        We were neglecting to IC the puts to RegExpObject.lastIndex on Octane/regexp,
     9        and ended up spending 4.5% of a time profile in operationPutByIdNonStrict.
     10
     11        ~3% progression on Octane/regexp.
     12
     13        * runtime/RegExpObject.cpp:
     14        (JSC::regExpObjectSetLastIndexStrict):
     15        (JSC::regExpObjectSetLastIndexNonStrict):
     16        (JSC::RegExpObject::put):
     17
    1182014-10-31  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r175365 r175416  
    291291}
    292292
     293static void regExpObjectSetLastIndexStrict(ExecState* exec, JSObject* slotBase, EncodedJSValue, EncodedJSValue value)
     294{
     295    asRegExpObject(slotBase)->setLastIndex(exec, JSValue::decode(value), true);
     296}
     297
     298static void regExpObjectSetLastIndexNonStrict(ExecState* exec, JSObject* slotBase, EncodedJSValue, EncodedJSValue value)
     299{
     300    asRegExpObject(slotBase)->setLastIndex(exec, JSValue::decode(value), false);
     301}
     302
    293303void RegExpObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
    294304{
    295305    if (propertyName == exec->propertyNames().lastIndex) {
    296306        asRegExpObject(cell)->setLastIndex(exec, value, slot.isStrictMode());
     307        slot.setCustomProperty(asRegExpObject(cell), slot.isStrictMode()
     308            ? regExpObjectSetLastIndexStrict
     309            : regExpObjectSetLastIndexNonStrict);
    297310        return;
    298311    }
Note: See TracChangeset for help on using the changeset viewer.