Index: src/snapshot/serialize.cc |
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc |
index 1ff60c22d7706fbeea635f195d584af7e4816d15..214df048dee0ed50701452a7f8a713ed36bf1ee8 100644 |
--- a/src/snapshot/serialize.cc |
+++ b/src/snapshot/serialize.cc |
@@ -561,8 +561,7 @@ void Deserializer::Deserialize(Isolate* isolate) { |
MaybeHandle<Object> Deserializer::DeserializePartial( |
- Isolate* isolate, Handle<JSGlobalProxy> global_proxy, |
- Handle<FixedArray>* outdated_contexts_out) { |
+ Isolate* isolate, Handle<JSGlobalProxy> global_proxy) { |
Initialize(isolate); |
if (!ReserveSpace()) { |
V8::FatalProcessOutOfMemory("deserialize context"); |
@@ -579,18 +578,13 @@ MaybeHandle<Object> Deserializer::DeserializePartial( |
OldSpace* code_space = isolate_->heap()->code_space(); |
Address start_address = code_space->top(); |
Object* root; |
- Object* outdated_contexts; |
VisitPointer(&root); |
DeserializeDeferredObjects(); |
- VisitPointer(&outdated_contexts); |
// There's no code deserialized here. If this assert fires then that's |
// changed and logging should be added to notify the profiler et al of the |
// new code, which also has to be flushed from instruction cache. |
CHECK_EQ(start_address, code_space->top()); |
- CHECK(outdated_contexts->IsFixedArray()); |
- *outdated_contexts_out = |
- Handle<FixedArray>(FixedArray::cast(outdated_contexts), isolate); |
return Handle<Object>(root, isolate); |
} |
@@ -1484,39 +1478,10 @@ void PartialSerializer::Serialize(Object** o) { |
} |
VisitPointer(o); |
SerializeDeferredObjects(); |
- SerializeOutdatedContextsAsFixedArray(); |
Pad(); |
} |
-void PartialSerializer::SerializeOutdatedContextsAsFixedArray() { |
- int length = outdated_contexts_.length(); |
- if (length == 0) { |
- FixedArray* empty = isolate_->heap()->empty_fixed_array(); |
- SerializeObject(empty, kPlain, kStartOfObject, 0); |
- } else { |
- // Serialize an imaginary fixed array containing outdated contexts. |
- int size = FixedArray::SizeFor(length); |
- Allocate(NEW_SPACE, size); |
- sink_->Put(kNewObject + NEW_SPACE, "emulated FixedArray"); |
- sink_->PutInt(size >> kObjectAlignmentBits, "FixedArray size in words"); |
- Map* map = isolate_->heap()->fixed_array_map(); |
- SerializeObject(map, kPlain, kStartOfObject, 0); |
- Smi* length_smi = Smi::FromInt(length); |
- sink_->Put(kOnePointerRawData, "Smi"); |
- for (int i = 0; i < kPointerSize; i++) { |
- sink_->Put(reinterpret_cast<byte*>(&length_smi)[i], "Byte"); |
- } |
- for (int i = 0; i < length; i++) { |
- Context* context = outdated_contexts_[i]; |
- BackReference back_reference = back_reference_map_.Lookup(context); |
- sink_->Put(kBackref + back_reference.space(), "BackRef"); |
- PutBackReference(context, back_reference); |
- } |
- } |
-} |
- |
- |
bool Serializer::ShouldBeSkipped(Object** current) { |
Object** roots = isolate()->heap()->roots_array_start(); |
return current == &roots[Heap::kStoreBufferTopRootIndex] |
@@ -1852,15 +1817,6 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
// Object has not yet been serialized. Serialize it here. |
ObjectSerializer serializer(this, obj, sink_, how_to_code, where_to_point); |
serializer.Serialize(); |
- |
- // TODO(yangguo): We probably only need ScriptContext here for post- |
- // processing in Genesis::HookUpGlobalThisBinding. |
- if (obj->IsContext() && |
- Context::cast(obj)->global_object() == global_object_) { |
- // Context refers to the current global object. This reference will |
- // become outdated after deserialization. |
- outdated_contexts_.Add(Context::cast(obj)); |
- } |
} |