Lines Matching defs:thread

22 void JSWeakMap::Set(JSThread *thread, const JSHandle<JSWeakMap> &map, const JSHandle<JSTaggedValue> &key,
25 [[maybe_unused]] EcmaHandleScope handleScope(thread);
27 THROW_TYPE_ERROR(thread, "the value must be Key of JSWeakMap");
29 JSHandle<LinkedHashMap> mapHandle(thread, LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject()));
31 JSHandle<LinkedHashMap> newMap = LinkedHashMap::SetWeakRef(thread, mapHandle, key, value);
32 map->SetLinkedMap(thread, newMap);
35 bool JSWeakMap::Delete(JSThread *thread, const JSHandle<JSWeakMap> &map, const JSHandle<JSTaggedValue> &key)
37 JSHandle<LinkedHashMap> mapHandle(thread, LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject()));
38 int entry = mapHandle->FindElement(thread, key.GetTaggedValue());
42 mapHandle->RemoveEntry(thread, entry);
44 JSHandle<LinkedHashMap> newMap = LinkedHashMap::Shrink(thread, mapHandle);
45 map->SetLinkedMap(thread, newMap);
49 bool JSWeakMap::Has(JSThread *thread, JSTaggedValue key) const
51 return LinkedHashMap::Cast(GetLinkedMap().GetTaggedObject())->Has(thread, key);
54 JSTaggedValue JSWeakMap::Get(JSThread *thread, JSTaggedValue key) const
56 return LinkedHashMap::Cast(GetLinkedMap().GetTaggedObject())->Get(thread, key);
76 void JSWeakSet::Add(JSThread *thread, const JSHandle<JSWeakSet> &weakSet, const JSHandle<JSTaggedValue> &value)
79 THROW_TYPE_ERROR(thread, "the value must be Key of JSWeakSet");
81 JSHandle<LinkedHashSet> weakSetHandle(thread, LinkedHashSet::Cast(weakSet->GetLinkedSet().GetTaggedObject()));
83 JSHandle<LinkedHashSet> newSet = LinkedHashSet::AddWeakRef(thread, weakSetHandle, value);
84 weakSet->SetLinkedSet(thread, newSet);
87 bool JSWeakSet::Delete(JSThread *thread, const JSHandle<JSWeakSet> &weakSet, const JSHandle<JSTaggedValue> &value)
89 JSHandle<LinkedHashSet> weakSetHandle(thread, LinkedHashSet::Cast(weakSet->GetLinkedSet().GetTaggedObject()));
90 int entry = weakSetHandle->FindElement(thread, value.GetTaggedValue());
94 weakSetHandle->RemoveEntry(thread, entry);
95 JSHandle<LinkedHashSet> newSet = LinkedHashSet::Shrink(thread, weakSetHandle);
96 weakSet->SetLinkedSet(thread, newSet);
100 bool JSWeakSet::Has(JSThread *thread, JSTaggedValue value) const
102 return LinkedHashSet::Cast(GetLinkedSet().GetTaggedObject())->Has(thread, value);