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

Unified Diff: src/snapshot/deserializer.cc

Issue 2200333004: [serializer][heap] Record references in deserialized code objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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') | test/cctest/test-serialize.cc » ('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 68d34896f8b17deedff6214647d6b7c4c28cc75a..9e8fdc08d04287e5a59ee40548d64e2a9a3e2dd6 100644
--- a/src/snapshot/deserializer.cc
+++ b/src/snapshot/deserializer.cc
@@ -37,9 +37,17 @@ void Deserializer::FlushICacheForNewIsolate() {
}
}
-void Deserializer::FlushICacheForNewCodeObjects() {
+void Deserializer::FlushICacheForNewCodeObjectsAndRecordEmbeddedObjects() {
DCHECK(deserializing_user_code_);
for (Code* code : new_code_objects_) {
+ // Record all references to embedded objects in the new code object.
+ for (RelocIterator it(code,
+ RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT));
+ !it.done(); it.next()) {
+ isolate_->heap()->RecordWriteIntoCode(code, it.rinfo(),
Yang 2016/08/03 12:29:52 This entire for loop is duplicate code from CopyCo
ahaas 2016/08/04 08:54:11 Done.
+ it.rinfo()->target_object());
+ }
+
if (FLAG_serialize_age_code) code->PreAge(isolate_);
Assembler::FlushICache(isolate_, code->instruction_start(),
code->instruction_size());
@@ -147,7 +155,7 @@ MaybeHandle<SharedFunctionInfo> Deserializer::DeserializeCode(
Object* root;
VisitPointer(&root);
DeserializeDeferredObjects();
- FlushICacheForNewCodeObjects();
+ FlushICacheForNewCodeObjectsAndRecordEmbeddedObjects();
result = Handle<SharedFunctionInfo>(SharedFunctionInfo::cast(root));
isolate->heap()->RegisterReservationsForBlackAllocation(reservations_);
}
« no previous file with comments | « src/snapshot/deserializer.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698