Commit 1566615
committed
[JSC]
https://bugs.webkit.org/show_bug.cgi?id=320620
Reviewed by Yusuke Suzuki and Keith Miller.
The sane-chain speculation for the indexed enumerator mode was guarded
only by benefitsFromOriginalArray(), which checks the indexing type but
not the array class. As a result an array with a custom prototype got
InBoundsSaneChain and DFG/FTL skipped hole checks against the prototype,
diverging from LLInt/baseline. Check isJSArrayWithOriginalStructure()
first, like every other sane-chain site in fixup does.
Test: JSTests/stress/for-in-enumerator-hole-with-inherited-index-custom-prototype.js
* JSTests/stress/for-in-enumerator-hole-with-inherited-index-custom-prototype.js: Added.
(shouldBe):
(mutate):
(test):
(makeArray):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
Canonical link: https://commits.webkit.org/318293@mainEnumeratorNextUpdateIndexAndMode should require the original array structure before using InBoundsSaneChain
1 parent 90b2ecf commit 1566615
2 files changed
Lines changed: 38 additions & 1 deletion
File tree
- JSTests/stress
- Source/JavaScriptCore/dfg
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3058 | 3058 | | |
3059 | 3059 | | |
3060 | 3060 | | |
3061 | | - | |
| 3061 | + | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | 3064 | | |
| |||
0 commit comments