5#ifndef INCLUDE_V8_VALUE_H_
6#define INCLUDE_V8_VALUE_H_
463 return static_cast<Value*
>(value);
473 V8_INLINE bool QuickIsNullOrUndefined()
const;
474#if V8_STATIC_ROOTS_BOOL
479 bool FullIsUndefined()
const;
480 bool FullIsNull()
const;
481 bool FullIsTrue()
const;
482 bool FullIsFalse()
const;
483 bool FullIsString()
const;
485 static void CheckCast(
Data* that);
525#ifdef V8_ENABLE_CHECKS
528 return static_cast<Value*
>(value);
532#ifdef V8_ENABLE_CHECKS
533 return FullIsUndefined();
535 return QuickIsUndefined();
539bool Value::QuickIsUndefined()
const {
543#if V8_STATIC_ROOTS_BOOL
544 return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
546 if (!I::HasHeapObjectTag(obj))
return false;
547 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
548 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
553#ifdef V8_ENABLE_CHECKS
556 return QuickIsNull();
560bool Value::QuickIsNull()
const {
564#if V8_STATIC_ROOTS_BOOL
565 return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
567 if (!I::HasHeapObjectTag(obj))
return false;
568 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
569 return (I::GetOddballKind(obj) == I::kNullOddballKind);
574#ifdef V8_ENABLE_CHECKS
575 return FullIsNull() || FullIsUndefined();
577 return QuickIsNullOrUndefined();
581bool Value::QuickIsNullOrUndefined()
const {
582#if V8_STATIC_ROOTS_BOOL
583 return QuickIsNull() || QuickIsUndefined();
588 if (!I::HasHeapObjectTag(obj))
return false;
589 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
590 int kind = I::GetOddballKind(obj);
591 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
596#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
597 return QuickIsTrue();
603#if V8_STATIC_ROOTS_BOOL
604bool Value::QuickIsTrue()
const {
608 return I::is_identical(obj, I::StaticReadOnlyRoot::kTrueValue);
613#if V8_STATIC_ROOTS_BOOL && !defined(V8_ENABLE_CHECKS)
614 return QuickIsFalse();
616 return FullIsFalse();
620#if V8_STATIC_ROOTS_BOOL
621bool Value::QuickIsFalse()
const {
625 return I::is_identical(obj, I::StaticReadOnlyRoot::kFalseValue);
630#ifdef V8_ENABLE_CHECKS
631 return FullIsString();
633 return QuickIsString();
637bool Value::QuickIsString()
const {
641 if (!I::HasHeapObjectTag(obj))
return false;
642#if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
643 return I::CheckInstanceMapRange(obj,
644 I::StaticReadOnlyRoot::kStringMapLowerBound,
645 I::StaticReadOnlyRoot::kStringMapUpperBound);
647 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
656 return obj_map == cached;
Definition: v8-isolate.h:261
Definition: v8-local-handle.h:266
Definition: v8-local-handle.h:632
Definition: v8-maybe.h:32
Definition: v8-value.h:502
void Update(Local< Value > baseline)
TypecheckWitness(Isolate *isolate)
bool Matches(Local< Value > candidate) const
Definition: v8-value.h:651
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:573
bool IsTrue() const
Definition: v8-value.h:595
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:629
MaybeLocal< Uint32 > ToArrayIndex(Local< Context > context) const
bool IsMapIterator() const
bool IsNull() const
Definition: v8-value.h:552
bool SameValue(Local< Value > that) const
bool IsNativeError() const
bool IsFloat64Array() const
bool IsFalse() const
Definition: v8-value.h:612
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:462
MaybeLocal< Uint32 > ToUint32(Local< Context > context) const
bool IsUndefined() const
Definition: v8-value.h:531
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 IsUint16Array() const
bool IsGeneratorObject() const
bool IsInt32Array() const
Definition: v8-internal.h:794
static Address LoadMap(Address obj)
Definition: v8-internal.h:1069
static Address ValueAsAddress(const T *value)
Definition: v8-internal.h:1625
uintptr_t Address
Definition: v8-internal.h:52
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