From f37d72fb9bc7f5313437f96a24e405e265c48877 Mon Sep 17 00:00:00 2001 From: "akling@apple.com" Date: Tue, 4 Feb 2014 00:13:01 +0000 Subject: [PATCH] Keep only captured symbols in CodeBlock symbol tables. 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 | 17 +++++++++++++++++ .../JavaScriptCore/bytecode/UnlinkedCodeBlock.h | 1 + .../bytecompiler/BytecodeGenerator.cpp | 3 +++ 3 files changed, 21 insertions(+) diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index dbd04a9ea1d3..7155c8cbaae5 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,20 @@ +2014-02-03 Andreas Kling + + Keep only captured symbols in CodeBlock symbol tables. + + + 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 Fix the LLInt C loop diff --git a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h index 7c091e1f1690..b11ab0ea185f 100644 --- a/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h +++ b/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h @@ -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; } diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 291f8e731c18..708081c72fa0 100644 --- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -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); -- 2.36.0