5#ifndef INCLUDE_V8_VALUE_H_
6#define INCLUDE_V8_VALUE_H_
475 return static_cast<Value*
>(value);
493 V8_INLINE bool QuickIsNullOrUndefined()
const;
494#if V8_STATIC_ROOTS_BOOL
499 bool FullIsUndefined()
const;
500 bool FullIsNull()
const;
501 bool FullIsTrue()
const;
502 bool FullIsFalse()
const;
503 bool FullIsString()
const;
505 static void CheckCast(
Data* that);
545#ifdef V8_ENABLE_CHECKS
548 return static_cast<Value*
>(value);
552#ifdef V8_ENABLE_CHECKS
553 return FullIsUndefined();
555 return QuickIsUndefined();
559bool Value::QuickIsUndefined()
const {
563#if V8_STATIC_ROOTS_BOOL
564 return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
566 if (!I::HasHeapObjectTag(obj))
return false;
567 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
568 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
573#ifdef V8_ENABLE_CHECKS
576 return QuickIsNull();
580bool Value::QuickIsNull()
const {
584#if V8_STATIC_ROOTS_BOOL
585 return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
587 if (!I::HasHeapObjectTag(obj))
return false;
588 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
589 return (I::GetOddballKind(obj) == I::kNullOddballKind);
594#ifdef V8_ENABLE_CHECKS
595 return FullIsNull() || FullIsUndefined();
597 return QuickIsNullOrUndefined();
601bool Value::QuickIsNullOrUndefined()
const {
602#if V8_STATIC_ROOTS_BOOL
603 return QuickIsNull() || QuickIsUndefined();
608 if (!I::HasHeapObjectTag(obj))
return false;
609 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
610 int kind = I::GetOddballKind(obj);
611 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
616#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
617 return QuickIsTrue();
623#if V8_STATIC_ROOTS_BOOL
624bool Value::QuickIsTrue()
const {
628 return I::is_identical(obj, I::StaticReadOnlyRoot::kTrueValue);
633#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
634 return QuickIsFalse();
636 return FullIsFalse();
640#if V8_STATIC_ROOTS_BOOL
641bool Value::QuickIsFalse()
const {
645 return I::is_identical(obj, I::StaticReadOnlyRoot::kFalseValue);
650#ifdef V8_ENABLE_CHECKS
651 return FullIsString();
653 return QuickIsString();
657bool Value::QuickIsString()
const {
661 if (!I::HasHeapObjectTag(obj))
return false;
662#if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
663 return I::CheckInstanceMapRange(obj,
664 I::StaticReadOnlyRoot::kStringMapLowerBound,
665 I::StaticReadOnlyRoot::kStringMapUpperBound);
667 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
676 return obj_map == cached;
Definition: v8-isolate.h:292
Definition: v8-local-handle.h:366
Definition: v8-local-handle.h:734
Definition: v8-maybe.h:39
Definition: v8-value.h:522
void Update(Local< Value > baseline)
TypecheckWitness(Isolate *isolate)
bool Matches(Local< Value > candidate) const
Definition: v8-value.h:671
Definition: v8-value.h:32
MaybeLocal< String > ToDetailString(Local< Context > context) const
bool BooleanValue(Isolate *isolate) const
bool IsTypedArray() const
Maybe< int32_t > Int32Value(Local< Context > context) const
bool IsSymbolObject() const
bool IsSharedArrayBuffer() const
Local< String > TypeOf(Isolate *)
bool IsBigInt64Array() const
MaybeLocal< Int32 > ToInt32(Local< Context > context) const
Maybe< double > NumberValue(Local< Context > context) const
MaybeLocal< Numeric > ToNumeric(Local< Context > context) const
MaybeLocal< BigInt > ToBigInt(Local< Context > context) const
bool IsStringObject() const
bool IsBigIntObject() const
bool IsNullOrUndefined() const
Definition: v8-value.h:593
bool IsTrue() const
Definition: v8-value.h:615
bool IsNumberObject() const
bool IsBooleanObject() const
bool IsUint32Array() const
Local< Boolean > ToBoolean(Isolate *isolate) const
bool IsArrayBuffer() const
bool IsUint8ClampedArray() const
bool IsString() const
Definition: v8-value.h:649
MaybeLocal< Uint32 > ToArrayIndex(Local< Context > context) const
bool IsMapIterator() const
bool IsNull() const
Definition: v8-value.h:572
bool SameValue(Local< Value > that) const
bool IsNativeError() const
bool IsFloat64Array() const
bool IsFalse() const
Definition: v8-value.h:632
Maybe< int64_t > IntegerValue(Local< Context > context) const
bool IsBigUint64Array() const
bool IsInt16Array() const
bool IsSetIterator() const
MaybeLocal< String > ToString(Local< Context > context) const
bool IsModuleNamespaceObject() const
Maybe< uint32_t > Uint32Value(Local< Context > context) const
bool IsWasmMemoryObject() const
Maybe< bool > Equals(Local< Context > context, Local< Value > that) const
bool IsFloat32Array() const
bool IsArrayBufferView() const
bool IsWasmModuleObject() const
bool IsGeneratorFunction() const
bool StrictEquals(Local< Value > that) const
static Value * Cast(T *value)
Definition: v8-value.h:474
MaybeLocal< Uint32 > ToUint32(Local< Context > context) const
bool IsUndefined() const
Definition: v8-value.h:551
bool IsFloat16Array() const
MaybeLocal< Primitive > ToPrimitive(Local< Context > context) const
MaybeLocal< Number > ToNumber(Local< Context > context) const
Maybe< bool > InstanceOf(Local< Context > context, Local< Object > object)
bool IsArgumentsObject() const
bool IsAsyncFunction() const
MaybeLocal< Integer > ToInteger(Local< Context > context) const
MaybeLocal< Object > ToObject(Local< Context > context) const
bool IsUint8Array() const
bool IsWasmMemoryMapDescriptor() const
bool IsDeferredModuleNamespaceObject() const
bool IsUint16Array() const
bool IsGeneratorObject() const
bool IsInt32Array() const
Definition: v8-internal.h:983
static Address LoadMap(Address obj)
Definition: v8-internal.h:1296
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1854
uintptr_t Address
Definition: v8-internal.h:38
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:874
#define V8_INLINE
Definition: v8config.h:518
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:688