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

Unified Diff: src/snapshot.h

Issue 932823002: Limit size of first page based on serialized data. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove printf debugging Created 5 years, 10 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 | « src/serialize.cc ('k') | src/snapshot-common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot.h
diff --git a/src/snapshot.h b/src/snapshot.h
index 5e3df4f48c249a794dff6064f48af4ad00a960b8..3135756a3252a2014c05de600f9b86a99a1d5679 100644
--- a/src/snapshot.h
+++ b/src/snapshot.h
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "src/isolate.h"
+#include "src/serialize.h"
#ifndef V8_SNAPSHOT_H_
#define V8_SNAPSHOT_H_
@@ -39,12 +40,14 @@ class Snapshot : public AllStatic {
static bool EmbedsScript();
+ static uint32_t SizeOfFirstPage(AllocationSpace space);
+
// To be implemented by the snapshot source.
static const v8::StartupData SnapshotBlob();
static v8::StartupData CreateSnapshotBlob(
- const Vector<const byte> startup_data,
- const Vector<const byte> context_data, Metadata metadata);
+ const StartupSerializer& startup_ser,
+ const PartialSerializer& context_ser, Snapshot::Metadata metadata);
#ifdef DEBUG
static bool SnapshotIsValid(v8::StartupData* snapshot_blob);
@@ -55,8 +58,19 @@ class Snapshot : public AllStatic {
static Vector<const byte> ExtractContextData(const v8::StartupData* data);
static Metadata ExtractMetadata(const v8::StartupData* data);
+ // Snapshot blob layout:
+ // [0] metadata
+ // [1 - 6] pre-calculated first page sizes for paged spaces
+ // [7] serialized start up data length
+ // ... serialized start up data
+ // ... serialized context data
+
+ static const int kNumPagedSpaces = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
+
static const int kMetadataOffset = 0;
- static const int kStartupLengthOffset = kMetadataOffset + kInt32Size;
+ static const int kFirstPageSizesOffset = kMetadataOffset + kInt32Size;
+ static const int kStartupLengthOffset =
+ kFirstPageSizesOffset + kNumPagedSpaces * kInt32Size;
static const int kStartupDataOffset = kStartupLengthOffset + kInt32Size;
static int ContextOffset(int startup_length) {
« no previous file with comments | « src/serialize.cc ('k') | src/snapshot-common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698