diff options
Diffstat (limited to 'deps/v8/src/elements-kind.cc')
-rw-r--r-- | deps/v8/src/elements-kind.cc | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/deps/v8/src/elements-kind.cc b/deps/v8/src/elements-kind.cc index 95bfc2e93d..eedf74e49c 100644 --- a/deps/v8/src/elements-kind.cc +++ b/deps/v8/src/elements-kind.cc @@ -4,7 +4,6 @@ #include "src/elements-kind.h" -#include "src/api.h" #include "src/base/lazy-instance.h" #include "src/elements.h" #include "src/objects-inl.h" @@ -131,31 +130,27 @@ static inline bool IsFastTransitionTarget(ElementsKind elements_kind) { bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, ElementsKind to_kind) { - if (IsFixedTypedArrayElementsKind(from_kind) || - IsFixedTypedArrayElementsKind(to_kind)) { - return false; - } - if (IsFastElementsKind(from_kind) && IsFastTransitionTarget(to_kind)) { - switch (from_kind) { - case PACKED_SMI_ELEMENTS: - return to_kind != PACKED_SMI_ELEMENTS; - case HOLEY_SMI_ELEMENTS: - return to_kind != PACKED_SMI_ELEMENTS && to_kind != HOLEY_SMI_ELEMENTS; - case PACKED_DOUBLE_ELEMENTS: - return to_kind != PACKED_SMI_ELEMENTS && - to_kind != HOLEY_SMI_ELEMENTS && - to_kind != PACKED_DOUBLE_ELEMENTS; - case HOLEY_DOUBLE_ELEMENTS: - return to_kind == PACKED_ELEMENTS || to_kind == HOLEY_ELEMENTS; - case PACKED_ELEMENTS: - return to_kind == HOLEY_ELEMENTS; - case HOLEY_ELEMENTS: - return false; - default: - return false; - } + if (!IsFastElementsKind(from_kind)) return false; + if (!IsFastTransitionTarget(to_kind)) return false; + DCHECK(!IsFixedTypedArrayElementsKind(from_kind)); + DCHECK(!IsFixedTypedArrayElementsKind(to_kind)); + switch (from_kind) { + case PACKED_SMI_ELEMENTS: + return to_kind != PACKED_SMI_ELEMENTS; + case HOLEY_SMI_ELEMENTS: + return to_kind != PACKED_SMI_ELEMENTS && to_kind != HOLEY_SMI_ELEMENTS; + case PACKED_DOUBLE_ELEMENTS: + return to_kind != PACKED_SMI_ELEMENTS && to_kind != HOLEY_SMI_ELEMENTS && + to_kind != PACKED_DOUBLE_ELEMENTS; + case HOLEY_DOUBLE_ELEMENTS: + return to_kind == PACKED_ELEMENTS || to_kind == HOLEY_ELEMENTS; + case PACKED_ELEMENTS: + return to_kind == HOLEY_ELEMENTS; + case HOLEY_ELEMENTS: + return false; + default: + return false; } - return false; } bool UnionElementsKindUptoSize(ElementsKind* a_out, ElementsKind b) { |