Lines Matching full:thread
41 JSThread *thread = argv->GetThread(); in ArrayConstructor() local
42 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ArrayConstructor()
51 …thread, containers::ErrorFlag::IS_NULL_ERROR, "The ArkTS Array's constructor cannot be directly in… in ArrayConstructor()
52 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ArrayConstructor()
62 return JSSharedArray::ArrayCreate(thread, JSTaggedNumber(0), newTarget).GetTaggedValue(); in ArrayConstructor()
66 …JSTaggedValue newArray = JSSharedArray::ArrayCreate(thread, JSTaggedNumber(argc), newTarget).GetTa… in ArrayConstructor()
67 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ArrayConstructor()
69 THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to create array.", JSTaggedValue::Exception()); in ArrayConstructor()
71 JSHandle<JSObject> newArrayHandle(thread, newArray); in ArrayConstructor()
80 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ArrayConstructor()
81 JSMutableHandle<JSTaggedValue> itemK(thread, JSTaggedValue::Undefined()); in ArrayConstructor()
86 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in ArrayConstructor()
87 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ArrayConstructor()
89 JSObject::CreateDataProperty(thread, newArrayHandle, key, itemK); in ArrayConstructor()
93 JSSharedArray::Cast(*newArrayHandle)->SetArrayLength(thread, argc); in ArrayConstructor()
104 JSThread *thread = argv->GetThread(); in From() local
105 [[maybe_unused]] EcmaHandleScope handleScope(thread); in From()
118 … THROW_TYPE_ERROR_AND_RETURN(thread, "the mapfn is not callable.", JSTaggedValue::Exception()); in From()
125 THROW_TYPE_ERROR_AND_RETURN(thread, "The items is null.", JSTaggedValue::Exception()); in From()
129 return BuiltinsString::StringToSList(thread, strItems); in From()
133 … auto error = ContainerError::ParamError(thread, "Parameter error.TypedArray not support yet."); in From()
134 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in From()
137 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in From()
139 JSHandle<JSTaggedValue> usingIterator = JSObject::GetMethod(thread, items, iteratorSymbol); in From()
141 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
143 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in From()
146 JSHandle<JSTaggedValue> iterator(thread, JSTaggedValue::Hole()); in From()
148 iterator = JSIterator::GetIterator(thread, items, usingIterator); in From()
150 return JSMapIterator::MapIteratorToList(thread, iterator); in From()
162 EcmaInterpreter::NewRuntimeCallInfo(thread, thisHandle, undefined, undefined, 0); in From()
164 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
166 newArray = JSSharedArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue(); in From()
167 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
170 … THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to construct the array.", JSTaggedValue::Exception()); in From()
172 JSHandle<JSObject> newArrayHandle(thread, newArray); in From()
175 iterator = JSIterator::GetIterator(thread, items, usingIterator); in From()
177 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
182 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in From()
183 JSMutableHandle<JSTaggedValue> mapValue(thread, JSTaggedValue::Undefined()); in From()
188 JSHandle<JSTaggedValue> next = JSIterator::IteratorStep(thread, iterator); in From()
190 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
196 JSSharedArray::LengthSetter(thread, newArrayHandle, key, true); in From()
197 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
202 JSHandle<JSTaggedValue> nextValue = JSIterator::IteratorValue(thread, next); in From()
204 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
213 … EcmaInterpreter::NewRuntimeCallInfo(thread, mapfn, thisArgHandle, undefined, argsLength); in From()
214 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
217 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, in From()
218 JSIterator::IteratorClose(thread, iterator, mapValue).GetTaggedValue()); in From()
224 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in From()
225 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in From()
230 … JSHandle<JSTaggedValue> defineStatus(thread, JSTaggedValue(JSObject::CreateDataPropertyOrThrow( in From()
231 thread, newArrayHandle, key, mapValue, SCheckMode::SKIP))); in From()
232 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, in From()
233 JSIterator::IteratorClose(thread, iterator, defineStatus).GetTaggedValue()); in From()
239 JSHandle<JSObject> arrayLikeObj = JSTaggedValue::ToObject(thread, items); in From()
241 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
244 int64_t len = ArrayHelper::GetArrayLength(thread, arrayLike); in From()
246 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
255 EcmaInterpreter::NewRuntimeCallInfo(thread, thisHandle, undefined, undefined, 1); in From()
256 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
259 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
261 …newArray = JSSharedArray::ArrayCreate(thread, JSTaggedNumber(static_cast<double>(len))).GetTaggedV… in From()
262 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
265 … THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to construct the array.", JSTaggedValue::Exception()); in From()
267 JSHandle<JSObject> newArrayHandle(thread, newArray); in From()
276 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in From()
277 JSMutableHandle<JSTaggedValue> mapValue(thread, JSTaggedValue::Undefined()); in From()
280 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, arrayLike, k); in From()
281 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
286 … EcmaInterpreter::NewRuntimeCallInfo(thread, mapfn, thisArgHandle, undefined, argsLength); in From()
287 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
290 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
296 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in From()
297 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in From()
299 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, k, mapValue, SCheckMode::SKIP); in From()
300 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
304 JSHandle<JSTaggedValue> lenHandle(thread, JSTaggedValue(len)); in From()
305 JSSharedArray::LengthSetter(thread, newArrayHandle, lenHandle, true); in From()
308 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
318 JSThread *thread = argv->GetThread(); in Create() local
319 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Create()
321 auto error = ContainerError::ParamError(thread, "Parameter error.Not enough parameters."); in Create()
322 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Create()
327 auto error = ContainerError::ParamError(thread, "Parameter error.Invalid array length."); in Create()
328 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Create()
330 auto arrayLength = JSTaggedValue::ToUint32(thread, arrayLengthValue); in Create()
331 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Create()
333 auto error = ContainerError::ParamError(thread, "Parameter error.Invalid array length."); in Create()
334 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Create()
338 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Create()
339 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Create()
341 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in Create()
345 EcmaInterpreter::NewRuntimeCallInfo(thread, thisHandle, undefined, undefined, 0); in Create()
347 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Create()
349 newArray = JSSharedArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue(); in Create()
350 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Create()
353 … THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to construct the array.", JSTaggedValue::Exception()); in Create()
355 JSHandle<JSObject> newArrayHandle(thread, newArray); in Create()
356 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Create()
359 elements->Set(thread, k, initValue); in Create()
361 newArrayHandle->SetElements(thread, elements); in Create()
362 auto len = JSHandle<JSTaggedValue>(thread, JSTaggedValue(arrayLength)); in Create()
363 JSSharedArray::LengthSetter(thread, newArrayHandle, len, true); in Create()
365 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Create()
374 JSThread *thread = argv->GetThread(); in IsArray() local
375 BUILTINS_API_TRACE(thread, SharedArray, IsArray); in IsArray()
376 [[maybe_unused]] EcmaHandleScope handleScope(thread); in IsArray()
396 JSThread *thread = argv->GetThread(); in Concat() local
397 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Concat()
403 auto error = ContainerError::BindError(thread, "The concat method cannot be bound."); in Concat()
404 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Concat()
406 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Concat()
407 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Concat()
408 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
413 …JSTaggedValue newArray = JSSharedArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(a… in Concat()
414 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
416 …THROW_TYPE_ERROR_AND_RETURN(thread, "array must be object or undefined.", JSTaggedValue::Exception… in Concat()
418 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
419 JSHandle<JSObject> newArrayHandle(thread, newArray); in Concat()
423 JSMutableHandle<JSTaggedValue> ele(thread, JSTaggedValue::Undefined()); in Concat()
424 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in Concat()
425 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Concat()
435 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Concat()
436 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Concat()
439 bool isSpreadable = ArrayHelper::IsConcatSpreadable(thread, ele); in Concat()
440 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
446 int64_t len = ArrayHelper::GetArrayLength(thread, ele); in Concat()
448 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
450 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Concat()
453 if (ele->IsStableJSArray(thread)) { in Concat()
454 JSStableArray::Concat(thread, newArrayHandle, JSHandle<JSObject>::Cast(ele), k, n); in Concat()
455 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
462 fromKey.Update(JSTaggedValue::ToString(thread, JSTaggedValue(k))); in Concat()
464 bool exists = JSTaggedValue::HasProperty(thread, ele, fromKey); in Concat()
465 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
469 JSSharedArray::FastGetPropertyByValue(thread, ele, fromKey); in Concat()
471 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Concat()
472 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Concat()
474 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
476 …JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValHandle, SCheckMode::SKIP… in Concat()
477 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
488 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Concat()
492 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, n, ele, SCheckMode::SKIP); in Concat()
493 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
498 JSHandle<JSTaggedValue> lenHandle(thread, JSTaggedValue(n)); in Concat()
499 JSSharedArray::LengthSetter(thread, newArrayHandle, lenHandle, true); in Concat()
500 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
511 JSThread *thread = argv->GetThread(); in Entries() local
512 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Entries()
515 auto error = ContainerError::BindError(thread, "The entries method cannot be bound."); in Entries()
516 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Entries()
518 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Entries()
521 JSHandle<JSObject> self = JSTaggedValue::ToObject(thread, GetThis(argv)); in Entries()
522 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Entries()
523 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Entries()
534 JSThread *thread = argv->GetThread(); in Fill() local
535 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Fill()
540 auto error = ContainerError::BindError(thread, "The fill method cannot be bound."); in Fill()
541 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Fill()
543 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisObjVal); in Fill()
544 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisObjVal); in Fill()
545 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
552 JSObject::TryOptimizeAsFastElements(thread, thisObjHandle); in Fill()
558 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
562 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Fill()
563 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Fill()
568 value = JSHandle<JSTaggedValue>(thread, JSTaggedValue::ToBigInt(thread, value)); in Fill()
570 value = JSHandle<JSTaggedValue>(thread, JSTaggedValue::ToNumber(thread, value)); in Fill()
572 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
576 int64_t len = ArrayHelper::GetLength(thread, thisObjVal); in Fill()
578 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
582 JSTaggedNumber argStartTemp = JSTaggedValue::ToInteger(thread, startArg); in Fill()
584 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
599 JSTaggedNumber argEndTemp = JSTaggedValue::ToInteger(thread, endArg); in Fill()
601 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
619 if (thisObjVal->IsStableJSArray(thread) && !startArg->IsJSObject() && !endArg->IsJSObject()) { in Fill()
620 auto opResult = JSStableArray::Fill(thread, thisObjHandle, value, start, end, len); in Fill()
625 bool result = JSTypedArray::FastTypedArrayFill(thread, thisObjVal, value, start, end); in Fill()
626 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
633 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Fill()
636 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, key, value); in Fill()
637 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
645 JSTaggedValue BuiltinsSharedArray::FilterUnStableJSArray(JSThread *thread, JSHandle<JSTaggedValue> … in FilterUnStableJSArray() argument
649 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in FilterUnStableJSArray()
652 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in FilterUnStableJSArray()
653 JSMutableHandle<JSTaggedValue> toIndexHandle(thread, JSTaggedValue::Undefined()); in FilterUnStableJSArray()
655 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in FilterUnStableJSArray()
656 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FilterUnStableJSArray()
658 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in FilterUnStableJSArray()
659 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FilterUnStableJSArray()
662 …EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength… in FilterUnStableJSArray()
663 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FilterUnStableJSArray()
666 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FilterUnStableJSArray()
669 …JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toIndexHandle, kValue, SCheckMode::SKI… in FilterUnStableJSArray()
670 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FilterUnStableJSArray()
683 JSThread *thread = argv->GetThread(); in Filter() local
684 BUILTINS_API_TRACE(thread, SharedArray, Filter); in Filter()
685 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Filter()
690 auto error = ContainerError::BindError(thread, "The filter method cannot be bound."); in Filter()
691 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Filter()
693 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Filter()
694 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Filter()
696 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
700 uint64_t len = static_cast<uint64_t>(ArrayHelper::GetArrayLength(thread, thisObjVal)); in Filter()
702 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
707 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Filter()
715 …JSTaggedValue newArray = JSSharedArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(a… in Filter()
717 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
718 JSHandle<JSObject> newArrayHandle(thread, newArray); in Filter()
737 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Filter()
738 JSMutableHandle<JSTaggedValue> toIndexHandle(thread, JSTaggedValue::Undefined()); in Filter()
740 if (thisObjVal->IsStableJSArray(thread)) { in Filter()
742 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
745 …FilterUnStableJSArray(thread, thisArgHandle, thisObjVal, k, len, toIndex, newArrayHandle, callback… in Filter()
755 JSThread *thread = argv->GetThread(); in Find() local
756 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Find()
761 auto error = ContainerError::BindError(thread, "The find method cannot be bound."); in Find()
762 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Find()
764 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Find()
765 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Find()
767 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
771 int64_t len = ArrayHelper::GetLength(thread, thisObjVal); in Find()
773 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
778 … THROW_TYPE_ERROR_AND_RETURN(thread, "the predicate is not callable.", JSTaggedValue::Exception()); in Find()
793 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Find()
796 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in Find()
797 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
800 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in Find()
802 …EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength… in Find()
803 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
806 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
822 JSThread *thread = argv->GetThread(); in FindIndex() local
823 [[maybe_unused]] EcmaHandleScope handleScope(thread); in FindIndex()
828 auto error = ContainerError::BindError(thread, "The findIndex method cannot be bound."); in FindIndex()
829 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in FindIndex()
831 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in FindIndex()
832 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in FindIndex()
834 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
838 uint64_t len = static_cast<uint64_t>(ArrayHelper::GetLength(thread, thisObjVal)); in FindIndex()
840 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
845 … THROW_TYPE_ERROR_AND_RETURN(thread, "the predicate is not callable.", JSTaggedValue::Exception()); in FindIndex()
862 if (thisObjVal->IsStableJSArray(thread)) { in FindIndex()
863 …callResult = JSStableArray::HandleFindIndexOfStable(thread, thisObjHandle, callbackFnHandle, thisA… in FindIndex()
864 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
869 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in FindIndex()
870 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in FindIndex()
873 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in FindIndex()
874 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
877 …EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength… in FindIndex()
878 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
881 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
896 JSThread *thread = argv->GetThread(); in ForEach() local
897 BUILTINS_API_TRACE(thread, SharedArray, ForEach); in ForEach()
898 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ForEach()
903 auto error = ContainerError::BindError(thread, "The forEach method cannot be bound."); in ForEach()
904 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ForEach()
906 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ForEach()
907 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in ForEach()
909 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
913 uint64_t len = static_cast<uint64_t>(ArrayHelper::GetArrayLength(thread, thisObjVal)); in ForEach()
915 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
920 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in ForEach()
937 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ForEach()
939 if (thisObjVal->IsStableJSArray(thread)) { in ForEach()
940 …JSStableArray::HandleforEachOfStable(thread, thisObjHandle, callbackFnHandle, thisArgHandle, len, … in ForEach()
941 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
944 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in ForEach()
946 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in ForEach()
947 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
949 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in ForEach()
950 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
953 …EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength… in ForEach()
954 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
957 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, funcResult); in ForEach()
967 EcmaRuntimeCallInfo *argv, JSThread *thread, const JSHandle<JSTaggedValue> &thisHandle) in IndexOfSlowPath() argument
970 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in IndexOfSlowPath()
972 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOfSlowPath()
975 int64_t length = ArrayHelper::GetLength(thread, thisObjVal); in IndexOfSlowPath()
977 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOfSlowPath()
983 int64_t fromIndex = ArrayHelper::GetStartIndexFromArgs(thread, argv, 1, length); in IndexOfSlowPath()
984 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOfSlowPath()
985 return IndexOfSlowPath(argv, thread, thisObjVal, length, fromIndex); in IndexOfSlowPath()
989 EcmaRuntimeCallInfo *argv, JSThread *thread, const JSHandle<JSTaggedValue> &thisObjVal, in IndexOfSlowPath() argument
995 JSMutableHandle<JSTaggedValue> keyHandle(thread, JSTaggedValue::Undefined()); in IndexOfSlowPath()
1000 bool found = ArrayHelper::ElementIsStrictEqualTo(thread, thisObjVal, keyHandle, target); in IndexOfSlowPath()
1001 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOfSlowPath()
1014 JSThread *thread = argv->GetThread(); in IndexOf() local
1015 BUILTINS_API_TRACE(thread, SharedArray, IndexOf); in IndexOf()
1016 [[maybe_unused]] EcmaHandleScope handleScope(thread); in IndexOf()
1020 auto error = ContainerError::BindError(thread, "The indexOf method cannot be bound."); in IndexOf()
1021 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in IndexOf()
1023 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in IndexOf()
1024 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOf()
1027 if (thisHandle->IsStableJSArray(thread)) { in IndexOf()
1028 … auto error = ContainerError::BindError(thread, "The indexOf method not support stable array."); in IndexOf()
1029 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in IndexOf()
1031 opResult = IndexOfSlowPath(argv, thread, thisHandle); in IndexOf()
1041 JSThread *thread = argv->GetThread(); in Join() local
1045 auto error = ContainerError::BindError(thread, "The join method cannot be bound."); in Join()
1046 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Join()
1048 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Join()
1049 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Join()
1058 JSThread *thread = argv->GetThread(); in Keys() local
1062 auto error = ContainerError::BindError(thread, "The keys method cannot be bound."); in Keys()
1063 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Keys()
1065 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Keys()
1066 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Keys()
1076 JSThread *thread = argv->GetThread(); in Map() local
1077 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Map()
1082 auto error = ContainerError::BindError(thread, "The map method cannot be bound."); in Map()
1083 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Map()
1085 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Map()
1086 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Map()
1088 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1092 int64_t rawLen = ArrayHelper::GetArrayLength(thread, thisObjVal); in Map()
1094 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1099 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Map()
1107 …JSSharedArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(static_cast<double>(rawLen… in Map()
1109 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1111 THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to create Object.", JSTaggedValue::Exception()); in Map()
1113 JSHandle<JSObject> newArrayHandle(thread, newArray); in Map()
1130 if (thisObjVal->IsStableJSArray(thread)) { in Map()
1132 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1134 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Map()
1135 JSMutableHandle<JSTaggedValue> mapResultHandle(thread, JSTaggedValue::Undefined()); in Map()
1136 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in Map()
1139 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in Map()
1140 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1142 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in Map()
1143 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1146 …EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength… in Map()
1147 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1151 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Map()
1152 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Map()
1154 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1156 … JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, k, mapResultHandle, SCheckMode::SKIP); in Map()
1157 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1172 JSThread *thread = argv->GetThread(); in Pop() local
1173 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Pop()
1178 auto error = ContainerError::BindError(thread, "The pop method cannot be bound."); in Pop()
1179 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Pop()
1181 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Pop()
1182 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in Pop()
1183 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1192 JSThread *thread = argv->GetThread(); in PopInner() local
1193 [[maybe_unused]] EcmaHandleScope handleScope(thread); in PopInner()
1196 …if (thisHandle->IsStableJSArray(thread) && JSObject::IsArrayLengthWritable(thread, thisObjHandle))… in PopInner()
1201 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in PopInner()
1205 int64_t len = ArrayHelper::GetArrayLength(thread, thisObjVal); in PopInner()
1207 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in PopInner()
1213 JSHandle<JSTaggedValue> lengthValue(thread, JSTaggedValue(0)); in PopInner()
1214 JSSharedArray::LengthSetter(thread, thisObjHandle, lengthValue, true); in PopInner()
1215 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in PopInner()
1230 JSHandle<JSTaggedValue> indexHandle(thread, JSTaggedValue(newLen)); in PopInner()
1232 JSTaggedValue::GetProperty(thread, thisObjVal, indexHandle, SCheckMode::SKIP).GetValue(); in PopInner()
1233 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in PopInner()
1234 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, indexHandle); in PopInner()
1235 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in PopInner()
1236 JSSharedArray::LengthSetter(thread, thisObjHandle, indexHandle, true); in PopInner()
1237 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in PopInner()
1247 JSThread *thread = argv->GetThread(); in Push() local
1248 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Push()
1251 auto error = ContainerError::BindError(thread, "The push method cannot be bound."); in Push()
1252 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Push()
1254 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in Push()
1255 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1256 if (thisHandle->IsStableJSArray(thread)) { in Push()
1264 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Push()
1266 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1270 int64_t len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Push()
1272 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1275 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Push()
1284 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Push()
1289 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Push()
1290 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Push()
1292 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, key, kValue); in Push()
1293 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1300 JSSharedArray::LengthSetter(thread, thisObjHandle, key, true); in Push()
1302 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1308 JSTaggedValue BuiltinsSharedArray::ReduceUnStableJSArray(JSThread *thread, JSHandle<JSTaggedValue> … in ReduceUnStableJSArray() argument
1312 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in ReduceUnStableJSArray()
1314 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ReduceUnStableJSArray()
1316 … bool exists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, k)); in ReduceUnStableJSArray()
1317 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceUnStableJSArray()
1319 … JSHandle<JSTaggedValue> kValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in ReduceUnStableJSArray()
1320 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceUnStableJSArray()
1326 …EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisArgHandle, undefined, argsLength… in ReduceUnStableJSArray()
1327 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceUnStableJSArray()
1331 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceUnStableJSArray()
1344 JSThread *thread = argv->GetThread(); in Reduce() local
1345 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Reduce()
1351 auto error = ContainerError::BindError(thread, "The reduce method cannot be bound."); in Reduce()
1352 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Reduce()
1354 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Reduce()
1355 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Reduce()
1357 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1361 int64_t len = ArrayHelper::GetLength(thread, thisObjVal); in Reduce()
1363 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1368 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Reduce()
1373 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Reduce()
1391 JSMutableHandle<JSTaggedValue> accumulator(thread, JSTaggedValue::Undefined()); in Reduce()
1398 JSTaggedValue::HasProperty(thread, thisObjVal, k)); in Reduce()
1399 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1401 … accumulator.Update(JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k).GetTaggedValue()); in Reduce()
1402 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1407 …THROW_TYPE_ERROR_AND_RETURN(thread, "accumulator can't be initialized.", JSTaggedValue::Exception(… in Reduce()
1411 if (thisObjVal->IsStableJSArray(thread)) { in Reduce()
1412 JSStableArray::Reduce(thread, thisObjHandle, callbackFnHandle, accumulator, k, len); in Reduce()
1413 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1415 …auto opResult = ReduceUnStableJSArray(thread, thisHandle, thisObjVal, k, len, accumulator, callbac… in Reduce()
1424 JSThread *thread = argv->GetThread(); in Shift() local
1425 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Shift()
1430 auto error = ContainerError::BindError(thread, "The shift method cannot be bound."); in Shift()
1431 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Shift()
1433 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Shift()
1434 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in Shift()
1436 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1437 …if (thisHandle->IsStableJSArray(thread) && JSObject::IsArrayLengthWritable(thread, thisObjHandle))… in Shift()
1444 int64_t len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Shift()
1446 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1452 JSHandle<JSTaggedValue> zeroLenHandle(thread, JSTaggedValue(len)); in Shift()
1453 JSSharedArray::LengthSetter(thread, thisObjHandle, zeroLenHandle, false); in Shift()
1454 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1459 JSHandle<JSTaggedValue> firstKey(thread, JSTaggedValue(0)); in Shift()
1461 JSTaggedValue::GetProperty(thread, thisObjVal, firstKey, SCheckMode::SKIP).GetValue(); in Shift()
1463 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1480 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Shift()
1483 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in Shift()
1484 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1486 … JSHandle<JSTaggedValue> fromValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in Shift()
1487 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1488 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, k - 1, fromValue); in Shift()
1489 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1492 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Shift()
1493 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1498 JSHandle<JSTaggedValue> deleteKey(thread, JSTaggedValue(len - 1)); in Shift()
1499 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, deleteKey); in Shift()
1501 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1504 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(len - 1)); in Shift()
1505 JSSharedArray::LengthSetter(thread, thisObjHandle, newLenHandle, true); in Shift()
1507 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1518 JSThread *thread = argv->GetThread(); in Slice() local
1519 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Slice()
1524 auto error = ContainerError::BindError(thread, "The slice method cannot be bound."); in Slice()
1525 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Slice()
1527 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Slice()
1528 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Slice()
1530 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1534 int64_t len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Slice()
1536 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1544 JSTaggedNumber argStartTemp = JSTaggedValue::ToInteger(thread, msg0); in Slice()
1546 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1568 JSTaggedNumber argEndTemp = JSTaggedValue::ToInteger(thread, msg1); in Slice()
1569 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1580 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1585 if (thisHandle->IsStableJSArray(thread) && !thisObjHandle->GetJSHClass()->HasConstructor() in Slice()
1587 auto opResult = JSStableArray::Slice(thread, thisObjHandle, k, count); in Slice()
1593 …JSSharedArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(static_cast<double>(count)… in Slice()
1595 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1599 JSHandle<JSObject> newArrayHandle(thread, newArray); in Slice()
1614 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Slice()
1615 JSMutableHandle<JSTaggedValue> nKey(thread, JSTaggedValue::Undefined()); in Slice()
1618 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, key); in Slice()
1619 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1622 …JSHandle<JSTaggedValue> kValueHandle = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k… in Slice()
1623 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1624 … JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, nKey, kValueHandle, SCheckMode::SKIP); in Slice()
1625 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1632 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(n)); in Slice()
1633 JSSharedArray::LengthSetter(thread, newArrayHandle, newLenHandle, true); in Slice()
1635 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1645 JSThread *thread = argv->GetThread(); in Sort() local
1646 BUILTINS_API_TRACE(thread, SharedArray, Sort); in Sort()
1647 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Sort()
1652 THROW_TYPE_ERROR_AND_RETURN(thread, "Callable is false", JSTaggedValue::Exception()); in Sort()
1658 auto error = ContainerError::BindError(thread, "The sort method cannot be bound."); in Sort()
1659 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Sort()
1661 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Sort()
1662 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in Sort()
1663 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
1666 if (thisHandle->IsStableJSArray(thread) && callbackFnHandle->IsUndefined()) { in Sort()
1667 JSStableArray::Sort(thread, thisObjHandle, callbackFnHandle); in Sort()
1669 JSSharedArray::Sort(thread, JSHandle<JSTaggedValue>::Cast(thisObjHandle), callbackFnHandle); in Sort()
1670 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
1681 JSThread *thread = argv->GetThread(); in Splice() local
1682 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Splice()
1687 auto error = ContainerError::BindError(thread, "The splice method cannot be bound."); in Splice()
1688 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Splice()
1690 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Splice()
1692 thread, thisHandle); in Splice()
1694 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1697 int64_t len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Splice()
1699 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1708 JSTaggedNumber argStartTemp = JSTaggedValue::ToInteger(thread, msg0); in Splice()
1710 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1736 JSTaggedNumber argDeleteCount = JSTaggedValue::ToInteger(thread, msg1); in Splice()
1737 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1744 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Splice()
1748 thread, thisObjHandle, JSTaggedNumber(static_cast<double>(actualDeleteCount))); in Splice()
1749 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1750 JSHandle<JSObject> newArrayHandle(thread, newArray); in Splice()
1751 if (thisHandle->IsStableJSArray(thread)) { in Splice()
1763 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in Splice()
1764 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Splice()
1769 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Splice()
1770 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1772 …JSHandle<JSTaggedValue> fromValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, from… in Splice()
1773 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1776 toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue()); in Splice()
1777 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1779 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValue); in Splice()
1780 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1785 JSHandle<JSTaggedValue> deleteCountHandle(thread, JSTaggedValue(actualDeleteCount)); in Splice()
1786 JSSharedArray::LengthSetter(thread, newArrayHandle, deleteCountHandle, true); in Splice()
1787 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1810 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Splice()
1811 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1813 …JSHandle<JSTaggedValue> fromValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, from… in Splice()
1814 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1815 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValue); in Splice()
1816 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1818 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Splice()
1819 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1824 JSMutableHandle<JSTaggedValue> deleteKey(thread, JSTaggedValue::Undefined()); in Splice()
1827 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, deleteKey); in Splice()
1828 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1852 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Splice()
1853 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1855 …JSHandle<JSTaggedValue> fromValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, from… in Splice()
1856 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1857 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValue); in Splice()
1858 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1860 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Splice()
1861 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1869 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Splice()
1873 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Splice()
1874 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Splice()
1877 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, key, itemValue); in Splice()
1878 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1883 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(newLen)); in Splice()
1884 JSSharedArray::LengthSetter(thread, thisObjHandle, newLenHandle, true); in Splice()
1886 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
1896 JSThread *thread = argv->GetThread(); in ToString() local
1897 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ToString()
1898 auto ecmaVm = thread->GetEcmaVM(); in ToString()
1903 auto error = ContainerError::BindError(thread, "The toString method cannot be bound."); in ToString()
1904 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ToString()
1906 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ToString()
1907 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in ToString()
1909 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
1913 JSHandle<JSTaggedValue> joinKey = thread->GlobalConstants()->GetHandledJoinString(); in ToString()
1914 …JSHandle<JSTaggedValue> callbackFnHandle = JSTaggedValue::GetProperty(thread, thisObjVal, joinKey)… in ToString()
1917 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
1923 JSHandle<JSTaggedValue> toStringKey = thread->GlobalConstants()->GetHandledToStringString(); in ToString()
1924 … callbackFnHandle = JSTaggedValue::GetProperty(thread, objectPrototype, toStringKey).GetValue(); in ToString()
1925 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
1928 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in ToString()
1930 … EcmaInterpreter::NewRuntimeCallInfo(thread, callbackFnHandle, thisObjVal, undefined, argsLength); in ToString()
1931 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
1942 JSThread *thread = argv->GetThread(); in Unshift() local
1943 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Unshift()
1951 auto error = ContainerError::BindError(thread, "The unshift method cannot be bound."); in Unshift()
1952 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Unshift()
1954 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Unshift()
1955 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in Unshift()
1957 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
1961 int64_t len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Unshift()
1963 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
1984 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Unshift()
1986 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in Unshift()
1987 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Unshift()
1992 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Unshift()
1993 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
1995 …JSHandle<JSTaggedValue> fromValue = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, from… in Unshift()
1996 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
1997 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValue); in Unshift()
1998 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2000 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Unshift()
2001 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2018 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in Unshift()
2019 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Unshift()
2021 JSSharedArray::FastSetPropertyByValue(thread, thisObjVal, toKey, toValue); in Unshift()
2022 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2029 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(newLen)); in Unshift()
2030 JSSharedArray::LengthSetter(thread, thisObjHandle, newLenHandle, true); in Unshift()
2032 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2043 JSThread *thread = argv->GetThread(); in Values() local
2044 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Values()
2047 auto error = ContainerError::BindError(thread, "The values method cannot be bound."); in Values()
2048 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Values()
2050 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Values()
2053 JSHandle<JSObject> self = JSTaggedValue::ToObject(thread, GetThis(argv)); in Values()
2054 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Values()
2055 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Values()
2063 JSThread *thread = argv->GetThread(); in Unscopables() local
2064 BUILTINS_API_TRACE(thread, SharedArray, Unscopables); in Unscopables()
2065 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Unscopables()
2066 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Unscopables()
2067 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in Unscopables()
2071 JSHandle<JSTaggedValue> trueVal(thread, JSTaggedValue::True()); in Unscopables()
2074 JSObject::CreateDataProperty(thread, unscopableList, atKey, trueVal); in Unscopables()
2077 JSObject::CreateDataProperty(thread, unscopableList, copyWithKey, trueVal); in Unscopables()
2080 JSObject::CreateDataProperty(thread, unscopableList, entriesKey, trueVal); in Unscopables()
2083 JSObject::CreateDataProperty(thread, unscopableList, fillKey, trueVal); in Unscopables()
2086 JSObject::CreateDataProperty(thread, unscopableList, findKey, trueVal); in Unscopables()
2089 JSObject::CreateDataProperty(thread, unscopableList, findIndexKey, trueVal); in Unscopables()
2092 JSObject::CreateDataProperty(thread, unscopableList, findLastKey, trueVal); in Unscopables()
2095 JSObject::CreateDataProperty(thread, unscopableList, findLastIndexKey, trueVal); in Unscopables()
2098 JSObject::CreateDataProperty(thread, unscopableList, flatKey, trueVal); in Unscopables()
2101 JSObject::CreateDataProperty(thread, unscopableList, flatMapKey, trueVal); in Unscopables()
2104 JSObject::CreateDataProperty(thread, unscopableList, includesKey, trueVal); in Unscopables()
2107 JSObject::CreateDataProperty(thread, unscopableList, keysKey, trueVal); in Unscopables()
2110 JSObject::CreateDataProperty(thread, unscopableList, valuesKey, trueVal); in Unscopables()
2113 JSObject::CreateDataProperty(thread, unscopableList, toReversedKey, trueVal); in Unscopables()
2116 JSObject::CreateDataProperty(thread, unscopableList, toSortedKey, trueVal); in Unscopables()
2119 JSObject::CreateDataProperty(thread, unscopableList, toSplicedKey, trueVal); in Unscopables()
2128 JSThread *thread = argv->GetThread(); in Includes() local
2129 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Includes()
2133 auto error = ContainerError::BindError(thread, "The includes method cannot be bound."); in Includes()
2134 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in Includes()
2136 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Includes()
2137 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in Includes()
2138 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Includes()
2145 int64_t len = ArrayHelper::GetLength(thread, thisObjVal); in Includes()
2146 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Includes()
2156 JSTaggedNumber fromIndexTemp = JSTaggedValue::ToNumber(thread, msg1); in Includes()
2157 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Includes()
2179 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Includes()
2180 JSMutableHandle<JSTaggedValue> kValueHandle(thread, JSTaggedValue::Undefined()); in Includes()
2183 JSHandle<JSTaggedValue> handledFrom(thread, JSTaggedValue(from)); in Includes()
2184 fromStr = JSTaggedValue::ToString(thread, handledFrom); in Includes()
2185 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Includes()
2187 …kValueHandle.Update(JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, key).GetTaggedValue(… in Includes()
2188 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Includes()
2203 JSThread *thread = argv->GetThread(); in At() local
2204 [[maybe_unused]] EcmaHandleScope handleScope(thread); in At()
2209 auto error = ContainerError::BindError(thread, "The at method cannot be bound."); in At()
2210 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in At()
2212 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in At()
2213 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in At()
2214 if (thisHandle->IsStableJSArray(thread)) { in At()
2218 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in At()
2220 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in At()
2224 int64_t len = ArrayHelper::GetLength(thread, thisObjVal); in At()
2226 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in At()
2229 JSTaggedNumber index = JSTaggedValue::ToInteger(thread, GetCallArg(argv, 0)); in At()
2231 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in At()
2251 JSHandle<JSTaggedValue> element = JSSharedArray::FastGetPropertyByValue(thread, thisObjVal, k); in At()
2252 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in At()
2261 JSThread *thread = argv->GetThread(); in ShrinkTo() local
2262 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ShrinkTo()
2264 auto error = ContainerError::ParamError(thread, "Parameter error.Not enough parameter."); in ShrinkTo()
2265 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ShrinkTo()
2269 auto error = ContainerError::BindError(thread, "The ShrinkTo method cannot be bound."); in ShrinkTo()
2270 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ShrinkTo()
2272 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ShrinkTo()
2273 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in ShrinkTo()
2276 auto error = ContainerError::ParamError(thread, "Parameter error.Invalid array length."); in ShrinkTo()
2277 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ShrinkTo()
2279 auto newLength = JSTaggedValue::ToUint32(thread, newLengthValue); in ShrinkTo()
2280 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ShrinkTo()
2282 auto error = ContainerError::ParamError(thread, "Parameter error.Invalid array length."); in ShrinkTo()
2283 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ShrinkTo()
2285 int64_t len = ArrayHelper::GetLength(thread, thisHandle); in ShrinkTo()
2286 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ShrinkTo()
2290 JSSharedArray::LengthSetter(thread, thisObjHandle, newLengthValue, true); in ShrinkTo()
2291 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ShrinkTo()
2300 JSThread *thread = argv->GetThread(); in ExtendTo() local
2301 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ExtendTo()
2303 auto error = ContainerError::ParamError(thread, "Parameter error.Not enough parameters."); in ExtendTo()
2304 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ExtendTo()
2308 auto error = ContainerError::BindError(thread, "The ExtendTo method cannot be bound."); in ExtendTo()
2309 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ExtendTo()
2311 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ExtendTo()
2312 [[maybe_unused]] ConcurrentApiScope<JSSharedArray, ModType::WRITE> scope(thread, thisHandle); in ExtendTo()
2315 auto error = ContainerError::ParamError(thread, "Parameter error.Invalid array length."); in ExtendTo()
2316 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ExtendTo()
2318 auto newLength = JSTaggedValue::ToUint32(thread, newLengthValue); in ExtendTo()
2319 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ExtendTo()
2321 auto error = ContainerError::ParamError(thread, "Parameter error.Invalid array length."); in ExtendTo()
2322 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ExtendTo()
2325 int64_t length = ArrayHelper::GetLength(thread, thisHandle); in ExtendTo()
2326 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ExtendTo()
2333 … auto error = ContainerError::ParamError(thread, "Parameter error.Only accept sendable value."); in ExtendTo()
2334 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in ExtendTo()
2336 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ExtendTo()
2339 … JSObject::CreateDataPropertyOrThrow(thread, thisObjHandle, key, initValue, SCheckMode::SKIP); in ExtendTo()
2342 JSSharedArray::LengthSetter(thread, thisObjHandle, key, true); in ExtendTo()
2343 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ExtendTo()
2347 JSTaggedValue BuiltinsSharedArray::LastIndexOfSlowPath(EcmaRuntimeCallInfo *argv, JSThread *thread, in LastIndexOfSlowPath() argument
2351 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in LastIndexOfSlowPath()
2353 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOfSlowPath()
2356 int64_t length = ArrayHelper::GetLength(thread, thisObjVal); in LastIndexOfSlowPath()
2358 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOfSlowPath()
2364 int64_t fromIndex = ArrayHelper::GetLastStartIndexFromArgs(thread, argv, 1, length); in LastIndexOfSlowPath()
2365 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOfSlowPath()
2366 return LastIndexOfSlowPath(argv, thread, thisObjVal, fromIndex); in LastIndexOfSlowPath()
2369 JSTaggedValue BuiltinsSharedArray::LastIndexOfSlowPath(EcmaRuntimeCallInfo *argv, JSThread *thread, in LastIndexOfSlowPath() argument
2375 JSMutableHandle<JSTaggedValue> keyHandle(thread, JSTaggedValue::Undefined()); in LastIndexOfSlowPath()
2380 bool found = ArrayHelper::ElementIsStrictEqualTo(thread, thisObjVal, keyHandle, target); in LastIndexOfSlowPath()
2381 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOfSlowPath()
2394 JSThread *thread = argv->GetThread(); in LastIndexOf() local
2395 BUILTINS_API_TRACE(thread, SharedArray, LastIndexOf); in LastIndexOf()
2396 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LastIndexOf()
2400 auto error = ContainerError::BindError(thread, "The lastIndexOf method cannot be bound."); in LastIndexOf()
2401 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in LastIndexOf()
2403 [[maybe_unused]] ConcurrentApiScope<JSSharedArray> scope(thread, thisHandle); in LastIndexOf()
2404 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOf()
2406 if (thisHandle->IsStableJSArray(thread)) { in LastIndexOf()
2407 …auto error = ContainerError::BindError(thread, "The lastIndexOf method not support stable array."); in LastIndexOf()
2408 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error, JSTaggedValue::Exception()); in LastIndexOf()
2410 return LastIndexOfSlowPath(argv, thread, thisHandle); in LastIndexOf()