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 4885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4896 * thread at any given time. The Locker/Unlocker API must be used to | 4896 * thread at any given time. The Locker/Unlocker API must be used to |
4897 * synchronize. | 4897 * synchronize. |
4898 */ | 4898 */ |
4899 class V8_EXPORT Isolate { | 4899 class V8_EXPORT Isolate { |
4900 public: | 4900 public: |
4901 /** | 4901 /** |
4902 * Initial configuration parameters for a new Isolate. | 4902 * Initial configuration parameters for a new Isolate. |
4903 */ | 4903 */ |
4904 struct CreateParams { | 4904 struct CreateParams { |
4905 CreateParams() | 4905 CreateParams() |
4906 : entry_hook(NULL), code_event_handler(NULL), snapshot_blob(NULL) {} | 4906 : entry_hook(NULL), |
| 4907 code_event_handler(NULL), |
| 4908 snapshot_blob(NULL), |
| 4909 counter_lookup_callback(NULL), |
| 4910 create_histogram_callback(NULL), |
| 4911 add_histogram_sample_callback(NULL) {} |
4907 | 4912 |
4908 /** | 4913 /** |
4909 * The optional entry_hook allows the host application to provide the | 4914 * The optional entry_hook allows the host application to provide the |
4910 * address of a function that's invoked on entry to every V8-generated | 4915 * address of a function that's invoked on entry to every V8-generated |
4911 * function. Note that entry_hook is invoked at the very start of each | 4916 * function. Note that entry_hook is invoked at the very start of each |
4912 * generated function. Furthermore, if an entry_hook is given, V8 will | 4917 * generated function. Furthermore, if an entry_hook is given, V8 will |
4913 * always run without a context snapshot. | 4918 * always run without a context snapshot. |
4914 */ | 4919 */ |
4915 FunctionEntryHook entry_hook; | 4920 FunctionEntryHook entry_hook; |
4916 | 4921 |
4917 /** | 4922 /** |
4918 * Allows the host application to provide the address of a function that is | 4923 * Allows the host application to provide the address of a function that is |
4919 * notified each time code is added, moved or removed. | 4924 * notified each time code is added, moved or removed. |
4920 */ | 4925 */ |
4921 JitCodeEventHandler code_event_handler; | 4926 JitCodeEventHandler code_event_handler; |
4922 | 4927 |
4923 /** | 4928 /** |
4924 * ResourceConstraints to use for the new Isolate. | 4929 * ResourceConstraints to use for the new Isolate. |
4925 */ | 4930 */ |
4926 ResourceConstraints constraints; | 4931 ResourceConstraints constraints; |
4927 | 4932 |
4928 /** | 4933 /** |
4929 * Explicitly specify a startup snapshot blob. The embedder owns the blob. | 4934 * Explicitly specify a startup snapshot blob. The embedder owns the blob. |
4930 */ | 4935 */ |
4931 StartupData* snapshot_blob; | 4936 StartupData* snapshot_blob; |
| 4937 |
| 4938 |
| 4939 /** |
| 4940 * Enables the host application to provide a mechanism for recording |
| 4941 * statistics counters. |
| 4942 */ |
| 4943 CounterLookupCallback counter_lookup_callback; |
| 4944 |
| 4945 /** |
| 4946 * Enables the host application to provide a mechanism for recording |
| 4947 * histograms. The CreateHistogram function returns a |
| 4948 * histogram which will later be passed to the AddHistogramSample |
| 4949 * function. |
| 4950 */ |
| 4951 CreateHistogramCallback create_histogram_callback; |
| 4952 AddHistogramSampleCallback add_histogram_sample_callback; |
4932 }; | 4953 }; |
4933 | 4954 |
4934 | 4955 |
4935 /** | 4956 /** |
4936 * Stack-allocated class which sets the isolate for all operations | 4957 * Stack-allocated class which sets the isolate for all operations |
4937 * executed within a local scope. | 4958 * executed within a local scope. |
4938 */ | 4959 */ |
4939 class V8_EXPORT Scope { | 4960 class V8_EXPORT Scope { |
4940 public: | 4961 public: |
4941 explicit Scope(Isolate* isolate) : isolate_(isolate) { | 4962 explicit Scope(Isolate* isolate) : isolate_(isolate) { |
(...skipping 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7916 */ | 7937 */ |
7917 | 7938 |
7918 | 7939 |
7919 } // namespace v8 | 7940 } // namespace v8 |
7920 | 7941 |
7921 | 7942 |
7922 #undef TYPE_CHECK | 7943 #undef TYPE_CHECK |
7923 | 7944 |
7924 | 7945 |
7925 #endif // V8_H_ | 7946 #endif // V8_H_ |
OLD | NEW |