Commit 735dc964 authored by lrn@chromium.org's avatar lrn@chromium.org

Fix bug 73940.

I think this actually turns the code in question into dead code, because the current definition of UseSparseVariant only allows arrays in DictionaryMode, and these never return encoded ranges from %GetArrayKeys. This is a subtle link between the definition of %GetArrayKeys and UseSparseVariant, so I would prefer to keep the code rather than having an invisible depeendency.

BUG=73940

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6946 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 485f4ea0
......@@ -1017,13 +1017,13 @@ function ArrayIndexOf(element, index) {
}
var min = index;
var max = length;
if (UseSparseVariant(this, length, true)) {
if (UseSparseVariant(this, length, IS_ARRAY(this))) {
var intervals = %GetArrayKeys(this, length);
if (intervals.length == 2 && intervals[0] < 0) {
// A single interval.
var intervalMin = -(intervals[0] + 1);
var intervalMax = intervalMin + intervals[1];
min = MAX(min, intervalMin);
if (min < intervalMin) min = intervalMin;
max = intervalMax; // Capped by length already.
// Fall through to loop below.
} else {
......@@ -1073,13 +1073,13 @@ function ArrayLastIndexOf(element, index) {
}
var min = 0;
var max = index;
if (UseSparseVariant(this, length, true)) {
if (UseSparseVariant(this, length, IS_ARRAY(this))) {
var intervals = %GetArrayKeys(this, index + 1);
if (intervals.length == 2 && intervals[0] < 0) {
// A single interval.
var intervalMin = -(intervals[0] + 1);
var intervalMax = intervalMin + intervals[1];
min = MAX(min, intervalMin);
if (min < intervalMin) min = intervalMin;
max = intervalMax; // Capped by index already.
// Fall through to loop below.
} else {
......
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