Add Containers List And LinkedList

Description
    1.To ensure the high performance of container classes, List and LinkedList is provided in ark.
    2.modify Copyright 2021->2022.
    3.fix containers.
Related issue
    #I58XA9:Add Containers List And LinkedList.

Signed-off-by: chenqi <chenqi151@huawei.com>
This commit is contained in:
chenqi
2022-06-02 09:11:52 +08:00
parent 39130320ac
commit 666eb6b8bd
87 changed files with 5580 additions and 160 deletions
+8 -6
View File
@@ -154,15 +154,17 @@ JSTaggedValue JSAPIPlainArray::Set(JSThread *thread, const JSHandle<JSAPIPlainAr
}
bool JSAPIPlainArray::GetOwnProperty(JSThread *thread, const JSHandle<JSAPIPlainArray> &obj,
const JSHandle<JSTaggedValue> &key, PropertyDescriptor &desc)
const JSHandle<JSTaggedValue> &key)
{
TaggedArray *keyArray = TaggedArray::Cast(obj->GetKeys().GetTaggedObject());
int32_t size = obj->GetLength();
int32_t index = obj->BinarySearch(keyArray, 0, size, key.GetTaggedValue().GetNumber());
if (index < 0 || index > size) {
int32_t index = obj->BinarySearch(keyArray, 0, size, key.GetTaggedValue().GetInt());
if (index < 0 || index >= size) {
THROW_RANGE_ERROR_AND_RETURN(thread, "GetOwnProperty index out-of-bounds", false);
}
return JSObject::GetOwnProperty(thread, JSHandle<JSObject>::Cast(obj), key, desc);
obj->Get(key.GetTaggedValue());
return true;
}
OperationResult JSAPIPlainArray::GetProperty(JSThread *thread, const JSHandle<JSAPIPlainArray> &obj,
@@ -170,8 +172,8 @@ OperationResult JSAPIPlainArray::GetProperty(JSThread *thread, const JSHandle<JS
{
TaggedArray *keyArray = TaggedArray::Cast(obj->GetKeys().GetTaggedObject());
int32_t size = obj->GetLength();
int32_t index = obj->BinarySearch(keyArray, 0, size, key.GetTaggedValue().GetNumber());
if (index < 0 || index > size) {
int32_t index = obj->BinarySearch(keyArray, 0, size, key.GetTaggedValue().GetInt());
if (index < 0 || index >= size) {
THROW_RANGE_ERROR_AND_RETURN(thread, "GetProperty index out-of-bounds",
OperationResult(thread, JSTaggedValue::Exception(), PropertyMetaData(false)));
}