Index: src/serialize.h |
diff --git a/src/serialize.h b/src/serialize.h |
index 563f0a06d025fb247d987beb357a0bea6212f447..21b7099ba88f82619efed79d9e5c2ed952093145 100644 |
--- a/src/serialize.h |
+++ b/src/serialize.h |
@@ -110,7 +110,7 @@ class ExternalReferenceTable { |
class ExternalReferenceEncoder { |
public: |
- ExternalReferenceEncoder(); |
+ explicit ExternalReferenceEncoder(Isolate* isolate); |
uint32_t Encode(Address key) const; |
@@ -134,7 +134,7 @@ class ExternalReferenceEncoder { |
class ExternalReferenceDecoder { |
public: |
- ExternalReferenceDecoder(); |
+ explicit ExternalReferenceDecoder(Isolate* isolate); |
~ExternalReferenceDecoder(); |
Address Decode(uint32_t key) const { |
@@ -208,7 +208,7 @@ class SnapshotByteSource { |
// both. |
class SerializerDeserializer: public ObjectVisitor { |
public: |
- static void Iterate(ObjectVisitor* visitor); |
+ static void Iterate(Isolate* isolate, ObjectVisitor* visitor); |
static int nop() { return kNop; } |
@@ -325,10 +325,10 @@ class Deserializer: public SerializerDeserializer { |
virtual ~Deserializer(); |
// Deserialize the snapshot into an empty heap. |
- void Deserialize(); |
+ void Deserialize(Isolate* isolate); |
// Deserialize a single object and the objects reachable from it. |
- void DeserializePartial(Object** root); |
+ void DeserializePartial(Isolate* isolate, Object** root); |
void set_reservation(int space_number, int reservation) { |
ASSERT(space_number >= 0); |
@@ -464,7 +464,7 @@ class CodeAddressMap; |
// There can be only one serializer per V8 process. |
class Serializer : public SerializerDeserializer { |
public: |
- explicit Serializer(SnapshotByteSink* sink); |
+ Serializer(Isolate* isolate, SnapshotByteSink* sink); |
~Serializer(); |
void VisitPointers(Object** start, Object** end); |
// You can call this after serialization to find out how much space was used |
@@ -474,7 +474,8 @@ class Serializer : public SerializerDeserializer { |
return fullness_[space]; |
} |
- static void Enable(); |
+ Isolate* isolate() { return isolate_; } |
Sven Panne
2013/09/03 11:38:56
const
|
+ static void Enable(Isolate* isolate); |
static void Disable(); |
// Call this when you have made use of the fact that there is no serialization |
@@ -593,9 +594,10 @@ class Serializer : public SerializerDeserializer { |
class PartialSerializer : public Serializer { |
public: |
- PartialSerializer(Serializer* startup_snapshot_serializer, |
+ PartialSerializer(Isolate* isolate, |
+ Serializer* startup_snapshot_serializer, |
SnapshotByteSink* sink) |
- : Serializer(sink), |
+ : Serializer(isolate, sink), |
startup_serializer_(startup_snapshot_serializer) { |
set_root_index_wave_front(Heap::kStrongRootListLength); |
} |
@@ -629,12 +631,13 @@ class PartialSerializer : public Serializer { |
class StartupSerializer : public Serializer { |
public: |
- explicit StartupSerializer(SnapshotByteSink* sink) : Serializer(sink) { |
+ StartupSerializer(Isolate* isolate, SnapshotByteSink* sink) |
+ : Serializer(isolate, sink) { |
// Clear the cache of objects used by the partial snapshot. After the |
// strong roots have been serialized we can create a partial snapshot |
// which will repopulate the cache with objects needed by that partial |
// snapshot. |
- Isolate::Current()->set_serialize_partial_snapshot_cache_length(0); |
+ isolate->set_serialize_partial_snapshot_cache_length(0); |
} |
// Serialize the current state of the heap. The order is: |
// 1) Strong references. |