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

Unified Diff: src/snapshot/serialize.cc

Issue 1488873004: [bootstrapper] no longer use outdated contexts list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/serialize.h ('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/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));
- }
}
« no previous file with comments | « src/snapshot/serialize.h ('k') | src/snapshot/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698