5#ifndef INCLUDE_V8_VALUE_H_
6#define INCLUDE_V8_VALUE_H_
480 return static_cast<Value*
>(value);
498 V8_INLINE bool QuickIsNullOrUndefined()
const;
499#if V8_STATIC_ROOTS_BOOL
504 bool FullIsUndefined()
const;
505 bool FullIsNull()
const;
506 bool FullIsTrue()
const;
507 bool FullIsFalse()
const;
508 bool FullIsString()
const;
510 static void CheckCast(
Data* that);
550#ifdef V8_ENABLE_CHECKS
553 return static_cast<Value*
>(value);
557#ifdef V8_ENABLE_CHECKS
558 return FullIsUndefined();
560 return QuickIsUndefined();
564bool Value::QuickIsUndefined()
const {
568#if V8_STATIC_ROOTS_BOOL
569 return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
571 if (!I::HasHeapObjectTag(obj))
return false;
572 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
573 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
578#ifdef V8_ENABLE_CHECKS
581 return QuickIsNull();
585bool Value::QuickIsNull()
const {
589#if V8_STATIC_ROOTS_BOOL
590 return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
592 if (!I::HasHeapObjectTag(obj))
return false;
593 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
594 return (I::GetOddballKind(obj) == I::kNullOddballKind);
599#ifdef V8_ENABLE_CHECKS
600 return FullIsNull() || FullIsUndefined();
602 return QuickIsNullOrUndefined();
606bool Value::QuickIsNullOrUndefined()
const {
607#if V8_STATIC_ROOTS_BOOL
608 return QuickIsNull() || QuickIsUndefined();
613 if (!I::HasHeapObjectTag(obj))
return false;
614 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
615 int kind = I::GetOddballKind(obj);
616 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
621#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
622 return QuickIsTrue();
628#if V8_STATIC_ROOTS_BOOL
629bool Value::QuickIsTrue()
const {
633 return I::is_identical(obj, I::StaticReadOnlyRoot::kTrueValue);
638#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
639 return QuickIsFalse();
641 return FullIsFalse();
645#if V8_STATIC_ROOTS_BOOL
646bool Value::QuickIsFalse()
const {
650 return I::is_identical(obj, I::StaticReadOnlyRoot::kFalseValue);
655#ifdef V8_ENABLE_CHECKS
656 return FullIsString();
658 return QuickIsString();
662bool Value::QuickIsString()
const {
666 if (!I::HasHeapObjectTag(obj))
return false;
667#if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
668 return I::CheckInstanceMapRange(obj,
669 I::StaticReadOnlyRoot::kStringMapLowerBound,
670 I::StaticReadOnlyRoot::kStringMapUpperBound);
672 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
681 return obj_map == cached;
Definition: v8-isolate.h:298
Definition: v8-local-handle.h:359
Definition: v8-local-handle.h:730
Definition: v8-maybe.h:39
Definition: v8-value.h:527
void Update(Local< Value > baseline)
TypecheckWitness(Isolate *isolate)
bool Matches(Local< Value > candidate) const
Definition: v8-value.h:676
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:598
bool IsTrue() const
Definition: v8-value.h:620
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:654
MaybeLocal< Uint32 > ToArrayIndex(Local< Context > context) const
bool IsMapIterator() const
bool IsNull() const
Definition: v8-value.h:577
bool SameValue(Local< Value > that) const
bool IsNativeError() const
bool IsFloat64Array() const
bool IsFalse() const
Definition: v8-value.h:637
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:479
MaybeLocal< Uint32 > ToUint32(Local< Context > context) const
bool IsUndefined() const
Definition: v8-value.h:556
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 IsArrayBufferBase() const
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:979
static Address LoadMap(Address obj)
Definition: v8-internal.h:1284
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1842
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