Lines Matching defs:thread
22 void JSSharedMap::Set(JSThread *thread, const JSHandle<JSSharedMap> &map,
26 auto error = containers::ContainerError::BusinessError(thread, containers::ErrorFlag::TYPE_ERROR,
28 THROW_NEW_ERROR_AND_RETURN(thread, error);
30 [[maybe_unused]] ConcurrentApiScope<JSSharedMap, ModType::WRITE> scope(thread,
32 RETURN_IF_ABRUPT_COMPLETION(thread);
34 JSHandle<LinkedHashMap> mapHandle(thread, LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject()));
35 JSHandle<LinkedHashMap> newMap = LinkedHashMap::Set(thread, mapHandle, key, value);
36 map->SetLinkedMap(thread, newMap);
39 bool JSSharedMap::Delete(JSThread *thread, const JSHandle<JSSharedMap> &map, const JSHandle<JSTaggedValue> &key)
41 [[maybe_unused]] ConcurrentApiScope<JSSharedMap, ModType::WRITE> scope(thread,
43 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
44 JSHandle<LinkedHashMap> mapHandle(thread, LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject()));
45 int entry = mapHandle->FindElement(thread, key.GetTaggedValue());
49 mapHandle->RemoveEntry(thread, entry);
53 void JSSharedMap::Clear(JSThread *thread, const JSHandle<JSSharedMap> &map)
55 [[maybe_unused]] ConcurrentApiScope<JSSharedMap, ModType::WRITE> scope(thread,
57 RETURN_IF_ABRUPT_COMPLETION(thread);
58 JSHandle<LinkedHashMap> mapHandle(thread, LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject()));
59 JSHandle<LinkedHashMap> newMap = LinkedHashMap::Clear(thread, mapHandle);
60 map->SetLinkedMap(thread, newMap);
63 bool JSSharedMap::Has(JSThread *thread, const JSHandle<JSSharedMap> &map, JSTaggedValue key)
65 [[maybe_unused]] ConcurrentApiScope<JSSharedMap> scope(thread, JSHandle<JSTaggedValue>::Cast(map));
66 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
67 return LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject())->Has(thread, key);
70 JSTaggedValue JSSharedMap::Get(JSThread *thread, const JSHandle<JSSharedMap> &map, JSTaggedValue key)
72 [[maybe_unused]] ConcurrentApiScope<JSSharedMap> scope(thread, JSHandle<JSTaggedValue>::Cast(map));
73 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Undefined());
74 return LinkedHashMap::Cast(map->GetLinkedMap().GetTaggedObject())->Get(thread, key);
77 uint32_t JSSharedMap::GetSize(JSThread *thread, const JSHandle<JSSharedMap> &map)
79 [[maybe_unused]] ConcurrentApiScope<JSSharedMap> scope(thread, JSHandle<JSTaggedValue>::Cast(map));
80 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, 0);
84 JSTaggedValue JSSharedMap::GetKey(JSThread *thread, const JSHandle<JSSharedMap> &map, uint32_t entry)
86 [[maybe_unused]] ConcurrentApiScope<JSSharedMap> scope(thread, JSHandle<JSTaggedValue>::Cast(map));
87 ASSERT_PRINT(entry >= 0 && entry < GetSize(thread, map), "entry must be non-negative integer less than capacity");
88 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Undefined());
92 JSTaggedValue JSSharedMap::GetValue(JSThread *thread, const JSHandle<JSSharedMap> &map, uint32_t entry)
94 [[maybe_unused]] ConcurrentApiScope<JSSharedMap> scope(thread, JSHandle<JSTaggedValue>::Cast(map));
95 ASSERT_PRINT(entry >= 0 && entry < GetSize(thread, map), "entry must be non-negative integer less than capacity");
96 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Undefined());