5#ifndef INCLUDE_V8_VALUE_H_
6#define INCLUDE_V8_VALUE_H_
458 return static_cast<Value*
>(value);
468 V8_INLINE bool QuickIsNullOrUndefined()
const;
469#if V8_STATIC_ROOTS_BOOL
474 bool FullIsUndefined()
const;
475 bool FullIsNull()
const;
476 bool FullIsTrue()
const;
477 bool FullIsFalse()
const;
478 bool FullIsString()
const;
480 static void CheckCast(
Data* that);
520#ifdef V8_ENABLE_CHECKS
523 return static_cast<Value*
>(value);
527#ifdef V8_ENABLE_CHECKS
528 return FullIsUndefined();
530 return QuickIsUndefined();
534bool Value::QuickIsUndefined()
const {
538#if V8_STATIC_ROOTS_BOOL
539 return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
541 if (!I::HasHeapObjectTag(obj))
return false;
542 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
543 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
548#ifdef V8_ENABLE_CHECKS
551 return QuickIsNull();
555bool Value::QuickIsNull()
const {
559#if V8_STATIC_ROOTS_BOOL
560 return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
562 if (!I::HasHeapObjectTag(obj))
return false;
563 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
564 return (I::GetOddballKind(obj) == I::kNullOddballKind);
569#ifdef V8_ENABLE_CHECKS
570 return FullIsNull() || FullIsUndefined();
572 return QuickIsNullOrUndefined();
576bool Value::QuickIsNullOrUndefined()
const {
577#if V8_STATIC_ROOTS_BOOL
578 return QuickIsNull() || QuickIsUndefined();
583 if (!I::HasHeapObjectTag(obj))
return false;
584 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
585 int kind = I::GetOddballKind(obj);
586 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
591#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
592 return QuickIsTrue();
598#if V8_STATIC_ROOTS_BOOL
599bool Value::QuickIsTrue()
const {
603 return I::is_identical(obj, I::StaticReadOnlyRoot::kTrueValue);
608#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
609 return QuickIsFalse();
611 return FullIsFalse();
615#if V8_STATIC_ROOTS_BOOL
616bool Value::QuickIsFalse()
const {
620 return I::is_identical(obj, I::StaticReadOnlyRoot::kFalseValue);
625#ifdef V8_ENABLE_CHECKS
626 return FullIsString();
628 return QuickIsString();
632bool Value::QuickIsString()
const {
636 if (!I::HasHeapObjectTag(obj))
return false;
637#if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
638 return I::CheckInstanceMapRange(obj,
639 I::StaticReadOnlyRoot::kStringMapLowerBound,
640 I::StaticReadOnlyRoot::kStringMapUpperBound);
642 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
651 return obj_map == cached;
Definition: v8-isolate.h:212
Definition: v8-local-handle.h:266
Definition: v8-local-handle.h:632
Definition: v8-maybe.h:32
Definition: v8-value.h:497
void Update(Local< Value > baseline)
TypecheckWitness(Isolate *isolate)
bool Matches(Local< Value > candidate) const
Definition: v8-value.h:646
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:568
bool IsTrue() const
Definition: v8-value.h:590
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:624
MaybeLocal< Uint32 > ToArrayIndex(Local< Context > context) const
bool IsMapIterator() const
bool IsNull() const
Definition: v8-value.h:547
bool SameValue(Local< Value > that) const
bool IsNativeError() const
bool IsFloat64Array() const
bool IsFalse() const
Definition: v8-value.h:607
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:457
MaybeLocal< Uint32 > ToUint32(Local< Context > context) const
bool IsUndefined() const
Definition: v8-value.h:526
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 IsUint16Array() const
bool IsGeneratorObject() const
bool IsInt32Array() const
Definition: v8-internal.h:855
static Address LoadMap(Address obj)
Definition: v8-internal.h:1131
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1687
uintptr_t Address
Definition: v8-internal.h:51
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:660