Changeset 127479 in webkit
- Timestamp:
- Sep 4, 2012 11:46:21 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r127408 r127479 1 2012-09-04 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Remove uses of ClassInfo from SpeculativeJIT::compileObjectOrOtherLogicalNot 4 https://bugs.webkit.org/show_bug.cgi?id=95510 5 6 Reviewed by Oliver Hunt. 7 8 More refactoring to get rid of ClassInfo checks in the DFG. 9 10 * dfg/DFGAbstractState.cpp: 11 (JSC::DFG::AbstractState::execute): 12 * dfg/DFGSpeculativeJIT.h: 13 (SpeculativeJIT): 14 * dfg/DFGSpeculativeJIT32_64.cpp: 15 (JSC::DFG::SpeculativeJIT::compileNonStringCellOrOtherLogicalNot): 16 (JSC::DFG::SpeculativeJIT::compileLogicalNot): 17 * dfg/DFGSpeculativeJIT64.cpp: 18 (JSC::DFG::SpeculativeJIT::compileNonStringCellOrOtherLogicalNot): 19 (JSC::DFG::SpeculativeJIT::compileLogicalNot): 20 1 21 2012-09-03 Patrick Gansterer <paroga@webkit.org> 2 22 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
r127345 r127479 609 609 if (isBooleanSpeculation(child.prediction())) 610 610 speculateBooleanUnary(node); 611 else if (child.shouldSpeculateFinalObjectOrOther()) { 612 node.setCanExit( 613 !isFinalObjectOrOtherSpeculation(forNode(node.child1()).m_type)); 614 forNode(node.child1()).filter(SpecFinalObject | SpecOther); 615 } else if (child.shouldSpeculateArrayOrOther()) { 616 node.setCanExit( 617 !isArrayOrOtherSpeculation(forNode(node.child1()).m_type)); 618 forNode(node.child1()).filter(SpecArray | SpecOther); 611 else if (child.shouldSpeculateNonStringCellOrOther()) { 612 node.setCanExit(true); 613 forNode(node.child1()).filter((SpecCell & ~SpecString) | SpecOther); 619 614 } else if (child.shouldSpeculateInteger()) 620 615 speculateInt32Unary(node); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r127343 r127479 2060 2060 void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild); 2061 2061 void compileValueAdd(Node&); 2062 void compile ObjectOrOtherLogicalNot(Edge value, const ClassInfo*, bool needSpeculationCheck);2062 void compileNonStringCellOrOtherLogicalNot(Edge value, bool needSpeculationCheck); 2063 2063 void compileLogicalNot(Node&); 2064 2064 void emitNonStringCellOrOtherBranch(Edge value, BlockIndex taken, BlockIndex notTaken, bool needSpeculationCheck); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r127343 r127479 1792 1792 } 1793 1793 1794 void SpeculativeJIT::compile ObjectOrOtherLogicalNot(Edge nodeUse, const ClassInfo* classInfo, bool needSpeculationCheck)1794 void SpeculativeJIT::compileNonStringCellOrOtherLogicalNot(Edge nodeUse, bool needSpeculationCheck) 1795 1795 { 1796 1796 JSValueOperand value(this, nodeUse); … … 1801 1801 1802 1802 MacroAssembler::Jump notCell = m_jit.branch32(MacroAssembler::NotEqual, valueTagGPR, TrustedImm32(JSValue::CellTag)); 1803 if (needSpeculationCheck) 1804 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valuePayloadGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(classInfo))); 1803 if (m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) { 1804 m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->add(speculationWatchpoint()); 1805 1806 if (needSpeculationCheck) { 1807 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, 1808 m_jit.branchPtr( 1809 MacroAssembler::Equal, 1810 MacroAssembler::Address(valuePayloadGPR, JSCell::structureOffset()), 1811 MacroAssembler::TrustedImmPtr(m_jit.globalData()->stringStructure.get()))); 1812 } 1813 } else { 1814 GPRTemporary structure(this); 1815 GPRReg structureGPR = structure.gpr(); 1816 1817 m_jit.loadPtr(MacroAssembler::Address(valuePayloadGPR, JSCell::structureOffset()), structureGPR); 1818 1819 if (needSpeculationCheck) { 1820 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, 1821 m_jit.branchPtr( 1822 MacroAssembler::Equal, 1823 structureGPR, 1824 MacroAssembler::TrustedImmPtr(m_jit.globalData()->stringStructure.get()))); 1825 } 1826 1827 MacroAssembler::Jump isNotMasqueradesAsUndefined = 1828 m_jit.branchTest8( 1829 MacroAssembler::Zero, 1830 MacroAssembler::Address(structureGPR, Structure::typeInfoFlagsOffset()), 1831 MacroAssembler::TrustedImm32(MasqueradesAsUndefined)); 1832 1833 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, 1834 m_jit.branchPtr( 1835 MacroAssembler::Equal, 1836 MacroAssembler::Address(structureGPR, Structure::globalObjectOffset()), 1837 MacroAssembler::TrustedImmPtr(m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)))); 1838 1839 isNotMasqueradesAsUndefined.link(&m_jit); 1840 } 1805 1841 m_jit.move(TrustedImm32(0), resultPayloadGPR); 1806 1842 MacroAssembler::Jump done = m_jit.jump(); … … 1812 1848 m_jit.move(valueTagGPR, resultPayloadGPR); 1813 1849 m_jit.or32(TrustedImm32(1), resultPayloadGPR); 1814 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, m_jit.branch32(MacroAssembler::NotEqual, resultPayloadGPR, TrustedImm32(JSValue::NullTag))); 1850 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeUse, 1851 m_jit.branch32( 1852 MacroAssembler::NotEqual, 1853 resultPayloadGPR, 1854 TrustedImm32(JSValue::NullTag))); 1815 1855 } 1816 1856 m_jit.move(TrustedImm32(1), resultPayloadGPR); … … 1830 1870 return; 1831 1871 } 1832 if (at(node.child1()).shouldSpeculateFinalObjectOrOther()) { 1833 compileObjectOrOtherLogicalNot(node.child1(), &JSFinalObject::s_info, !isFinalObjectOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1834 return; 1835 } 1836 if (at(node.child1()).shouldSpeculateArrayOrOther()) { 1837 compileObjectOrOtherLogicalNot(node.child1(), &JSArray::s_info, !isArrayOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1872 if (at(node.child1()).shouldSpeculateNonStringCellOrOther()) { 1873 compileNonStringCellOrOtherLogicalNot(node.child1(), 1874 !isNonStringCellOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1838 1875 return; 1839 1876 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r127343 r127479 1836 1836 } 1837 1837 1838 void SpeculativeJIT::compile ObjectOrOtherLogicalNot(Edge nodeUse, const ClassInfo* classInfo, bool needSpeculationCheck)1838 void SpeculativeJIT::compileNonStringCellOrOtherLogicalNot(Edge nodeUse, bool needSpeculationCheck) 1839 1839 { 1840 1840 JSValueOperand value(this, nodeUse); … … 1844 1844 1845 1845 MacroAssembler::Jump notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister); 1846 if (needSpeculationCheck) 1847 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valueGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(classInfo))); 1848 m_jit.move(TrustedImm32(static_cast<int32_t>(ValueFalse)), resultGPR); 1846 if (m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) { 1847 m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)->masqueradesAsUndefinedWatchpoint()->add(speculationWatchpoint()); 1848 1849 if (needSpeculationCheck) { 1850 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, 1851 m_jit.branchPtr( 1852 MacroAssembler::Equal, 1853 MacroAssembler::Address(valueGPR, JSCell::structureOffset()), 1854 MacroAssembler::TrustedImmPtr(m_jit.globalData()->stringStructure.get()))); 1855 } 1856 } else { 1857 GPRTemporary structure(this); 1858 GPRReg structureGPR = structure.gpr(); 1859 1860 m_jit.loadPtr(MacroAssembler::Address(valueGPR, JSCell::structureOffset()), structureGPR); 1861 1862 if (needSpeculationCheck) { 1863 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, 1864 m_jit.branchPtr( 1865 MacroAssembler::Equal, 1866 structureGPR, 1867 MacroAssembler::TrustedImmPtr(m_jit.globalData()->stringStructure.get()))); 1868 } 1869 1870 MacroAssembler::Jump isNotMasqueradesAsUndefined = 1871 m_jit.branchTest8( 1872 MacroAssembler::Zero, 1873 MacroAssembler::Address(structureGPR, Structure::typeInfoFlagsOffset()), 1874 MacroAssembler::TrustedImm32(MasqueradesAsUndefined)); 1875 1876 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, 1877 m_jit.branchPtr( 1878 MacroAssembler::Equal, 1879 MacroAssembler::Address(structureGPR, Structure::globalObjectOffset()), 1880 MacroAssembler::TrustedImmPtr(m_jit.graph().globalObjectFor(m_jit.graph()[nodeUse.index()].codeOrigin)))); 1881 1882 isNotMasqueradesAsUndefined.link(&m_jit); 1883 } 1884 m_jit.move(TrustedImm32(ValueFalse), resultGPR); 1849 1885 MacroAssembler::Jump done = m_jit.jump(); 1850 1886 1851 1887 notCell.link(&m_jit); 1852 1888 1853 1889 if (needSpeculationCheck) { 1854 1890 m_jit.move(valueGPR, resultGPR); 1855 1891 m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR); 1856 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, m_jit.branchPtr(MacroAssembler::NotEqual, resultGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull)))); 1857 } 1858 m_jit.move(TrustedImm32(static_cast<int32_t>(ValueTrue)), resultGPR); 1892 speculationCheck(BadType, JSValueRegs(valueGPR), nodeUse, 1893 m_jit.branchPtr( 1894 MacroAssembler::NotEqual, 1895 resultGPR, 1896 MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull)))); 1897 } 1898 m_jit.move(TrustedImm32(ValueTrue), resultGPR); 1859 1899 1860 1900 done.link(&m_jit); … … 1865 1905 void SpeculativeJIT::compileLogicalNot(Node& node) 1866 1906 { 1867 if (at(node.child1()).shouldSpeculateFinalObjectOrOther()) { 1868 compileObjectOrOtherLogicalNot(node.child1(), &JSFinalObject::s_info, !isFinalObjectOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1869 return; 1870 } 1871 if (at(node.child1()).shouldSpeculateArrayOrOther()) { 1872 compileObjectOrOtherLogicalNot(node.child1(), &JSArray::s_info, !isArrayOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1907 if (at(node.child1()).shouldSpeculateNonStringCellOrOther()) { 1908 compileNonStringCellOrOtherLogicalNot(node.child1(), 1909 !isNonStringCellOrOtherSpeculation(m_state.forNode(node.child1()).m_type)); 1873 1910 return; 1874 1911 }
Note: See TracChangeset
for help on using the changeset viewer.