Reason for revert:
Shouldn't unconditionally load holes since it tanks performance. I'll change it in a follow-up to only do it if the IC ever saw it happen.
Original issue's description:
> Allow loading holes from holey smi arrays
>
> BUG=
>
> Committed: https://crrev.com/
eab5bb5390fab79d063f29398377c6d181963dde
> Cr-Commit-Position: refs/heads/master@{#28298}
TBR=mvstanton@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Review URL: https://codereview.chromium.org/
1131203002
Cr-Commit-Position: refs/heads/master@{#28309}
DeoptimizeIf(eq, instr, Deoptimizer::kHole);
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
__ cmp(result, scratch);
Deoptimizer::kHole);
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ CompareRoot(result, Heap::kTheHoleValueRootIndex);
__ B(ne, &done);
// Loads from a "stock" fast holey array can convert the hole to undefined
// with impunity.
LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE;
- bool holey_smi_elements =
- *map == isolate()->get_initial_js_array_map(FAST_HOLEY_SMI_ELEMENTS);
bool holey_double_elements =
*map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS);
bool holey_elements =
*map == isolate()->get_initial_js_array_map(FAST_HOLEY_ELEMENTS);
- if ((holey_smi_elements || holey_double_elements || holey_elements) &&
+ if ((holey_double_elements || holey_elements) &&
isolate()->IsFastArrayConstructorPrototypeChainIntact()) {
load_mode =
holey_double_elements ? ALLOW_RETURN_HOLE : CONVERT_HOLE_TO_UNDEFINED;
DeoptimizeIf(equal, instr, Deoptimizer::kHole);
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ cmp(result, factory()->the_hole_value());
__ j(not_equal, &done);
DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch));
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
__ Branch(&done, ne, result, Operand(scratch));
DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch));
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
__ Branch(&done, ne, result, Operand(scratch));
DeoptimizeIf(eq, instr, Deoptimizer::kHole);
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
__ cmp(result, scratch);
DeoptimizeIf(equal, instr, Deoptimizer::kHole);
}
} else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(hinstr->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- hinstr->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ CompareRoot(result, Heap::kTheHoleValueRootIndex);
__ j(not_equal, &done);
DeoptimizeIf(equal, instr, Deoptimizer::kHole);
}
} else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
- DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
- instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
+ DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
Label done;
__ cmp(result, factory()->the_hole_value());
__ j(not_equal, &done);