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

Unified Diff: src/snapshot/serializer-common.h

Issue 2736923002: SnapshotCreator: start from existing snapshot if we have one (Closed)
Patch Set: addressed comments Created 3 years, 9 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/snapshot/deserializer.cc ('k') | src/snapshot/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serializer-common.h
diff --git a/src/snapshot/serializer-common.h b/src/snapshot/serializer-common.h
index b426efd538e99384dea8f8088ee61094b154752e..b4bcf7ff73471de20bf4af61bdb0744847e62420 100644
--- a/src/snapshot/serializer-common.h
+++ b/src/snapshot/serializer-common.h
@@ -245,14 +245,26 @@ class SerializedData {
}
uint32_t GetMagicNumber() const { return GetHeaderValue(kMagicNumberOffset); }
+ uint32_t GetExtraReferences() const {
+ return GetHeaderValue(kExtraExternalReferencesOffset);
+ }
class ChunkSizeBits : public BitField<uint32_t, 0, 31> {};
class IsLastChunkBits : public BitField<bool, 31, 1> {};
static uint32_t ComputeMagicNumber(ExternalReferenceTable* table) {
- uint32_t external_refs = table->size();
+ uint32_t external_refs = table->size() - table->num_api_references();
return 0xC0DE0000 ^ external_refs;
}
+ static uint32_t GetExtraReferences(ExternalReferenceTable* table) {
+ return table->num_api_references();
+ }
+
+ static const int kMagicNumberOffset = 0;
+ static const int kExtraExternalReferencesOffset =
+ kMagicNumberOffset + kInt32Size;
+ static const int kVersionHashOffset =
+ kExtraExternalReferencesOffset + kInt32Size;
protected:
void SetHeaderValue(int offset, uint32_t value) {
@@ -271,13 +283,15 @@ class SerializedData {
static uint32_t ComputeMagicNumber(Isolate* isolate) {
return ComputeMagicNumber(ExternalReferenceTable::instance(isolate));
}
+ static uint32_t GetExtraReferences(Isolate* isolate) {
+ return GetExtraReferences(ExternalReferenceTable::instance(isolate));
+ }
void SetMagicNumber(Isolate* isolate) {
SetHeaderValue(kMagicNumberOffset, ComputeMagicNumber(isolate));
+ SetHeaderValue(kExtraExternalReferencesOffset, GetExtraReferences(isolate));
}
- static const int kMagicNumberOffset = 0;
-
byte* data_;
int size_;
bool owns_data_;
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | src/snapshot/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698