OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 * Counts the number of allocated handles. | 860 * Counts the number of allocated handles. |
861 */ | 861 */ |
862 static int NumberOfHandles(Isolate* isolate); | 862 static int NumberOfHandles(Isolate* isolate); |
863 | 863 |
864 V8_INLINE Isolate* GetIsolate() const { | 864 V8_INLINE Isolate* GetIsolate() const { |
865 return reinterpret_cast<Isolate*>(isolate_); | 865 return reinterpret_cast<Isolate*>(isolate_); |
866 } | 866 } |
867 | 867 |
868 HandleScope(const HandleScope&) = delete; | 868 HandleScope(const HandleScope&) = delete; |
869 void operator=(const HandleScope&) = delete; | 869 void operator=(const HandleScope&) = delete; |
870 void* operator new(size_t size) = delete; | 870 void* operator new(size_t size); |
871 void operator delete(void*, size_t) = delete; | 871 void operator delete(void*, size_t); |
872 | 872 |
873 protected: | 873 protected: |
874 V8_INLINE HandleScope() {} | 874 V8_INLINE HandleScope() {} |
875 | 875 |
876 void Initialize(Isolate* isolate); | 876 void Initialize(Isolate* isolate); |
877 | 877 |
878 static internal::Object** CreateHandle(internal::Isolate* isolate, | 878 static internal::Object** CreateHandle(internal::Isolate* isolate, |
879 internal::Object* value); | 879 internal::Object* value); |
880 | 880 |
881 private: | 881 private: |
(...skipping 30 matching lines...) Expand all Loading... |
912 */ | 912 */ |
913 template <class T> | 913 template <class T> |
914 V8_INLINE Local<T> Escape(Local<T> value) { | 914 V8_INLINE Local<T> Escape(Local<T> value) { |
915 internal::Object** slot = | 915 internal::Object** slot = |
916 Escape(reinterpret_cast<internal::Object**>(*value)); | 916 Escape(reinterpret_cast<internal::Object**>(*value)); |
917 return Local<T>(reinterpret_cast<T*>(slot)); | 917 return Local<T>(reinterpret_cast<T*>(slot)); |
918 } | 918 } |
919 | 919 |
920 EscapableHandleScope(const EscapableHandleScope&) = delete; | 920 EscapableHandleScope(const EscapableHandleScope&) = delete; |
921 void operator=(const EscapableHandleScope&) = delete; | 921 void operator=(const EscapableHandleScope&) = delete; |
922 void* operator new(size_t size) = delete; | 922 void* operator new(size_t size); |
923 void operator delete(void*, size_t) = delete; | 923 void operator delete(void*, size_t); |
924 | 924 |
925 private: | 925 private: |
926 internal::Object** Escape(internal::Object** escape_value); | 926 internal::Object** Escape(internal::Object** escape_value); |
927 internal::Object** escape_slot_; | 927 internal::Object** escape_slot_; |
928 }; | 928 }; |
929 | 929 |
930 class V8_EXPORT SealHandleScope { | 930 class V8_EXPORT SealHandleScope { |
931 public: | 931 public: |
932 SealHandleScope(Isolate* isolate); | 932 SealHandleScope(Isolate* isolate); |
933 ~SealHandleScope(); | 933 ~SealHandleScope(); |
934 | 934 |
935 SealHandleScope(const SealHandleScope&) = delete; | 935 SealHandleScope(const SealHandleScope&) = delete; |
936 void operator=(const SealHandleScope&) = delete; | 936 void operator=(const SealHandleScope&) = delete; |
937 void* operator new(size_t size) = delete; | 937 void* operator new(size_t size); |
938 void operator delete(void*, size_t) = delete; | 938 void operator delete(void*, size_t); |
939 | 939 |
940 private: | 940 private: |
941 internal::Isolate* const isolate_; | 941 internal::Isolate* const isolate_; |
942 internal::Object** prev_limit_; | 942 internal::Object** prev_limit_; |
943 int prev_sealed_level_; | 943 int prev_sealed_level_; |
944 }; | 944 }; |
945 | 945 |
946 | 946 |
947 // --- Special objects --- | 947 // --- Special objects --- |
948 | 948 |
(...skipping 6906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7855 * UseAfterReturn is enabled, then the address returned will be the address | 7855 * UseAfterReturn is enabled, then the address returned will be the address |
7856 * of the C++ try catch handler itself. | 7856 * of the C++ try catch handler itself. |
7857 */ | 7857 */ |
7858 static void* JSStackComparableAddress(v8::TryCatch* handler) { | 7858 static void* JSStackComparableAddress(v8::TryCatch* handler) { |
7859 if (handler == NULL) return NULL; | 7859 if (handler == NULL) return NULL; |
7860 return handler->js_stack_comparable_address_; | 7860 return handler->js_stack_comparable_address_; |
7861 } | 7861 } |
7862 | 7862 |
7863 TryCatch(const TryCatch&) = delete; | 7863 TryCatch(const TryCatch&) = delete; |
7864 void operator=(const TryCatch&) = delete; | 7864 void operator=(const TryCatch&) = delete; |
7865 void* operator new(size_t size) = delete; | 7865 void* operator new(size_t size); |
7866 void operator delete(void*, size_t) = delete; | 7866 void operator delete(void*, size_t); |
7867 | 7867 |
7868 private: | 7868 private: |
7869 void ResetInternal(); | 7869 void ResetInternal(); |
7870 | 7870 |
7871 v8::internal::Isolate* isolate_; | 7871 v8::internal::Isolate* isolate_; |
7872 v8::TryCatch* next_; | 7872 v8::TryCatch* next_; |
7873 void* exception_; | 7873 void* exception_; |
7874 void* message_obj_; | 7874 void* message_obj_; |
7875 void* js_stack_comparable_address_; | 7875 void* js_stack_comparable_address_; |
7876 bool is_verbose_ : 1; | 7876 bool is_verbose_ : 1; |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9731 */ | 9731 */ |
9732 | 9732 |
9733 | 9733 |
9734 } // namespace v8 | 9734 } // namespace v8 |
9735 | 9735 |
9736 | 9736 |
9737 #undef TYPE_CHECK | 9737 #undef TYPE_CHECK |
9738 | 9738 |
9739 | 9739 |
9740 #endif // INCLUDE_V8_H_ | 9740 #endif // INCLUDE_V8_H_ |
OLD | NEW |