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

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: The version I'll commit 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
« no previous file with comments | « SConstruct ('k') | samples/process.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 4ab1ec2b4f8c54c83f36f4ee2ecd53ddec1be599..b621f0110a519378621cae992e59f6ddc8635049 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2641,6 +2641,18 @@ class V8EXPORT Isolate {
};
+class StartupData {
+ public:
+ enum CompressionAlgorithm {
+ kUncompressed,
+ kBZip2
+ };
+
+ const char* data;
+ int compressed_size;
+ int raw_size;
+};
+
/**
* Container class for static utility functions.
*/
@@ -2670,6 +2682,26 @@ class V8EXPORT V8 {
static bool IsDead();
/**
+ * The following 4 functions are to be used when V8 is built with
+ * the '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 StartupData::CompressionAlgorithm GetCompressedStartupDataAlgorithm();
+ 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
« no previous file with comments | « SConstruct ('k') | samples/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698