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

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

Issue 2640623002: [heap] VerifyPointersVisitor should check that non-HeapObjects are Smis (Closed)
Patch Set: Created 3 years, 11 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 #ifndef V8_HEAP_HEAP_INL_H_ 5 #ifndef V8_HEAP_HEAP_INL_H_
6 #define V8_HEAP_HEAP_INL_H_ 6 #define V8_HEAP_HEAP_INL_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 heap_->always_allocate_scope_count_.Increment(-1); 843 heap_->always_allocate_scope_count_.Increment(-1);
844 } 844 }
845 845
846 846
847 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { 847 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) {
848 for (Object** current = start; current < end; current++) { 848 for (Object** current = start; current < end; current++) {
849 if ((*current)->IsHeapObject()) { 849 if ((*current)->IsHeapObject()) {
850 HeapObject* object = HeapObject::cast(*current); 850 HeapObject* object = HeapObject::cast(*current);
851 CHECK(object->GetIsolate()->heap()->Contains(object)); 851 CHECK(object->GetIsolate()->heap()->Contains(object));
852 CHECK(object->map()->IsMap()); 852 CHECK(object->map()->IsMap());
853 } else {
854 CHECK((*current)->IsSmi());
853 } 855 }
854 } 856 }
855 } 857 }
856 858
857 859
858 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { 860 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) {
859 for (Object** current = start; current < end; current++) { 861 for (Object** current = start; current < end; current++) {
860 CHECK((*current)->IsSmi()); 862 CHECK((*current)->IsSmi());
861 } 863 }
862 } 864 }
863 } // namespace internal 865 } // namespace internal
864 } // namespace v8 866 } // namespace v8
865 867
866 #endif // V8_HEAP_HEAP_INL_H_ 868 #endif // V8_HEAP_HEAP_INL_H_
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