35 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
36 #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the
37 build configuration to ensure that at most one of these is set
40 #ifdef BUILDING_V8_SHARED
41 # define V8_EXPORT __declspec(dllexport)
43 # define V8_EXPORT __declspec(dllimport)
51 #if V8_HAS_ATTRIBUTE_VISIBILITY
&& defined(V8_SHARED)
52 # ifdef BUILDING_V8_SHARED
53 # define V8_EXPORT __attribute__ ((visibility("default")))
80 class ImplementationUtilities;
90 class ObjectOperationDescriptor;
95 class RawOperationDescriptor;
109 template <
class T>
class Local;
112 template <
class T>
class Eternal;
113 template<
class T>
class NonCopyablePersistentTraits;
116 class M = NonCopyablePersistentTraits<T> >
class Persistent;
120 template <
class K,
class V,
class T>
122 template <
class K,
class V,
class T>
125 template<
class T,
class P>
class WeakCallbackObject;
134 class CallHandlerHelper;
144 struct StreamedSource;
146 class PropertyCallbackArguments;
147 class FunctionCallbackArguments;
161 return data_ == other.data_;
165 return data_ != other.data_;
169 return data_ < other.data_;
178 #define TYPE_CHECK(T, S)
180 *(static_cast<T* volatile*>(0
)) = static_cast<S*>(0
);
215 : val_(
reinterpret_cast<T*>(*that)) {
248 if (a == 0)
return b == 0;
249 if (b == 0)
return false;
257 if (a == 0)
return b == 0;
258 if (b == 0)
return false;
270 return !operator==(that);
275 return !operator==(that);
279 #ifdef V8_ENABLE_CHECKS
282 if (that.IsEmpty())
return Local<T>();
284 return Local<T>(T::Cast(*that));
289 return Local<S>::Cast(*
this);
306 template<
class F>
friend class Local;
321 template <
class F1,
class F2,
class F3>
333 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
356 : val_(
reinterpret_cast<T*>(*that)) {
364 out->val_ =
IsEmpty() ?
nullptr :
this->val_;
387 Set(isolate, handle);
395 static const int kInitialValue = -1;
400 static const int kInternalFieldsInWeakCallback = 2;
403 template <
typename T>
409 void* internal_fields[kInternalFieldsInWeakCallback],
411 : isolate_(isolate), parameter_(parameter), callback_(callback) {
412 for (
int i = 0; i < kInternalFieldsInWeakCallback; ++i) {
413 internal_fields_[i] = internal_fields[i];
422 void* GetInternalField1()
const) {
423 return internal_fields_[0];
426 void* GetInternalField2()
const) {
427 return internal_fields_[1];
444 void* internal_fields_[kInternalFieldsInWeakCallback];
448 template <
class T,
class P>
454 : isolate_(isolate), parameter_(parameter), handle_(handle) {}
516 if (a == NULL)
return b == NULL;
517 if (b == NULL)
return false;
525 if (a == NULL)
return b == NULL;
526 if (b == NULL)
return false;
532 return !operator==(that);
537 return !operator==(that);
547 template <
typename P>
549 "use WeakCallbackInfo version",
553 template <
typename S,
typename P>
555 "use WeakCallbackInfo version",
556 void SetWeak(P* parameter,
565 template <
typename P>
568 void SetPhantom(P* parameter,
570 int internal_field_index1 = -1,
571 int internal_field_index2 = -1));
573 template <
typename P>
625 template<
class F>
friend class Local;
631 template <
class F1,
class F2,
class F3>
636 explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
652 class NonCopyablePersistentTraits {
656 template<
class S,
class M>
676 template<
class S,
class M>
713 template <
class S,
class M2>
727 template <
class S,
class M2>
735 template <
class S,
class M2>
746 if (M::kResetInDestructor)
this->Reset();
752 #ifdef V8_ENABLE_CHECKS
755 if (!that.IsEmpty()) T::Cast(*that);
757 return reinterpret_cast<
Persistent<T>&>(that);
768 template<
class F>
friend class Local;
773 V8_INLINE T* operator*()
const {
return this->val_; }
774 template<
class S,
class M2>
815 other.val_ =
nullptr;
826 this->val_ = rhs.val_;
845 void operator=(
Global&) =
delete;
846 V8_INLINE T* operator*()
const {
return this->val_; }
881 return reinterpret_cast<
Isolate*>(isolate_);
901 void* operator
new(size_t size);
902 void operator
delete(
void*, size_t);
909 template<
class F>
friend class Local;
934 Escape(
reinterpret_cast<
internal::Object**>(*value));
935 return Local<T>(
reinterpret_cast<T*>(slot));
945 void* operator
new(size_t size);
946 void operator
delete(
void*, size_t);
961 void* operator
new(size_t size);
962 void operator
delete(
void*, size_t);
988 bool is_shared_cross_origin =
false,
989 bool is_opaque =
false)
990 : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) |
991 (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
992 (is_opaque ? kIsOpaque : 0)) {}
995 (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {}
997 return (flags_ & kIsEmbedderDebugScript) != 0;
1000 return (flags_ & kIsSharedCrossOrigin) != 0;
1002 bool IsOpaque()
const {
return (flags_ & kIsOpaque) != 0; }
1007 kIsEmbedderDebugScript = 1,
1008 kIsSharedCrossOrigin = 1 << 1,
1090 "Use maybe version",
1328 "Use maybe version",
1358 "Use maybe version",
1395 "Use maybe version",
1417 size_t context_extension_count,
1421 Local<
String> arguments[], size_t context_extension_count,
2025 V8_INLINE bool QuickIsUndefined()
const;
2028 bool FullIsUndefined()
const;
2029 bool FullIsNull()
const;
2030 bool FullIsString()
const;
2051 static void CheckCast(
v8::
Value* obj);
2071 static void CheckCast(
v8::
Value* obj);
2163 int* nchars_ref = NULL,
2222 virtual const uint16_t*
data()
const = 0;
2252 virtual const char*
data()
const = 0;
2289 "Use maybe version",
2302 "Use maybe version",
2315 "Use maybe version",
2341 "Use maybe version",
2367 "Use maybe version",
2430 Value(
const Value&);
2431 void operator=(
const Value&);
2438 static void CheckCast(
v8::
Value* obj);
2476 static void CheckCast(
v8::
Value* obj);
2490 static void CheckCast(
v8::
Value* obj);
2505 static void CheckCast(
v8::
Value* obj);
2519 static void CheckCast(
v8::
Value* obj);
2533 static void CheckCast(
v8::
Value* obj);
2595 bool Set(uint32_t index,
Local<
Value> value));
2808 bool HasRealIndexedProperty(uint32_t index));
2812 bool HasRealNamedCallbackProperty(
Local<
String> key));
2821 "Use maybe version",
2832 "Use maybe version",
2939 static void CheckCast(
Value* obj);
2940 Local<
Value> SlowGetInternalField(
int index);
2941 void* SlowGetAlignedPointerFromInternalField(
int index);
2970 static void CheckCast(
Value* obj);
3014 static void CheckCast(
Value* obj);
3053 static void CheckCast(
Value* obj);
3057 template<
typename T>
3061 : value_(that.value_) {
3065 template <
typename S>
3068 template <
typename S>
3070 template <
typename S>
3085 template <
typename S>
3092 template <
class F,
class G,
class H>
3107 template<
typename T>
3136 bool is_construct_call);
3148 template<
typename T>
3160 friend class MacroAssembler;
3192 "Use maybe version",
3265 static void CheckCast(
Value* obj);
3306 static void CheckCast(
Value* obj);
3340 static void CheckCast(
Value* obj);
3344 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
3346 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
3385 virtual void Free(
void* data, size_t length) = 0;
3402 void*
Data()
const {
return data_; }
3407 size_t byte_length_;
3433 Isolate* isolate,
void* data, size_t byte_length,
3484 static void CheckCast(
Value* obj);
3488 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
3490 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
3539 static void CheckCast(
Value* obj);
3560 static void CheckCast(
Value* obj);
3571 size_t byte_offset, size_t length);
3573 size_t byte_offset, size_t length);
3578 static void CheckCast(
Value* obj);
3589 size_t byte_offset, size_t length);
3596 Uint8ClampedArray();
3597 static void CheckCast(
Value* obj);
3607 size_t byte_offset, size_t length);
3609 size_t byte_offset, size_t length);
3614 static void CheckCast(
Value* obj);
3625 size_t byte_offset, size_t length);
3627 size_t byte_offset, size_t length);
3632 static void CheckCast(
Value* obj);
3643 size_t byte_offset, size_t length);
3645 size_t byte_offset, size_t length);
3650 static void CheckCast(
Value* obj);
3661 size_t byte_offset, size_t length);
3663 size_t byte_offset, size_t length);
3668 static void CheckCast(
Value* obj);
3679 size_t byte_offset, size_t length);
3681 size_t byte_offset, size_t length);
3686 static void CheckCast(
Value* obj);
3697 size_t byte_offset, size_t length);
3699 size_t byte_offset, size_t length);
3704 static void CheckCast(
Value* obj);
3715 size_t byte_offset, size_t length);
3717 size_t byte_offset, size_t length);
3722 static void CheckCast(
Value* obj);
3733 size_t byte_offset, size_t length);
3735 size_t byte_offset, size_t length);
3740 static void CheckCast(
Value* obj);
3765 void*
Data()
const {
return data_; }
3770 size_t byte_length_;
3796 Isolate* isolate,
void* data, size_t byte_length,
3838 SharedArrayBuffer();
3839 static void CheckCast(
Value* obj);
3876 static void CheckCast(
v8::
Value* obj);
3892 static void CheckCast(
v8::
Value* obj);
3908 static void CheckCast(
v8::
Value* obj);
3924 static void CheckCast(
v8::
Value* obj);
3942 static void CheckCast(
v8::
Value* obj);
3993 static void CheckCast(
v8::
Value* obj);
4007 static void CheckCast(
v8::
Value* obj);
4617 deleter
, enumerator
, data
));
4695 AccessorSignature();
4721 : data_(data), length_(length) {}
4722 const char*
data()
const {
return data_; }
4738 const char* source = 0,
4740 const char** deps = 0,
4741 int source_length = -1);
4748 const char*
name()
const {
return name_; }
4759 size_t source_length_;
4805 uint64_t virtual_memory_limit);
4809 void ConfigureDefaults(uint64_t physical_memory,
4810 uint64_t virtual_memory_limit,
4811 uint32_t number_of_processors));
4823 return max_available_threads_;
4827 void set_max_available_threads(
int value)) {
4828 max_available_threads_ = value;
4832 code_range_size_ = value;
4836 int max_semi_space_size_;
4837 int max_old_space_size_;
4838 int max_executable_size_;
4839 uint32_t* stack_limit_;
4840 int max_available_threads_;
4841 size_t code_range_size_;
4930 : promise_(promise),
4933 stack_trace_(stack_trace) {}
5012 size_t total_heap_size_;
5013 size_t total_heap_size_executable_;
5014 size_t total_physical_size_;
5015 size_t total_available_size_;
5016 size_t used_heap_size_;
5017 size_t heap_size_limit_;
5034 const char* space_name_;
5036 size_t space_used_size_;
5037 size_t space_available_size_;
5038 size_t physical_space_size_;
5053 const char* object_type_;
5054 const char* object_sub_type_;
5055 size_t object_count_;
5056 size_t object_size_;
5077 uintptr_t return_addr_location);
5178 uint16_t class_id) {}
5270 Scope(
const Scope&);
5305 void* internal_throws_;
5306 void* internal_assert_;
5480 size_t frames_limit,
SampleInfo* sample_info);
5565 template<
typename T,
typename S>
5760 bool IdleNotification(
int idle_time_in_ms));
5871 bool capture,
int frame_limit = 10,
5909 template <
class K,
class V,
class Traits>
5916 void* operator
new(size_t size);
5917 void operator
delete(
void*, size_t);
5922 void CollectAllGarbage(
const char* gc_reason);
5952 typedef uintptr_t (*ReturnAddressLocationResolver)(
5953 uintptr_t return_addr_location);
5963 "Use isolate version",
5971 "Use isolate version",
void SetAllowCodeGenerationFromStringsCallback(
5981 "Use isolate version",
6025 "Use isolate version",
6033 "Use isolate version",
void RemoveMessageListeners(
MessageCallback that));
6040 "Use isolate version",
6041 void SetCaptureStackTraceForUncaughtExceptions(
6042 bool capture,
int frame_limit = 10,
6062 "Use isolate version",
6076 "Use isolate version",
6085 "Use isolate version",
6099 "Use isolate version",
6108 "Use isolate version",
6116 "Use isolate version",
6125 "Use isolate version",
6145 ReturnAddressLocationResolver return_address_resolver);
6157 void TerminateExecution(
Isolate* isolate));
6170 "Use isolate version",
6171 bool IsExecutionTerminating(
Isolate* isolate = NULL));
6190 "Use isolate version",
void CancelTerminateExecution(
Isolate* isolate));
6209 "Use isoalte version",
6217 "Use isolate version",
6225 "Use isolate version",
6226 void VisitHandlesWithClassIds(
Isolate* isolate,
6237 "Use isolate version",
6238 void VisitHandlesForPartialDependence(
Isolate* isolate,
6268 static void DisposeGlobal(
internal::Object** global_handle);
6270 static void MakeWeak(
internal::Object** global_handle,
void* data,
6271 WeakCallback weak_callback);
6272 static void MakeWeak(
internal::Object** global_handle,
void* data,
6275 static void MakeWeak(
internal::Object** global_handle,
void* data,
6277 int internal_field_index1,
6279 int internal_field_index2,
6281 static void* ClearWeak(
internal::Object** global_handle);
6282 static void Eternalize(
Isolate* isolate,
6287 static void FromJustIsNothing();
6288 static void ToLocalEmpty();
6289 static void InternalFieldOutOfBounds(
int index);
6327 return has_value ? value : default_value;
6331 return (
IsJust() == other.IsJust()) &&
6340 Maybe() : has_value(
false) {}
6341 explicit Maybe(
const T& t) : has_value(
true), value(t) {}
6493 if (handler == NULL)
return NULL;
6494 return handler->js_stack_comparable_address_;
6498 void ResetInternal();
6503 void* operator
new(size_t size);
6504 void operator
delete(
void*, size_t);
6510 void* js_stack_comparable_address_;
6511 bool is_verbose_ : 1;
6512 bool can_continue_ : 1;
6513 bool capture_message_ : 1;
6515 bool has_terminated_ : 1;
6531 : name_count_(name_count), names_(names) { }
6533 const char**
begin()
const {
return &names_[0]; }
6534 const char**
end()
const {
return &names_[name_count_]; }
6537 const int name_count_;
6538 const char** names_;
6712 void* SlowGetAlignedPointerFromEmbedderData(
int index);
6801 void Initialize(
Isolate* isolate);
6828 void Initialize(
Isolate* isolate);
6836 void operator=(
const Locker&);
6859 template <size_t ptr_size>
struct SmiTagging;
6861 template<
int kSmiShiftSize>
6864 uintptr_t tagged_value =
6865 (
static_cast<uintptr_t>(value) << smi_shift_bits) |
kSmiTag;
6866 return reinterpret_cast<
internal::Object*>(tagged_value);
6870 template <>
struct SmiTagging<4> {
6877 return static_cast<
int>(
reinterpret_cast<intptr_t>(value)) >> shift_bits;
6894 return static_cast<uintptr_t>(value + 0x40000000U) < 0x80000000U;
6899 template <>
struct SmiTagging<8> {
6906 return static_cast<
int>(
reinterpret_cast<intptr_t>(value) >> shift_bits);
6913 return (value ==
static_cast<int32_t>(value));
6987 #ifdef V8_ENABLE_CHECKS
6988 CheckInitializedImpl(isolate);
7029 return *addr &
static_cast<uint8_t>(1U << shift);
7033 bool value,
int shift) {
7035 uint8_t mask =
static_cast<uint8_t>(1U << shift);
7036 *addr =
static_cast<uint8_t>((*addr & ~mask) | (value << shift));
7053 uint8_t *addr =
reinterpret_cast<uint8_t *>(isolate) +
7055 *
reinterpret_cast<
void**>(addr) = data;
7060 const uint8_t* addr =
reinterpret_cast<
const uint8_t*>(isolate) +
7062 return *
reinterpret_cast<
void*
const*>(addr);
7071 template <
typename T>
7073 const uint8_t* addr =
7075 return *
reinterpret_cast<
const T*>(addr);
7078 template <
typename T>
7082 O* ctx = *
reinterpret_cast<O*
const*>(context);
7088 return I::ReadField<T>(embedder_data, value_offset);
7097 return New(isolate, that.val_);
7102 return New(isolate, that.val_);
7108 if (that == NULL)
return Local<T>();
7112 reinterpret_cast<
internal::Isolate*>(isolate)
, *p
)));
7120 V8::Eternalize(isolate,
reinterpret_cast<
Value*>(*handle), &
this->index_);
7126 return Local<T>(
reinterpret_cast<T*>(
*V8::GetEternal(isolate, index_)));
7133 return Local<T>(val_);
7139 #ifdef V8_ENABLE_CHECKS
7140 if (index < 0 || index >= kInternalFieldsInWeakCallback) {
7141 V8::InternalFieldOutOfBounds(index);
7144 return internal_fields_[index];
7150 if (that == NULL)
return NULL;
7152 return reinterpret_cast<T*>(
7153 V8::GlobalizeReference(
reinterpret_cast<
internal::Isolate*>(isolate),
7158 template <
class T,
class M>
7159 template <
class S,
class M2>
7163 if (that.IsEmpty())
return;
7165 this->val_ =
reinterpret_cast<T*>(
V8::CopyPersistent(p));
7166 M::Copy(that,
this);
7173 if (
this->IsEmpty())
return false;
7182 if (
this->IsEmpty())
return false;
7183 uint8_t node_state =
7193 if (
this->IsEmpty())
return false;
7201 if (
this->IsEmpty())
return;
7202 V8::DisposeGlobal(
reinterpret_cast<
internal::Object**>(
this->val_));
7212 if (other.IsEmpty())
return;
7213 this->val_ = New(isolate, other.val_);
7223 if (other.IsEmpty())
return;
7224 this->val_ = New(isolate, other.val_);
7229 template <
typename S,
typename P>
7235 V8::MakeWeak(
reinterpret_cast<
internal::Object**>(
this->val_), parameter,
7236 reinterpret_cast<Callback>(callback));
7241 template <
typename P>
7245 SetWeak<T, P>(parameter, callback);
7250 template <
typename P>
7253 int internal_field_index1,
int internal_field_index2) {
7255 V8::MakeWeak(
reinterpret_cast<
internal::Object**>(
this->val_), parameter,
7256 internal_field_index1, internal_field_index2,
7257 reinterpret_cast<Callback>(callback));
7262 template <
typename P>
7267 V8::MakeWeak(
reinterpret_cast<
internal::Object**>(
this->val_), parameter,
7268 reinterpret_cast<Callback>(callback), type);
7273 template <
typename P>
7275 return reinterpret_cast<P*>(
7276 V8::ClearWeak(
reinterpret_cast<
internal::Object**>(
this->val_)));
7283 if (
this->IsEmpty())
return;
7293 if (
this->IsEmpty())
return;
7303 if (
this->IsEmpty())
return;
7306 *
reinterpret_cast<uint16_t*>(addr) = class_id;
7313 if (
this->IsEmpty())
return 0;
7316 return *
reinterpret_cast<uint16_t*>(addr);
7320 template<
typename T>
7323 template<
typename T>
7324 template<
typename S>
7328 *value_ = GetDefaultValue();
7330 *value_ = *
reinterpret_cast<
internal::Object**>(*handle);
7334 template <
typename T>
7335 template <
typename S>
7339 *value_ = GetDefaultValue();
7341 *value_ = *
reinterpret_cast<
internal::Object**>(*handle);
7345 template <
typename T>
7346 template <
typename S>
7350 *value_ = GetDefaultValue();
7352 *value_ = *
reinterpret_cast<
internal::Object**>(*handle);
7356 template<
typename T>
7362 template<
typename T>
7373 template<
typename T>
7377 bool fits_into_int32_t = (i & (1U << 31)) == 0;
7379 Set(
static_cast<int32_t>(i));
7385 template<
typename T>
7398 template<
typename T>
7405 template<
typename T>
7412 template<
typename T>
7419 template<
typename T>
7422 return *
reinterpret_cast<
Isolate**>(&value_[-2]);
7425 template<
typename T>
7426 template<
typename S>
7432 template<
typename T>
7439 template<
typename T>
7443 bool is_construct_call)
7450 template<
typename T>
7457 template<
typename T>
7464 template<
typename T>
7470 template<
typename T>
7477 template<
typename T>
7483 template<
typename T>
7489 template<
typename T>
7495 template<
typename T>
7501 template<
typename T>
7514 : resource_name_(resource_name),
7515 resource_line_offset_(resource_line_offset),
7516 resource_column_offset_(resource_column_offset),
7517 options_
(!resource_is_embedder_debug_script
.IsEmpty() &&
7519 !resource_is_shared_cross_origin
.IsEmpty() &&
7522 script_id_(script_id),
7523 source_map_url_(source_map_url) {}
7529 return resource_line_offset_;
7534 return resource_column_offset_;
7546 : source_string(string),
7552 cached_data(data) {}
7557 : source_string(string), cached_data(data) {}
7584 #ifndef V8_ENABLE_CHECKS
7588 O* obj = *
reinterpret_cast<O**>(
this);
7594 O** result =
HandleScope::CreateHandle(
reinterpret_cast<HO*>(obj), value);
7598 return SlowGetInternalField(index);
7603 #ifndef V8_ENABLE_CHECKS
7606 O* obj = *
reinterpret_cast<O**>(
this);
7614 return SlowGetAlignedPointerFromInternalField(index);
7619 #ifdef V8_ENABLE_CHECKS
7622 return static_cast<
String*>(value);
7638 O* obj = *
reinterpret_cast<O*
const*>(
this);
7646 #ifdef V8_ENABLE_CHECKS
7647 VerifyExternalStringResource(result);
7657 O* obj = *
reinterpret_cast<O*
const*>(
this);
7666 #ifdef V8_ENABLE_CHECKS
7667 VerifyExternalStringResourceBase(resource, *encoding_out);
7674 #ifdef V8_ENABLE_CHECKS
7675 return FullIsUndefined();
7677 return QuickIsUndefined();
7681 bool Value::QuickIsUndefined()
const {
7684 O* obj = *
reinterpret_cast<O*
const*>(
this);
7692 #ifdef V8_ENABLE_CHECKS
7693 return FullIsNull();
7695 return QuickIsNull();
7699 bool Value::QuickIsNull()
const {
7702 O* obj = *
reinterpret_cast<O*
const*>(
this);
7710 #ifdef V8_ENABLE_CHECKS
7711 return FullIsString();
7713 return QuickIsString();
7717 bool Value::QuickIsString()
const {
7720 O* obj = *
reinterpret_cast<O*
const*>(
this);
7727 return static_cast<
Value*>(value);
7780 #ifdef V8_ENABLE_CHECKS
7783 return static_cast<
Boolean*>(value);
7788 #ifdef V8_ENABLE_CHECKS
7791 return static_cast<
Name*>(value);
7796 #ifdef V8_ENABLE_CHECKS
7799 return static_cast<
Symbol*>(value);
7804 #ifdef V8_ENABLE_CHECKS
7807 return static_cast<
Number*>(value);
7812 #ifdef V8_ENABLE_CHECKS
7815 return static_cast<
Integer*>(value);
7820 #ifdef V8_ENABLE_CHECKS
7823 return static_cast<
Int32*>(value);
7828 #ifdef V8_ENABLE_CHECKS
7831 return static_cast<
Uint32*>(value);
7836 #ifdef V8_ENABLE_CHECKS
7839 return static_cast<
Date*>(value);
7844 #ifdef V8_ENABLE_CHECKS
7852 #ifdef V8_ENABLE_CHECKS
7860 #ifdef V8_ENABLE_CHECKS
7868 #ifdef V8_ENABLE_CHECKS
7876 #ifdef V8_ENABLE_CHECKS
7879 return static_cast<
RegExp*>(value);
7884 #ifdef V8_ENABLE_CHECKS
7887 return static_cast<
Object*>(value);
7892 #ifdef V8_ENABLE_CHECKS
7895 return static_cast<
Array*>(value);
7900 #ifdef V8_ENABLE_CHECKS
7903 return static_cast<
Map*>(value);
7908 #ifdef V8_ENABLE_CHECKS
7911 return static_cast<
Set*>(value);
7916 #ifdef V8_ENABLE_CHECKS
7919 return static_cast<
Promise*>(value);
7924 #ifdef V8_ENABLE_CHECKS
7932 #ifdef V8_ENABLE_CHECKS
7940 #ifdef V8_ENABLE_CHECKS
7948 #ifdef V8_ENABLE_CHECKS
7956 #ifdef V8_ENABLE_CHECKS
7964 #ifdef V8_ENABLE_CHECKS
7972 #ifdef V8_ENABLE_CHECKS
7980 #ifdef V8_ENABLE_CHECKS
7988 #ifdef V8_ENABLE_CHECKS
7996 #ifdef V8_ENABLE_CHECKS
8004 #ifdef V8_ENABLE_CHECKS
8012 #ifdef V8_ENABLE_CHECKS
8020 #ifdef V8_ENABLE_CHECKS
8028 #ifdef V8_ENABLE_CHECKS
8031 return static_cast<
DataView*>(value);
8036 #ifdef V8_ENABLE_CHECKS
8044 #ifdef V8_ENABLE_CHECKS
8047 return static_cast<
Function*>(value);
8052 #ifdef V8_ENABLE_CHECKS
8055 return static_cast<
External*>(value);
8059 template<
typename T>
8065 template<
typename T>
8071 template<
typename T>
8077 template<
typename T>
8083 template<
typename T>
8144 int64_t change_in_bytes) {
8146 int64_t* amount_of_external_allocated_memory =
8147 reinterpret_cast<int64_t*>(
reinterpret_cast<uint8_t*>(
this) +
8149 int64_t* amount_of_external_allocated_memory_at_last_global_gc =
8150 reinterpret_cast<int64_t*>(
8151 reinterpret_cast<uint8_t*>(
this) +
8153 int64_t amount = *amount_of_external_allocated_memory + change_in_bytes;
8154 if (change_in_bytes > 0 &&
8155 amount - *amount_of_external_allocated_memory_at_last_global_gc >
8157 CollectAllGarbage(
"external memory allocation limit reached.");
8159 *amount_of_external_allocated_memory = amount;
8160 return *amount_of_external_allocated_memory;
8164 template<
typename T>
8168 SetObjectGroupId(
reinterpret_cast<
v8::
internal::Object**>(object.val_), id);
8172 template<
typename T>
8176 SetReferenceFromGroup(id,
8177 reinterpret_cast<
v8::
internal::Object**>(object.val_));
8181 template<
typename T,
typename S>
8186 SetReference(
reinterpret_cast<
v8::
internal::Object**>(parent.val_),
8187 reinterpret_cast<
v8::
internal::Object**>(child.val_));
8192 #ifndef V8_ENABLE_CHECKS
8196 HO* context = *
reinterpret_cast<HO**>(
this);
8201 return SlowGetEmbedderData(index);
8207 #ifndef V8_ENABLE_CHECKS
8211 return SlowGetAlignedPointerFromEmbedderData(index);
8216 void V8::SetAllowCodeGenerationFromStringsCallback(
8241 void V8::SetFailedAccessCheckCallbackFunction(
8248 void V8::SetCaptureStackTraceForUncaughtExceptions(
8293 bool V8::IsExecutionTerminating(
Isolate* isolate) {
8294 if (isolate == NULL) {
8301 void V8::CancelTerminateExecution(
Isolate* isolate) {
8318 void V8::VisitHandlesWithClassIds(
Isolate* isolate,
8324 void V8::VisitHandlesForPartialDependence(
Isolate* isolate,