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

Side by Side Diff: src/heap/heap.cc

Issue 1135353003: Factor out handling of mixed objects preprocessing after migration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 1352
1353 FlushNumberStringCache(); 1353 FlushNumberStringCache();
1354 if (FLAG_cleanup_code_caches_at_gc) { 1354 if (FLAG_cleanup_code_caches_at_gc) {
1355 polymorphic_code_cache()->set_cache(undefined_value()); 1355 polymorphic_code_cache()->set_cache(undefined_value());
1356 } 1356 }
1357 1357
1358 ClearNormalizedMapCaches(); 1358 ClearNormalizedMapCaches();
1359 } 1359 }
1360 1360
1361 1361
1362 void Heap::MigrateMixedObjectInNewSpaceEpilog(HeapObject* dst) {
1363 DCHECK(dst->MayContainMixedValues());
1364 }
1365
1366
1362 // Helper class for copying HeapObjects 1367 // Helper class for copying HeapObjects
1363 class ScavengeVisitor : public ObjectVisitor { 1368 class ScavengeVisitor : public ObjectVisitor {
1364 public: 1369 public:
1365 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {} 1370 explicit ScavengeVisitor(Heap* heap) : heap_(heap) {}
1366 1371
1367 void VisitPointer(Object** p) { ScavengePointer(p); } 1372 void VisitPointer(Object** p) { ScavengePointer(p); }
1368 1373
1369 void VisitPointers(Object** start, Object** end) { 1374 void VisitPointers(Object** start, Object** end) {
1370 // Copy all HeapObject pointers in [start, end) 1375 // Copy all HeapObject pointers in [start, end)
1371 for (Object** p = start; p < end; p++) ScavengePointer(p); 1376 for (Object** p = start; p < end; p++) ScavengePointer(p);
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 2122
2118 // Make sure that we do not overwrite the promotion queue which is at 2123 // Make sure that we do not overwrite the promotion queue which is at
2119 // the end of to-space. 2124 // the end of to-space.
2120 DCHECK(!heap->InToSpace(target) || 2125 DCHECK(!heap->InToSpace(target) ||
2121 heap->promotion_queue()->IsBelowPromotionQueue( 2126 heap->promotion_queue()->IsBelowPromotionQueue(
2122 heap->new_space()->top())); 2127 heap->new_space()->top()));
2123 2128
2124 // Copy the content of source to target. 2129 // Copy the content of source to target.
2125 heap->CopyBlock(target->address(), source->address(), size); 2130 heap->CopyBlock(target->address(), source->address(), size);
2126 2131
2132 if (target->MayContainMixedValues()) {
2133 heap->MigrateMixedObjectInNewSpaceEpilog(target);
2134 }
2135
2127 // Set the forwarding address. 2136 // Set the forwarding address.
2128 source->set_map_word(MapWord::FromForwardingAddress(target)); 2137 source->set_map_word(MapWord::FromForwardingAddress(target));
2129 2138
2130 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { 2139 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
2131 // Update NewSpace stats if necessary. 2140 // Update NewSpace stats if necessary.
2132 RecordCopiedObject(heap, target); 2141 RecordCopiedObject(heap, target);
2133 heap->OnMoveEvent(target, source, size); 2142 heap->OnMoveEvent(target, source, size);
2134 } 2143 }
2135 2144
2136 if (marks_handling == TRANSFER_MARKS) { 2145 if (marks_handling == TRANSFER_MARKS) {
(...skipping 4392 matching lines...) Expand 10 before | Expand all | Expand 10 after
6529 } 6538 }
6530 delete list; 6539 delete list;
6531 } else { 6540 } else {
6532 prev = list; 6541 prev = list;
6533 } 6542 }
6534 list = next; 6543 list = next;
6535 } 6544 }
6536 } 6545 }
6537 } 6546 }
6538 } // namespace v8::internal 6547 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.h » ('j') | src/heap/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698