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

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

Issue 1465223007: Fix promotion of JSFunctions with in-object properties. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | 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 #include "src/heap/scavenger.h" 5 #include "src/heap/scavenger.h"
6 6
7 #include "src/contexts.h" 7 #include "src/contexts.h"
8 #include "src/heap/heap.h" 8 #include "src/heap/heap.h"
9 #include "src/heap/objects-visiting-inl.h" 9 #include "src/heap/objects-visiting-inl.h"
10 #include "src/heap/scavenger-inl.h" 10 #include "src/heap/scavenger-inl.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 heap->old_space()->AllocateRaw(object_size, alignment); 185 heap->old_space()->AllocateRaw(object_size, alignment);
186 186
187 HeapObject* target = NULL; // Initialization to please compiler. 187 HeapObject* target = NULL; // Initialization to please compiler.
188 if (allocation.To(&target)) { 188 if (allocation.To(&target)) {
189 MigrateObject(heap, object, target, object_size); 189 MigrateObject(heap, object, target, object_size);
190 190
191 // Update slot to new target. 191 // Update slot to new target.
192 *slot = target; 192 *slot = target;
193 193
194 if (object_contents == POINTER_OBJECT) { 194 if (object_contents == POINTER_OBJECT) {
195 if (map->instance_type() == JS_FUNCTION_TYPE) { 195 heap->promotion_queue()->insert(target, object_size);
196 heap->promotion_queue()->insert(target,
197 JSFunction::kNonWeakFieldsEndOffset);
198 } else {
199 heap->promotion_queue()->insert(target, object_size);
200 }
201 } 196 }
202 heap->IncrementPromotedObjectsSize(object_size); 197 heap->IncrementPromotedObjectsSize(object_size);
203 return true; 198 return true;
204 } 199 }
205 return false; 200 return false;
206 } 201 }
207 202
208 203
209 template <ObjectContents object_contents, AllocationAlignment alignment> 204 template <ObjectContents object_contents, AllocationAlignment alignment>
210 static inline void EvacuateObject(Map* map, HeapObject** slot, 205 static inline void EvacuateObject(Map* map, HeapObject** slot,
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 477
483 void ScavengeVisitor::ScavengePointer(Object** p) { 478 void ScavengeVisitor::ScavengePointer(Object** p) {
484 Object* object = *p; 479 Object* object = *p;
485 if (!heap_->InNewSpace(object)) return; 480 if (!heap_->InNewSpace(object)) return;
486 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), 481 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
487 reinterpret_cast<HeapObject*>(object)); 482 reinterpret_cast<HeapObject*>(object));
488 } 483 }
489 484
490 } // namespace internal 485 } // namespace internal
491 } // namespace v8 486 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698