Changeset 266813 in webkit
- Timestamp:
- Sep 9, 2020, 9:47:38 PM (6 years ago)
- Location:
- trunk
- 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
-
trunk/JSTests/ChangeLog
r266778 r266813 1 2020-09-09 Saam Barati <sbarati@apple.com> 2 3 OutOfBoundsSaneChain operations should use their own heap locations 4 https://bugs.webkit.org/show_bug.cgi?id=216328 5 <rdar://problem/68568039> 6 7 Reviewed by Keith Miller. 8 9 * stress/out-of-bounds-sane-chain-need-their-own-heap-location.js: Added. 10 (foo): 11 1 12 2020-09-09 Alexey Shvayka <shvaikalesh@gmail.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r266795 r266813 1 2020-09-09 Saam Barati <sbarati@apple.com> 2 3 OutOfBoundsSaneChain operations should use their own heap locations 4 https://bugs.webkit.org/show_bug.cgi?id=216328 5 <rdar://problem/68568039> 6 7 Reviewed by Keith Miller. 8 9 There is code in local CSE that does some basic bounds check elimination 10 for PutByVal. It does this analysis by seeing if a particular heap location 11 is already defined, and if so, it eliminates the bounds check for the 12 PutByVal. This doesn't work for OutOfBoundsSaneChain for the obvious reason 13 that these GetByVals are not proven to be in bounds. So GetByVal's in the 14 OutOfBoundsSaneChain mode reusing non OutOfBoundsSaneChain heap locations 15 can lead to a bug where we mistakenly remove a bounds check. The fix is to 16 have all OutOfBoundsSaneChain operations use distinct heaps, and for CSE to 17 not query those heaps. 18 19 * dfg/DFGArrayMode.h: 20 (JSC::DFG::ArrayMode::isAnySaneChain const): Deleted. 21 * dfg/DFGClobberize.h: 22 (JSC::DFG::clobberize): 23 * dfg/DFGHeapLocation.cpp: 24 (WTF::printInternal): 25 * dfg/DFGHeapLocation.h: 26 1 27 2020-09-09 Keith Miller <keith_miller@apple.com> 2 28 -
trunk/Source/JavaScriptCore/dfg/DFGArrayMode.h
r265775 r266813 288 288 } 289 289 290 bool isAnySaneChain() const291 {292 return isInBoundsSaneChain() || isOutOfBoundsSaneChain();293 }294 295 290 bool isOutOfBounds() const 296 291 { -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r266095 r266813 938 938 read(Butterfly_publicLength); 939 939 read(IndexedInt32Properties); 940 LocationKind kind = mode.isOutOfBoundsSaneChain() ? IndexedPropertyInt32O rOtherLoc : indexedPropertyLoc;940 LocationKind kind = mode.isOutOfBoundsSaneChain() ? IndexedPropertyInt32OutOfBoundsSaneChainLoc : indexedPropertyLoc; 941 941 def(HeapLocation(kind, IndexedInt32Properties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); 942 942 return; … … 950 950 read(IndexedDoubleProperties); 951 951 LocationKind kind; 952 if (node->hasDoubleResult()) 953 kind = mode.isAnySaneChain() ? IndexedPropertyDoubleSaneChainLoc : IndexedPropertyDoubleLoc; 954 else { 952 if (node->hasDoubleResult()) { 953 if (mode.isInBoundsSaneChain()) 954 kind = IndexedPropertyDoubleSaneChainLoc; 955 else if (mode.isOutOfBoundsSaneChain()) 956 kind = IndexedPropertyDoubleOutOfBoundsSaneChainLoc; 957 else 958 kind = IndexedPropertyDoubleLoc; 959 } else { 955 960 ASSERT(mode.isOutOfBoundsSaneChain()); 956 kind = IndexedPropertyDoubleOrOther SaneChainLoc;961 kind = IndexedPropertyDoubleOrOtherOutOfBoundsSaneChainLoc; 957 962 } 958 963 def(HeapLocation(kind, IndexedDoubleProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); … … 966 971 read(Butterfly_publicLength); 967 972 read(IndexedContiguousProperties); 968 def(HeapLocation( indexedPropertyLoc, IndexedContiguousProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node));973 def(HeapLocation(mode.isOutOfBoundsSaneChain() ? IndexedPropertyJSOutOfBoundsSaneChainLoc : indexedPropertyLoc, IndexedContiguousProperties, graph.varArgChild(node, 0), graph.varArgChild(node, 1)), LazyNode(node)); 969 974 return; 970 975 } … … 1055 1060 write(Butterfly_publicLength); 1056 1061 def(HeapLocation(indexedPropertyLoc, IndexedInt32Properties, base, index), LazyNode(value)); 1057 def(HeapLocation(IndexedPropertyInt32O rOtherLoc, IndexedInt32Properties, base, index), LazyNode(value));1062 def(HeapLocation(IndexedPropertyInt32OutOfBoundsSaneChainLoc, IndexedInt32Properties, base, index), LazyNode(value)); 1058 1063 return; 1059 1064 … … 1071 1076 def(HeapLocation(IndexedPropertyDoubleLoc, IndexedDoubleProperties, base, index), LazyNode(value)); 1072 1077 def(HeapLocation(IndexedPropertyDoubleSaneChainLoc, IndexedDoubleProperties, base, index), LazyNode(value)); 1078 def(HeapLocation(IndexedPropertyDoubleOutOfBoundsSaneChainLoc, IndexedDoubleProperties, base, index), LazyNode(value)); 1073 1079 return; 1074 1080 … … 1085 1091 write(Butterfly_publicLength); 1086 1092 def(HeapLocation(indexedPropertyLoc, IndexedContiguousProperties, base, index), LazyNode(value)); 1093 def(HeapLocation(IndexedPropertyJSOutOfBoundsSaneChainLoc, IndexedContiguousProperties, base, index), LazyNode(value)); 1087 1094 return; 1088 1095 -
trunk/Source/JavaScriptCore/dfg/DFGHeapLocation.cpp
r265907 r266813 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 -
trunk/Source/JavaScriptCore/dfg/DFGHeapLocation.h
r265907 r266813 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.