| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
| 8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
| 9 #include "src/jsregexp.h" | 9 #include "src/jsregexp.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 switch (instance_type) { | 49 switch (instance_type) { |
| 50 case SYMBOL_TYPE: | 50 case SYMBOL_TYPE: |
| 51 Symbol::cast(this)->SymbolVerify(); | 51 Symbol::cast(this)->SymbolVerify(); |
| 52 break; | 52 break; |
| 53 case MAP_TYPE: | 53 case MAP_TYPE: |
| 54 Map::cast(this)->MapVerify(); | 54 Map::cast(this)->MapVerify(); |
| 55 break; | 55 break; |
| 56 case HEAP_NUMBER_TYPE: | 56 case HEAP_NUMBER_TYPE: |
| 57 case MUTABLE_HEAP_NUMBER_TYPE: |
| 57 HeapNumber::cast(this)->HeapNumberVerify(); | 58 HeapNumber::cast(this)->HeapNumberVerify(); |
| 58 break; | 59 break; |
| 59 case FIXED_ARRAY_TYPE: | 60 case FIXED_ARRAY_TYPE: |
| 60 FixedArray::cast(this)->FixedArrayVerify(); | 61 FixedArray::cast(this)->FixedArrayVerify(); |
| 61 break; | 62 break; |
| 62 case FIXED_DOUBLE_ARRAY_TYPE: | 63 case FIXED_DOUBLE_ARRAY_TYPE: |
| 63 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 64 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
| 64 break; | 65 break; |
| 65 case CONSTANT_POOL_ARRAY_TYPE: | 66 case CONSTANT_POOL_ARRAY_TYPE: |
| 66 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); | 67 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 void Symbol::SymbolVerify() { | 199 void Symbol::SymbolVerify() { |
| 199 CHECK(IsSymbol()); | 200 CHECK(IsSymbol()); |
| 200 CHECK(HasHashCode()); | 201 CHECK(HasHashCode()); |
| 201 CHECK_GT(Hash(), 0); | 202 CHECK_GT(Hash(), 0); |
| 202 CHECK(name()->IsUndefined() || name()->IsString()); | 203 CHECK(name()->IsUndefined() || name()->IsString()); |
| 203 CHECK(flags()->IsSmi()); | 204 CHECK(flags()->IsSmi()); |
| 204 } | 205 } |
| 205 | 206 |
| 206 | 207 |
| 207 void HeapNumber::HeapNumberVerify() { | 208 void HeapNumber::HeapNumberVerify() { |
| 208 CHECK(IsHeapNumber()); | 209 CHECK(IsHeapNumber() || IsMutableHeapNumber()); |
| 209 } | 210 } |
| 210 | 211 |
| 211 | 212 |
| 212 void ByteArray::ByteArrayVerify() { | 213 void ByteArray::ByteArrayVerify() { |
| 213 CHECK(IsByteArray()); | 214 CHECK(IsByteArray()); |
| 214 } | 215 } |
| 215 | 216 |
| 216 | 217 |
| 217 void FreeSpace::FreeSpaceVerify() { | 218 void FreeSpace::FreeSpaceVerify() { |
| 218 CHECK(IsFreeSpace()); | 219 CHECK(IsFreeSpace()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (HasFastProperties()) { | 257 if (HasFastProperties()) { |
| 257 CHECK_EQ(map()->unused_property_fields(), | 258 CHECK_EQ(map()->unused_property_fields(), |
| 258 (map()->inobject_properties() + properties()->length() - | 259 (map()->inobject_properties() + properties()->length() - |
| 259 map()->NextFreePropertyIndex())); | 260 map()->NextFreePropertyIndex())); |
| 260 DescriptorArray* descriptors = map()->instance_descriptors(); | 261 DescriptorArray* descriptors = map()->instance_descriptors(); |
| 261 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 262 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { |
| 262 if (descriptors->GetDetails(i).type() == FIELD) { | 263 if (descriptors->GetDetails(i).type() == FIELD) { |
| 263 Representation r = descriptors->GetDetails(i).representation(); | 264 Representation r = descriptors->GetDetails(i).representation(); |
| 264 FieldIndex index = FieldIndex::ForDescriptor(map(), i); | 265 FieldIndex index = FieldIndex::ForDescriptor(map(), i); |
| 265 Object* value = RawFastPropertyAt(index); | 266 Object* value = RawFastPropertyAt(index); |
| 266 if (r.IsDouble()) ASSERT(value->IsHeapNumber()); | 267 if (r.IsDouble()) ASSERT(value->IsMutableHeapNumber()); |
| 267 if (value->IsUninitialized()) continue; | 268 if (value->IsUninitialized()) continue; |
| 268 if (r.IsSmi()) ASSERT(value->IsSmi()); | 269 if (r.IsSmi()) ASSERT(value->IsSmi()); |
| 269 if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); | 270 if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); |
| 270 HeapType* field_type = descriptors->GetFieldType(i); | 271 HeapType* field_type = descriptors->GetFieldType(i); |
| 271 if (r.IsNone()) { | 272 if (r.IsNone()) { |
| 272 CHECK(field_type->Is(HeapType::None())); | 273 CHECK(field_type->Is(HeapType::None())); |
| 273 } else if (!HeapType::Any()->Is(field_type)) { | 274 } else if (!HeapType::Any()->Is(field_type)) { |
| 274 CHECK(!field_type->NowStable() || field_type->NowContains(value)); | 275 CHECK(!field_type->NowStable() || field_type->NowContains(value)); |
| 275 } | 276 } |
| 276 } | 277 } |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 for (int i = 0; i < number_of_transitions(); ++i) { | 1186 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1186 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1187 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1187 } | 1188 } |
| 1188 return true; | 1189 return true; |
| 1189 } | 1190 } |
| 1190 | 1191 |
| 1191 | 1192 |
| 1192 #endif // DEBUG | 1193 #endif // DEBUG |
| 1193 | 1194 |
| 1194 } } // namespace v8::internal | 1195 } } // namespace v8::internal |
| OLD | NEW |