OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 void HeapObject::HeapObjectVerify() { | 74 void HeapObject::HeapObjectVerify() { |
75 InstanceType instance_type = map()->instance_type(); | 75 InstanceType instance_type = map()->instance_type(); |
76 | 76 |
77 if (instance_type < FIRST_NONSTRING_TYPE) { | 77 if (instance_type < FIRST_NONSTRING_TYPE) { |
78 String::cast(this)->StringVerify(); | 78 String::cast(this)->StringVerify(); |
79 return; | 79 return; |
80 } | 80 } |
81 | 81 |
82 switch (instance_type) { | 82 switch (instance_type) { |
| 83 case SYMBOL_TYPE: |
| 84 Symbol::cast(this)->SymbolVerify(); |
| 85 break; |
83 case MAP_TYPE: | 86 case MAP_TYPE: |
84 Map::cast(this)->MapVerify(); | 87 Map::cast(this)->MapVerify(); |
85 break; | 88 break; |
86 case HEAP_NUMBER_TYPE: | 89 case HEAP_NUMBER_TYPE: |
87 HeapNumber::cast(this)->HeapNumberVerify(); | 90 HeapNumber::cast(this)->HeapNumberVerify(); |
88 break; | 91 break; |
89 case FIXED_ARRAY_TYPE: | 92 case FIXED_ARRAY_TYPE: |
90 FixedArray::cast(this)->FixedArrayVerify(); | 93 FixedArray::cast(this)->FixedArrayVerify(); |
91 break; | 94 break; |
92 case FIXED_DOUBLE_ARRAY_TYPE: | 95 case FIXED_DOUBLE_ARRAY_TYPE: |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 209 } |
207 } | 210 } |
208 | 211 |
209 | 212 |
210 void HeapObject::VerifyHeapPointer(Object* p) { | 213 void HeapObject::VerifyHeapPointer(Object* p) { |
211 CHECK(p->IsHeapObject()); | 214 CHECK(p->IsHeapObject()); |
212 CHECK(HEAP->Contains(HeapObject::cast(p))); | 215 CHECK(HEAP->Contains(HeapObject::cast(p))); |
213 } | 216 } |
214 | 217 |
215 | 218 |
| 219 void Symbol::SymbolVerify() { |
| 220 CHECK(IsSymbol()); |
| 221 CHECK(HasHashCode()); |
| 222 CHECK_GT(Hash(), 0); |
| 223 } |
| 224 |
| 225 |
216 void HeapNumber::HeapNumberVerify() { | 226 void HeapNumber::HeapNumberVerify() { |
217 CHECK(IsHeapNumber()); | 227 CHECK(IsHeapNumber()); |
218 } | 228 } |
219 | 229 |
220 | 230 |
221 void ByteArray::ByteArrayVerify() { | 231 void ByteArray::ByteArrayVerify() { |
222 CHECK(IsByteArray()); | 232 CHECK(IsByteArray()); |
223 } | 233 } |
224 | 234 |
225 | 235 |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 for (int i = 0; i < number_of_transitions(); ++i) { | 1040 for (int i = 0; i < number_of_transitions(); ++i) { |
1031 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1041 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1032 } | 1042 } |
1033 return true; | 1043 return true; |
1034 } | 1044 } |
1035 | 1045 |
1036 | 1046 |
1037 #endif // DEBUG | 1047 #endif // DEBUG |
1038 | 1048 |
1039 } } // namespace v8::internal | 1049 } } // namespace v8::internal |
OLD | NEW |