Changeset 200645 in webkit
- Timestamp:
- May 10, 2016, 2:35:32 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r200634 r200645 1 2016-05-10 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] FTL can produce GetByVal nodes without proper bounds checking 4 https://bugs.webkit.org/show_bug.cgi?id=157502 5 rdar://problem/26027027 6 7 Reviewed by Filip Pizlo. 8 9 It was possible for FTL to generates GetByVal on arbitrary offsets 10 without any bounds checking. 11 12 The bug is caused by the order of optimization phases: 13 -First, the Integer Range Optimization proves that a CheckInBounds 14 test can never fail. 15 This proof is based on control flow or preceeding instructions 16 inside a loop. 17 -The Loop Invariant Code Motion phase finds that the GetByVal does not 18 depend on anything in the loop and hoist it out of the loop. 19 -> As a result, the conditions that were necessary to eliminate 20 the CheckInBounds are no longer met before the GetByVal. 21 22 This patch just moves the Integer Range Optimization phase after 23 Loop Invariant Code Motion to make sure no code is moved after 24 its integer ranges bounds proofs have been used. 25 26 * dfg/DFGPlan.cpp: 27 (JSC::DFG::Plan::compileInThreadImpl): 28 * tests/stress/bounds-check-not-eliminated-by-licm.js: Added. 29 (testInLoopTests): 30 1 31 2016-05-10 Joseph Pecoraro <pecoraro@apple.com> 2 32 -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r200531 r200645 400 400 performGlobalCSE(dfg); 401 401 performLivenessAnalysis(dfg); 402 performIntegerRangeOptimization(dfg);403 performLivenessAnalysis(dfg);404 402 performCFA(dfg); 405 403 performConstantFolding(dfg); … … 425 423 // then we'd need to do some simple SSA fix-up. 426 424 performLICM(dfg); 425 426 // FIXME: Currently: IntegerRangeOptimization *must* be run after LICM. 427 // 428 // IntegerRangeOptimization makes changes on nodes based on preceding blocks 429 // and nodes. LICM moves nodes which can invalidates assumptions used 430 // by IntegerRangeOptimization. 431 // 432 // Ideally, the dependencies should be explicit. See https://bugs.webkit.org/show_bug.cgi?id=157534. 433 performLivenessAnalysis(dfg); 434 performIntegerRangeOptimization(dfg); 427 435 428 436 performCleanUp(dfg);
Note:
See TracChangeset
for help on using the changeset viewer.