| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 80   } | 80   } | 
| 81 | 81 | 
| 82   switch (instance_type) { | 82   switch (instance_type) { | 
| 83     case SYMBOL_TYPE: | 83     case SYMBOL_TYPE: | 
| 84       Symbol::cast(this)->SymbolVerify(); | 84       Symbol::cast(this)->SymbolVerify(); | 
| 85       break; | 85       break; | 
| 86     case MAP_TYPE: | 86     case MAP_TYPE: | 
| 87       Map::cast(this)->MapVerify(); | 87       Map::cast(this)->MapVerify(); | 
| 88       break; | 88       break; | 
| 89     case HEAP_NUMBER_TYPE: | 89     case HEAP_NUMBER_TYPE: | 
|  | 90     case MUTABLE_HEAP_NUMBER_TYPE: | 
| 90       HeapNumber::cast(this)->HeapNumberVerify(); | 91       HeapNumber::cast(this)->HeapNumberVerify(); | 
| 91       break; | 92       break; | 
| 92     case FIXED_ARRAY_TYPE: | 93     case FIXED_ARRAY_TYPE: | 
| 93       FixedArray::cast(this)->FixedArrayVerify(); | 94       FixedArray::cast(this)->FixedArrayVerify(); | 
| 94       break; | 95       break; | 
| 95     case FIXED_DOUBLE_ARRAY_TYPE: | 96     case FIXED_DOUBLE_ARRAY_TYPE: | 
| 96       FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 97       FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 
| 97       break; | 98       break; | 
| 98     case CONSTANT_POOL_ARRAY_TYPE: | 99     case CONSTANT_POOL_ARRAY_TYPE: | 
| 99       ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); | 100       ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); | 
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 225 void Symbol::SymbolVerify() { | 226 void Symbol::SymbolVerify() { | 
| 226   CHECK(IsSymbol()); | 227   CHECK(IsSymbol()); | 
| 227   CHECK(HasHashCode()); | 228   CHECK(HasHashCode()); | 
| 228   CHECK_GT(Hash(), 0); | 229   CHECK_GT(Hash(), 0); | 
| 229   CHECK(name()->IsUndefined() || name()->IsString()); | 230   CHECK(name()->IsUndefined() || name()->IsString()); | 
| 230   CHECK(flags()->IsSmi()); | 231   CHECK(flags()->IsSmi()); | 
| 231 } | 232 } | 
| 232 | 233 | 
| 233 | 234 | 
| 234 void HeapNumber::HeapNumberVerify() { | 235 void HeapNumber::HeapNumberVerify() { | 
| 235   CHECK(IsHeapNumber()); | 236   CHECK(IsHeapNumber() || IsMutableHeapNumber()); | 
| 236 } | 237 } | 
| 237 | 238 | 
| 238 | 239 | 
| 239 void ByteArray::ByteArrayVerify() { | 240 void ByteArray::ByteArrayVerify() { | 
| 240   CHECK(IsByteArray()); | 241   CHECK(IsByteArray()); | 
| 241 } | 242 } | 
| 242 | 243 | 
| 243 | 244 | 
| 244 void FreeSpace::FreeSpaceVerify() { | 245 void FreeSpace::FreeSpaceVerify() { | 
| 245   CHECK(IsFreeSpace()); | 246   CHECK(IsFreeSpace()); | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 283   if (HasFastProperties()) { | 284   if (HasFastProperties()) { | 
| 284     CHECK_EQ(map()->unused_property_fields(), | 285     CHECK_EQ(map()->unused_property_fields(), | 
| 285              (map()->inobject_properties() + properties()->length() - | 286              (map()->inobject_properties() + properties()->length() - | 
| 286               map()->NextFreePropertyIndex())); | 287               map()->NextFreePropertyIndex())); | 
| 287     DescriptorArray* descriptors = map()->instance_descriptors(); | 288     DescriptorArray* descriptors = map()->instance_descriptors(); | 
| 288     for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 289     for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 
| 289       if (descriptors->GetDetails(i).type() == FIELD) { | 290       if (descriptors->GetDetails(i).type() == FIELD) { | 
| 290         Representation r = descriptors->GetDetails(i).representation(); | 291         Representation r = descriptors->GetDetails(i).representation(); | 
| 291         int field = descriptors->GetFieldIndex(i); | 292         int field = descriptors->GetFieldIndex(i); | 
| 292         Object* value = RawFastPropertyAt(field); | 293         Object* value = RawFastPropertyAt(field); | 
| 293         if (r.IsDouble()) ASSERT(value->IsHeapNumber()); | 294         if (r.IsDouble()) ASSERT(value->IsMutableHeapNumber()); | 
| 294         if (value->IsUninitialized()) continue; | 295         if (value->IsUninitialized()) continue; | 
| 295         if (r.IsSmi()) ASSERT(value->IsSmi()); | 296         if (r.IsSmi()) ASSERT(value->IsSmi()); | 
| 296         if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); | 297         if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); | 
| 297       } | 298       } | 
| 298     } | 299     } | 
| 299   } | 300   } | 
| 300 | 301 | 
| 301   // If a GC was caused while constructing this object, the elements | 302   // If a GC was caused while constructing this object, the elements | 
| 302   // pointer may point to a one pointer filler map. | 303   // pointer may point to a one pointer filler map. | 
| 303   if (ElementsAreSafeToExamine()) { | 304   if (ElementsAreSafeToExamine()) { | 
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1157   for (int i = 0; i < number_of_transitions(); ++i) { | 1158   for (int i = 0; i < number_of_transitions(); ++i) { | 
| 1158     if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1159     if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 
| 1159   } | 1160   } | 
| 1160   return true; | 1161   return true; | 
| 1161 } | 1162 } | 
| 1162 | 1163 | 
| 1163 | 1164 | 
| 1164 #endif  // DEBUG | 1165 #endif  // DEBUG | 
| 1165 | 1166 | 
| 1166 } }  // namespace v8::internal | 1167 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|