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

Unified Diff: include/v8.h

Issue 6901090: Add support for startup data (snapshot) compression. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 4ab1ec2b4f8c54c83f36f4ee2ecd53ddec1be599..3c496161a5e7f0e8a2ad0658d7f88cbcbdac3ea1 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2641,6 +2641,15 @@ class V8EXPORT Isolate {
};
+class StartupData {
+ public:
+ int id;
Søren Thygesen Gjesse 2011/04/29 06:50:29 Is this id actually required?
mnaganov (inactive) 2011/04/29 12:07:58 I think, no. As we don't expose to embedder what t
+ const char* data;
+ int compressed_size;
+ int decompressed_size;
Søren Thygesen Gjesse 2011/04/29 06:50:29 Should the compression algorithm be exposed here (
mnaganov (inactive) 2011/04/29 12:07:58 Makes sense. But not for every resource, as it is
+};
+
+
/**
* Container class for static utility functions.
*/
@@ -2670,6 +2679,25 @@ class V8EXPORT V8 {
static bool IsDead();
/**
+ * The following 3 functions are to be used when V8 is built with
Søren Thygesen Gjesse 2011/04/29 06:50:29 with -> with the
mnaganov (inactive) 2011/04/29 12:07:58 Done.
+ * 'compress_startup_data' flag enabled. In this case, the embedder
+ * must decompress startup data prior to initializing V8.
+ *
+ * This is how interaction with V8 should look like:
+ * int compressed_data_count = v8::V8::GetCompressedStartupDataCount();
+ * v8::StartupData* compressed_data =
+ * new v8::StartupData[compressed_data_count];
+ * v8::V8::GetCompressedStartupData(compressed_data);
+ * ... decompress data (compressed_data can be updated in-place) ...
+ * v8::V8::SetDecompressedStartupData(compressed_data);
+ * ... now V8 can be initialized
+ * ... make sure the decompressed data stays valid until V8 shutdown
+ */
+ static int GetCompressedStartupDataCount();
+ static void GetCompressedStartupData(StartupData* compressed_data);
+ static void SetDecompressedStartupData(StartupData* decompressed_data);
+
+ /**
* Adds a message listener.
*
* The same message listener can be added more than once and it that

Powered by Google App Engine
This is Rietveld 408576698