5#ifndef INCLUDE_V8_VALUE_H_
6#define INCLUDE_V8_VALUE_H_
439 return static_cast<Value*
>(value);
449 V8_INLINE bool QuickIsNullOrUndefined()
const;
451 bool FullIsUndefined()
const;
452 bool FullIsNull()
const;
453 bool FullIsString()
const;
455 static void CheckCast(
Data* that);
460#ifdef V8_ENABLE_CHECKS
463 return static_cast<Value*
>(value);
467#ifdef V8_ENABLE_CHECKS
468 return FullIsUndefined();
470 return QuickIsUndefined();
474bool Value::QuickIsUndefined()
const {
478#if V8_STATIC_ROOTS_BOOL
479 return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
481 if (!I::HasHeapObjectTag(obj))
return false;
482 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
483 return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
488#ifdef V8_ENABLE_CHECKS
491 return QuickIsNull();
495bool Value::QuickIsNull()
const {
499#if V8_STATIC_ROOTS_BOOL
500 return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
502 if (!I::HasHeapObjectTag(obj))
return false;
503 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
504 return (I::GetOddballKind(obj) == I::kNullOddballKind);
509#ifdef V8_ENABLE_CHECKS
510 return FullIsNull() || FullIsUndefined();
512 return QuickIsNullOrUndefined();
516bool Value::QuickIsNullOrUndefined()
const {
517#if V8_STATIC_ROOTS_BOOL
518 return QuickIsNull() || QuickIsUndefined();
523 if (!I::HasHeapObjectTag(obj))
return false;
524 if (I::GetInstanceType(obj) != I::kOddballType)
return false;
525 int kind = I::GetOddballKind(obj);
526 return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
531#ifdef V8_ENABLE_CHECKS
532 return FullIsString();
534 return QuickIsString();
538bool Value::QuickIsString()
const {
542 if (!I::HasHeapObjectTag(obj))
return false;
543#if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
544 return I::CheckInstanceMapRange(obj, I::StaticReadOnlyRoot::kFirstStringMap,
545 I::StaticReadOnlyRoot::kLastStringMap);
547 return (I::GetInstanceType(obj) < I::kFirstNonstringType);
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
bool IsArrayBuffer() const
bool IsWasmMemoryObject() const
bool IsSharedArrayBuffer() const
bool IsUint8Array() const
V8_WARN_UNUSED_RESULT MaybeLocal< Uint32 > ToUint32(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 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
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 ValueAsAddress(const T *value)
#define V8_WARN_UNUSED_RESULT