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

Unified Diff: src/serialize.h

Issue 296853007: Make serializer non-static. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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-visiting-inl.h ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.h
diff --git a/src/serialize.h b/src/serialize.h
index 958f20e24f3d45e84e939c4cf2aea7200dc7e212..e90e4eb89ae594a2ad09b969d7a95e497ce9a2ff 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -60,7 +60,7 @@ class ExternalReferenceTable {
private:
explicit ExternalReferenceTable(Isolate* isolate) : refs_(64) {
- PopulateTable(isolate);
+ PopulateTable(isolate);
}
struct ExternalReferenceEntry {
@@ -447,16 +447,7 @@ class Serializer : public SerializerDeserializer {
}
Isolate* isolate() const { return isolate_; }
- static void RequestEnable(Isolate* isolate);
- static void InitializeOncePerProcess();
- static void TearDown();
-
- static bool enabled(Isolate* isolate) {
- SerializationState state = static_cast<SerializationState>(
- NoBarrier_Load(&serialization_state_));
- ASSERT(state != SERIALIZER_STATE_UNINITIALIZED);
- return state == SERIALIZER_STATE_ENABLED;
- }
+
SerializationAddressMapper* address_mapper() { return &address_mapper_; }
void PutRoot(int index,
HeapObject* object,
@@ -555,14 +546,6 @@ class Serializer : public SerializerDeserializer {
SnapshotByteSink* sink_;
ExternalReferenceEncoder* external_reference_encoder_;
- enum SerializationState {
- SERIALIZER_STATE_UNINITIALIZED = 0,
- SERIALIZER_STATE_DISABLED = 1,
- SERIALIZER_STATE_ENABLED = 2
- };
-
- static AtomicWord serialization_state_;
-
SerializationAddressMapper address_mapper_;
intptr_t root_index_wave_front_;
void Pad();
@@ -570,8 +553,12 @@ class Serializer : public SerializerDeserializer {
friend class ObjectSerializer;
friend class Deserializer;
+ // We may not need the code address map for logging for every instance
+ // of the serializer. Initialize it on demand.
+ void InitializeCodeAddressMap();
+
private:
- static CodeAddressMap* code_address_map_;
+ CodeAddressMap* code_address_map_;
DISALLOW_COPY_AND_ASSIGN(Serializer);
};
@@ -584,6 +571,7 @@ class PartialSerializer : public Serializer {
: Serializer(isolate, sink),
startup_serializer_(startup_snapshot_serializer) {
set_root_index_wave_front(Heap::kStrongRootListLength);
+ InitializeCodeAddressMap();
}
// Serialize the objects reachable from a single object pointer.
@@ -623,6 +611,7 @@ class StartupSerializer : public Serializer {
// which will repopulate the cache with objects needed by that partial
// snapshot.
isolate->set_serialize_partial_snapshot_cache_length(0);
+ InitializeCodeAddressMap();
}
// Serialize the current state of the heap. The order is:
// 1) Strong references.
« no previous file with comments | « src/objects-visiting-inl.h ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698