Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r243069 - Structure::flattenDictionary() should clear unused pr…
…operty slots. https://bugs.webkit.org/show_bug.cgi?id=195871 <rdar://problem/48959497> Reviewed by Michael Saboff. JSTests: * stress/structure-flattenDictionary-should-clear-unused-property-slots.js: Added. Source/JavaScriptCore: It currently attempts to do this but fails because it's actually clearing up the preCapacity region instead. The fix is simply to account for the preCapacity when computing the start address of the property slots. * runtime/Structure.cpp: (JSC::Structure::flattenDictionaryStructure):
- Loading branch information
1 parent
7f1db1b
commit 3eba690
Showing
4 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
JSTests/stress/structure-flattenDictionary-should-clear-unused-property-slots.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This test should not crash. | ||
|
||
var arr = []; | ||
arr.x = 0; | ||
arr.y = 0; | ||
delete arr["x"]; | ||
|
||
for (var i = 0; i < 2; ++i) | ||
arr.unshift(i); | ||
|
||
arr.z = 42; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters