Changeset 98398 in webkit
- Timestamp:
- Oct 25, 2011, 2:56:31 PM (15 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/CodeBlock.cpp (modified) (2 diffs)
-
bytecode/CodeBlock.h (modified) (1 diff)
-
dfg/DFGGraph.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r98383 r98398 1 2011-10-25 Filip Pizlo <fpizlo@apple.com> 2 3 Tiered compilation may introduce dangling pointers in constant buffers 4 https://bugs.webkit.org/show_bug.cgi?id=70854 5 6 Reviewed by Oliver Hunt. 7 8 Tiered compilation now copies constant buffers, which fixes the regression in 9 https://bugs.webkit.org/show_bug.cgi?id=70246. No new tests because this 10 regression relies on a subtle interleaving of optimized compilation and garbage 11 collection, and cannot be reproduced in a simple test. 12 13 This also adds some new debug support, which was used to fix this bug and is 14 likely to be useful in the future. 15 16 * bytecode/CodeBlock.cpp: 17 (JSC::CodeBlock::copyDataFrom): 18 (JSC::CodeBlock::usesOpcode): 19 * bytecode/CodeBlock.h: 20 * dfg/DFGGraph.cpp: 21 (JSC::DFG::Graph::dump): 22 1 23 2011-10-25 Mark Hahnenberg <mhahnenberg@apple.com> 2 24 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r98179 r98398 1829 1829 replaceExistingEntries(m_functionDecls, alternative->m_functionDecls); 1830 1830 replaceExistingEntries(m_functionExprs, alternative->m_functionExprs); 1831 if (!!m_rareData && !!alternative->m_rareData) 1832 replaceExistingEntries(m_rareData->m_constantBuffers, alternative->m_rareData->m_constantBuffers); 1831 1833 } 1832 1834 … … 2003 2005 #endif 2004 2006 2007 #ifndef NDEBUG 2008 bool CodeBlock::usesOpcode(OpcodeID opcodeID) 2009 { 2010 Interpreter* interpreter = globalData()->interpreter; 2011 Instruction* instructionsBegin = instructions().begin(); 2012 unsigned instructionCount = instructions().size(); 2013 2014 for (unsigned bytecodeOffset = 0; bytecodeOffset < instructionCount; ) { 2015 switch (interpreter->getOpcodeID(instructionsBegin[bytecodeOffset].u.opcode)) { 2016 #define DEFINE_OP(curOpcode, length) \ 2017 case curOpcode: \ 2018 if (curOpcode == opcodeID) \ 2019 return true; \ 2020 bytecodeOffset += length; \ 2021 break; 2022 FOR_EACH_OPCODE_ID(DEFINE_OP) 2023 #undef DEFINE_OP 2024 default: 2025 ASSERT_NOT_REACHED(); 2026 break; 2027 } 2028 } 2029 2030 return false; 2031 } 2032 #endif 2033 2005 2034 } // namespace JSC -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r98220 r98398 391 391 void discardBytecode() { m_instructions.clear(); } 392 392 393 #ifndef NDEBUG 394 bool usesOpcode(OpcodeID); 395 #endif 396 393 397 unsigned instructionCount() { return m_instructionCount; } 394 398 void setInstructionCount(unsigned instructionCount) { m_instructionCount = instructionCount; } -
trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp
r98179 r98398 223 223 hasPrinted = true; 224 224 } 225 if (node.hasConstantBuffer() && codeBlock) { 226 if (hasPrinted) 227 printf(", "); 228 printf("%u:[", node.startConstant()); 229 for (unsigned i = 0; i < node.numConstants(); ++i) { 230 if (i) 231 printf(", "); 232 printf("%s", codeBlock->constantBuffer(node.startConstant())[i].description()); 233 } 234 printf("]"); 235 hasPrinted = true; 236 } 225 237 if (op == JSConstant) { 226 238 printf("%s$%u", hasPrinted ? ", " : "", node.constantNumber());
Note:
See TracChangeset
for help on using the changeset viewer.