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

Side by Side Diff: src/heap/scavenger-inl.h

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 unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | test/cctest/heap/heap-tester.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_SCAVENGER_INL_H_ 5 #ifndef V8_HEAP_SCAVENGER_INL_H_
6 #define V8_HEAP_SCAVENGER_INL_H_ 6 #define V8_HEAP_SCAVENGER_INL_H_
7 7
8 #include "src/heap/scavenger.h" 8 #include "src/heap/scavenger.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ScavengeObject(reinterpret_cast<HeapObject**>(slot), heap_object); 48 ScavengeObject(reinterpret_cast<HeapObject**>(slot), heap_object);
49 49
50 object = *slot; 50 object = *slot;
51 // If the object was in from space before and is after executing the 51 // If the object was in from space before and is after executing the
52 // callback in to space, the object is still live. 52 // callback in to space, the object is still live.
53 // Unfortunately, we do not know about the slot. It could be in a 53 // Unfortunately, we do not know about the slot. It could be in a
54 // just freed free space object. 54 // just freed free space object.
55 if (heap->InToSpace(object)) { 55 if (heap->InToSpace(object)) {
56 return KEEP_SLOT; 56 return KEEP_SLOT;
57 } 57 }
58 } else {
59 DCHECK(!heap->InNewSpace(object));
60 } 58 }
59 // Slots can point to "to" space if the slot has been recorded multiple
60 // times in the remembered set. We remove the redundant slot now.
61 return REMOVE_SLOT; 61 return REMOVE_SLOT;
62 } 62 }
63 63
64 // static 64 // static
65 template <PromotionMode promotion_mode> 65 template <PromotionMode promotion_mode>
66 void StaticScavengeVisitor<promotion_mode>::VisitPointer(Heap* heap, 66 void StaticScavengeVisitor<promotion_mode>::VisitPointer(Heap* heap,
67 HeapObject* obj, 67 HeapObject* obj,
68 Object** p) { 68 Object** p) {
69 Object* object = *p; 69 Object* object = *p;
70 if (!heap->InNewSpace(object)) return; 70 if (!heap->InNewSpace(object)) return;
71 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), 71 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
72 reinterpret_cast<HeapObject*>(object)); 72 reinterpret_cast<HeapObject*>(object));
73 } 73 }
74 74
75 } // namespace internal 75 } // namespace internal
76 } // namespace v8 76 } // namespace v8
77 77
78 #endif // V8_HEAP_SCAVENGER_INL_H_ 78 #endif // V8_HEAP_SCAVENGER_INL_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | test/cctest/heap/heap-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698