Commit 1f413298 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[map] Cleanup: Smi validity "cells" are always valid

We can check map validity cells for Sminess without checking their
value, since their value as a Smi (and not a Cell) should always be
"valid"

Change-Id: Ie73079107144e352c358c0ec42abd0c10bdcf73a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3663090
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80721}
parent b636d185
......@@ -788,9 +788,13 @@ ACCESSORS_CHECKED(Map, wasm_type_info, WasmTypeInfo,
bool Map::IsPrototypeValidityCellValid() const {
Object validity_cell = prototype_validity_cell();
Object value = validity_cell.IsSmi() ? Smi::cast(validity_cell)
: Cell::cast(validity_cell).value();
return value == Smi::FromInt(Map::kPrototypeChainValid);
if (validity_cell.IsSmi()) {
// Smi validity cells should always be considered valid.
DCHECK_EQ(Smi::cast(validity_cell).value(), Map::kPrototypeChainValid);
return true;
}
Smi cell_value = Smi::cast(Cell::cast(validity_cell).value());
return cell_value == Smi::FromInt(Map::kPrototypeChainValid);
}
DEF_GETTER(Map, GetConstructor, Object) {
......
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