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

Unified Diff: src/snapshot/serialize.h

Issue 1204863006: Serializer: commit new internalized strings after deserialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « src/objects.cc ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serialize.h
diff --git a/src/snapshot/serialize.h b/src/snapshot/serialize.h
index 341338515672e98515aa315c9e2c5aa620db4b75..001d7753922915989cb059888ed11579db4c5c8f 100644
--- a/src/snapshot/serialize.h
+++ b/src/snapshot/serialize.h
@@ -568,6 +568,8 @@ class Deserializer: public SerializerDeserializer {
void DeserializeDeferredObjects();
+ void CommitNewInternalizedStrings(Isolate* isolate);
+
// Fills in some heap data in an area from start to end (non-inclusive). The
// space id is used for the write barrier. The object_address is the address
// of the object we are writing into, or NULL if we are not writing into an
@@ -606,6 +608,7 @@ class Deserializer: public SerializerDeserializer {
List<HeapObject*> deserialized_large_objects_;
List<Code*> new_code_objects_;
+ List<Handle<String> > new_internalized_strings_;
bool deserializing_user_code_;
@@ -909,15 +912,11 @@ class CodeSerializer : public Serializer {
}
const List<uint32_t>* stub_keys() const { return &stub_keys_; }
- int num_internalized_strings() const { return num_internalized_strings_; }
private:
CodeSerializer(Isolate* isolate, SnapshotByteSink* sink, String* source,
Code* main_code)
- : Serializer(isolate, sink),
- source_(source),
- main_code_(main_code),
- num_internalized_strings_(0) {
+ : Serializer(isolate, sink), source_(source), main_code_(main_code) {
back_reference_map_.AddSourceString(source);
}
@@ -939,7 +938,6 @@ class CodeSerializer : public Serializer {
DisallowHeapAllocation no_gc_;
String* source_;
Code* main_code_;
- int num_internalized_strings_;
List<uint32_t> stub_keys_;
DISALLOW_COPY_AND_ASSIGN(CodeSerializer);
};
@@ -998,7 +996,6 @@ class SerializedCodeData : public SerializedData {
Vector<const Reservation> Reservations() const;
Vector<const byte> Payload() const;
- int NumInternalizedStrings() const;
Vector<const uint32_t> CodeStubKeys() const;
private:
@@ -1019,17 +1016,16 @@ class SerializedCodeData : public SerializedData {
uint32_t SourceHash(String* source) const { return source->length(); }
// The data header consists of uint32_t-sized entries:
- // [ 0] magic number and external reference count
- // [ 1] version hash
- // [ 2] source hash
- // [ 3] cpu features
- // [ 4] flag hash
- // [ 5] number of internalized strings
- // [ 6] number of code stub keys
- // [ 7] number of reservation size entries
- // [ 8] payload length
- // [ 9] payload checksum part 1
- // [10] payload checksum part 2
+ // [0] magic number and external reference count
+ // [1] version hash
+ // [2] source hash
+ // [3] cpu features
+ // [4] flag hash
+ // [5] number of code stub keys
+ // [6] number of reservation size entries
+ // [7] payload length
+ // [8] payload checksum part 1
+ // [9] payload checksum part 2
// ... reservations
// ... code stub keys
// ... serialized payload
@@ -1037,9 +1033,7 @@ class SerializedCodeData : public SerializedData {
static const int kSourceHashOffset = kVersionHashOffset + kInt32Size;
static const int kCpuFeaturesOffset = kSourceHashOffset + kInt32Size;
static const int kFlagHashOffset = kCpuFeaturesOffset + kInt32Size;
- static const int kNumInternalizedStringsOffset = kFlagHashOffset + kInt32Size;
- static const int kNumReservationsOffset =
- kNumInternalizedStringsOffset + kInt32Size;
+ static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size;
static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size;
static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size;
static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size;
« no previous file with comments | « src/objects.cc ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698