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

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: 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
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index d6a83346fab226b70ba9816222077bf99b14ffd9..e039633c2a0ef578e00db018330712d53eac713d 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3373,6 +3373,12 @@ 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.
+ for (RelocIterator it(new_code,
Michael Lippautz 2016/08/02 19:07:57 That works, but ideally we would have fused visito
ahaas 2016/08/03 08:47:42 I think that this would be an optimization that we
ulan 2016/08/03 10:59:32 Yep, I would prefer decoding reloc info once. But
+ RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT));
+ !it.done(); it.next()) {
+ RecordWriteIntoCode(new_code, it.rinfo(), it.rinfo()->target_object());
+ }
return new_code;
}

Powered by Google App Engine
This is Rietveld 408576698