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

Unified Diff: src/heap/heap.cc

Issue 2203783002: [heap] Record references in the new code objects in heap::CopyCode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Init tmp pointer to avoid compiler warning 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/heap/heap.h ('k') | src/heap/scavenger-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index d6a83346fab226b70ba9816222077bf99b14ffd9..7320be3ad2f44cc3b5599ab674b9c49893aafe13 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3373,6 +3373,8 @@ AllocationResult Heap::CopyCode(Code* code) {
// We have to iterate over the object and process its pointers when black
// allocation is on.
incremental_marking()->IterateBlackObject(new_code);
+ // Record all references to embedded objects in the new code object.
+ RecordWritesIntoCode(new_code);
return new_code;
}
@@ -5788,6 +5790,13 @@ void Heap::RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo,
source_page, reinterpret_cast<Address>(host), slot_type, addr);
}
+void Heap::RecordWritesIntoCode(Code* code) {
+ for (RelocIterator it(code, RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT));
+ !it.done(); it.next()) {
+ RecordWriteIntoCode(code, it.rinfo(), it.rinfo()->target_object());
+ }
+}
+
Space* AllSpaces::next() {
switch (counter_++) {
case NEW_SPACE:
@@ -5805,7 +5814,6 @@ Space* AllSpaces::next() {
}
}
-
PagedSpace* PagedSpaces::next() {
switch (counter_++) {
case OLD_SPACE:
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/scavenger-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698