Title: [175416] trunk/Source/_javascript_Core
Revision
175416
Author
[email protected]
Date
2014-10-31 12:28:12 -0700 (Fri, 31 Oct 2014)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (175415 => 175416)


--- trunk/Source/_javascript_Core/ChangeLog	2014-10-31 19:11:01 UTC (rev 175415)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-10-31 19:28:12 UTC (rev 175416)
@@ -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-31  Chris Dumez  <[email protected]>
 
         Fix a couple of warnings in JSC reported by clang static analyzer

Modified: trunk/Source/_javascript_Core/runtime/RegExpObject.cpp (175415 => 175416)


--- trunk/Source/_javascript_Core/runtime/RegExpObject.cpp	2014-10-31 19:11:01 UTC (rev 175415)
+++ trunk/Source/_javascript_Core/runtime/RegExpObject.cpp	2014-10-31 19:28:12 UTC (rev 175416)
@@ -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);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to