Keep only captured symbols in CodeBlock symbol tables.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Feb 2014 00:13:01 +0000 (00:13 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Feb 2014 00:13:01 +0000 (00:13 +0000)
<https://webkit.org/b/128050>

Discard all uncaptured symbols at the end of codegen since only
the captured ones will be used after that point.

~2MB progression on Membuster OSUS.

Reviewed by Geoffrey Garen.

* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::setSymbolTable):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

index dbd04a9ea1d3493ada727f476b6154b092a197a7..7155c8cbaae5e1a19747b398cc43a9cb7c230edb 100644 (file)
@@ -1,3 +1,20 @@
+2014-02-03  Andreas Kling  <akling@apple.com>
+
+        Keep only captured symbols in CodeBlock symbol tables.
+        <https://webkit.org/b/128050>
+
+        Discard all uncaptured symbols at the end of codegen since only
+        the captured ones will be used after that point.
+
+        ~2MB progression on Membuster OSUS.
+
+        Reviewed by Geoffrey Garen.
+
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::setSymbolTable):
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::generate):
+
 2014-02-03  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Fix the LLInt C loop
index 7c091e1f16909ee3b6cf145a710044817849f6c4..b11ab0ea185fa2389794b67fe31bd05a2dad18d3 100644 (file)
@@ -383,6 +383,7 @@ public:
     UnlinkedHandlerInfo& exceptionHandler(int index) { ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; }
 
     SymbolTable* symbolTable() const { return m_symbolTable.get(); }
+    void setSymbolTable(SymbolTable* table) { m_symbolTable.set(*m_vm, this, table); }
 
     VM* vm() const { return m_vm; }
 
index 291f8e731c18d6b290fa56a831dc55de3ffb2314..708081c72fa04f7025b11bfdc5768dae4699ccb8 100644 (file)
@@ -115,6 +115,9 @@ ParserError BytecodeGenerator::generate()
 
     m_codeBlock->shrinkToFit();
 
+    if (m_codeBlock->symbolTable())
+        m_codeBlock->setSymbolTable(m_codeBlock->symbolTable()->cloneCapturedNames(*m_codeBlock->vm()));
+
     if (m_expressionTooDeep)
         return ParserError(ParserError::OutOfMemory);
     return ParserError(ParserError::ErrorNone);