CodeBlock: LLIntCallLinkInfo vector can be sized-to-fit at creation.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Aug 2013 01:21:23 +0000 (01:21 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Aug 2013 01:21:23 +0000 (01:21 +0000)
<https://webkit.org/b/120487>

Reviewed by Oliver Hunt.

CodeBlock::m_llintCallLinkInfos never changes size after creation, so make it a Vector
instead of a SegmentedVector. Use resizeToFit() instead of grow() since we know the
exact amount of space needed.

* bytecode/CodeBlock.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::shrinkToFit):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h

index defa88b..e6e8a28 100644 (file)
@@ -1,3 +1,19 @@
+2013-08-29  Andreas Kling  <akling@apple.com>
+
+        CodeBlock: LLIntCallLinkInfo vector can be sized-to-fit at creation.
+        <https://webkit.org/b/120487>
+
+        Reviewed by Oliver Hunt.
+
+        CodeBlock::m_llintCallLinkInfos never changes size after creation, so make it a Vector
+        instead of a SegmentedVector. Use resizeToFit() instead of grow() since we know the
+        exact amount of space needed.
+
+        * bytecode/CodeBlock.h:
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::CodeBlock):
+        (JSC::CodeBlock::shrinkToFit):
+
 2013-08-29  Oliver Hunt  <oliver@apple.com>
 
         Fix issues found by MSVC (which also happily fixes an unintentional pessimisation)
index f8685e5..aa1a4df 100644 (file)
@@ -1635,7 +1635,7 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin
     // Allocate metadata buffers for the bytecode
 #if ENABLE(LLINT)
     if (size_t size = unlinkedCodeBlock->numberOfLLintCallLinkInfos())
-        m_llintCallLinkInfos.grow(size);
+        m_llintCallLinkInfos.resizeToFit(size);
 #endif
 #if ENABLE(DFG_JIT)
     if (size_t size = unlinkedCodeBlock->numberOfArrayProfiles())
@@ -2442,9 +2442,6 @@ void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& d
 
 void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
 {
-#if ENABLE(LLINT)
-    m_llintCallLinkInfos.shrinkToFit();
-#endif
 #if ENABLE(JIT)
     m_structureStubInfos.shrinkToFit();
     m_callLinkInfos.shrinkToFit();
index 7f45e54..4756bfb 100644 (file)
@@ -1074,7 +1074,7 @@ private:
     unsigned m_codeType;
 
 #if ENABLE(LLINT)
-    SegmentedVector<LLIntCallLinkInfo, 8> m_llintCallLinkInfos;
+    Vector<LLIntCallLinkInfo> m_llintCallLinkInfos;
     SentinelLinkedList<LLIntCallLinkInfo, BasicRawSentinelNode<LLIntCallLinkInfo> > m_incomingLLIntCalls;
 #endif
     RefPtr<JITCode> m_jitCode;