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, I::StaticReadOnlyRoot::kFirstStringMap,
639 I::StaticReadOnlyRoot::kLastStringMap);
641 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
650 return obj_map == cached;
V8_INLINE bool Matches(Local< Value > candidate) const
void Update(Local< Value > baseline)
TypecheckWitness(Isolate *isolate)
bool IsArgumentsObject() const
V8_WARN_UNUSED_RESULT MaybeLocal< Int32 > ToInt32(Local< Context > context) const
bool IsInt16Array() const
bool IsBigUint64Array() const
V8_WARN_UNUSED_RESULT Maybe< double > NumberValue(Local< Context > context) const
bool IsModuleNamespaceObject() const
V8_INLINE bool IsNullOrUndefined() const
bool IsTypedArray() const
bool IsSymbolObject() const
V8_WARN_UNUSED_RESULT MaybeLocal< BigInt > ToBigInt(Local< Context > context) const
V8_INLINE bool IsTrue() const
bool IsArrayBuffer() const
V8_INLINE bool IsFalse() const
bool IsWasmMemoryObject() const
bool IsSharedArrayBuffer() const
bool IsUint8Array() const
V8_WARN_UNUSED_RESULT MaybeLocal< Uint32 > ToUint32(Local< Context > context) const
V8_WARN_UNUSED_RESULT MaybeLocal< Numeric > ToNumeric(Local< Context > context) const
bool IsWasmModuleObject() const
bool IsArrayBufferView() const
bool IsBooleanObject() const
bool IsInt32Array() const
bool IsBigIntObject() const
Local< String > TypeOf(Isolate *)
V8_WARN_UNUSED_RESULT MaybeLocal< String > ToDetailString(Local< Context > context) const
V8_INLINE bool IsString() const
V8_WARN_UNUSED_RESULT MaybeLocal< Primitive > ToPrimitive(Local< Context > context) const
V8_WARN_UNUSED_RESULT Maybe< bool > Equals(Local< Context > context, Local< Value > that) const
static V8_INLINE Value * Cast(T *value)
bool IsNativeError() const
bool BooleanValue(Isolate *isolate) const
V8_WARN_UNUSED_RESULT MaybeLocal< Number > ToNumber(Local< Context > context) const
bool IsSetIterator() const
bool IsUint8ClampedArray() const
bool IsStringObject() const
bool IsGeneratorFunction() const
V8_WARN_UNUSED_RESULT MaybeLocal< Object > ToObject(Local< Context > context) const
bool IsUint32Array() const
bool IsNumberObject() const
V8_WARN_UNUSED_RESULT MaybeLocal< Integer > ToInteger(Local< Context > context) const
V8_WARN_UNUSED_RESULT Maybe< int64_t > IntegerValue(Local< Context > context) const
bool IsFloat32Array() const
V8_INLINE bool IsNull() const
bool IsBigInt64Array() const
bool StrictEquals(Local< Value > that) const
V8_WARN_UNUSED_RESULT Maybe< uint32_t > Uint32Value(Local< Context > context) const
V8_WARN_UNUSED_RESULT MaybeLocal< String > ToString(Local< Context > context) const
V8_INLINE bool IsUndefined() const
bool IsMapIterator() const
bool IsGeneratorObject() const
Maybe< bool > InstanceOf(Local< Context > context, Local< Object > object)
bool IsFloat64Array() const
bool SameValue(Local< Value > that) const
bool IsFloat16Array() const
V8_WARN_UNUSED_RESULT MaybeLocal< Uint32 > ToArrayIndex(Local< Context > context) const
bool IsUint16Array() const
bool IsAsyncFunction() const
V8_WARN_UNUSED_RESULT Maybe< int32_t > Int32Value(Local< Context > context) const
Local< Boolean > ToBoolean(Isolate *isolate) const
static V8_INLINE Address LoadMap(Address obj)
static V8_INLINE Address ValueAsAddress(const T *value)
#define V8_WARN_UNUSED_RESULT