| 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/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
| 10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 void JSObject::JSObjectVerify() { | 249 void JSObject::JSObjectVerify() { |
| 250 VerifyHeapPointer(properties()); | 250 VerifyHeapPointer(properties()); |
| 251 VerifyHeapPointer(elements()); | 251 VerifyHeapPointer(elements()); |
| 252 | 252 |
| 253 if (GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS) { | 253 if (GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS) { |
| 254 CHECK(this->elements()->IsFixedArray()); | 254 CHECK(this->elements()->IsFixedArray()); |
| 255 CHECK_GE(this->elements()->length(), 2); | 255 CHECK_GE(this->elements()->length(), 2); |
| 256 } | 256 } |
| 257 | 257 |
| 258 if (HasFastProperties()) { | 258 if (HasFastProperties()) { |
| 259 CHECK_EQ(map()->unused_property_fields(), | 259 int actual_unused_property_fields = map()->inobject_properties() + |
| 260 (map()->inobject_properties() + properties()->length() - | 260 properties()->length() - |
| 261 map()->NextFreePropertyIndex())); | 261 map()->NextFreePropertyIndex(); |
| 262 if (map()->unused_property_fields() != actual_unused_property_fields) { |
| 263 // This could actually happen in the middle of StoreTransitionStub |
| 264 // when the new extended backing store is already set into the object and |
| 265 // the allocation of the MutableHeapNumber triggers GC (in this case map |
| 266 // is not updated yet). |
| 267 CHECK_EQ(map()->unused_property_fields(), |
| 268 actual_unused_property_fields - JSObject::kFieldsAdded); |
| 269 } |
| 262 DescriptorArray* descriptors = map()->instance_descriptors(); | 270 DescriptorArray* descriptors = map()->instance_descriptors(); |
| 263 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 271 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { |
| 264 if (descriptors->GetDetails(i).type() == FIELD) { | 272 if (descriptors->GetDetails(i).type() == FIELD) { |
| 265 Representation r = descriptors->GetDetails(i).representation(); | 273 Representation r = descriptors->GetDetails(i).representation(); |
| 266 FieldIndex index = FieldIndex::ForDescriptor(map(), i); | 274 FieldIndex index = FieldIndex::ForDescriptor(map(), i); |
| 267 Object* value = RawFastPropertyAt(index); | 275 Object* value = RawFastPropertyAt(index); |
| 268 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); | 276 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); |
| 269 if (value->IsUninitialized()) continue; | 277 if (value->IsUninitialized()) continue; |
| 270 if (r.IsSmi()) DCHECK(value->IsSmi()); | 278 if (r.IsSmi()) DCHECK(value->IsSmi()); |
| 271 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); | 279 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 for (int i = 0; i < number_of_transitions(); ++i) { | 1204 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1197 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1205 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1198 } | 1206 } |
| 1199 return true; | 1207 return true; |
| 1200 } | 1208 } |
| 1201 | 1209 |
| 1202 | 1210 |
| 1203 #endif // DEBUG | 1211 #endif // DEBUG |
| 1204 | 1212 |
| 1205 } } // namespace v8::internal | 1213 } } // namespace v8::internal |
| OLD | NEW |