WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
the patch
blah.patch (text/plain), 6.18 KB, created by
Filip Pizlo
on 2013-11-12 12:55:54 PST
(
hide
)
Description:
the patch
Filename:
MIME Type:
Creator:
Filip Pizlo
Created:
2013-11-12 12:55:54 PST
Size:
6.18 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 159139) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,25 @@ >+2013-11-12 Filip Pizlo <fpizlo@apple.com> >+ >+ Liveness analysis should take less memory in CodeBlock when it is unused >+ https://bugs.webkit.org/show_bug.cgi?id=124225 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Basically, I turned CodeBlock::m_livenessAnalysis into a pointer that is null by >+ default. >+ >+ * bytecode/BytecodeLivenessAnalysis.cpp: >+ (JSC::BytecodeLivenessAnalysis::BytecodeLivenessAnalysis): >+ (JSC::BytecodeLivenessAnalysis::runLivenessFixpoint): >+ (JSC::BytecodeLivenessAnalysis::operandIsLiveAtBytecodeOffset): >+ (JSC::BytecodeLivenessAnalysis::dumpResults): >+ (JSC::BytecodeLivenessAnalysis::compute): >+ * bytecode/BytecodeLivenessAnalysis.h: >+ * bytecode/CodeBlock.cpp: >+ (JSC::CodeBlock::CodeBlock): >+ * bytecode/CodeBlock.h: >+ (JSC::CodeBlock::livenessAnalysis): >+ > 2013-11-11 Oliver Hunt <oliver@apple.com> > > Support unprefixed deconstructing assignment >Index: Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp (revision 159136) >+++ Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.cpp (working copy) >@@ -33,16 +33,9 @@ namespace JSC { > > BytecodeLivenessAnalysis::BytecodeLivenessAnalysis(CodeBlock* codeBlock) > : m_codeBlock(codeBlock) >- , m_computed(false) > { > ASSERT(m_codeBlock); >-} >- >-BytecodeLivenessAnalysis::BytecodeLivenessAnalysis(const BytecodeLivenessAnalysis& other) >- : m_codeBlock(other.m_codeBlock) >- , m_basicBlocks(other.m_basicBlocks) >- , m_computed(other.m_computed) >-{ >+ compute(); > } > > static int numberOfCapturedVariables(CodeBlock* codeBlock) >@@ -588,7 +581,6 @@ static void computeLocalLivenessForBlock > > void BytecodeLivenessAnalysis::runLivenessFixpoint() > { >- ASSERT(!m_computed); > UnlinkedCodeBlock* unlinkedCodeBlock = m_codeBlock->unlinkedCodeBlock(); > unsigned numberOfVariables = unlinkedCodeBlock->m_numVars + > unlinkedCodeBlock->m_numCalleeRegisters - numberOfCapturedVariables(m_codeBlock); >@@ -631,7 +623,6 @@ void BytecodeLivenessAnalysis::getLivene > bool BytecodeLivenessAnalysis::operandIsLiveAtBytecodeOffset(int operand, unsigned bytecodeOffset) > { > int numCapturedVars = numberOfCapturedVariables(m_codeBlock); >- ASSERT(m_computed); > if (VirtualRegister(operand).isArgument()) > return true; > if (operand <= captureStart(m_codeBlock) && operand > captureEnd(m_codeBlock)) >@@ -678,7 +669,6 @@ FastBitVector BytecodeLivenessAnalysis:: > > void BytecodeLivenessAnalysis::dumpResults() > { >- ASSERT(m_computed); > Interpreter* interpreter = m_codeBlock->vm()->interpreter; > Instruction* instructionsBegin = m_codeBlock->instructions().begin(); > for (unsigned i = 0; i < m_basicBlocks.size(); i++) { >@@ -733,13 +723,9 @@ void BytecodeLivenessAnalysis::dumpResul > > void BytecodeLivenessAnalysis::compute() > { >- if (m_computed) >- return; >- > computeBytecodeBasicBlocks(m_codeBlock, m_basicBlocks); > ASSERT(m_basicBlocks.size()); > runLivenessFixpoint(); >- m_computed = true; > > if (Options::dumpBytecodeLivenessResults()) > dumpResults(); >Index: Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.h >=================================================================== >--- Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.h (revision 159136) >+++ Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysis.h (working copy) >@@ -38,21 +38,12 @@ class CodeBlock; > class BytecodeLivenessAnalysis { > public: > BytecodeLivenessAnalysis(CodeBlock*); >- BytecodeLivenessAnalysis(const BytecodeLivenessAnalysis&); > > bool operandIsLiveAtBytecodeOffset(int operand, unsigned bytecodeOffset); > FastBitVector getLivenessInfoAtBytecodeOffset(unsigned bytecodeOffset); > >- bool hasBeenComputed() { return m_computed; } >- void compute(); >- void computeIfNecessary() >- { >- if (m_computed) >- return; >- compute(); >- } >- > private: >+ void compute(); > void runLivenessFixpoint(); > void dumpResults(); > >@@ -60,8 +51,6 @@ private: > > CodeBlock* m_codeBlock; > Vector<RefPtr<BytecodeBasicBlock> > m_basicBlocks; >- >- bool m_computed; > }; > > } // namespace JSC >Index: Source/JavaScriptCore/bytecode/CodeBlock.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/CodeBlock.cpp (revision 159136) >+++ Source/JavaScriptCore/bytecode/CodeBlock.cpp (working copy) >@@ -1572,7 +1572,6 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, > , m_optimizationDelayCounter(0) > , m_reoptimizationRetryCounter(0) > , m_hash(other.m_hash) >- , m_livenessAnalysis(other.m_livenessAnalysis) > #if ENABLE(JIT) > , m_capabilityLevelState(DFG::CapabilityLevelNotSet) > #endif >@@ -1618,7 +1617,6 @@ CodeBlock::CodeBlock(ScriptExecutable* o > , m_osrExitCounter(0) > , m_optimizationDelayCounter(0) > , m_reoptimizationRetryCounter(0) >- , m_livenessAnalysis(this) > #if ENABLE(JIT) > , m_capabilityLevelState(DFG::CapabilityLevelNotSet) > #endif >Index: Source/JavaScriptCore/bytecode/CodeBlock.h >=================================================================== >--- Source/JavaScriptCore/bytecode/CodeBlock.h (revision 159136) >+++ Source/JavaScriptCore/bytecode/CodeBlock.h (working copy) >@@ -679,7 +679,12 @@ public: > > JSGlobalObject* globalObjectFor(CodeOrigin); > >- BytecodeLivenessAnalysis& livenessAnalysis() { return m_livenessAnalysis; } >+ BytecodeLivenessAnalysis& livenessAnalysis() >+ { >+ if (!m_livenessAnalysis) >+ m_livenessAnalysis = std::make_unique<BytecodeLivenessAnalysis>(this); >+ return *m_livenessAnalysis; >+ } > > // Jump Tables > >@@ -1077,7 +1082,7 @@ private: > > mutable CodeBlockHash m_hash; > >- BytecodeLivenessAnalysis m_livenessAnalysis; >+ std::unique_ptr<BytecodeLivenessAnalysis> m_livenessAnalysis; > > struct RareData { > WTF_MAKE_FAST_ALLOCATED;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mhahnenberg
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 124225
: 216709