Changeset 100221 in webkit
- Timestamp:
- Nov 14, 2011, 5:22:52 PM (15 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGByteCodeParser.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r100219 r100221 1 2011-11-14 Filip Pizlo <fpizlo@apple.com> 2 3 DFG's inline references to objects should be tracked 4 https://bugs.webkit.org/show_bug.cgi?id=72313 5 6 Reviewed by Gavin Barraclough. 7 8 Added a pinCell() method in the parser that currently creates a 9 dummy constant in CodeBlock. Added calls to pinCell() wherever the 10 DFG would inline a constant reference that the original code would 11 not have referred to. 12 13 * dfg/DFGByteCodeParser.cpp: 14 (JSC::DFG::ByteCodeParser::getCellConstantIndex): 15 (JSC::DFG::ByteCodeParser::pinCell): 16 (JSC::DFG::ByteCodeParser::cellConstant): 17 (JSC::DFG::ByteCodeParser::handleCall): 18 (JSC::DFG::ByteCodeParser::handleInlining): 19 (JSC::DFG::ByteCodeParser::parseBlock): 20 1 21 2011-11-14 Filip Pizlo <fpizlo@apple.com> 2 22 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r100219 r100221 508 508 } 509 509 510 NodeIndex cellConstant(JSCell* cell)510 unsigned getCellConstantIndex(JSCell* cell) 511 511 { 512 512 HashMap<JSCell*, unsigned>::iterator iter = m_cellConstants.find(cell); 513 513 if (iter != m_cellConstants.end()) 514 return getJSConstant(iter->second);514 return iter->second; 515 515 516 516 m_codeBlock->addConstant(cell); … … 520 520 m_cellConstants.add(cell, m_codeBlock->numberOfConstantRegisters() - 1); 521 521 522 return getJSConstant(m_codeBlock->numberOfConstantRegisters() - 1); 522 return m_codeBlock->numberOfConstantRegisters() - 1; 523 } 524 525 void pinCell(JSCell* cell) 526 { 527 if (!cell) 528 return; 529 getCellConstantIndex(cell); 530 } 531 532 NodeIndex cellConstant(JSCell* cell) 533 { 534 return getJSConstant(getCellConstantIndex(cell)); 523 535 } 524 536 … … 922 934 923 935 if (intrinsic != NoIntrinsic) { 924 if (!certainAboutExpectedFunction) 936 if (!certainAboutExpectedFunction) { 937 pinCell(expectedFunction); 925 938 addToGraph(CheckFunction, OpInfo(expectedFunction), callTarget); 939 } 926 940 927 941 if (handleIntrinsic(usesResult, resultOperand, intrinsic, firstArg, lastArg, prediction)) { … … 990 1004 // by checking the callee (if necessary) and making sure that arguments and the callee 991 1005 // are flushed. 992 if (!certainAboutExpectedFunction) 1006 if (!certainAboutExpectedFunction) { 1007 pinCell(expectedFunction); 993 1008 addToGraph(CheckFunction, OpInfo(expectedFunction), callTargetNodeIndex); 1009 } 994 1010 995 1011 // FIXME: Don't flush constants! … … 1652 1668 // It's monomorphic as far as we can tell, since the method_check was linked 1653 1669 // but the slow path (i.e. the normal get_by_id) never fired. 1670 1671 pinCell(methodCall.cachedStructure.get()); 1672 pinCell(methodCall.cachedPrototypeStructure.get()); 1673 pinCell(methodCall.cachedFunction.get()); 1674 pinCell(methodCall.cachedPrototype.get()); 1654 1675 1655 1676 NodeIndex checkMethod = addToGraph(CheckMethod, OpInfo(identifier), OpInfo(m_graph.m_methodCheckData.size()), base); … … 1762 1783 addToGraph(ForceOSRExit); 1763 1784 1785 for (unsigned i = 0; i < structureSet.size(); ++i) 1786 pinCell(structureSet[i]); 1787 1764 1788 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(structureSet)), base); 1765 1789 set(currentInstruction[1].u.operand, addToGraph(GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction), addToGraph(GetPropertyStorage, base))); … … 1795 1819 1796 1820 if (offset != notFound) { 1821 pinCell(structure); 1797 1822 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(structure)), base); 1798 1823 addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), base, addToGraph(GetPropertyStorage, base), value); … … 1821 1846 1822 1847 if (offset != notFound && structureChainIsStillValid(direct, previousStructure, structureChain)) { 1848 pinCell(previousStructure); 1849 pinCell(newStructure); 1823 1850 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(previousStructure)), base); 1824 1851 if (!direct) { 1825 if (!previousStructure->storedPrototype().isNull()) 1852 if (!previousStructure->storedPrototype().isNull()) { 1853 pinCell(previousStructure->storedPrototype().asCell()->structure()); 1854 pinCell(previousStructure->storedPrototype().asCell()); 1826 1855 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(previousStructure->storedPrototype().asCell()->structure())), cellConstant(previousStructure->storedPrototype().asCell())); 1856 } 1827 1857 1828 1858 for (WriteBarrier<Structure>* it = structureChain->head(); *it; ++it) { … … 1831 1861 continue; 1832 1862 ASSERT(prototype.isCell()); 1863 pinCell(prototype.asCell()); 1864 pinCell(prototype.asCell()->structure()); 1833 1865 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(prototype.asCell()->structure())), cellConstant(prototype.asCell())); 1834 1866 }
Note:
See TracChangeset
for help on using the changeset viewer.