chromium/v8/src/objects/elements-kind.h

// Copyright 2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_OBJECTS_ELEMENTS_KIND_H_
#define V8_OBJECTS_ELEMENTS_KIND_H_

#include "src/base/bits.h"
#include "src/base/bounds.h"
#include "src/base/macros.h"
#include "src/common/checks.h"
#include "src/flags/flags.h"

namespace v8 {
namespace internal {

// V has parameters (Type, type, TYPE, C type)
#define TYPED_ARRAYS_BASE(V)

#define TYPED_ARRAYS_FLOAT16(V)

#define TYPED_ARRAYS(V)

#define RAB_GSAB_TYPED_ARRAYS_BASE(V)

#define RAB_GSAB_TYPED_ARRAYS_FLOAT16(V)

#define RAB_GSAB_TYPED_ARRAYS(V)

// The TypedArrays backed by RAB / GSAB are called Uint8Array, Uint16Array etc,
// and not RabGsabUint8Array, RabGsabUint16Array etc. This macro is used for
// generating code which refers to the TypedArray type.
#define RAB_GSAB_TYPED_ARRAYS_WITH_TYPED_ARRAY_TYPE_BASE(V)

#define RAB_GSAB_TYPED_ARRAYS_WITH_TYPED_ARRAY_TYPE_FLOAT16(V)

#define RAB_GSAB_TYPED_ARRAYS_WITH_TYPED_ARRAY_TYPE(V)

// Like RAB_GSAB_TYPED_ARRAYS but has an additional parameter for
// for the corresponding non-RAB/GSAB ElementsKind.
#define RAB_GSAB_TYPED_ARRAYS_WITH_NON_RAB_GSAB_ELEMENTS_KIND_BASE(V)

#define RAB_GSAB_TYPED_ARRAYS_WITH_NON_RAB_GSAB_ELEMENTS_KIND_FLOAT16(V)

#define RAB_GSAB_TYPED_ARRAYS_WITH_NON_RAB_GSAB_ELEMENTS_KIND(V)

enum ElementsKind : uint8_t {};

constexpr int kElementsKindCount =;
constexpr int kFastElementsKindCount =;

// The number to add to a packed elements kind to reach a holey elements kind
constexpr int kFastElementsKindPackedToHoley =;

constexpr int kElementsKindBits =;
static_assert;
static_assert;

constexpr int kFastElementsKindBits =;
static_assert;
static_assert;

const uint8_t* TypedArrayAndRabGsabTypedArrayElementsKindShifts();
const uint8_t* TypedArrayAndRabGsabTypedArrayElementsKindSizes();
inline constexpr int ElementsKindToShiftSize(ElementsKind elements_kind) {}
inline constexpr int ElementsKindToByteSize(ElementsKind elements_kind) {}
int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind);
const char* ElementsKindToString(ElementsKind kind);

inline ElementsKind GetInitialFastElementsKind() {}

ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number);
int GetSequenceIndexFromFastElementsKind(ElementsKind elements_kind);

ElementsKind GetNextTransitionElementsKind(ElementsKind elements_kind);

inline bool IsDictionaryElementsKind(ElementsKind kind) {}

inline bool IsFastArgumentsElementsKind(ElementsKind kind) {}

inline bool IsSlowArgumentsElementsKind(ElementsKind kind) {}

inline bool IsSloppyArgumentsElementsKind(ElementsKind kind) {}

inline bool IsStringWrapperElementsKind(ElementsKind kind) {}

inline bool IsTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsRabGsabTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsTypedArrayOrRabGsabTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsBigIntTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsFloat16TypedArrayElementsKind(ElementsKind kind) {}

inline bool IsFloatTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsSignedIntTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsUnsignedIntTypedArrayElementsKind(ElementsKind kind) {}

inline bool IsWasmArrayElementsKind(ElementsKind kind) {}

inline bool IsSharedArrayElementsKind(ElementsKind kind) {}

inline bool IsTerminalElementsKind(ElementsKind kind) {}

inline bool IsFastElementsKind(ElementsKind kind) {}

inline bool IsTransitionElementsKind(ElementsKind kind) {}

constexpr bool IsDoubleElementsKind(ElementsKind kind) {}

inline bool IsFixedFloatElementsKind(ElementsKind kind) {}

inline bool IsDoubleOrFloatElementsKind(ElementsKind kind) {}

// This predicate is used for disabling respective functionality in builtins.
inline bool IsAnyNonextensibleElementsKindUnchecked(ElementsKind kind) {}

inline bool IsAnyNonextensibleElementsKind(ElementsKind kind) {}

inline bool IsNonextensibleElementsKind(ElementsKind kind) {}

inline bool IsSealedElementsKind(ElementsKind kind) {}

inline bool IsFrozenElementsKind(ElementsKind kind) {}

inline bool IsFastOrNonextensibleOrSealedElementsKind(ElementsKind kind) {}

inline bool IsSmiOrObjectElementsKind(ElementsKind kind) {}

constexpr bool IsSmiElementsKind(ElementsKind kind) {}

inline bool IsFastNumberElementsKind(ElementsKind kind) {}

constexpr bool IsObjectElementsKind(ElementsKind kind) {}

inline bool IsAnyHoleyNonextensibleElementsKind(ElementsKind kind) {}

constexpr bool IsHoleyElementsKind(ElementsKind kind) {}

inline bool IsHoleyElementsKindForRead(ElementsKind kind) {}

inline bool IsHoleyOrDictionaryElementsKind(ElementsKind kind) {}

inline bool IsFastPackedElementsKind(ElementsKind kind) {}

inline ElementsKind GetPackedElementsKind(ElementsKind holey_kind) {}

inline ElementsKind GetHoleyElementsKind(ElementsKind packed_kind) {}

inline ElementsKind GetCorrespondingRabGsabElementsKind(
    ElementsKind typed_array_kind) {}

inline ElementsKind GetCorrespondingNonRabGsabElementsKind(
    ElementsKind typed_array_kind) {}

inline bool UnionElementsKindUptoPackedness(ElementsKind* a_out,
                                            ElementsKind b) {}

bool UnionElementsKindUptoSize(ElementsKind* a_out, ElementsKind b);

inline ElementsKind FastSmiToObjectElementsKind(ElementsKind from_kind) {}

inline bool IsSimpleMapChangeTransition(ElementsKind from_kind,
                                        ElementsKind to_kind) {}

bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind,
                                         ElementsKind to_kind);

inline ElementsKind GetMoreGeneralElementsKind(ElementsKind from_kind,
                                               ElementsKind to_kind) {}

inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) {}

inline bool ElementsKindEqual(ElementsKind a, ElementsKind b) {}

}  // namespace internal
}  // namespace v8

#endif  // V8_OBJECTS_ELEMENTS_KIND_H_