Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: include/v8.h

Issue 2066993004: [snapshot] serialize embedder-provided external references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: also serialize next_serial_number Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 * thread at any given time. The Locker/Unlocker API must be used to 5486 * thread at any given time. The Locker/Unlocker API must be used to
5487 * synchronize. 5487 * synchronize.
5488 */ 5488 */
5489 class V8_EXPORT Isolate { 5489 class V8_EXPORT Isolate {
5490 public: 5490 public:
5491 /** 5491 /**
5492 * Initial configuration parameters for a new Isolate. 5492 * Initial configuration parameters for a new Isolate.
5493 */ 5493 */
5494 struct CreateParams { 5494 struct CreateParams {
5495 CreateParams() 5495 CreateParams()
5496 : entry_hook(NULL), 5496 : entry_hook(nullptr),
5497 code_event_handler(NULL), 5497 code_event_handler(nullptr),
5498 snapshot_blob(NULL), 5498 snapshot_blob(nullptr),
5499 counter_lookup_callback(NULL), 5499 counter_lookup_callback(nullptr),
5500 create_histogram_callback(NULL), 5500 create_histogram_callback(nullptr),
5501 add_histogram_sample_callback(NULL), 5501 add_histogram_sample_callback(nullptr),
5502 array_buffer_allocator(NULL) {} 5502 array_buffer_allocator(nullptr),
5503 external_references(nullptr) {}
5503 5504
5504 /** 5505 /**
5505 * The optional entry_hook allows the host application to provide the 5506 * The optional entry_hook allows the host application to provide the
5506 * address of a function that's invoked on entry to every V8-generated 5507 * address of a function that's invoked on entry to every V8-generated
5507 * function. Note that entry_hook is invoked at the very start of each 5508 * function. Note that entry_hook is invoked at the very start of each
5508 * generated function. Furthermore, if an entry_hook is given, V8 will 5509 * generated function. Furthermore, if an entry_hook is given, V8 will
5509 * not use a snapshot, including custom snapshots. 5510 * not use a snapshot, including custom snapshots.
5510 */ 5511 */
5511 FunctionEntryHook entry_hook; 5512 FunctionEntryHook entry_hook;
5512 5513
(...skipping 27 matching lines...) Expand all
5540 * function. 5541 * function.
5541 */ 5542 */
5542 CreateHistogramCallback create_histogram_callback; 5543 CreateHistogramCallback create_histogram_callback;
5543 AddHistogramSampleCallback add_histogram_sample_callback; 5544 AddHistogramSampleCallback add_histogram_sample_callback;
5544 5545
5545 /** 5546 /**
5546 * The ArrayBuffer::Allocator to use for allocating and freeing the backing 5547 * The ArrayBuffer::Allocator to use for allocating and freeing the backing
5547 * store of ArrayBuffers. 5548 * store of ArrayBuffers.
5548 */ 5549 */
5549 ArrayBuffer::Allocator* array_buffer_allocator; 5550 ArrayBuffer::Allocator* array_buffer_allocator;
5551
5552 /**
5553 * Specifies an optional null-terminated array of raw addresses in the
jochen (gone - plz use gerrit) 2016/06/20 13:11:12 nullptr
5554 * embedder that V8 can match against during serialization and use for
5555 * deserialization. This array and its content must stay valid for the
5556 * entire lifetime of the isolate.
5557 */
5558 intptr_t* external_references;
5550 }; 5559 };
5551 5560
5552 5561
5553 /** 5562 /**
5554 * Stack-allocated class which sets the isolate for all operations 5563 * Stack-allocated class which sets the isolate for all operations
5555 * executed within a local scope. 5564 * executed within a local scope.
5556 */ 5565 */
5557 class V8_EXPORT Scope { 5566 class V8_EXPORT Scope {
5558 public: 5567 public:
5559 explicit Scope(Isolate* isolate) : isolate_(isolate) { 5568 explicit Scope(Isolate* isolate) : isolate_(isolate) {
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
6768 * Helper class to create a snapshot data blob. 6777 * Helper class to create a snapshot data blob.
6769 */ 6778 */
6770 class SnapshotCreator { 6779 class SnapshotCreator {
6771 public: 6780 public:
6772 enum class FunctionCodeHandling { kClear, kKeep }; 6781 enum class FunctionCodeHandling { kClear, kKeep };
6773 6782
6774 /** 6783 /**
6775 * Create and enter an isolate, and set it up for serialization. 6784 * Create and enter an isolate, and set it up for serialization.
6776 * The isolate is either created from scratch or from an existing snapshot. 6785 * The isolate is either created from scratch or from an existing snapshot.
6777 * The caller keeps ownership of the argument snapshot. 6786 * The caller keeps ownership of the argument snapshot.
6787 * \param existing_blob existing snapshot from which to create this one.
6788 * \param external_references a null-terminated array of external references
6789 * that must be equivalent to CreateParams::external_references.
6778 */ 6790 */
6779 explicit SnapshotCreator(StartupData* existing_blob = nullptr); 6791 SnapshotCreator(intptr_t* external_references = nullptr,
jochen (gone - plz use gerrit) 2016/06/20 13:11:12 maybe make that the second parameter, so it's back
6792 StartupData* existing_blob = nullptr);
6780 6793
6781 ~SnapshotCreator(); 6794 ~SnapshotCreator();
6782 6795
6783 /** 6796 /**
6784 * \returns the isolate prepared by the snapshot creator. 6797 * \returns the isolate prepared by the snapshot creator.
6785 */ 6798 */
6786 Isolate* GetIsolate(); 6799 Isolate* GetIsolate();
6787 6800
6788 /** 6801 /**
6789 * Add a context to be included in the snapshot blob. 6802 * Add a context to be included in the snapshot blob.
6790 * \returns the index of the context in the snapshot blob. 6803 * \returns the index of the context in the snapshot blob.
6791 */ 6804 */
6792 size_t AddContext(Local<Context> context); 6805 size_t AddContext(Local<Context> context);
6793 6806
6794 /** 6807 /**
6795 * Created a snapshot data blob. 6808 * Created a snapshot data blob.
6809 * This must not be called from within a handle scope.
6796 * \param function_code_handling whether to include compiled function code 6810 * \param function_code_handling whether to include compiled function code
6797 * in the snapshot. 6811 * in the snapshot.
6798 * \returns { nullptr, 0 } on failure, and a startup snapshot on success. The 6812 * \returns { nullptr, 0 } on failure, and a startup snapshot on success. The
6799 * caller acquires ownership of the data array in the return value. 6813 * caller acquires ownership of the data array in the return value.
6800 */ 6814 */
6801 StartupData CreateBlob(FunctionCodeHandling function_code_handling); 6815 StartupData CreateBlob(FunctionCodeHandling function_code_handling);
6802 6816
6803 private: 6817 private:
6804 void* data_; 6818 void* data_;
6805 6819
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
8853 */ 8867 */
8854 8868
8855 8869
8856 } // namespace v8 8870 } // namespace v8
8857 8871
8858 8872
8859 #undef TYPE_CHECK 8873 #undef TYPE_CHECK
8860 8874
8861 8875
8862 #endif // INCLUDE_V8_H_ 8876 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698