OLD | NEW |
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/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
11 #include "src/ostreams.h" | 11 #include "src/ostreams.h" |
12 #include "src/regexp/jsregexp.h" | 12 #include "src/regexp/jsregexp.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 #ifdef VERIFY_HEAP | 17 #ifdef VERIFY_HEAP |
18 | 18 |
19 void Object::ObjectVerify() { | 19 void Object::ObjectVerify() { |
20 if (IsSmi()) { | 20 if (IsSmi()) { |
21 Smi::cast(this)->SmiVerify(); | 21 Smi::cast(this)->SmiVerify(); |
22 } else { | 22 } else { |
23 HeapObject::cast(this)->HeapObjectVerify(); | 23 HeapObject::cast(this)->HeapObjectVerify(); |
24 } | 24 } |
| 25 CHECK(!IsConstructor() || IsCallable()); |
25 } | 26 } |
26 | 27 |
27 | 28 |
28 void Object::VerifyPointer(Object* p) { | 29 void Object::VerifyPointer(Object* p) { |
29 if (p->IsHeapObject()) { | 30 if (p->IsHeapObject()) { |
30 HeapObject::VerifyHeapPointer(p); | 31 HeapObject::VerifyHeapPointer(p); |
31 } else { | 32 } else { |
32 CHECK(p->IsSmi()); | 33 CHECK(p->IsSmi()); |
33 } | 34 } |
34 } | 35 } |
35 | 36 |
36 | 37 |
37 void Smi::SmiVerify() { | 38 void Smi::SmiVerify() { |
38 CHECK(IsSmi()); | 39 CHECK(IsSmi()); |
39 CHECK(!IsCallable()); | 40 CHECK(!IsCallable()); |
| 41 CHECK(!IsConstructor()); |
40 } | 42 } |
41 | 43 |
42 | 44 |
43 void HeapObject::HeapObjectVerify() { | 45 void HeapObject::HeapObjectVerify() { |
44 InstanceType instance_type = map()->instance_type(); | 46 InstanceType instance_type = map()->instance_type(); |
45 | 47 |
46 if (instance_type < FIRST_NONSTRING_TYPE) { | 48 if (instance_type < FIRST_NONSTRING_TYPE) { |
47 String::cast(this)->StringVerify(); | 49 String::cast(this)->StringVerify(); |
48 return; | 50 return; |
49 } | 51 } |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 | 1331 |
1330 // Both are done at the same time. | 1332 // Both are done at the same time. |
1331 CHECK_EQ(new_it.done(), old_it.done()); | 1333 CHECK_EQ(new_it.done(), old_it.done()); |
1332 } | 1334 } |
1333 | 1335 |
1334 | 1336 |
1335 #endif // DEBUG | 1337 #endif // DEBUG |
1336 | 1338 |
1337 } // namespace internal | 1339 } // namespace internal |
1338 } // namespace v8 | 1340 } // namespace v8 |
OLD | NEW |