Build fix for HasOwnPropertyCache::Entry caused slowdown by introducing a constructor...
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 20:34:15 +0000 (20:34 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 20:34:15 +0000 (20:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163490

Reviewed by Darin Adler.

* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::Entry::Entry):
(JSC::HasOwnPropertyCache::tryAdd):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@207425 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/HasOwnPropertyCache.h

index 217d486..bec84c4 100644 (file)
@@ -1,3 +1,14 @@
+2016-10-17  Saam Barati  <sbarati@apple.com>
+
+        Build fix for HasOwnPropertyCache::Entry caused slowdown by introducing a constructor that doesn't use move semantics for the RefPtr<UniquedStringImpl> parameter
+        https://bugs.webkit.org/show_bug.cgi?id=163490
+
+        Reviewed by Darin Adler.
+
+        * runtime/HasOwnPropertyCache.h:
+        (JSC::HasOwnPropertyCache::Entry::Entry):
+        (JSC::HasOwnPropertyCache::tryAdd):
+
 2016-10-17  Mark Lam  <mark.lam@apple.com>
 
         Use the reject() helper function for conditionally throwing TypeErrors.
index c06bbc0..29a57e6 100644 (file)
@@ -44,12 +44,11 @@ public:
 
         Entry() = default;
 
-        Entry(RefPtr<UniquedStringImpl> impl, StructureID structureID, bool result)
-            : impl(impl)
+        Entry(RefPtr<UniquedStringImpl>&& impl, StructureID structureID, bool result)
+            : impl(WTFMove(impl))
             , structureID(structureID)
             , result(result)
-        {
-        }
+        { }
 
         Entry& operator=(Entry&& other)
         {
@@ -122,7 +121,7 @@ public:
             UniquedStringImpl* impl = propName.uid();
             StructureID id = structure->id();
             uint32_t index = HasOwnPropertyCache::hash(id, impl) & mask;
-            bitwise_cast<Entry*>(this)[index] = Entry{ RefPtr<UniquedStringImpl>(impl), id, result };
+            bitwise_cast<Entry*>(this)[index] = Entry { RefPtr<UniquedStringImpl>(impl), id, result };
         }
     }