diff --git a/runtime/ecma_class_linker_extension.cpp b/runtime/ecma_class_linker_extension.cpp index 745431ed81f9555eb9c1d82f77e0f0ac9c6f66e0..9bba23ed39d4056558cf02d56df9fa2e8e9f8f93 100644 --- a/runtime/ecma_class_linker_extension.cpp +++ b/runtime/ecma_class_linker_extension.cpp @@ -112,7 +112,7 @@ Class *EcmaClassLinkerExtension::NewClass(const uint8_t *descriptor, size_t vtab // All fields must be set before call SetClass to make TSAN happy. // The intstance of this HClass may be read by update remset thread. // The thread skips the object if this class is null. - hclass_ptr->SetClass(hclass_ptr); + hclass_ptr->SetClassWithoutBarrier(hclass_ptr); JSHandle klass_obj(vm_->GetJSThread(), factory->NewNonMovableDynObject(hclass)); auto *klass = diff --git a/runtime/mem/tagged_object-inl.h b/runtime/mem/tagged_object-inl.h index dd79d8a8696415fde6d217e99b647f0a34fc7b57..420265d71ee4ac6b782bfa59d84123f4647e1348 100644 --- a/runtime/mem/tagged_object-inl.h +++ b/runtime/mem/tagged_object-inl.h @@ -30,12 +30,12 @@ inline void TaggedObject::SetClassWithoutBarrier(JSHClass *hclass) inline void TaggedObject::SetClass(JSHClass *hclass) { - ObjectHeader::SetClass(hclass->GetHClass()); + ObjectAccessor::SetClass(this, hclass->GetHClass()); } inline void TaggedObject::SetClass(JSHandle hclass) { - ObjectHeader::SetClass(hclass->GetHClass()); + ObjectAccessor::SetClass(this, hclass->GetHClass()); } inline JSHClass *TaggedObject::GetClass() const