| 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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 * context in which it was created (ScriptCompiler::CompileBound or | 1107 * context in which it was created (ScriptCompiler::CompileBound or |
| 1108 * UnboundScript::BindToCurrentContext()). | 1108 * UnboundScript::BindToCurrentContext()). |
| 1109 */ | 1109 */ |
| 1110 V8_DEPRECATE_SOON("Use maybe version", Local<Value> Run()); | 1110 V8_DEPRECATE_SOON("Use maybe version", Local<Value> Run()); |
| 1111 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Run(Local<Context> context); | 1111 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Run(Local<Context> context); |
| 1112 | 1112 |
| 1113 /** | 1113 /** |
| 1114 * Returns the corresponding context-unbound script. | 1114 * Returns the corresponding context-unbound script. |
| 1115 */ | 1115 */ |
| 1116 Local<UnboundScript> GetUnboundScript(); | 1116 Local<UnboundScript> GetUnboundScript(); |
| 1117 | |
| 1118 V8_DEPRECATED("Use GetUnboundScript()->GetId()", | |
| 1119 int GetId()) { | |
| 1120 return GetUnboundScript()->GetId(); | |
| 1121 } | |
| 1122 }; | 1117 }; |
| 1123 | 1118 |
| 1124 | 1119 |
| 1125 /** | 1120 /** |
| 1126 * For compiling scripts. | 1121 * For compiling scripts. |
| 1127 */ | 1122 */ |
| 1128 class V8_EXPORT ScriptCompiler { | 1123 class V8_EXPORT ScriptCompiler { |
| 1129 public: | 1124 public: |
| 1130 /** | 1125 /** |
| 1131 * Compilation data that the embedder can cache and pass back to speed up | 1126 * Compilation data that the embedder can cache and pass back to speed up |
| (...skipping 3671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4803 * capabilities of the current device the VM is running on. | 4798 * capabilities of the current device the VM is running on. |
| 4804 * | 4799 * |
| 4805 * \param physical_memory The total amount of physical memory on the current | 4800 * \param physical_memory The total amount of physical memory on the current |
| 4806 * device, in bytes. | 4801 * device, in bytes. |
| 4807 * \param virtual_memory_limit The amount of virtual memory on the current | 4802 * \param virtual_memory_limit The amount of virtual memory on the current |
| 4808 * device, in bytes, or zero, if there is no limit. | 4803 * device, in bytes, or zero, if there is no limit. |
| 4809 */ | 4804 */ |
| 4810 void ConfigureDefaults(uint64_t physical_memory, | 4805 void ConfigureDefaults(uint64_t physical_memory, |
| 4811 uint64_t virtual_memory_limit); | 4806 uint64_t virtual_memory_limit); |
| 4812 | 4807 |
| 4813 // Deprecated, will be removed soon. | |
| 4814 V8_DEPRECATED("Use two-args version instead", | |
| 4815 void ConfigureDefaults(uint64_t physical_memory, | |
| 4816 uint64_t virtual_memory_limit, | |
| 4817 uint32_t number_of_processors)); | |
| 4818 | |
| 4819 int max_semi_space_size() const { return max_semi_space_size_; } | 4808 int max_semi_space_size() const { return max_semi_space_size_; } |
| 4820 void set_max_semi_space_size(int value) { max_semi_space_size_ = value; } | 4809 void set_max_semi_space_size(int value) { max_semi_space_size_ = value; } |
| 4821 int max_old_space_size() const { return max_old_space_size_; } | 4810 int max_old_space_size() const { return max_old_space_size_; } |
| 4822 void set_max_old_space_size(int value) { max_old_space_size_ = value; } | 4811 void set_max_old_space_size(int value) { max_old_space_size_ = value; } |
| 4823 int max_executable_size() const { return max_executable_size_; } | 4812 int max_executable_size() const { return max_executable_size_; } |
| 4824 void set_max_executable_size(int value) { max_executable_size_ = value; } | 4813 void set_max_executable_size(int value) { max_executable_size_ = value; } |
| 4825 uint32_t* stack_limit() const { return stack_limit_; } | 4814 uint32_t* stack_limit() const { return stack_limit_; } |
| 4826 // Sets an address beyond which the VM's stack may not grow. | 4815 // Sets an address beyond which the VM's stack may not grow. |
| 4827 void set_stack_limit(uint32_t* value) { stack_limit_ = value; } | 4816 void set_stack_limit(uint32_t* value) { stack_limit_ = value; } |
| 4828 V8_DEPRECATED("Unused, will be removed", int max_available_threads() const) { | |
| 4829 return max_available_threads_; | |
| 4830 } | |
| 4831 // Set the number of threads available to V8, assuming at least 1. | |
| 4832 V8_DEPRECATED("Unused, will be removed", | |
| 4833 void set_max_available_threads(int value)) { | |
| 4834 max_available_threads_ = value; | |
| 4835 } | |
| 4836 size_t code_range_size() const { return code_range_size_; } | 4817 size_t code_range_size() const { return code_range_size_; } |
| 4837 void set_code_range_size(size_t value) { | 4818 void set_code_range_size(size_t value) { |
| 4838 code_range_size_ = value; | 4819 code_range_size_ = value; |
| 4839 } | 4820 } |
| 4840 | 4821 |
| 4841 private: | 4822 private: |
| 4842 int max_semi_space_size_; | 4823 int max_semi_space_size_; |
| 4843 int max_old_space_size_; | 4824 int max_old_space_size_; |
| 4844 int max_executable_size_; | 4825 int max_executable_size_; |
| 4845 uint32_t* stack_limit_; | 4826 uint32_t* stack_limit_; |
| 4846 int max_available_threads_; | |
| 4847 size_t code_range_size_; | 4827 size_t code_range_size_; |
| 4848 }; | 4828 }; |
| 4849 | 4829 |
| 4850 | 4830 |
| 4851 // --- Exceptions --- | 4831 // --- Exceptions --- |
| 4852 | 4832 |
| 4853 | 4833 |
| 4854 typedef void (*FatalErrorCallback)(const char* location, const char* message); | 4834 typedef void (*FatalErrorCallback)(const char* location, const char* message); |
| 4855 | 4835 |
| 4856 | 4836 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5369 * Creates a new isolate. Does not change the currently entered | 5349 * Creates a new isolate. Does not change the currently entered |
| 5370 * isolate. | 5350 * isolate. |
| 5371 * | 5351 * |
| 5372 * When an isolate is no longer used its resources should be freed | 5352 * When an isolate is no longer used its resources should be freed |
| 5373 * by calling Dispose(). Using the delete operator is not allowed. | 5353 * by calling Dispose(). Using the delete operator is not allowed. |
| 5374 * | 5354 * |
| 5375 * V8::Initialize() must have run prior to this. | 5355 * V8::Initialize() must have run prior to this. |
| 5376 */ | 5356 */ |
| 5377 static Isolate* New(const CreateParams& params); | 5357 static Isolate* New(const CreateParams& params); |
| 5378 | 5358 |
| 5379 static V8_DEPRECATED("Always pass CreateParams", Isolate* New()); | |
| 5380 | |
| 5381 /** | 5359 /** |
| 5382 * Returns the entered isolate for the current thread or NULL in | 5360 * Returns the entered isolate for the current thread or NULL in |
| 5383 * case there is no current isolate. | 5361 * case there is no current isolate. |
| 5384 * | 5362 * |
| 5385 * This method must not be invoked before V8::Initialize() was invoked. | 5363 * This method must not be invoked before V8::Initialize() was invoked. |
| 5386 */ | 5364 */ |
| 5387 static Isolate* GetCurrent(); | 5365 static Isolate* GetCurrent(); |
| 5388 | 5366 |
| 5389 /** | 5367 /** |
| 5390 * Methods below this point require holding a lock (using Locker) in | 5368 * Methods below this point require holding a lock (using Locker) in |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5971 | 5949 |
| 5972 /** | 5950 /** |
| 5973 * Set the callback to invoke to check if code generation from | 5951 * Set the callback to invoke to check if code generation from |
| 5974 * strings should be allowed. | 5952 * strings should be allowed. |
| 5975 */ | 5953 */ |
| 5976 V8_INLINE static V8_DEPRECATE_SOON( | 5954 V8_INLINE static V8_DEPRECATE_SOON( |
| 5977 "Use isolate version", void SetAllowCodeGenerationFromStringsCallback( | 5955 "Use isolate version", void SetAllowCodeGenerationFromStringsCallback( |
| 5978 AllowCodeGenerationFromStringsCallback that)); | 5956 AllowCodeGenerationFromStringsCallback that)); |
| 5979 | 5957 |
| 5980 /** | 5958 /** |
| 5981 * Set allocator to use for ArrayBuffer memory. | |
| 5982 * The allocator should be set only once. The allocator should be set | |
| 5983 * before any code tha uses ArrayBuffers is executed. | |
| 5984 * This allocator is used in all isolates. | |
| 5985 */ | |
| 5986 static V8_DEPRECATE_SOON( | |
| 5987 "Use isolate version", | |
| 5988 void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator)); | |
| 5989 | |
| 5990 /** | |
| 5991 * Check if V8 is dead and therefore unusable. This is the case after | 5959 * Check if V8 is dead and therefore unusable. This is the case after |
| 5992 * fatal errors such as out-of-memory situations. | 5960 * fatal errors such as out-of-memory situations. |
| 5993 */ | 5961 */ |
| 5994 V8_INLINE static V8_DEPRECATE_SOON("no alternative", bool IsDead()); | 5962 V8_INLINE static V8_DEPRECATE_SOON("no alternative", bool IsDead()); |
| 5995 | 5963 |
| 5996 /** | 5964 /** |
| 5997 * Hand startup data to V8, in case the embedder has chosen to build | 5965 * Hand startup data to V8, in case the embedder has chosen to build |
| 5998 * V8 with external startup data. | 5966 * V8 with external startup data. |
| 5999 * | 5967 * |
| 6000 * Note: | 5968 * Note: |
| (...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8344 */ | 8312 */ |
| 8345 | 8313 |
| 8346 | 8314 |
| 8347 } // namespace v8 | 8315 } // namespace v8 |
| 8348 | 8316 |
| 8349 | 8317 |
| 8350 #undef TYPE_CHECK | 8318 #undef TYPE_CHECK |
| 8351 | 8319 |
| 8352 | 8320 |
| 8353 #endif // V8_H_ | 8321 #endif // V8_H_ |
| OLD | NEW |