Changeset 267585 in webkit
- Timestamp:
- Sep 25, 2020, 11:21:03 AM (6 years ago)
- Location:
- branches/safari-610-branch
- Files:
-
- 1 added
- 6 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/out-of-bounds-sane-chain-need-their-own-heap-location.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGArrayMode.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGClobberize.h (modified) (6 diffs)
-
Source/JavaScriptCore/dfg/DFGHeapLocation.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/dfg/DFGHeapLocation.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610-branch/JSTests/ChangeLog
r267285 r267585 1 2020-09-25 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r266813. rdar://problem/69582551 4 5 OutOfBoundsSaneChain operations should use their own heap locations 6 https://bugs.webkit.org/show_bug.cgi?id=216328 7 <rdar://problem/68568039> 8 9 Reviewed by Keith Miller. 10 11 JSTests: 12 13 * stress/out-of-bounds-sane-chain-need-their-own-heap-location.js: Added. 14 (foo): 15 16 Source/JavaScriptCore: 17 18 There is code in local CSE that does some basic bounds check elimination 19 for PutByVal. It does this analysis by seeing if a particular heap location 20 is already defined, and if so, it eliminates the bounds check for the 21 PutByVal. This doesn't work for OutOfBoundsSaneChain for the obvious reason 22 that these GetByVals are not proven to be in bounds. So GetByVal's in the 23 OutOfBoundsSaneChain mode reusing non OutOfBoundsSaneChain heap locations 24 can lead to a bug where we mistakenly remove a bounds check. The fix is to 25 have all OutOfBoundsSaneChain operations use distinct heaps, and for CSE to 26 not query those heaps. 27 28 * dfg/DFGArrayMode.h: 29 (JSC::DFG::ArrayMode::isAnySaneChain const): Deleted. 30 * dfg/DFGClobberize.h: 31 (JSC::DFG::clobberize): 32 * dfg/DFGHeapLocation.cpp: 33 (WTF::printInternal): 34 * dfg/DFGHeapLocation.h: 35 36 37 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266813 268f45cc-cd09-0410-ab3c-d52691b4dbfc 38 39 2020-09-09 Saam Barati <sbarati@apple.com> 40 41 OutOfBoundsSaneChain operations should use their own heap locations 42 https://bugs.webkit.org/show_bug.cgi?id=216328 43 <rdar://problem/68568039> 44 45 Reviewed by Keith Miller. 46 47 * stress/out-of-bounds-sane-chain-need-their-own-heap-location.js: Added. 48 (foo): 49 1 50 2020-09-18 Alan Coon <alancoon@apple.com> 2 51 -
branches/safari-610-branch/Source/JavaScriptCore/ChangeLog
r267285 r267585 1 2020-09-25 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r266813. rdar://problem/69582551 4 5 OutOfBoundsSaneChain operations should use their own heap locations 6 https://bugs.webkit.org/show_bug.cgi?id=216328 7 <rdar://problem/68568039> 8 9 Reviewed by Keith Miller. 10 11 JSTests: 12 13 * stress/out-of-bounds-sane-chain-need-their-own-heap-location.js: Added. 14 (foo): 15 16 Source/JavaScriptCore: 17 18 There is code in local CSE that does some basic bounds check elimination 19 for PutByVal. It does this analysis by seeing if a particular heap location 20 is already defined, and if so, it eliminates the bounds check for the 21 PutByVal. This doesn't work for OutOfBoundsSaneChain for the obvious reason 22 that these GetByVals are not proven to be in bounds. So GetByVal's in the 23 OutOfBoundsSaneChain mode reusing non OutOfBoundsSaneChain heap locations 24 can lead to a bug where we mistakenly remove a bounds check. The fix is to 25 have all OutOfBoundsSaneChain operations use distinct heaps, and for CSE to 26 not query those heaps. 27 28 * dfg/DFGArrayMode.h: 29 (JSC::DFG::ArrayMode::isAnySaneChain const): Deleted. 30 * dfg/DFGClobberize.h: 31 (JSC::DFG::clobberize): 32 * dfg/DFGHeapLocation.cpp: 33 (WTF::printInternal): 34 * dfg/DFGHeapLocation.h: 35 36 37 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266813 268f45cc-cd09-0410-ab3c-d52691b4dbfc 38 39 2020-09-09 Saam Barati <sbarati@apple.com> 40 41 OutOfBoundsSaneChain operations should use their own heap locations 42 https://bugs.webkit.org/show_bug.cgi?id=216328 43 <rdar://problem/68568039> 44 45 Reviewed by Keith Miller. 46 47 There is code in local CSE that does some basic bounds check elimination 48 for PutByVal. It does this analysis by seeing if a particular heap location 49 is already defined, and if so, it eliminates the bounds check for the 50 PutByVal. This doesn't work for OutOfBoundsSaneChain for the obvious reason 51 that these GetByVals are not proven to be in bounds. So GetByVal's in the 52 OutOfBoundsSaneChain mode reusing non OutOfBoundsSaneChain heap locations 53 can lead to a bug where we mistakenly remove a bounds check. The fix is to 54 have all OutOfBoundsSaneChain operations use distinct heaps, and for CSE to 55 not query those heaps. 56 57 * dfg/DFGArrayMode.h: 58 (JSC::DFG::ArrayMode::isAnySaneChain const): Deleted. 59 * dfg/DFGClobberize.h: 60 (JSC::DFG::clobberize): 61 * dfg/DFGHeapLocation.cpp: 62 (WTF::printInternal): 63 * dfg/DFGHeapLocation.h: 64 1 65 2020-09-18 Alan Coon <alancoon@apple.com> 2 66 -
branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGArrayMode.h
r265775 r267585 288 288 } 289 289 290 bool isAnySaneChain() const291 {292 return isInBoundsSaneChain() || isOutOfBoundsSaneChain();293 }294 295 290 bool isOutOfBounds() const 296 291 { -
branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGClobberize.h
r265934 r267585 939 939 read(Butterfly_publicLength); 940 940 read(IndexedInt32Properties); 941 LocationKind kind = mode.isOutOfBoundsSaneChain() ? IndexedPropertyInt32O rOtherLoc : indexedPropertyLoc;941 LocationKind kind = mode.isOutOfBoundsSaneChain() ? IndexedPropertyInt32OutOfBoundsSaneChainLoc : indexedPropertyLoc; 942 942 def(HeapLocation(kind, IndexedInt32Properties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); 943 943 return; … … 951 951 read(IndexedDoubleProperties); 952 952 LocationKind kind; 953 if (node->hasDoubleResult()) 954 kind = mode.isAnySaneChain() ? IndexedPropertyDoubleSaneChainLoc : IndexedPropertyDoubleLoc; 955 else { 953 if (node->hasDoubleResult()) { 954 if (mode.isInBoundsSaneChain()) 955 kind = IndexedPropertyDoubleSaneChainLoc; 956 else if (mode.isOutOfBoundsSaneChain()) 957 kind = IndexedPropertyDoubleOutOfBoundsSaneChainLoc; 958 else 959 kind = IndexedPropertyDoubleLoc; 960 } else { 956 961 ASSERT(mode.isOutOfBoundsSaneChain()); 957 kind = IndexedPropertyDoubleOrOther SaneChainLoc;962 kind = IndexedPropertyDoubleOrOtherOutOfBoundsSaneChainLoc; 958 963 } 959 964 def(HeapLocation(kind, IndexedDoubleProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); … … 967 972 read(Butterfly_publicLength); 968 973 read(IndexedContiguousProperties); 969 def(HeapLocation( indexedPropertyLoc, IndexedContiguousProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node));974 def(HeapLocation(mode.isOutOfBoundsSaneChain() ? IndexedPropertyJSOutOfBoundsSaneChainLoc : indexedPropertyLoc, IndexedContiguousProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); 970 975 return; 971 976 } … … 1056 1061 write(Butterfly_publicLength); 1057 1062 def(HeapLocation(indexedPropertyLoc, IndexedInt32Properties, base, index), LazyNode(value)); 1058 def(HeapLocation(IndexedPropertyInt32O rOtherLoc, IndexedInt32Properties, base, index), LazyNode(value));1063 def(HeapLocation(IndexedPropertyInt32OutOfBoundsSaneChainLoc, IndexedInt32Properties, base, index), LazyNode(value)); 1059 1064 return; 1060 1065 … … 1072 1077 def(HeapLocation(IndexedPropertyDoubleLoc, IndexedDoubleProperties, base, index), LazyNode(value)); 1073 1078 def(HeapLocation(IndexedPropertyDoubleSaneChainLoc, IndexedDoubleProperties, base, index), LazyNode(value)); 1079 def(HeapLocation(IndexedPropertyDoubleOutOfBoundsSaneChainLoc, IndexedDoubleProperties, base, index), LazyNode(value)); 1074 1080 return; 1075 1081 … … 1086 1092 write(Butterfly_publicLength); 1087 1093 def(HeapLocation(indexedPropertyLoc, IndexedContiguousProperties, base, index), LazyNode(value)); 1094 def(HeapLocation(IndexedPropertyJSOutOfBoundsSaneChainLoc, IndexedContiguousProperties, base, index), LazyNode(value)); 1088 1095 return; 1089 1096 -
branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp
r265907 r267585 143 143 return; 144 144 145 case IndexedPropertyDoubleOrOtherSaneChainLoc: 146 out.print("IndexedPropertyDoubleOrOtherSaneChainLoc"); 145 case IndexedPropertyDoubleOutOfBoundsSaneChainLoc: 146 out.print("IndexedPropertyDoubleOutOfBoundsSaneChainLoc"); 147 return; 148 149 case IndexedPropertyDoubleOrOtherOutOfBoundsSaneChainLoc: 150 out.print("IndexedPropertyDoubleOrOtherOutOfBoundsSaneChainLoc"); 147 151 return; 148 152 … … 151 155 return; 152 156 153 case IndexedPropertyInt32O rOtherLoc:154 out.print("IndexedPropertyInt32O rOtherLoc");157 case IndexedPropertyInt32OutOfBoundsSaneChainLoc: 158 out.print("IndexedPropertyInt32OutOfBoundsSaneChainLoc"); 155 159 return; 156 160 … … 161 165 case IndexedPropertyJSLoc: 162 166 out.print("IndexedPropertyJSLoc"); 167 return; 168 169 case IndexedPropertyJSOutOfBoundsSaneChainLoc: 170 out.print("IndexedPropertyJSOutOfBoundsSaneChainLoc"); 163 171 return; 164 172 -
branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGHeapLocation.h
r265907 r267585 50 50 IndexedPropertyDoubleLoc, 51 51 IndexedPropertyDoubleSaneChainLoc, 52 IndexedPropertyDoubleOrOtherSaneChainLoc, 52 IndexedPropertyDoubleOutOfBoundsSaneChainLoc, 53 IndexedPropertyDoubleOrOtherOutOfBoundsSaneChainLoc, 53 54 IndexedPropertyInt32Loc, 54 IndexedPropertyInt32O rOtherLoc,55 IndexedPropertyInt32OutOfBoundsSaneChainLoc, 55 56 IndexedPropertyInt52Loc, 57 IndexedPropertyJSOutOfBoundsSaneChainLoc, 56 58 IndexedPropertyJSLoc, 57 59 IndexedPropertyStorageLoc,
Note:
See TracChangeset
for help on using the changeset viewer.