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

Side by Side Diff: include/v8.h

Issue 2046423002: [snapshot] introduce SnapshotCreator API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 6474 matching lines...) Expand 10 before | Expand all | Expand 10 after
6485 * warm-up script to trigger code compilation. The side effects are then 6485 * warm-up script to trigger code compilation. The side effects are then
6486 * discarded. The resulting startup snapshot will include compiled code. 6486 * discarded. The resulting startup snapshot will include compiled code.
6487 * Returns { NULL, 0 } on failure. 6487 * Returns { NULL, 0 } on failure.
6488 * The caller acquires ownership of the data array in the return value. 6488 * The caller acquires ownership of the data array in the return value.
6489 * The argument startup blob is untouched. 6489 * The argument startup blob is untouched.
6490 */ 6490 */
6491 static StartupData WarmUpSnapshotDataBlob(StartupData cold_startup_blob, 6491 static StartupData WarmUpSnapshotDataBlob(StartupData cold_startup_blob,
6492 const char* warmup_source); 6492 const char* warmup_source);
6493 6493
6494 /** 6494 /**
6495 * Helper class to create a snapshot data blob.
6496 */
6497 class SnapshotCreator {
jochen (gone - plz use gerrit) 2016/06/08 13:06:48 I'd not make this a subclass of V8 but a top-level
Yang 2016/06/08 13:30:29 Done.
6498 public:
6499 enum FunctionCodeHandling { CLEAR_FUNCTION_CODE, KEEP_FUNCTION_CODE };
jochen (gone - plz use gerrit) 2016/06/08 13:06:48 what about using an enum class { kClear, kKeep}
Yang 2016/06/08 13:30:29 Done.
6500
6501 /**
6502 * Create an enter an isolate, which is correctly set up for serialization.
6503 * The isolate is either created from scratch or from an existing snapshot.
6504 * The caller keeps ownership of the argument snapshot.
6505 */
6506 explicit SnapshotCreator(StartupData* existing_blob = nullptr);
jochen (gone - plz use gerrit) 2016/06/08 13:06:48 can you explain why the existing snapshot is neede
Yang 2016/06/08 13:30:29 As discussed, this is for creating warmed up snaps
6507
6508 ~SnapshotCreator();
6509
6510 /**
6511 * \returns the isolate prepared by the snapshot creator.
6512 */
6513 Isolate* GetIsolate();
6514
6515 /**
6516 * Add a context to be included in the snapshot blob.
6517 */
6518 void AddContext(Local<Context> context);
6519
6520 /**
6521 * Created a snapshot data blob.
6522 * \param function_code_handling whether to include compiled function code
6523 * in the snapshot.
6524 * \returns { NULL, 0 } on failure, and a startup snapshot on success. The
jochen (gone - plz use gerrit) 2016/06/08 13:06:48 nullptr?
Yang 2016/06/08 13:30:29 Done.
6525 * caller acquires ownership of the data array in the return value.
6526 */
6527 StartupData CreateBlob(
6528 FunctionCodeHandling function_code_handling = CLEAR_FUNCTION_CODE);
jochen (gone - plz use gerrit) 2016/06/08 13:06:48 I don't think the default arg is needed
Yang 2016/06/08 13:30:29 Done.
6529
6530 private:
6531 void* data_;
6532 };
jochen (gone - plz use gerrit) 2016/06/08 13:06:48 do we have some DISALLOW_COPY_AND_ASSING in the AP
Yang 2016/06/08 13:30:29 We don't have it as a macro, but override the copy
6533
6534 /**
6495 * Adds a message listener. 6535 * Adds a message listener.
6496 * 6536 *
6497 * The same message listener can be added more than once and in that 6537 * The same message listener can be added more than once and in that
6498 * case it will be called more than once for each message. 6538 * case it will be called more than once for each message.
6499 * 6539 *
6500 * If data is specified, it will be passed to the callback when it is called. 6540 * If data is specified, it will be passed to the callback when it is called.
6501 * Otherwise, the exception object will be passed to the callback instead. 6541 * Otherwise, the exception object will be passed to the callback instead.
6502 */ 6542 */
6503 V8_INLINE static V8_DEPRECATED( 6543 V8_INLINE static V8_DEPRECATED(
6504 "Use isolate version", 6544 "Use isolate version",
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after
8829 */ 8869 */
8830 8870
8831 8871
8832 } // namespace v8 8872 } // namespace v8
8833 8873
8834 8874
8835 #undef TYPE_CHECK 8875 #undef TYPE_CHECK
8836 8876
8837 8877
8838 #endif // INCLUDE_V8_H_ 8878 #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