#pragma once
namespace JSC {
enum JSType : uint8_t {
CellType,
StringType,
HeapBigIntType,
LastMaybeFalsyCellPrimitive = HeapBigIntType,
SymbolType,
GetterSetterType,
CustomGetterSetterType,
APIValueWrapperType,
NativeExecutableType,
ProgramExecutableType,
ModuleProgramExecutableType,
EvalExecutableType,
FunctionExecutableType,
UnlinkedFunctionExecutableType,
UnlinkedProgramCodeBlockType,
UnlinkedModuleProgramCodeBlockType,
UnlinkedEvalCodeBlockType,
UnlinkedFunctionCodeBlockType,
CodeBlockType,
JSImmutableButterflyType,
JSSourceCodeType,
JSScriptFetcherType,
JSScriptFetchParametersType,
ObjectType,
FinalObjectType,
JSCalleeType,
JSFunctionType,
InternalFunctionType,
NullSetterFunctionType,
NumberObjectType,
ErrorInstanceType,
PureForwardingProxyType,
ImpureProxyType,
DirectArgumentsType,
ScopedArgumentsType,
ClonedArgumentsType,
ArrayType,
DerivedArrayType,
ArrayBufferType,
Int8ArrayType,
Uint8ArrayType,
Uint8ClampedArrayType,
Int16ArrayType,
Uint16ArrayType,
Int32ArrayType,
Uint32ArrayType,
Float32ArrayType,
Float64ArrayType,
DataViewType,
GlobalObjectType,
GlobalLexicalEnvironmentType,
LexicalEnvironmentType,
ModuleEnvironmentType,
StrictEvalActivationType,
WithScopeType,
ModuleNamespaceObjectType,
RegExpObjectType,
JSDateType,
ProxyObjectType,
JSGeneratorType,
JSAsyncGeneratorType,
JSArrayIteratorType,
JSMapIteratorType,
JSSetIteratorType,
JSStringIteratorType,
JSPromiseType,
JSMapType,
JSSetType,
JSWeakMapType,
JSWeakSetType,
WebAssemblyModuleType,
StringObjectType,
DerivedStringObjectType,
LastJSCObjectType = DerivedStringObjectType, MaxJSType = 0b11111111,
};
static constexpr uint32_t FirstTypedArrayType = Int8ArrayType;
static constexpr uint32_t LastTypedArrayType = DataViewType;
static constexpr uint32_t LastTypedArrayTypeExcludingDataView = LastTypedArrayType - 1;
static constexpr uint32_t FirstObjectType = ObjectType;
static constexpr uint32_t LastObjectType = MaxJSType;
static constexpr uint32_t NumberOfTypedArrayTypes = LastTypedArrayType - FirstTypedArrayType + 1;
static constexpr uint32_t NumberOfTypedArrayTypesExcludingDataView = NumberOfTypedArrayTypes - 1;
static_assert(sizeof(JSType) == sizeof(uint8_t), "sizeof(JSType) is one byte.");
static_assert(LastJSCObjectType < 0b11100000, "Embedder can use 0b11100000 or upper.");
inline constexpr bool isTypedArrayType(JSType type)
{
return (static_cast<uint32_t>(type) - FirstTypedArrayType) < NumberOfTypedArrayTypesExcludingDataView;
}
}
namespace WTF {
class PrintStream;
void printInternal(PrintStream&, JSC::JSType);
}