Changeset 180247 in webkit
- Timestamp:
- Feb 17, 2015, 6:38:16 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGPlan.cpp (modified) (1 diff)
-
ftl/FTLLowerDFGToLLVM.cpp (modified) (57 diffs)
-
ftl/FTLLowerDFGToLLVM.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r180237 r180247 1 2015-02-17 Michael Saboff <msaboff@apple.com> 2 3 CrashTracer: DFG_CRASH beneath JSC::FTL::LowerDFGToLLVM::compileNode 4 https://bugs.webkit.org/show_bug.cgi?id=141730 5 6 Reviewed by Geoffrey Garen. 7 8 Added a new failure handler, loweringFailed(), to LowerDFGToLLVM that reports failures 9 while processing DFG lowering. For debug builds, the failures are logged identical 10 to the way the DFG_CRASH() reports them. For release builds, the failures are reported 11 and that FTL compilation is terminated, but the process is allowed to continue. 12 Wrapped calls to loweringFailed() in a macro LOWERING_FAILED so the function and 13 line number are reported at the point of the inconsistancy. 14 15 Converted instances of DFG_CRASH to LOWERING_FAILED. 16 17 * dfg/DFGPlan.cpp: 18 (JSC::DFG::Plan::compileInThreadImpl): Added lowerDFGToLLVM() failure check that 19 will fail the FTL compile. 20 21 * ftl/FTLLowerDFGToLLVM.cpp: 22 (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM): 23 Added new member variable, m_loweringSucceeded, to stop compilation on the first 24 reported failure. 25 26 * ftl/FTLLowerDFGToLLVM.cpp: 27 (JSC::FTL::LowerDFGToLLVM::lower): 28 * ftl/FTLLowerDFGToLLVM.h: 29 Added check for compilation failures and now report those failures via a boolean 30 return value. 31 32 * ftl/FTLLowerDFGToLLVM.cpp: 33 (JSC::FTL::LowerDFGToLLVM::createPhiVariables): 34 (JSC::FTL::LowerDFGToLLVM::compileNode): 35 (JSC::FTL::LowerDFGToLLVM::compileUpsilon): 36 (JSC::FTL::LowerDFGToLLVM::compilePhi): 37 (JSC::FTL::LowerDFGToLLVM::compileDoubleRep): 38 (JSC::FTL::LowerDFGToLLVM::compileValueRep): 39 (JSC::FTL::LowerDFGToLLVM::compileValueToInt32): 40 (JSC::FTL::LowerDFGToLLVM::compilePutLocal): 41 (JSC::FTL::LowerDFGToLLVM::compileArithAddOrSub): 42 (JSC::FTL::LowerDFGToLLVM::compileArithMul): 43 (JSC::FTL::LowerDFGToLLVM::compileArithDiv): 44 (JSC::FTL::LowerDFGToLLVM::compileArithMod): 45 (JSC::FTL::LowerDFGToLLVM::compileArithMinOrMax): 46 (JSC::FTL::LowerDFGToLLVM::compileArithAbs): 47 (JSC::FTL::LowerDFGToLLVM::compileArithNegate): 48 (JSC::FTL::LowerDFGToLLVM::compileArrayifyToStructure): 49 (JSC::FTL::LowerDFGToLLVM::compileGetById): 50 (JSC::FTL::LowerDFGToLLVM::compileGetMyArgumentByVal): 51 (JSC::FTL::LowerDFGToLLVM::compileGetArrayLength): 52 (JSC::FTL::LowerDFGToLLVM::compileGetByVal): 53 (JSC::FTL::LowerDFGToLLVM::compilePutByVal): 54 (JSC::FTL::LowerDFGToLLVM::compileArrayPush): 55 (JSC::FTL::LowerDFGToLLVM::compileArrayPop): 56 (JSC::FTL::LowerDFGToLLVM::compileNewArray): 57 (JSC::FTL::LowerDFGToLLVM::compileToString): 58 (JSC::FTL::LowerDFGToLLVM::compileMakeRope): 59 (JSC::FTL::LowerDFGToLLVM::compileCompareEq): 60 (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq): 61 (JSC::FTL::LowerDFGToLLVM::compileSwitch): 62 (JSC::FTL::LowerDFGToLLVM::compare): 63 (JSC::FTL::LowerDFGToLLVM::boolify): 64 (JSC::FTL::LowerDFGToLLVM::opposite): 65 (JSC::FTL::LowerDFGToLLVM::lowJSValue): 66 (JSC::FTL::LowerDFGToLLVM::speculate): 67 (JSC::FTL::LowerDFGToLLVM::isArrayType): 68 (JSC::FTL::LowerDFGToLLVM::exitValueForAvailability): 69 (JSC::FTL::LowerDFGToLLVM::exitValueForNode): 70 (JSC::FTL::LowerDFGToLLVM::setInt52): 71 Changed DFG_CRASH() to LOWERING_FAILED(). Updated related control flow as appropriate. 72 73 (JSC::FTL::LowerDFGToLLVM::loweringFailed): New error reporting member function. 74 1 75 2015-02-17 Filip Pizlo <fpizlo@apple.com> 2 76 -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r179882 r180247 387 387 388 388 FTL::State state(dfg); 389 FTL::lowerDFGToLLVM(state); 389 if (!FTL::lowerDFGToLLVM(state)) { 390 FTL::fail(state); 391 return FTLPath; 392 } 390 393 391 394 if (reportCompileTimes()) -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r180160 r180247 94 94 : m_graph(state.graph) 95 95 , m_ftlState(state) 96 , m_loweringSucceeded(true) 96 97 , m_heaps(state.context) 97 98 , m_out(state.context) … … 103 104 { 104 105 } 105 106 void lower() 106 107 108 #define LOWERING_FAILED(node, reason) \ 109 loweringFailed((node), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, (reason)); 110 111 bool lower() 107 112 { 108 113 CString name; … … 252 257 break; 253 258 default: 254 DFG_CRASH(m_graph,node, "Bad flush format for argument");259 LOWERING_FAILED(node, "Bad flush format for argument"); 255 260 break; 256 261 } 257 262 } 263 264 if (!m_loweringSucceeded) 265 return m_loweringSucceeded; 266 258 267 m_out.jump(lowBlock(m_graph.block(0))); 259 268 260 for (BasicBlock* block : preOrder) 269 for (BasicBlock* block : preOrder) { 261 270 compileBlock(block); 271 272 if (!m_loweringSucceeded) 273 return m_loweringSucceeded; 274 } 262 275 263 276 if (Options::dumpLLVMIR()) … … 268 281 if (validationEnabled()) 269 282 verifyModule(m_ftlState.module); 283 284 return m_loweringSucceeded; 270 285 } 271 286 … … 300 315 break; 301 316 default: 302 DFG_CRASH(m_graph,node, "Bad Phi node result type");303 break;317 LOWERING_FAILED(node, "Bad Phi node result type"); 318 return; 304 319 } 305 320 m_phis.add(node, buildAlloca(m_out.m_builder, type)); … … 797 812 break; 798 813 default: 799 DFG_CRASH(m_graph, m_node, "Unrecognized node in FTL backend"); 800 break; 801 } 814 LOWERING_FAILED(m_node, "Unrecognized node in FTL backend"); 815 break; 816 } 817 818 if (!m_loweringSucceeded) 819 return false; 802 820 803 821 if (!m_state.isValid()) { … … 836 854 break; 837 855 default: 838 DFG_CRASH(m_graph,m_node, "Bad use kind");856 LOWERING_FAILED(m_node, "Bad use kind"); 839 857 break; 840 858 } … … 862 880 break; 863 881 default: 864 DFG_CRASH(m_graph,m_node, "Bad use kind");882 LOWERING_FAILED(m_node, "Bad use kind"); 865 883 break; 866 884 } … … 900 918 901 919 default: 902 DFG_CRASH(m_graph,m_node, "Bad use kind");920 LOWERING_FAILED(m_node, "Bad use kind"); 903 921 } 904 922 } … … 925 943 926 944 default: 927 DFG_CRASH(m_graph,m_node, "Bad use kind");945 LOWERING_FAILED(m_node, "Bad use kind"); 928 946 } 929 947 } … … 988 1006 989 1007 default: 990 DFG_CRASH(m_graph,m_node, "Bad use kind");1008 LOWERING_FAILED(m_node, "Bad use kind"); 991 1009 break; 992 1010 } … … 1095 1113 1096 1114 default: 1097 DFG_CRASH(m_graph,m_node, "Bad flush format");1115 LOWERING_FAILED(m_node, "Bad flush format"); 1098 1116 break; 1099 1117 } … … 1255 1273 1256 1274 default: 1257 DFG_CRASH(m_graph,m_node, "Bad use kind");1275 LOWERING_FAILED(m_node, "Bad use kind"); 1258 1276 break; 1259 1277 } … … 1329 1347 1330 1348 default: 1331 DFG_CRASH(m_graph,m_node, "Bad use kind");1349 LOWERING_FAILED(m_node, "Bad use kind"); 1332 1350 break; 1333 1351 } … … 1432 1450 1433 1451 default: 1434 DFG_CRASH(m_graph,m_node, "Bad use kind");1452 LOWERING_FAILED(m_node, "Bad use kind"); 1435 1453 break; 1436 1454 } … … 1530 1548 1531 1549 default: 1532 DFG_CRASH(m_graph,m_node, "Bad use kind");1550 LOWERING_FAILED(m_node, "Bad use kind"); 1533 1551 break; 1534 1552 } … … 1581 1599 1582 1600 default: 1583 DFG_CRASH(m_graph,m_node, "Bad use kind");1601 LOWERING_FAILED(m_node, "Bad use kind"); 1584 1602 break; 1585 1603 } … … 1607 1625 1608 1626 default: 1609 DFG_CRASH(m_graph,m_node, "Bad use kind");1627 LOWERING_FAILED(m_node, "Bad use kind"); 1610 1628 break; 1611 1629 } … … 1732 1750 1733 1751 default: 1734 DFG_CRASH(m_graph,m_node, "Bad use kind");1752 LOWERING_FAILED(m_node, "Bad use kind"); 1735 1753 break; 1736 1754 } … … 1870 1888 break; 1871 1889 default: 1872 DFG_CRASH(m_graph,m_node, "Bad array type");1873 break;1890 LOWERING_FAILED(m_node, "Bad array type"); 1891 return; 1874 1892 } 1875 1893 … … 1939 1957 1940 1958 default: 1941 DFG_CRASH(m_graph,m_node, "Bad use kind");1959 LOWERING_FAILED(m_node, "Bad use kind"); 1942 1960 return; 1943 1961 } … … 2090 2108 // https://bugs.webkit.org/show_bug.cgi?id=129576 2091 2109 2092 DFG_CRASH(m_graph, m_node, "Unimplemented"); 2110 LOWERING_FAILED(m_node, "Unimplemented"); 2111 return; 2093 2112 } 2094 2113 … … 2136 2155 } 2137 2156 2138 DFG_CRASH(m_graph,m_node, "Bad array type");2157 LOWERING_FAILED(m_node, "Bad array type"); 2139 2158 return; 2140 2159 } … … 2286 2305 break; 2287 2306 default: 2288 DFG_CRASH(m_graph, m_node, "Bad element size"); 2307 LOWERING_FAILED(m_node, "Bad element size"); 2308 return; 2289 2309 } 2290 2310 … … 2330 2350 break; 2331 2351 default: 2332 DFG_CRASH(m_graph, m_node, "Bad typed array type"); 2352 LOWERING_FAILED(m_node, "Bad typed array type"); 2353 return; 2333 2354 } 2334 2355 … … 2337 2358 } 2338 2359 2339 DFG_CRASH(m_graph,m_node, "Bad array type");2360 LOWERING_FAILED(m_node, "Bad array type"); 2340 2361 return; 2341 2362 } } … … 2441 2462 break; 2442 2463 } 2443 2464 2444 2465 default: 2445 DFG_CRASH(m_graph, m_node, "Bad array type"); 2466 LOWERING_FAILED(m_node, "Bad array type"); 2467 return; 2446 2468 } 2447 2469 … … 2536 2558 2537 2559 default: 2538 DFG_CRASH(m_graph, m_node, "Bad use kind"); 2560 LOWERING_FAILED(m_node, "Bad use kind"); 2561 return; 2539 2562 } 2540 2563 … … 2553 2576 break; 2554 2577 default: 2555 DFG_CRASH(m_graph, m_node, "Bad element size"); 2578 LOWERING_FAILED(m_node, "Bad element size"); 2579 return; 2556 2580 } 2557 2581 } else /* !isInt(type) */ { … … 2567 2591 break; 2568 2592 default: 2569 DFG_CRASH(m_graph, m_node, "Bad typed array type"); 2593 LOWERING_FAILED(m_node, "Bad typed array type"); 2594 return; 2570 2595 } 2571 2596 } … … 2591 2616 } 2592 2617 2593 DFG_CRASH(m_graph,m_node, "Bad array type");2594 break;2618 LOWERING_FAILED(m_node, "Bad array type"); 2619 return; 2595 2620 } 2596 2621 } … … 2663 2688 2664 2689 default: 2665 DFG_CRASH(m_graph,m_node, "Bad array type");2690 LOWERING_FAILED(m_node, "Bad array type"); 2666 2691 return; 2667 2692 } … … 2721 2746 2722 2747 default: 2723 DFG_CRASH(m_graph,m_node, "Bad array type");2748 LOWERING_FAILED(m_node, "Bad array type"); 2724 2749 return; 2725 2750 } … … 2758 2783 case ALL_BLANK_INDEXING_TYPES: 2759 2784 case ALL_UNDECIDED_INDEXING_TYPES: 2760 DFG_CRASH(m_graph,m_node, "Bad indexing type");2761 break;2785 LOWERING_FAILED(m_node, "Bad indexing type"); 2786 return; 2762 2787 2763 2788 case ALL_DOUBLE_INDEXING_TYPES: … … 2776 2801 2777 2802 default: 2778 DFG_CRASH(m_graph,m_node, "Corrupt indexing type");2779 break;2803 LOWERING_FAILED(m_node, "Corrupt indexing type"); 2804 return; 2780 2805 } 2781 2806 } … … 3058 3083 3059 3084 default: 3060 DFG_CRASH(m_graph,m_node, "Bad use kind");3061 break;3085 LOWERING_FAILED(m_node, "Bad use kind"); 3086 return; 3062 3087 } 3063 3088 } … … 3150 3175 break; 3151 3176 default: 3152 DFG_CRASH(m_graph,m_node, "Bad number of children");3153 break;3177 LOWERING_FAILED(m_node, "Bad number of children"); 3178 return; 3154 3179 } 3155 3180 m_out.jump(continuation); … … 3571 3596 return; 3572 3597 } 3573 3574 DFG_CRASH(m_graph,m_node, "Bad use kinds");3598 3599 LOWERING_FAILED(m_node, "Bad use kinds"); 3575 3600 } 3576 3601 … … 3665 3690 } 3666 3691 3667 DFG_CRASH(m_graph,m_node, "Bad use kinds");3692 LOWERING_FAILED(m_node, "Bad use kinds"); 3668 3693 } 3669 3694 … … 3851 3876 3852 3877 default: 3853 DFG_CRASH(m_graph,m_node, "Bad use kind");3854 break;3878 LOWERING_FAILED(m_node, "Bad use kind"); 3879 return; 3855 3880 } 3856 3881 … … 3897 3922 3898 3923 default: 3899 DFG_CRASH(m_graph,m_node, "Bad use kind");3900 break;3924 LOWERING_FAILED(m_node, "Bad use kind"); 3925 return; 3901 3926 } 3902 3927 … … 3950 3975 3951 3976 case SwitchString: { 3952 DFG_CRASH(m_graph,m_node, "Unimplemented");3977 LOWERING_FAILED(m_node, "Unimplemented"); 3953 3978 return; 3954 3979 } … … 3973 3998 3974 3999 default: 3975 DFG_CRASH(m_graph,m_node, "Bad use kind");4000 LOWERING_FAILED(m_node, "Bad use kind"); 3976 4001 return; 3977 4002 } … … 3981 4006 } } 3982 4007 3983 DFG_CRASH(m_graph,m_node, "Bad switch kind");4008 LOWERING_FAILED(m_node, "Bad switch kind"); 3984 4009 } 3985 4010 … … 4951 4976 } 4952 4977 4953 DFG_CRASH(m_graph,m_node, "Bad use kinds");4978 LOWERING_FAILED(m_node, "Bad use kinds"); 4954 4979 } 4955 4980 … … 5264 5289 } 5265 5290 default: 5266 DFG_CRASH(m_graph,m_node, "Bad use kind");5291 LOWERING_FAILED(m_node, "Bad use kind"); 5267 5292 return 0; 5268 5293 } … … 5643 5668 return Int52; 5644 5669 } 5645 DFG_CRASH(m_graph,m_node, "Bad use kind");5670 LOWERING_FAILED(m_node, "Bad use kind"); 5646 5671 return Int52; 5647 5672 } … … 5787 5812 } 5788 5813 5789 DFG_CRASH(m_graph,m_node, "Value not defined");5814 LOWERING_FAILED(m_node, "Value not defined"); 5790 5815 return 0; 5791 5816 } … … 6102 6127 break; 6103 6128 default: 6104 DFG_CRASH(m_graph, m_node, "Unsupported speculation use kind"); 6129 LOWERING_FAILED(m_node, "Unsupported speculation use kind"); 6130 return; 6105 6131 } 6106 6132 } … … 6163 6189 switch (arrayMode.arrayClass()) { 6164 6190 case Array::OriginalArray: 6165 DFG_CRASH(m_graph,m_node, "Unexpected original array");6191 LOWERING_FAILED(m_node, "Unexpected original array"); 6166 6192 return 0; 6167 6193 … … 6183 6209 } 6184 6210 6185 DFG_CRASH(m_graph, m_node, "Corrupt array class"); 6211 LOWERING_FAILED(m_node, "Corrupt array class"); 6212 return 0; 6186 6213 } 6187 6214 … … 6717 6744 } 6718 6745 6719 DFG_CRASH(m_graph,m_node, "Invalid flush format");6746 LOWERING_FAILED(m_node, "Invalid flush format"); 6720 6747 return ExitValue::dead(); 6721 6748 } … … 6790 6817 return exitArgument(arguments, ValueFormatDouble, value.value()); 6791 6818 6792 DFG_CRASH(m_graph,m_node, toCString("Cannot find value for node: ", node).data());6819 LOWERING_FAILED(m_node, toCString("Cannot find value for node: ", node).data()); 6793 6820 return ExitValue::dead(); 6794 6821 } … … 6848 6875 } 6849 6876 6850 DFG_CRASH(m_graph,m_node, "Corrupt int52 kind");6877 LOWERING_FAILED(m_node, "Corrupt int52 kind"); 6851 6878 } 6852 6879 void setJSValue(Node* node, LValue value) … … 7002 7029 m_out.unreachable(); 7003 7030 } 7004 7031 7032 void loweringFailed(Node* node, const char* file, int line, const char* function, const char* assertion) 7033 { 7034 #ifndef NDEBUG 7035 m_graph.handleAssertionFailure(node, file, line, function, (assertion)); 7036 #else 7037 UNUSED_PARAM(node); 7038 UNUSED_PARAM(file); 7039 UNUSED_PARAM(line); 7040 UNUSED_PARAM(function); 7041 UNUSED_PARAM(assertion); 7042 #endif 7043 m_loweringSucceeded = false; 7044 } 7045 7005 7046 AvailabilityMap& availabilityMap() { return m_availabilityCalculator.m_availability; } 7006 7047 … … 7010 7051 Graph& m_graph; 7011 7052 State& m_ftlState; 7053 bool m_loweringSucceeded; 7012 7054 AbstractHeapRepository m_heaps; 7013 7055 Output m_out; … … 7057 7099 unsigned m_tbaaKind; 7058 7100 unsigned m_tbaaStructKind; 7101 7102 #undef LOWERING_FAILED 7059 7103 }; 7060 7104 7061 voidlowerDFGToLLVM(State& state)7105 bool lowerDFGToLLVM(State& state) 7062 7106 { 7063 7107 LowerDFGToLLVM lowering(state); 7064 lowering.lower();7108 return lowering.lower(); 7065 7109 } 7066 7110 -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.h
r164424 r180247 34 34 namespace JSC { namespace FTL { 35 35 36 voidlowerDFGToLLVM(State&);36 bool lowerDFGToLLVM(State&); 37 37 38 38 } } // namespace JSC::FTL
Note:
See TracChangeset
for help on using the changeset viewer.