Lines Matching defs:slot

22 void LogErrorForObjSlot(const BaseHeap *heap, const char *headerInfo, TaggedObject *obj, ObjectSlot slot,
25 TaggedObject *slotValue = slot.GetTaggedObject();
35 << ", slot address=" << reinterpret_cast<void*>(slot.SlotAddress())
36 << ", slot value=" << slotValue
37 << ", slot value region=" << slotRegion
38 << ", slot value space type=" << slotRegion->GetSpaceTypeName()
39 << ", slot value type=" << JSHClass::DumpJSType(slotValue->GetClass()->GetObjectType())
45 << ", obj slot oldToNew bit=" << region->TestOldToNew(slot.SlotAddress())
46 << ", obj slot newToEden bit=" << region->TestNewToEden(slot.SlotAddress())
47 << ", obj slot value mark bit=" << slotRegion->Test(slotValue)
78 ObjectSlot slot(ToUintPtr(object));
83 "but InactiveSemiSpace(FromSpace) Object.", object, slot, value);
100 for (ObjectSlot slot = start; slot < end; slot++) {
104 VerifyObjectSlotLegal(slot, root);
109 for (ObjectSlot slot = start; slot < end; slot++) {
110 VerifyObjectSlotLegal(slot, root);
115 void VerifyObjectVisitor::VerifyObjectSlotLegal(ObjectSlot slot, TaggedObject *object) const
117 JSTaggedValue value(slot.GetTaggedType());
121 object, slot, value.GetTaggedWeakRef());
125 object, slot, value.GetTaggedWeakRef());
129 VerifyHeapObjectSlotLegal(slot, value, object);
133 void VerifyObjectVisitor::VerifyHeapObjectSlotLegal(ObjectSlot slot,
140 object, slot, slotValue.GetTaggedObject());
144 object, slot, slotValue.GetTaggedObject());
152 VerifyMarkEden(object, slot, slotValue.GetTaggedObject());
155 VerifyEvacuateEden(object, slot, slotValue.GetTaggedObject());
158 VerifyMarkYoung(object, slot, slotValue.GetTaggedObject());
161 VerifyEvacuateYoung(object, slot, slotValue.GetTaggedObject());
164 VerifyMarkFull(object, slot, slotValue.GetTaggedObject());
167 VerifyEvacuateOld(object, slot, slotValue.GetTaggedObject());
170 VerifyEvacuateFull(object, slot, slotValue.GetTaggedObject());
173 VerifySharedRSetPostFullGC(object, slot, slotValue.GetTaggedObject());
177 VerifySharedObjectReference(object, slot, slotValue.GetTaggedObject());
185 void VerifyObjectVisitor::VerifyMarkEden(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
192 if (!objectRegion->TestOldToNew(slot.SlotAddress())) {
193 LogErrorForObjSlot(heap_, "Verify MarkEden: Old object, slot miss old_to_new bit.", object, slot, value);
195 LogErrorForObjSlot(heap_, "Verify MarkEden: Old object, slot has old_to_new bit, miss gc_mark bit.",
196 object, slot, value);
201 if (!objectRegion->TestNewToEden(slot.SlotAddress())) {
204 LogErrorForObjSlot(heap_, "Verify MarkEden: Young object, slot miss new_to_eden bit.", object, slot, value);
206 LogErrorForObjSlot(heap_, "Verify MarkEden: Young object, slot has new_to_eden bit, miss gc_mark bit.",
207 object, slot, value);
217 LogErrorForObjSlot(heap_, "Verify MarkEden: Marked object, slot in EdenSpace, miss gc_mark bit.",
218 object, slot, value);
222 LogErrorForObjSlot(heap_, "Verify MarkEden: Marked object, slot marked, but NOT in Eden Space.",
223 object, slot, value);
229 void VerifyObjectVisitor::VerifyMarkYoung(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
235 if (!objectRegion->TestOldToNew(slot.SlotAddress())) {
236 LogErrorForObjSlot(heap_, "Verify MarkYoung: Old object, slot miss old_to_new bit.", object, slot, value);
238 LogErrorForObjSlot(heap_, "Verify MarkYoung: Old object, slot has old_to_new bit, miss gc_mark bit.",
239 object, slot, value);
243 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) {
244 LogErrorForObjSlot(heap_, "Verify MarkYoung: Local object, slot local_to_share bit = 0, "
245 "but SharedHeap object.", object, slot, value);
254 LogErrorForObjSlot(heap_, "Verify MarkYoung: Marked object, slot in YoungSpace, miss gc_mark bit.",
255 object, slot, value);
260 LogErrorForObjSlot(heap_, "Verify MarkYoung: Marked object, slot marked, but NOT in "
261 "Young/AppSpawn/ReadOnly Space.", object, slot, value);
266 void VerifyObjectVisitor::VerifyEvacuateEden(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
271 if (objectRegion->TestOldToNew(slot.SlotAddress())) {
274 LogErrorForObjSlot(heap_, "Verify EvacuateEden: Old object, slot old_to_new bit = 1, "
275 "but in EdenSpace object.", object, slot, value);
277 LogErrorForObjSlot(heap_, "Verify EvacuateEden: Old object, slot old_to_new bit = 1, "
278 "but NOT ActiveSpace(ToSpace) object.", object, slot, value);
282 LogErrorForObjSlot(heap_, "Verify EvacuateEden: Old object, slot old_to_new bit = 0, "
283 "but YoungSpace object.", object, slot, value);
288 if (objectRegion->TestNewToEden(slot.SlotAddress())) {
290 LogErrorForObjSlot(heap_, "Verify EvacuateEden: Young object, slot young_to_eden bit = 1, "
291 "but NOT Eden object.", object, slot, value);
293 LogErrorForObjSlot(heap_, "Verify EvacuateEden: Young object, slot young_to_eden bit = 1, "
294 "but Eden object.", object, slot, value);
298 LogErrorForObjSlot(heap_, "Verify EvacuateEden: Young object, slot young_to_eden bit = 0, "
299 "but Eden object.", object, slot, value);
305 void VerifyObjectVisitor::VerifyEvacuateYoung(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
311 if (objectRegion->TestOldToNew(slot.SlotAddress())) {
314 LogErrorForObjSlot(heap_, "Verify EvacuateYoung: Old object, slot old_to_new bit = 1, "
315 "but in EdenSpace object.", object, slot, value);
317 LogErrorForObjSlot(heap_, "Verify EvacuateYoung: Old object, slot old_to_new bit = 1, "
318 "but NOT ActiveSpace(ToSpace) object.", object, slot, value);
322 LogErrorForObjSlot(heap_, "Verify EvacuateYoung: Old object, slot old_to_new bit = 0, "
323 "but YoungSpace object.", object, slot, value);
328 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) {
329 LogErrorForObjSlot(heap_, "Verify EvacuateYoung: Local object, slot local_to_share bit = 0, "
330 "but SharedHeap object.", object, slot, value);
335 LogErrorForObjSlot(heap_, "Verify EvacuateYoung: ActiveSpace object, slot in InactiveSpace(FromSpace).",
336 object, slot, value);
338 LogErrorForObjSlot(heap_, "Verify EvacuateYoung: ActiveSpace object, slot in EdenSpace.",
339 object, slot, value);
344 void VerifyObjectVisitor::VerifyMarkFull(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
349 if (!objectRegion->TestOldToNew(slot.SlotAddress())) {
350 LogErrorForObjSlot(heap_, "Verify MarkFull: Old object, slot miss old_to_new bit.", object, slot, value);
355 LogErrorForObjSlot(heap_, "Verify MarkFull: Marked object, slot miss gc_mark bit.", object, slot, value);
359 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) {
360 LogErrorForObjSlot(heap_, "Verify VerifyMarkFull: Local object, slot local_to_share bit = 0, "
361 "but SharedHeap object.", object, slot, value);
367 [[maybe_unused]]ObjectSlot slot,
370 VerifyEvacuateYoung(root, slot, value);
374 [[maybe_unused]]ObjectSlot slot,
377 VerifyEvacuateYoung(root, slot, value);
380 void VerifyObjectVisitor::VerifySharedObjectReference(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
387 object, slot, value);
390 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) {
391 LogErrorForObjSlot(heap_, "Verify SharedObjectReference: Local object, slot local_to_share bit = 0, "
392 "but SharedHeap object.", object, slot, value);
397 void VerifyObjectVisitor::VerifySharedRSetPostFullGC(TaggedObject *object, ObjectSlot slot, TaggedObject *value) const
402 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) {
403 LogErrorForObjSlot(heap_, "Verify SharedRSetPostFullGC: Local object, slot local_to_share bit = 0, "
404 "but SharedHeap object.", object, slot, value);
411 ObjectSlot slot(reinterpret_cast<uintptr_t>(obj));
413 LOG_GC(DEBUG) << "Heap object(" << slot.SlotAddress() << ") old to new rset fail: value is "
414 << slot.GetTaggedType();
421 LOG_GC(ERROR) << "Heap object(" << slot.GetTaggedType() << ") old to new rset fail: value("
422 << slot.GetTaggedObject() << "/"
423 << JSHClass::DumpJSType(slot.GetTaggedObject()->GetClass()->GetObjectType())
444 RootVisitor visitor = [this, &failCount]([[maybe_unused]] Root type, ObjectSlot slot) {
445 JSTaggedValue value(slot.GetTaggedType());
450 VerifyObjectSlot(slot, &failCount);
453 for (ObjectSlot slot = start; slot < end; slot++) {
454 JSTaggedValue value(slot.GetTaggedType());
459 VerifyObjectSlot(slot, &failCount);
492 void Verification::VerifyObjectSlot(const ObjectSlot &slot, size_t *failCount) const
494 JSTaggedValue value(slot.GetTaggedType());
563 auto f = [cm] (ObjectSlot slot, TaggedObject *obj) {
565 JSTaggedValue value(slot.GetTaggedType());
573 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) { // LCOV_EXCL_START
574 LOG_GC(FATAL) << "verify shared1 " << cm << ':' << slot.SlotAddress()
579 LOG_GC(FATAL) << "verify shared2 " << cm << ':' << slot.SlotAddress()
584 LOG_GC(FATAL) << "verify shared3 " << cm << ':' << slot.SlotAddress()
596 for (ObjectSlot slot = start; slot < end; slot++) {
600 f(slot, root);
605 for (ObjectSlot slot = start; slot < end; slot++) {
606 f(slot, root);
613 auto f = [cm] (ObjectSlot slot, TaggedObject *obj) {
618 JSTaggedValue value(slot.GetTaggedType());
624 LOG_GC(FATAL) << "verify shared4 " << cm << ':' << slot.SlotAddress()
630 LOG_GC(FATAL) << "verify shared5 " << cm << ':' << slot.SlotAddress()
635 LOG_GC(FATAL) << "verify shared6 " << cm << ':' << slot.SlotAddress()
647 for (ObjectSlot slot = start; slot < end; slot++) {
651 f(slot, root);
656 for (ObjectSlot slot = start; slot < end; slot++) {
657 f(slot, root);
675 auto f = [cm] (ObjectSlot slot, TaggedObject *obj) {
677 JSTaggedValue value(slot.GetTaggedType());
685 if (!objectRegion->TestLocalToShare(slot.SlotAddress())) { // LCOV_EXCL_START
686 LOG_GC(FATAL) << "verify shared7 " << cm << ':' << slot.SlotAddress()
691 LOG_GC(FATAL) << "verify shared8 " << cm << ':' << slot.SlotAddress()
696 LOG_GC(FATAL) << "verify shared9 " << cm << ':' << slot.SlotAddress()
708 for (ObjectSlot slot = start; slot < end; slot++) {
712 f(slot, root);
717 for (ObjectSlot slot = start; slot < end; slot++) {
718 f(slot, root);
725 auto f = [cm] (ObjectSlot slot, TaggedObject *obj) {
731 JSTaggedValue value(slot.GetTaggedType());
737 LOG_GC(FATAL) << "verify shared11 " << cm << ':' << slot.SlotAddress()
743 LOG_GC(FATAL) << "verify shared12 " << cm << ':' << slot.SlotAddress()
748 LOG_GC(FATAL) << "verify shared13 " << cm << ':' << slot.SlotAddress()
760 for (ObjectSlot slot = start; slot < end; slot++) {
764 f(slot, root);
769 for (ObjectSlot slot = start; slot < end; slot++) {
770 f(slot, root);
779 RootVisitor visitor = [this, &failCount]([[maybe_unused]] Root type, ObjectSlot slot) {
780 VerifyObjectSlot(slot, &failCount);
783 for (ObjectSlot slot = start; slot < end; slot++) {
784 VerifyObjectSlot(slot, &failCount);
791 RootVisitor serializeVisitor = [this, &failCount]([[maybe_unused]] Root type, ObjectSlot slot) {
792 JSTaggedValue value(slot.GetTaggedType());
844 void SharedHeapVerification::VerifyObjectSlot(const ObjectSlot &slot, size_t *failCount) const
846 JSTaggedValue value(slot.GetTaggedType());