Lines Matching defs:thread
27 void JSAPIDeque::InsertFront(JSThread *thread, const JSHandle<JSAPIDeque> &deque, const JSHandle<JSTaggedValue> &value)
29 JSHandle<TaggedArray> elements(thread, deque->GetElements());
36 elements = GrowCapacity(thread, deque, capacity, first, last);
44 elements->Set(thread, first, value);
48 void JSAPIDeque::InsertEnd(JSThread *thread, const JSHandle<JSAPIDeque> &deque, const JSHandle<JSTaggedValue> &value)
50 JSHandle<TaggedArray> elements(thread, deque->GetElements());
57 elements = GrowCapacity(thread, deque, capacity, first, last);
62 elements->Set(thread, last, value);
93 JSHandle<TaggedArray> JSAPIDeque::GrowCapacity(JSThread *thread, const JSHandle<JSAPIDeque> &deque,
96 JSHandle<TaggedArray> oldElements(thread, deque->GetElements());
101 thread->GetEcmaVM()->GetFactory()->CopyDeque(oldElements, newCapacity, size, first, last);
102 deque->SetElements(thread, newElements);
166 JSTaggedValue JSAPIDeque::Set(JSThread *thread, const uint32_t index, JSTaggedValue value)
177 elements->Set(thread, curIndex, value);
198 JSHandle<TaggedArray> JSAPIDeque::OwnKeys(JSThread *thread, const JSHandle<JSAPIDeque> &deque)
202 JSHandle<TaggedArray> oldElements(thread, deque->GetElements());
209 thread->GetEcmaVM()->GetFactory()->CopyDeque(oldElements, newCapacity, length, firstIndex, lastIndex);
212 deque->SetElements(thread, newElements);
214 return JSObject::GetOwnPropertyKeys(thread, JSHandle<JSObject>::Cast(deque));
217 JSHandle<TaggedArray> JSAPIDeque::OwnEnumKeys(JSThread *thread, const JSHandle<JSAPIDeque> &deque)
221 JSHandle<TaggedArray> oldElements(thread, deque->GetElements());
228 thread->GetEcmaVM()->GetFactory()->CopyDeque(oldElements, newCapacity, length, firstIndex, lastIndex);
231 deque->SetElements(thread, newElements);
233 return JSObject::GetOwnEnumPropertyKeys(thread, JSHandle<JSObject>::Cast(deque));
236 bool JSAPIDeque::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIDeque> &deque,
241 JSHandle<EcmaString> result = JSTaggedValue::ToString(thread, key.GetTaggedValue());
242 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
246 JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
247 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, false);
256 JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::RANGE_ERROR, oss.str().c_str());
257 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, false);
264 JSTaggedValue JSAPIDeque::GetIteratorObj(JSThread *thread, const JSHandle<JSAPIDeque> &deque)
266 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
272 OperationResult JSAPIDeque::GetProperty(JSThread *thread, const JSHandle<JSAPIDeque> &obj,
277 JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::RANGE_ERROR, "Container is empty");
278 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, OperationResult(thread,
286 indexKey = JSHandle<JSTaggedValue>(thread, JSTaggedValue::TryCastDoubleToInt32(indexKey->GetDouble()));
290 JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::TYPE_ERROR, errorMsg.c_str());
291 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error,
292 OperationResult(thread, JSTaggedValue::Exception(), PropertyMetaData(false)));
300 JSTaggedValue error = ContainerError::BusinessError(thread, ErrorFlag::RANGE_ERROR, oss.str().c_str());
301 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, OperationResult(thread,
306 return OperationResult(thread, obj->Get(index), PropertyMetaData(false));
309 bool JSAPIDeque::SetProperty(JSThread *thread, const JSHandle<JSAPIDeque> &obj,
318 indexKey = JSHandle<JSTaggedValue>(thread, JSTaggedValue::TryCastDoubleToInt32(indexKey->GetDouble()));
329 obj->Set(thread, index, value.GetTaggedValue());