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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 class NumberObject; | 85 class NumberObject; |
86 class Object; | 86 class Object; |
87 class ObjectOperationDescriptor; | 87 class ObjectOperationDescriptor; |
88 class ObjectTemplate; | 88 class ObjectTemplate; |
89 class Platform; | 89 class Platform; |
90 class Primitive; | 90 class Primitive; |
91 class Promise; | 91 class Promise; |
92 class RawOperationDescriptor; | 92 class RawOperationDescriptor; |
93 class Script; | 93 class Script; |
94 class Signature; | 94 class Signature; |
| 95 class StartupData; |
95 class StackFrame; | 96 class StackFrame; |
96 class StackTrace; | 97 class StackTrace; |
97 class String; | 98 class String; |
98 class StringObject; | 99 class StringObject; |
99 class Symbol; | 100 class Symbol; |
100 class SymbolObject; | 101 class SymbolObject; |
101 class Private; | 102 class Private; |
102 class Uint32; | 103 class Uint32; |
103 class Utils; | 104 class Utils; |
104 class Value; | 105 class Value; |
(...skipping 4534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4639 */ | 4640 */ |
4640 class V8_EXPORT Isolate { | 4641 class V8_EXPORT Isolate { |
4641 public: | 4642 public: |
4642 /** | 4643 /** |
4643 * Initial configuration parameters for a new Isolate. | 4644 * Initial configuration parameters for a new Isolate. |
4644 */ | 4645 */ |
4645 struct CreateParams { | 4646 struct CreateParams { |
4646 CreateParams() | 4647 CreateParams() |
4647 : entry_hook(NULL), | 4648 : entry_hook(NULL), |
4648 code_event_handler(NULL), | 4649 code_event_handler(NULL), |
4649 enable_serializer(false) {} | 4650 enable_serializer(false), |
| 4651 snapshot_blob(NULL) {} |
4650 | 4652 |
4651 /** | 4653 /** |
4652 * The optional entry_hook allows the host application to provide the | 4654 * The optional entry_hook allows the host application to provide the |
4653 * address of a function that's invoked on entry to every V8-generated | 4655 * address of a function that's invoked on entry to every V8-generated |
4654 * function. Note that entry_hook is invoked at the very start of each | 4656 * function. Note that entry_hook is invoked at the very start of each |
4655 * generated function. Furthermore, if an entry_hook is given, V8 will | 4657 * generated function. Furthermore, if an entry_hook is given, V8 will |
4656 * always run without a context snapshot. | 4658 * always run without a context snapshot. |
4657 */ | 4659 */ |
4658 FunctionEntryHook entry_hook; | 4660 FunctionEntryHook entry_hook; |
4659 | 4661 |
4660 /** | 4662 /** |
4661 * Allows the host application to provide the address of a function that is | 4663 * Allows the host application to provide the address of a function that is |
4662 * notified each time code is added, moved or removed. | 4664 * notified each time code is added, moved or removed. |
4663 */ | 4665 */ |
4664 JitCodeEventHandler code_event_handler; | 4666 JitCodeEventHandler code_event_handler; |
4665 | 4667 |
4666 /** | 4668 /** |
4667 * ResourceConstraints to use for the new Isolate. | 4669 * ResourceConstraints to use for the new Isolate. |
4668 */ | 4670 */ |
4669 ResourceConstraints constraints; | 4671 ResourceConstraints constraints; |
4670 | 4672 |
4671 /** | 4673 /** |
4672 * This flag currently renders the Isolate unusable. | 4674 * This flag currently renders the Isolate unusable. |
4673 */ | 4675 */ |
4674 bool enable_serializer; | 4676 bool enable_serializer; |
| 4677 |
| 4678 /** |
| 4679 * Explicitly specify a startup snapshot blob. The embedder owns the blob. |
| 4680 */ |
| 4681 StartupData* snapshot_blob; |
4675 }; | 4682 }; |
4676 | 4683 |
4677 | 4684 |
4678 /** | 4685 /** |
4679 * Stack-allocated class which sets the isolate for all operations | 4686 * Stack-allocated class which sets the isolate for all operations |
4680 * executed within a local scope. | 4687 * executed within a local scope. |
4681 */ | 4688 */ |
4682 class V8_EXPORT Scope { | 4689 class V8_EXPORT Scope { |
4683 public: | 4690 public: |
4684 explicit Scope(Isolate* isolate) : isolate_(isolate) { | 4691 explicit Scope(Isolate* isolate) : isolate_(isolate) { |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5390 * - The call will abort if the data is invalid. | 5397 * - The call will abort if the data is invalid. |
5391 */ | 5398 */ |
5392 static void SetNativesDataBlob(StartupData* startup_blob); | 5399 static void SetNativesDataBlob(StartupData* startup_blob); |
5393 static void SetSnapshotDataBlob(StartupData* startup_blob); | 5400 static void SetSnapshotDataBlob(StartupData* startup_blob); |
5394 | 5401 |
5395 /** | 5402 /** |
5396 * Create a new isolate and context for the purpose of capturing a snapshot | 5403 * Create a new isolate and context for the purpose of capturing a snapshot |
5397 * Returns { NULL, 0 } on failure. | 5404 * Returns { NULL, 0 } on failure. |
5398 * The caller owns the data array in the return value. | 5405 * The caller owns the data array in the return value. |
5399 */ | 5406 */ |
5400 static StartupData CreateSnapshotDataBlob(char* custom_source = NULL); | 5407 static StartupData CreateSnapshotDataBlob(const char* custom_source = NULL); |
5401 | 5408 |
5402 /** | 5409 /** |
5403 * Adds a message listener. | 5410 * Adds a message listener. |
5404 * | 5411 * |
5405 * The same message listener can be added more than once and in that | 5412 * The same message listener can be added more than once and in that |
5406 * case it will be called more than once for each message. | 5413 * case it will be called more than once for each message. |
5407 * | 5414 * |
5408 * If data is specified, it will be passed to the callback when it is called. | 5415 * If data is specified, it will be passed to the callback when it is called. |
5409 * Otherwise, the exception object will be passed to the callback instead. | 5416 * Otherwise, the exception object will be passed to the callback instead. |
5410 */ | 5417 */ |
(...skipping 2130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7541 */ | 7548 */ |
7542 | 7549 |
7543 | 7550 |
7544 } // namespace v8 | 7551 } // namespace v8 |
7545 | 7552 |
7546 | 7553 |
7547 #undef TYPE_CHECK | 7554 #undef TYPE_CHECK |
7548 | 7555 |
7549 | 7556 |
7550 #endif // V8_H_ | 7557 #endif // V8_H_ |
OLD | NEW |