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

Unified Diff: include/v8.h

Issue 2076083002: [snapshot] support including templates in the snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@externalref
Patch Set: fix build 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 94436a50e8aeac1c6aa24b72c14d6e083134e7b3..20583c852ca83d686b31099cc562359d99714289 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4487,6 +4487,9 @@ class V8_EXPORT FunctionTemplate : public Template {
Local<Value> data = Local<Value>(),
Local<Signature> signature = Local<Signature>(), int length = 0);
+ /** Get a template included in the snapshot by index. */
+ static Local<FunctionTemplate> FromSnapshot(Isolate* isolate, size_t index);
+
/**
* Creates a function template with a fast handler. If a fast handler is set,
* the callback cannot be null.
@@ -4662,6 +4665,9 @@ class V8_EXPORT ObjectTemplate : public Template {
Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New());
+ /** Get a template included in the snapshot by index. */
+ static Local<ObjectTemplate> FromSnapshot(Isolate* isolate, size_t index);
+
/** Creates a new instance of this template.*/
V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance());
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
@@ -6811,6 +6817,12 @@ class SnapshotCreator {
size_t AddContext(Local<Context> context);
/**
+ * Add a template to be included in the snapshot blob.
+ * \returns the index of the template in the snapshot blob.
+ */
+ size_t AddTemplate(Local<Template> template_obj);
+
+ /**
* Created a snapshot data blob.
* This must not be called from within a handle scope.
* \param function_code_handling whether to include compiled function code
« 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