5#ifndef INCLUDE_V8_VALUE_H_
6#define INCLUDE_V8_VALUE_H_
15
16
30
31
35
36
37
38
39
43
44
45
46
47
51
52
53
54
55
56
60
61
62
63
64
65
69
70
71
72
73
74
78
79
80
81
82
86
87
88
89
90
94
95
96
97
101
102
103
104
108
109
110
114
115
119
120
121
122
126
127
128
129
133
134
135
136
140
141
145
146
150
151
155
156
160
161
165
166
170
171
175
176
180
181
185
186
190
191
195
196
200
201
205
206
210
211
215
216
220
221
225
226
230
231
235
236
240
241
245
246
250
251
255
256
260
261
265
266
270
271
275
276
280
281
285
286
290
291
295
296
300
301
305
306
310
311
315
316
320
321
325
326
330
331
335
336
340
341
345
346
350
351
355
356
360
361
365
366
370
371
375
376
377
381
382
383
387
388
392
393
397
398
402
403
404
405
409
410
414
415
416
417
421
422
423
424
428
429
430
431
435
436
440
441
442
468 return static_cast<
Value*>(value);
476
477
478
479
480
486 V8_INLINE bool QuickIsNullOrUndefined()
const;
492 bool FullIsUndefined()
const;
493 bool FullIsNull()
const;
494 bool FullIsTrue()
const;
495 bool FullIsFalse()
const;
496 bool FullIsString()
const;
498 static void CheckCast(
Data* that);
502
503
504
505
506
507
508
509
510
511
512
513
514
520
521
522
523
524
528
529
538#ifdef V8_ENABLE_CHECKS
541 return static_cast<
Value*>(value);
545#ifdef V8_ENABLE_CHECKS
546 return FullIsUndefined();
548 return QuickIsUndefined();
552bool Value::QuickIsUndefined()
const {
555 A obj =
internal::ValueHelper::ValueAsAddress(
this);
557 return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
566#ifdef V8_ENABLE_CHECKS
569 return QuickIsNull();
573bool Value::QuickIsNull()
const {
576 A obj =
internal::ValueHelper::ValueAsAddress(
this);
578 return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
587#ifdef V8_ENABLE_CHECKS
588 return FullIsNull() || FullIsUndefined();
590 return QuickIsNullOrUndefined();
594bool Value::QuickIsNullOrUndefined()
const {
596 return QuickIsNull() || QuickIsUndefined();
600 A obj =
internal::ValueHelper::ValueAsAddress(
this);
610 return QuickIsTrue();
627 return QuickIsFalse();
629 return FullIsFalse();
643#ifdef V8_ENABLE_CHECKS
644 return FullIsString();
646 return QuickIsString();
650bool Value::QuickIsString()
const {
653 A obj =
internal::ValueHelper::ValueAsAddress(
this);
656 return I::CheckInstanceMapRange(obj,
657 I::StaticReadOnlyRoot::kStringMapLowerBound,
658 I::StaticReadOnlyRoot::kStringMapUpperBound);
668 internal::ValueHelper::ValueAsAddress(*cached_map_);
669 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 IsWasmMemoryMapDescriptor() const
bool IsBooleanObject() const
bool IsInt32Array() const
bool IsBigIntObject() const
V8_INLINE Value * Cast(Data *value)
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 constexpr bool HasHeapObjectTag(Address value)
static V8_INLINE int GetInstanceType(Address obj)
static const int kOddballType
static V8_INLINE int GetOddballKind(Address obj)
static const int kUndefinedOddballKind
static const int kNullOddballKind
static const int kFirstNonstringType
#define V8_STATIC_ROOTS_BOOL
#define V8_WARN_UNUSED_RESULT