Changeset 152953 in webkit
- Timestamp:
- Jul 21, 2013, 2:44:38 PM (12 years ago)
- Location:
- branches/dfgFourthTier/Source/JavaScriptCore
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog
r152952 r152953 1 2013-07-20 Filip Pizlo <fpizlo@apple.com> 2 3 fourthTier: each DFG node that relies on other nodes to do their type checks should be able to tell you if those type checks happened 4 https://bugs.webkit.org/show_bug.cgi?id=118866 5 6 Reviewed by Sam Weinig. 7 8 Adds a safeToExecute() method that takes a node and an abstract state and tells you 9 if the node will run without crashing under that state. 10 11 * JavaScriptCore.xcodeproj/project.pbxproj: 12 * bytecode/CodeBlock.cpp: 13 (JSC::CodeBlock::CodeBlock): 14 * dfg/DFGCFAPhase.cpp: 15 (CFAPhase): 16 (JSC::DFG::CFAPhase::CFAPhase): 17 (JSC::DFG::CFAPhase::run): 18 (JSC::DFG::CFAPhase::performBlockCFA): 19 (JSC::DFG::CFAPhase::performForwardCFA): 20 * dfg/DFGSafeToExecute.h: Added. 21 (DFG): 22 (SafeToExecuteEdge): 23 (JSC::DFG::SafeToExecuteEdge::SafeToExecuteEdge): 24 (JSC::DFG::SafeToExecuteEdge::operator()): 25 (JSC::DFG::SafeToExecuteEdge::result): 26 (JSC::DFG::safeToExecute): 27 * dfg/DFGStructureAbstractValue.h: 28 (JSC::DFG::StructureAbstractValue::isValidOffset): 29 (StructureAbstractValue): 30 * runtime/Options.h: 31 (JSC): 32 1 33 2013-07-20 Filip Pizlo <fpizlo@apple.com> 2 34 -
branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r152952 r152953 376 376 0FE50591179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 377 377 0FE50593179A604500B35F8C /* DFGEdgeUsesStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE50592179A604500B35F8C /* DFGEdgeUsesStructure.h */; settings = {ATTRIBUTES = (Private, ); }; }; 378 0FE5059F179B4A2300B35F8C /* DFGSafeToExecute.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5059E179B4A2000B35F8C /* DFGSafeToExecute.h */; settings = {ATTRIBUTES = (Private, ); }; }; 378 379 0FE505A2179B60ED00B35F8C /* FTLFail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE505A0179B60ED00B35F8C /* FTLFail.cpp */; }; 379 380 0FE505A3179B60ED00B35F8C /* FTLFail.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE505A1179B60ED00B35F8C /* FTLFail.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1431 1432 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGSaneStringGetByValSlowPathGenerator.h; path = dfg/DFGSaneStringGetByValSlowPathGenerator.h; sourceTree = "<group>"; }; 1432 1433 0FE50592179A604500B35F8C /* DFGEdgeUsesStructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGEdgeUsesStructure.h; path = dfg/DFGEdgeUsesStructure.h; sourceTree = "<group>"; }; 1434 0FE5059E179B4A2000B35F8C /* DFGSafeToExecute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGSafeToExecute.h; path = dfg/DFGSafeToExecute.h; sourceTree = "<group>"; }; 1433 1435 0FE505A0179B60ED00B35F8C /* FTLFail.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLFail.cpp; path = ftl/FTLFail.cpp; sourceTree = "<group>"; }; 1434 1436 0FE505A1179B60ED00B35F8C /* FTLFail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLFail.h; path = ftl/FTLFail.h; sourceTree = "<group>"; }; … … 3140 3142 86BB09BE138E381B0056702F /* DFGRepatch.cpp */, 3141 3143 86BB09BF138E381B0056702F /* DFGRepatch.h */, 3144 0FE5059E179B4A2000B35F8C /* DFGSafeToExecute.h */, 3142 3145 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */, 3143 3146 86ECA3F9132DF25A002B2AD7 /* DFGScoreBoard.h */, … … 3917 3920 0F46E6F4177CF0D200E1F755 /* DFGNaturalLoops.h in Headers */, 3918 3921 0F46E6E3177CC36600E1F755 /* LLVMDisassembler.h in Headers */, 3922 0FE5059F179B4A2300B35F8C /* DFGSafeToExecute.h in Headers */, 3919 3923 0F46E6E4177CC36600E1F755 /* UDis86Disassembler.h in Headers */, 3920 3924 ); -
branches/dfgFourthTier/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r152872 r152953 1824 1824 || Options::verboseOSR() 1825 1825 || Options::verboseCompilationQueue() 1826 || Options::reportCompileTimes()) 1826 || Options::reportCompileTimes() 1827 || Options::verboseCFA()) 1827 1828 hash(); 1828 1829 -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
r152909 r152953 33 33 #include "DFGInPlaceAbstractState.h" 34 34 #include "DFGPhase.h" 35 #include "DFGSafeToExecute.h" 35 36 #include "Operations.h" 36 37 … … 39 40 class CFAPhase : public Phase { 40 41 public: 41 #if DFG_ENABLE(DFG_PROPAGATION_VERBOSE)42 static const bool verbose = true;43 #else44 static const bool verbose = false;45 #endif46 47 42 CFAPhase(Graph& graph) 48 43 : Phase(graph, "control flow analysis") 49 44 , m_state(graph) 50 45 , m_interpreter(graph, m_state) 46 , m_verbose(Options::verboseCFA()) 51 47 { 52 48 } … … 59 55 60 56 m_count = 0; 57 58 if (m_verbose && !shouldDumpGraphAtEachPhase()) { 59 dataLog("Graph before CFA:\n"); 60 m_graph.dump(); 61 } 61 62 62 63 // This implements a pseudo-worklist-based forward CFA, except that the visit order … … 88 89 if (!block->cfaShouldRevisit) 89 90 return; 90 if ( verbose)91 if (m_verbose) 91 92 dataLog(" Block ", *block, ":\n"); 92 93 m_state.beginBasicBlock(block); 93 if ( verbose) {94 if (m_verbose) { 94 95 dataLogF(" head vars: "); 95 96 dumpOperands(block->valuesAtHead, WTF::dataFile()); … … 97 98 } 98 99 for (unsigned i = 0; i < block->size(); ++i) { 99 if ( verbose) {100 if (m_verbose) { 100 101 Node* node = block->at(i); 101 102 dataLogF(" %s @%u: ", Graph::opName(node->op()), node->index()); 103 104 if (!safeToExecute(m_state, m_graph, node)) 105 dataLog("(UNSAFE) "); 106 102 107 m_interpreter.dump(WTF::dataFile()); 108 103 109 if (m_state.haveStructures()) 104 110 dataLog(" (Have Structures)"); … … 106 112 } 107 113 if (!m_interpreter.execute(i)) { 108 if ( verbose)114 if (m_verbose) 109 115 dataLogF(" Expect OSR exit.\n"); 110 116 break; 111 117 } 112 118 } 113 if ( verbose) {119 if (m_verbose) { 114 120 dataLogF(" tail regs: "); 115 121 m_interpreter.dump(WTF::dataFile()); … … 118 124 m_changed |= m_state.endBasicBlock(MergeToSuccessors); 119 125 120 if ( verbose) {126 if (m_verbose) { 121 127 dataLogF(" tail vars: "); 122 128 dumpOperands(block->valuesAtTail, WTF::dataFile()); … … 128 134 { 129 135 ++m_count; 130 if ( verbose)136 if (m_verbose) 131 137 dataLogF("CFA [%u]\n", ++m_count); 132 138 … … 138 144 InPlaceAbstractState m_state; 139 145 AbstractInterpreter<InPlaceAbstractState> m_interpreter; 146 147 bool m_verbose; 140 148 141 149 bool m_changed; -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
r151824 r152953 283 283 } 284 284 285 bool isValidOffset(PropertyOffset offset) 286 { 287 if (isTop()) 288 return false; 289 if (isClear()) 290 return true; 291 return m_structure->isValidOffset(offset); 292 } 293 285 294 bool hasSingleton() const 286 295 { -
branches/dfgFourthTier/Source/JavaScriptCore/runtime/Options.h
r152952 r152953 86 86 v(bool, verboseCompilationQueue, false) \ 87 87 v(bool, reportCompileTimes, false) \ 88 v(bool, verboseCFA, false) \ 88 89 \ 89 90 v(bool, enableOSREntryInLoops, true) \
Note:
See TracChangeset
for help on using the changeset viewer.