[JSC] Record CoW status in ArrayProfile correctly
https://bugs.webkit.org/show_bug.cgi?id=187949
Reviewed by Saam Barati.
JSTests:
* stress/array-profile-should-record-copy-on-write.js: Added.
(shouldBe):
(test1):
(test2):
(test3):
Source/JavaScriptCore:
In this patch, we simplify asArrayModes: just shifting the value with IndexingMode.
This is important since our OSR exit compiler records m_observedArrayModes by calculating
ArrayModes with shifting. Since ArrayModes for CoW arrays are incorrectly calculated,
our OSR exit compiler records incorrect results in ArrayProfile. And it leads to
Array::Generic DFG nodes.
* bytecode/ArrayProfile.h:
(JSC::asArrayModes):
(JSC::ArrayProfile::ArrayProfile):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileExit):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* runtime/IndexingType.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234331
268f45cc-cd09-0410-ab3c-
d52691b4dbfc