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 4868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4879 void V8_EXPORT RegisterExtension(Extension* extension); | 4879 void V8_EXPORT RegisterExtension(Extension* extension); |
4880 | 4880 |
4881 | 4881 |
4882 // --- Statics --- | 4882 // --- Statics --- |
4883 | 4883 |
4884 V8_INLINE Local<Primitive> Undefined(Isolate* isolate); | 4884 V8_INLINE Local<Primitive> Undefined(Isolate* isolate); |
4885 V8_INLINE Local<Primitive> Null(Isolate* isolate); | 4885 V8_INLINE Local<Primitive> Null(Isolate* isolate); |
4886 V8_INLINE Local<Boolean> True(Isolate* isolate); | 4886 V8_INLINE Local<Boolean> True(Isolate* isolate); |
4887 V8_INLINE Local<Boolean> False(Isolate* isolate); | 4887 V8_INLINE Local<Boolean> False(Isolate* isolate); |
4888 | 4888 |
4889 | |
4890 /** | 4889 /** |
4891 * A set of constraints that specifies the limits of the runtime's memory use. | 4890 * A set of constraints that specifies the limits of the runtime's memory use. |
4892 * You must set the heap size before initializing the VM - the size cannot be | 4891 * You must set the heap size before initializing the VM - the size cannot be |
4893 * adjusted after the VM is initialized. | 4892 * adjusted after the VM is initialized. |
4894 * | 4893 * |
4895 * If you are using threads then you should hold the V8::Locker lock while | 4894 * If you are using threads then you should hold the V8::Locker lock while |
4896 * setting the stack limit and you must set a non-default stack limit separately | 4895 * setting the stack limit and you must set a non-default stack limit separately |
4897 * for each thread. | 4896 * for each thread. |
| 4897 * |
| 4898 * The arguments for set_max_semi_space_size, set_max_old_space_size, |
| 4899 * set_max_executable_size, set_code_range_size specify limits in MB. |
4898 */ | 4900 */ |
4899 class V8_EXPORT ResourceConstraints { | 4901 class V8_EXPORT ResourceConstraints { |
4900 public: | 4902 public: |
4901 ResourceConstraints(); | 4903 ResourceConstraints(); |
4902 | 4904 |
4903 /** | 4905 /** |
4904 * Configures the constraints with reasonable default values based on the | 4906 * Configures the constraints with reasonable default values based on the |
4905 * capabilities of the current device the VM is running on. | 4907 * capabilities of the current device the VM is running on. |
4906 * | 4908 * |
4907 * \param physical_memory The total amount of physical memory on the current | 4909 * \param physical_memory The total amount of physical memory on the current |
4908 * device, in bytes. | 4910 * device, in bytes. |
4909 * \param virtual_memory_limit The amount of virtual memory on the current | 4911 * \param virtual_memory_limit The amount of virtual memory on the current |
4910 * device, in bytes, or zero, if there is no limit. | 4912 * device, in bytes, or zero, if there is no limit. |
4911 */ | 4913 */ |
4912 void ConfigureDefaults(uint64_t physical_memory, | 4914 void ConfigureDefaults(uint64_t physical_memory, |
4913 uint64_t virtual_memory_limit); | 4915 uint64_t virtual_memory_limit); |
4914 | 4916 |
4915 int max_semi_space_size() const { return max_semi_space_size_; } | 4917 int max_semi_space_size() const { return max_semi_space_size_; } |
4916 void set_max_semi_space_size(int value) { max_semi_space_size_ = value; } | 4918 void set_max_semi_space_size(int limit_in_mb) { |
| 4919 max_semi_space_size_ = limit_in_mb; |
| 4920 } |
4917 int max_old_space_size() const { return max_old_space_size_; } | 4921 int max_old_space_size() const { return max_old_space_size_; } |
4918 void set_max_old_space_size(int value) { max_old_space_size_ = value; } | 4922 void set_max_old_space_size(int limit_in_mb) { |
| 4923 max_old_space_size_ = limit_in_mb; |
| 4924 } |
4919 int max_executable_size() const { return max_executable_size_; } | 4925 int max_executable_size() const { return max_executable_size_; } |
4920 void set_max_executable_size(int value) { max_executable_size_ = value; } | 4926 void set_max_executable_size(int limit_in_mb) { |
| 4927 max_executable_size_ = limit_in_mb; |
| 4928 } |
4921 uint32_t* stack_limit() const { return stack_limit_; } | 4929 uint32_t* stack_limit() const { return stack_limit_; } |
4922 // Sets an address beyond which the VM's stack may not grow. | 4930 // Sets an address beyond which the VM's stack may not grow. |
4923 void set_stack_limit(uint32_t* value) { stack_limit_ = value; } | 4931 void set_stack_limit(uint32_t* value) { stack_limit_ = value; } |
4924 size_t code_range_size() const { return code_range_size_; } | 4932 size_t code_range_size() const { return code_range_size_; } |
4925 void set_code_range_size(size_t value) { | 4933 void set_code_range_size(size_t limit_in_mb) { |
4926 code_range_size_ = value; | 4934 code_range_size_ = limit_in_mb; |
4927 } | 4935 } |
4928 | 4936 |
4929 private: | 4937 private: |
4930 int max_semi_space_size_; | 4938 int max_semi_space_size_; |
4931 int max_old_space_size_; | 4939 int max_old_space_size_; |
4932 int max_executable_size_; | 4940 int max_executable_size_; |
4933 uint32_t* stack_limit_; | 4941 uint32_t* stack_limit_; |
4934 size_t code_range_size_; | 4942 size_t code_range_size_; |
4935 }; | 4943 }; |
4936 | 4944 |
(...skipping 3627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8564 */ | 8572 */ |
8565 | 8573 |
8566 | 8574 |
8567 } // namespace v8 | 8575 } // namespace v8 |
8568 | 8576 |
8569 | 8577 |
8570 #undef TYPE_CHECK | 8578 #undef TYPE_CHECK |
8571 | 8579 |
8572 | 8580 |
8573 #endif // INCLUDE_V8_H_ | 8581 #endif // INCLUDE_V8_H_ |
OLD | NEW |