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

Unified Diff: src/snapshot/deserializer.cc

Issue 1992723002: [serializer] prepare attached references for general use. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments Created 4 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/snapshot/deserializer.h ('k') | src/snapshot/partial-serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/deserializer.cc
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc
index 0a21feffa1484d7714e398ea15955778c52f7075..88820ae6033efe63b29c13389d6e8545b2de2a63 100644
--- a/src/snapshot/deserializer.cc
+++ b/src/snapshot/deserializer.cc
@@ -119,9 +119,7 @@ MaybeHandle<Object> Deserializer::DeserializePartial(
return MaybeHandle<Object>();
}
- Vector<Handle<Object> > attached_objects = Vector<Handle<Object> >::New(1);
- attached_objects[kGlobalProxyReference] = global_proxy;
- SetAttachedObjects(attached_objects);
+ AddAttachedObject(global_proxy);
DisallowHeapAllocation no_gc;
// Keep track of the code space start and end pointers in case new
@@ -167,7 +165,6 @@ MaybeHandle<SharedFunctionInfo> Deserializer::DeserializeCode(
Deserializer::~Deserializer() {
// TODO(svenpanne) Re-enable this assertion when v8 initialization is fixed.
// DCHECK(source_.AtEOF());
- attached_objects_.Dispose();
}
// This is called on the roots. It is the driver of the deserialization
@@ -315,7 +312,8 @@ void Deserializer::CommitPostProcessedObjects(Isolate* isolate) {
HeapObject* Deserializer::GetBackReferencedObject(int space) {
HeapObject* obj;
- BackReference back_reference(source_.GetInt());
+ SerializerReference back_reference =
+ SerializerReference::FromBitfield(source_.GetInt());
if (space == LO_SPACE) {
CHECK(back_reference.chunk_index() == 0);
uint32_t index = back_reference.large_object_index();
@@ -496,7 +494,6 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space,
new_object = reinterpret_cast<Object*>(address); \
} else if (where == kAttachedReference) { \
int index = source_.GetInt(); \
- DCHECK(deserializing_user_code() || index == kGlobalProxyReference); \
new_object = *attached_objects_[index]; \
emit_write_barrier = isolate->heap()->InNewSpace(new_object); \
} else { \
« no previous file with comments | « src/snapshot/deserializer.h ('k') | src/snapshot/partial-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698