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

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

Issue 2858523002: Merged: [heap] Filter out non-heap values when tracing wrappers (Closed)
Patch Set: Created 3 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
« 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 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/heap/heap.h" 5 #include "src/heap/heap.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/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/ast/context-slot-cache.h" 10 #include "src/ast/context-slot-cache.h"
(...skipping 5643 matching lines...) Expand 10 before | Expand all | Expand 10 after
5654 js_object->GetEmbedderField(0) != undefined_value() && 5654 js_object->GetEmbedderField(0) != undefined_value() &&
5655 js_object->GetEmbedderField(1) != undefined_value()) { 5655 js_object->GetEmbedderField(1) != undefined_value()) {
5656 DCHECK(reinterpret_cast<intptr_t>(js_object->GetEmbedderField(0)) % 2 == 0); 5656 DCHECK(reinterpret_cast<intptr_t>(js_object->GetEmbedderField(0)) % 2 == 0);
5657 local_embedder_heap_tracer()->AddWrapperToTrace(std::pair<void*, void*>( 5657 local_embedder_heap_tracer()->AddWrapperToTrace(std::pair<void*, void*>(
5658 reinterpret_cast<void*>(js_object->GetEmbedderField(0)), 5658 reinterpret_cast<void*>(js_object->GetEmbedderField(0)),
5659 reinterpret_cast<void*>(js_object->GetEmbedderField(1)))); 5659 reinterpret_cast<void*>(js_object->GetEmbedderField(1))));
5660 } 5660 }
5661 } 5661 }
5662 5662
5663 void Heap::RegisterExternallyReferencedObject(Object** object) { 5663 void Heap::RegisterExternallyReferencedObject(Object** object) {
5664 // The embedder is not aware of whether numbers are materialized as heap
5665 // objects are just passed around as Smis.
5666 if (!(*object)->IsHeapObject()) return;
5664 HeapObject* heap_object = HeapObject::cast(*object); 5667 HeapObject* heap_object = HeapObject::cast(*object);
5665 DCHECK(Contains(heap_object)); 5668 DCHECK(Contains(heap_object));
5666 if (FLAG_incremental_marking_wrappers && incremental_marking()->IsMarking()) { 5669 if (FLAG_incremental_marking_wrappers && incremental_marking()->IsMarking()) {
5667 IncrementalMarking::MarkGrey(this, heap_object); 5670 IncrementalMarking::MarkGrey(this, heap_object);
5668 } else { 5671 } else {
5669 DCHECK(mark_compact_collector()->in_use()); 5672 DCHECK(mark_compact_collector()->in_use());
5670 mark_compact_collector()->MarkObject(heap_object); 5673 mark_compact_collector()->MarkObject(heap_object);
5671 } 5674 }
5672 } 5675 }
5673 5676
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
6399 } 6402 }
6400 6403
6401 6404
6402 // static 6405 // static
6403 int Heap::GetStaticVisitorIdForMap(Map* map) { 6406 int Heap::GetStaticVisitorIdForMap(Map* map) {
6404 return StaticVisitorBase::GetVisitorId(map); 6407 return StaticVisitorBase::GetVisitorId(map);
6405 } 6408 }
6406 6409
6407 } // namespace internal 6410 } // namespace internal
6408 } // namespace v8 6411 } // 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