Commit 0c1702b1 authored by ager@chromium.org's avatar ager@chromium.org

Don't use SmartSlice just because the receiver is an array.

Only do so if the estimated number of elements is low compared to the
end position for the slice. This is similar to other heuristics used
for array operations that use the %GetElementKeys runtime function.

R=erik.corry@gmail.com

Review URL: http://codereview.chromium.org/7111032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8184 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c0a0c82b
......@@ -631,7 +631,9 @@ function ArraySlice(start, end) {
if (end_i < start_i) return result;
if (IS_ARRAY(this)) {
if (IS_ARRAY(this) &&
(end_i > 1000) &&
(%EstimateNumberOfElements(this) < end_i)) {
SmartSlice(this, start_i, end_i - start_i, len, result);
} else {
SimpleSlice(this, start_i, end_i - start_i, len, result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment