segmentTimeSeriesByMaximizingSchwarzCriterion returns a bogus result on empty charts
https://bugs.webkit.org/show_bug.cgi?id=160575
Rubber-stamped by Chris Dumez.
The bug was caused by an early return in segmentTimeSeriesByMaximizingSchwarzCriterion.
Removed this early return as the one in splitIntoSegmentsUntilGoodEnough was sufficient.
Also factored out a few functions in findOptimalSegmentation so that they can be better
optimized in JSC's DFG and FTL tiers, and removed unused debuggingTestingRangeNomination.
* public/shared/statistics.js:
(Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Removed an early return.
(Statistics.splitIntoSegmentsUntilGoodEnough):
(.allocateCostUpperTriangularForSegmentation): Extracted from findOptimalSegmentation.
(.allocatePreviousNodeForSegmentation): Ditto.
(.findOptimalSegmentationInternal): Ditto.
(.findOptimalSegmentation):
* unit-tests/statistics-tests.js: Added a test case.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@204190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
3 files changed