Commit a7dd60a9 authored by akling@apple.com's avatar akling@apple.com

CodeBlock: Size m_callLinkInfos and m_byValInfos to fit earlier.

<https://webkit.org/b/127239>

Reviewed by Anders Carlsson.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::setNumberOfByValInfos):
(JSC::CodeBlock::setNumberOfCallLinkInfos):

    Use resizeToFit() instead of grow() for these vectors, since
    we know the final size here.

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

    No need to shrink here anymore. We were not even shrinking
    m_byValInfo before!


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1bc7b20f
2014-01-18 Andreas Kling <akling@apple.com>
CodeBlock: Size m_callLinkInfos and m_byValInfos to fit earlier.
<https://webkit.org/b/127239>
Reviewed by Anders Carlsson.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setNumberOfByValInfos):
(JSC::CodeBlock::setNumberOfCallLinkInfos):
Use resizeToFit() instead of grow() for these vectors, since
we know the final size here.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::shrinkToFit):
No need to shrink here anymore. We were not even shrinking
m_byValInfo before!
2014-01-18 Andreas Kling <akling@apple.com>
CodeBlock: Size m_function{Exprs,Decls} to fit from creation.
......
......@@ -2583,9 +2583,6 @@ unsigned CodeBlock::opDebugBytecodeOffsetForLineAndColumn(unsigned& line, unsign
void CodeBlock::shrinkToFit(ShrinkMode shrinkMode)
{
#if ENABLE(JIT)
m_callLinkInfos.shrinkToFit();
#endif
m_rareCaseProfiles.shrinkToFit();
m_specialFastCaseProfiles.shrinkToFit();
......
......@@ -401,11 +401,11 @@ public:
String nameForRegister(VirtualRegister);
#if ENABLE(JIT)
void setNumberOfByValInfos(size_t size) { m_byValInfos.grow(size); }
void setNumberOfByValInfos(size_t size) { m_byValInfos.resizeToFit(size); }
size_t numberOfByValInfos() const { return m_byValInfos.size(); }
ByValInfo& byValInfo(size_t index) { return m_byValInfos[index]; }
void setNumberOfCallLinkInfos(size_t size) { m_callLinkInfos.grow(size); }
void setNumberOfCallLinkInfos(size_t size) { m_callLinkInfos.resizeToFit(size); }
size_t numberOfCallLinkInfos() const { return m_callLinkInfos.size(); }
CallLinkInfo& callLinkInfo(int index) { return m_callLinkInfos[index]; }
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment