case MUTABLE_HEAP_NUMBER_TYPE:
HeapNumber::cast(this)->HeapNumberVerify();
break;
- case FLOAT32x4_TYPE:
- Float32x4::cast(this)->Float32x4Verify();
- break;
- case FLOAT64x2_TYPE:
- Float64x2::cast(this)->Float64x2Verify();
- break;
- case INT32x4_TYPE:
- Int32x4::cast(this)->Int32x4Verify();
- break;
case FIXED_ARRAY_TYPE:
FixedArray::cast(this)->FixedArrayVerify();
break;
case PROPERTY_CELL_TYPE:
PropertyCell::cast(this)->PropertyCellVerify();
break;
+ case WEAK_CELL_TYPE:
+ WeakCell::cast(this)->WeakCellVerify();
+ break;
case JS_ARRAY_TYPE:
JSArray::cast(this)->JSArrayVerify();
break;
}
-void Float32x4::Float32x4Verify() {
- CHECK(IsFloat32x4());
-}
-
-
-void Float64x2::Float64x2Verify() {
- CHECK(IsFloat64x2());
-}
-
-
-void Int32x4::Int32x4Verify() {
- CHECK(IsInt32x4());
-}
-
-
void ByteArray::ByteArrayVerify() {
CHECK(IsByteArray());
}
}
if (HasFastProperties()) {
- CHECK_EQ(map()->unused_property_fields(),
- (map()->inobject_properties() + properties()->length() -
- map()->NextFreePropertyIndex()));
+ int actual_unused_property_fields = map()->inobject_properties() +
+ properties()->length() -
+ map()->NextFreePropertyIndex();
+ if (map()->unused_property_fields() != actual_unused_property_fields) {
+ // This could actually happen in the middle of StoreTransitionStub
+ // when the new extended backing store is already set into the object and
+ // the allocation of the MutableHeapNumber triggers GC (in this case map
+ // is not updated yet).
+ CHECK_EQ(map()->unused_property_fields(),
+ actual_unused_property_fields - JSObject::kFieldsAdded);
+ }
DescriptorArray* descriptors = map()->instance_descriptors();
for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
if (descriptors->GetDetails(i).type() == FIELD) {
VerifyObjectField(JSGlobalProxy::kNativeContextOffset);
// Make sure that this object has no properties, elements.
CHECK_EQ(0, properties()->length());
- CHECK(HasFastSmiElements());
+ CHECK_EQ(FAST_HOLEY_SMI_ELEMENTS, GetElementsKind());
CHECK_EQ(0, FixedArray::cast(elements())->length());
}
}
+void WeakCell::WeakCellVerify() {
+ CHECK(IsWeakCell());
+ VerifyObjectField(kValueOffset);
+ VerifyObjectField(kNextOffset);
+}
+
+
void Code::CodeVerify() {
CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()),
kCodeAlignment));
}
+void Code::VerifyEmbeddedObjectsInFullCode() {
+ // Check that no context-specific object has been embedded.
+ Heap* heap = GetIsolate()->heap();
+ int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
+ for (RelocIterator it(this, mask); !it.done(); it.next()) {
+ Object* obj = it.rinfo()->target_object();
+ if (obj->IsCell()) obj = Cell::cast(obj)->value();
+ if (obj->IsPropertyCell()) obj = PropertyCell::cast(obj)->value();
+ if (!obj->IsHeapObject()) continue;
+ Map* map = obj->IsMap() ? Map::cast(obj) : HeapObject::cast(obj)->map();
+ int i = 0;
+ while (map != heap->roots_array_start()[i++]) {
+ CHECK_LT(i, Heap::kStrongRootListLength);
+ }
+ }
+}
+
+
#endif // DEBUG
} } // namespace v8::internal