5 #ifndef INCLUDE_V8_PRIMITIVE_H_
6 #define INCLUDE_V8_PRIMITIVE_H_
22 class ScopedExternalStringLock;
38 #ifdef V8_ENABLE_CHECKS
41 return static_cast<
Boolean*>(data);
47 static void CheckCast(
v8::
Data* that);
65 #ifdef V8_ENABLE_CHECKS
72 static void CheckCast(
Data* obj);
90 #ifdef V8_ENABLE_CHECKS
93 return static_cast<
Name*>(data);
97 static void CheckCast(
Data* that);
196 int Write(
Isolate* isolate, uint16_t* buffer,
int start = 0,
int length = -1,
200 int length = -1,
int options =
NO_OPTIONS)
const;
203 int* nchars_ref =
nullptr,
int options =
NO_OPTIONS)
const;
293 virtual const uint16_t*
data()
const = 0;
306 CheckCachedDataInvariants();
320 void CheckCachedDataInvariants()
const;
322 const uint16_t* cached_data_ =
nullptr;
348 virtual const char*
data()
const = 0;
359 CheckCachedDataInvariants();
373 void CheckCachedDataInvariants()
const;
375 const char* cached_data_ =
nullptr;
399 #ifdef V8_ENABLE_CHECKS
402 return static_cast<
String*>(data);
416 Isolate* isolate,
const char (&literal)[N],
418 static_assert(N <=
kMaxLength,
"String is too long");
419 return NewFromUtf8Literal(isolate, literal, type, N - 1);
425 Isolate* isolate,
const char* data,
431 Isolate* isolate,
const uint8_t* data,
437 Isolate* isolate,
const uint16_t* data,
560 static void CheckCast(
v8::
Data* that);
627 #ifdef V8_ENABLE_CHECKS
630 return static_cast<
Symbol*>(data);
635 static void CheckCast(
Data* that);
646 #ifdef V8_ENABLE_CHECKS
649 return static_cast<
Number*>(data);
654 static void CheckCast(
v8::
Data* that);
666 #ifdef V8_ENABLE_CHECKS
669 return static_cast<
Integer*>(data);
674 static void CheckCast(
v8::
Data* that);
684 #ifdef V8_ENABLE_CHECKS
687 return static_cast<
Int32*>(data);
692 static void CheckCast(
v8::
Data* that);
702 #ifdef V8_ENABLE_CHECKS
705 return static_cast<
Uint32*>(data);
710 static void CheckCast(
v8::
Data* that);
728 int word_count,
const uint64_t* words);
759 void ToWordsArray(
int* sign_bit,
int* word_count, uint64_t* words)
const;
762 #ifdef V8_ENABLE_CHECKS
765 return static_cast<
BigInt*>(data);
770 static void CheckCast(
v8::
Data* that);
784 A obj = *
reinterpret_cast<
const A*>(
this);
794 result = GetExternalStringResourceSlow();
796 #ifdef V8_ENABLE_CHECKS
797 VerifyExternalStringResource(result);
806 A obj = *
reinterpret_cast<
const A*>(
this);
818 resource = GetExternalStringResourceBaseSlow(encoding_out);
820 #ifdef V8_ENABLE_CHECKS
821 VerifyExternalStringResourceBase(resource, *encoding_out);