30 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
31 #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the
32 build configuration to ensure that at most one of these is set
35 #ifdef BUILDING_V8_SHARED
36 # define V8_EXPORT __declspec(dllexport)
38 # define V8_EXPORT __declspec(dllimport)
46 #if V8_HAS_ATTRIBUTE_VISIBILITY
&& defined(V8_SHARED)
47 # ifdef BUILDING_V8_SHARED
48 # define V8_EXPORT __attribute__ ((visibility("default")))
76 class ImplementationUtilities;
100 template <
class T>
class Handle;
101 template <
class T>
class Local;
102 template <
class T>
class Eternal;
103 template<
class T>
class NonCopyablePersistentTraits;
106 class M = NonCopyablePersistentTraits<T> >
class Persistent;
110 template<
class T,
class P>
class WeakCallbackObject;
122 class CallHandlerHelper;
133 class PropertyCallbackArguments;
134 class FunctionCallbackArguments;
148 return data_ == other.data_;
152 return data_ != other.data_;
156 return data_ < other.data_;
165 #define TYPE_CHECK(T, S)
167 *(static_cast<T* volatile*>(0
)) = static_cast<S*>(0
);
214 : val_(
reinterpret_cast<T*>(*that)) {
246 if (a == 0)
return b == 0;
247 if (b == 0)
return false;
255 if (a == 0)
return b == 0;
256 if (b == 0)
return false;
267 return !operator==(that);
272 return !operator==(that);
276 #ifdef V8_ENABLE_CHECKS
279 if (that.IsEmpty())
return Handle<T>();
281 return Handle<T>(T::Cast(*that));
285 return Handle<S>::Cast(*
this);
289 return New(isolate, that.val_);
293 return New(isolate, that.val_);
301 template<
class F>
friend class Local;
317 V8_INLINE explicit Handle(T* val) : val_(val) {}
336 :
Handle<T>(
reinterpret_cast<T*>(*that)) {
347 #ifdef V8_ENABLE_CHECKS
350 if (that.IsEmpty())
return Local<T>();
352 return Local<T>(T::Cast(*that));
355 :
Handle<T>(
reinterpret_cast<T*>(*that)) {
360 return Local<S>::Cast(*
this);
378 template<
class F>
friend class Local;
401 Set(isolate, handle);
409 static const int kInitialValue = -1;
414 template<
class T,
class P>
425 WeakCallbackData(
Isolate* isolate,
Local<T> handle, P* parameter)
426 : isolate_(isolate), handle_(handle), parameter_(parameter) { }
473 if (a == 0)
return b == 0;
474 if (b == 0)
return false;
481 if (a == 0)
return b == 0;
482 if (b == 0)
return false;
488 return !operator==(that);
492 return !operator==(that);
507 template<
typename S,
typename P>
560 template<
class F>
friend class Local;
569 explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
585 class NonCopyablePersistentTraits {
589 template<
class S,
class M>
609 template<
class S,
class M>
645 template <
class S,
class M2>
659 template <
class S,
class M2>
667 template <
class S,
class M2>
678 if (M::kResetInDestructor)
this->Reset();
684 #ifdef V8_ENABLE_CHECKS
687 if (!that.IsEmpty()) T::Cast(*that);
689 return reinterpret_cast<
Persistent<T>&>(that);
704 template<
class F>
friend class Local;
709 V8_INLINE T* operator*()
const {
return this->val_; }
710 template<
class S,
class M2>
757 rvalue.object->val_ = 0;
767 this->val_ = rhs.val_;
812 return reinterpret_cast<
Isolate*>(isolate_);
832 void* operator
new(size_t size);
833 void operator
delete(
void*, size_t);
840 template<
class F>
friend class Local;
865 Escape(
reinterpret_cast<
internal::Object**>(*value));
866 return Local<T>(
reinterpret_cast<T*>(slot));
876 void* operator
new(size_t size);
877 void operator
delete(
void*, size_t);
928 : resource_name_(resource_name),
929 resource_line_offset_(resource_line_offset),
930 resource_column_offset_(resource_column_offset),
931 resource_is_shared_cross_origin_(resource_is_shared_cross_origin),
932 script_id_(script_id) { }
1570 V8_INLINE bool QuickIsUndefined()
const;
1573 bool FullIsUndefined()
const;
1574 bool FullIsNull()
const;
1575 bool FullIsString()
const;
1680 int* nchars_ref = NULL,
1739 virtual const uint16_t*
data()
const = 0;
1770 virtual const char*
data()
const = 0;
1814 const uint8_t* data,
1821 const uint16_t* data,
1921 Value(
const Value&);
1922 void operator=(
const Value&);
1929 static void CheckCast(
v8::
Value* obj);
1961 static void CheckCast(
v8::
Value* obj);
2003 static void CheckCast(
v8::
Value* obj);
2018 static void CheckCast(
v8::
Value* obj);
2360 int number_of_elements);
2394 static void CheckCast(
Value* obj);
2395 Local<
Value> SlowGetInternalField(
int index);
2396 void* SlowGetAlignedPointerFromInternalField(
int index);
2422 static void CheckCast(
Value* obj);
2426 template<
typename T>
2430 : value_(that.value_) {
2449 template <
typename S>
2470 template<
typename T>
2499 bool is_construct_call);
2511 template<
typename T>
2523 friend class MacroAssembler;
2608 static void CheckCast(
Value* obj);
2641 static void CheckCast(
Value* obj);
2658 static void CheckCast(
Value* obj);
2662 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
2664 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
2699 virtual void Free(
void* data, size_t length) = 0;
2716 void*
Data()
const {
return data_; }
2721 size_t byte_length_;
2747 size_t byte_length);
2780 static void CheckCast(
Value* obj);
2784 #ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
2786 #define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
2818 static void CheckCast(
Value* obj);
2839 static void CheckCast(
Value* obj);
2850 size_t byte_offset, size_t length);
2855 static void CheckCast(
Value* obj);
2866 size_t byte_offset, size_t length);
2870 Uint8ClampedArray();
2871 static void CheckCast(
Value* obj);
2881 size_t byte_offset, size_t length);
2886 static void CheckCast(
Value* obj);
2897 size_t byte_offset, size_t length);
2902 static void CheckCast(
Value* obj);
2913 size_t byte_offset, size_t length);
2918 static void CheckCast(
Value* obj);
2929 size_t byte_offset, size_t length);
2934 static void CheckCast(
Value* obj);
2945 size_t byte_offset, size_t length);
2950 static void CheckCast(
Value* obj);
2961 size_t byte_offset, size_t length);
2966 static void CheckCast(
Value* obj);
2977 size_t byte_offset, size_t length);
2982 static void CheckCast(
Value* obj);
2993 size_t byte_offset, size_t length);
2998 static void CheckCast(
Value* obj);
3032 static void CheckCast(
v8::
Value* obj);
3048 static void CheckCast(
v8::
Value* obj);
3064 static void CheckCast(
v8::
Value* obj);
3080 static void CheckCast(
v8::
Value* obj);
3098 static void CheckCast(
v8::
Value* obj);
3144 static void CheckCast(
v8::
Value* obj);
3158 static void CheckCast(
v8::
Value* obj);
3670 bool turned_on_by_default =
true);
3720 AccessorSignature();
3726 DeclaredAccessorDescriptor();
3735 int internal_field);
3737 ObjectOperationDescriptor();
3755 int16_t byte_offset);
3757 void* compare_value);
3761 uint8_t bool_offset = 0);
3764 uint8_t compare_value);
3768 uint16_t compare_value);
3772 uint32_t compare_value);
3775 RawOperationDescriptor();
3800 : data_(data), length_(length) {}
3801 const char*
data()
const {
return data_; }
3817 const char* source = 0,
3819 const char** deps = 0,
3820 int source_length = -1);
3827 const char*
name()
const {
return name_; }
3838 size_t source_length_;
3886 uint64_t virtual_memory_limit,
3887 uint32_t number_of_processors);
3901 max_available_threads_ = value;
3905 code_range_size_ = value;
3909 int max_semi_space_size_;
3910 int max_old_space_size_;
3911 int max_executable_size_;
3912 uint32_t* stack_limit_;
3913 int max_available_threads_;
3914 size_t code_range_size_;
4049 size_t total_heap_size_;
4050 size_t total_heap_size_executable_;
4051 size_t total_physical_size_;
4052 size_t used_heap_size_;
4053 size_t heap_size_limit_;
4089 Scope(
const Scope&);
4124 void* internal_throws_;
4125 void* internal_assert_;
4322 template<
typename T,
typename S>
4498 void* operator
new(size_t size);
4499 void operator
delete(
void*, size_t);
4504 void CollectAllGarbage(
const char* gc_reason);
4537 const char* compressed_data,
4538 int compressed_data_size) = 0;
4565 typedef uintptr_t (*ReturnAddressLocationResolver)(
4566 uintptr_t return_addr_location);
4581 uintptr_t return_addr_location);
4686 uint16_t class_id) {}
4784 int frame_limit = 10,