Title: [159097] trunk/Source/_javascript_Core
Revision
159097
Author
akl...@apple.com
Date
2013-11-11 23:56:39 -0800 (Mon, 11 Nov 2013)

Log Message

CodeBlock: Un-segment some Vectors.
<https://webkit.org/b/124188>

Turn some SegmentedVectors into Vectors where the final item count
is known at CodeBlock construction time. This removes unnecessary
allocation and indirection.

I've got ~4.5 MB below SegmentedVector<ValueProfile>::ensureSegment
on Membuster3 (peak, before pressure signal) so this should help
take a bit of the edge off there.

Reviewed by Geoffrey Garen.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (159096 => 159097)


--- trunk/Source/_javascript_Core/ChangeLog	2013-11-12 06:43:34 UTC (rev 159096)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-11-12 07:56:39 UTC (rev 159097)
@@ -1,3 +1,18 @@
+2013-11-11  Andreas Kling  <akl...@apple.com>
+
+        CodeBlock: Un-segment some Vectors.
+        <https://webkit.org/b/124188>
+
+        Turn some SegmentedVectors into Vectors where the final item count
+        is known at CodeBlock construction time. This removes unnecessary
+        allocation and indirection.
+
+        I've got ~4.5 MB below SegmentedVector<ValueProfile>::ensureSegment
+        on Membuster3 (peak, before pressure signal) so this should help
+        take a bit of the edge off there.
+
+        Reviewed by Geoffrey Garen.
+
 2013-11-11  Filip Pizlo  <fpi...@apple.com>
 
         Get rid of the lastResultRegister optimization in the baseline JIT

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (159096 => 159097)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-11-12 06:43:34 UTC (rev 159096)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-11-12 07:56:39 UTC (rev 159097)
@@ -1718,12 +1718,12 @@
     if (size_t size = unlinkedCodeBlock->numberOfArrayProfiles())
         m_arrayProfiles.grow(size);
     if (size_t size = unlinkedCodeBlock->numberOfArrayAllocationProfiles())
-        m_arrayAllocationProfiles.grow(size);
+        m_arrayAllocationProfiles.resizeToFit(size);
     if (size_t size = unlinkedCodeBlock->numberOfValueProfiles())
-        m_valueProfiles.grow(size);
+        m_valueProfiles.resizeToFit(size);
 #endif
     if (size_t size = unlinkedCodeBlock->numberOfObjectAllocationProfiles())
-        m_objectAllocationProfiles.grow(size);
+        m_objectAllocationProfiles.resizeToFit(size);
 
     // Copy and translate the UnlinkedInstructions
     size_t instructionCount = unlinkedCodeBlock->instructions().size();

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (159096 => 159097)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2013-11-12 06:43:34 UTC (rev 159096)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2013-11-12 07:56:39 UTC (rev 159097)
@@ -1044,13 +1044,13 @@
 #endif
 #if ENABLE(VALUE_PROFILER)
     Vector<ValueProfile> m_argumentValueProfiles;
-    SegmentedVector<ValueProfile, 8> m_valueProfiles;
+    Vector<ValueProfile> m_valueProfiles;
     SegmentedVector<RareCaseProfile, 8> m_rareCaseProfiles;
     SegmentedVector<RareCaseProfile, 8> m_specialFastCaseProfiles;
-    SegmentedVector<ArrayAllocationProfile, 8> m_arrayAllocationProfiles;
+    Vector<ArrayAllocationProfile> m_arrayAllocationProfiles;
     ArrayProfileVector m_arrayProfiles;
 #endif
-    SegmentedVector<ObjectAllocationProfile, 8> m_objectAllocationProfiles;
+    Vector<ObjectAllocationProfile> m_objectAllocationProfiles;
 
     // Constant Pool
     Vector<Identifier> m_additionalIdentifiers;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to