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

Side by Side Diff: src/objects-debug.cc

Issue 2625053006: [debugging] Add %Verify() helper and check verify a HeapObject has a Map. (Closed)
Patch Set: added simple verification in release build 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 | src/runtime/runtime.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 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/disasm.h" 8 #include "src/disasm.h"
9 #include "src/disassembler.h" 9 #include "src/disassembler.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 26 matching lines...) Expand all
37 37
38 38
39 void Smi::SmiVerify() { 39 void Smi::SmiVerify() {
40 CHECK(IsSmi()); 40 CHECK(IsSmi());
41 CHECK(!IsCallable()); 41 CHECK(!IsCallable());
42 CHECK(!IsConstructor()); 42 CHECK(!IsConstructor());
43 } 43 }
44 44
45 45
46 void HeapObject::HeapObjectVerify() { 46 void HeapObject::HeapObjectVerify() {
47 VerifyHeapPointer(map());
48 CHECK(map()->IsMap());
47 InstanceType instance_type = map()->instance_type(); 49 InstanceType instance_type = map()->instance_type();
48 50
49 if (instance_type < FIRST_NONSTRING_TYPE) { 51 if (instance_type < FIRST_NONSTRING_TYPE) {
50 String::cast(this)->StringVerify(); 52 String::cast(this)->StringVerify();
51 return; 53 return;
52 } 54 }
53 55
54 switch (instance_type) { 56 switch (instance_type) {
55 case SYMBOL_TYPE: 57 case SYMBOL_TYPE:
56 Symbol::cast(this)->SymbolVerify(); 58 Symbol::cast(this)->SymbolVerify();
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 1564
1563 // Both are done at the same time. 1565 // Both are done at the same time.
1564 CHECK_EQ(new_it.done(), old_it.done()); 1566 CHECK_EQ(new_it.done(), old_it.done());
1565 } 1567 }
1566 1568
1567 1569
1568 #endif // DEBUG 1570 #endif // DEBUG
1569 1571
1570 } // namespace internal 1572 } // namespace internal
1571 } // namespace v8 1573 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698