Modified: releases/WebKitGTK/webkit-2.6/Source/_javascript_Core/ChangeLog (175934 => 175935)
--- releases/WebKitGTK/webkit-2.6/Source/_javascript_Core/ChangeLog 2014-11-11 16:36:57 UTC (rev 175934)
+++ releases/WebKitGTK/webkit-2.6/Source/_javascript_Core/ChangeLog 2014-11-11 16:40:44 UTC (rev 175935)
@@ -1,3 +1,20 @@
+2014-10-31 Andreas Kling <[email protected]>
+
+ 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):
+
2014-10-30 Andreas Kling <[email protected]>
Unreviewed assertion fix.
Modified: releases/WebKitGTK/webkit-2.6/Source/_javascript_Core/runtime/RegExpObject.cpp (175934 => 175935)
--- releases/WebKitGTK/webkit-2.6/Source/_javascript_Core/runtime/RegExpObject.cpp 2014-11-11 16:36:57 UTC (rev 175934)
+++ releases/WebKitGTK/webkit-2.6/Source/_javascript_Core/runtime/RegExpObject.cpp 2014-11-11 16:40:44 UTC (rev 175935)
@@ -290,10 +290,23 @@
return JSValue::encode(regExpObjectSourceInternal(exec, pattern, pattern.characters16(), pattern.length()));
}
+static void regExpObjectSetLastIndexStrict(ExecState* exec, JSObject* slotBase, EncodedJSValue, EncodedJSValue value)
+{
+ asRegExpObject(slotBase)->setLastIndex(exec, JSValue::decode(value), true);
+}
+
+static void regExpObjectSetLastIndexNonStrict(ExecState* exec, JSObject* slotBase, EncodedJSValue, EncodedJSValue value)
+{
+ asRegExpObject(slotBase)->setLastIndex(exec, JSValue::decode(value), false);
+}
+
void RegExpObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
if (propertyName == exec->propertyNames().lastIndex) {
asRegExpObject(cell)->setLastIndex(exec, value, slot.isStrictMode());
+ slot.setCustomProperty(asRegExpObject(cell), slot.isStrictMode()
+ ? regExpObjectSetLastIndexStrict
+ : regExpObjectSetLastIndexNonStrict);
return;
}
Base::put(cell, exec, propertyName, value, slot);