Lines Matching full:thread
59 JSTaggedValue RuntimeStubs::RuntimeInc(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeInc() argument
61 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeInc()
62 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInc()
65 return BigInt::BigintAddOne(thread, bigValue).GetTaggedValue(); in RuntimeInc()
71 JSTaggedValue RuntimeStubs::RuntimeDec(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeDec() argument
73 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeDec()
74 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDec()
77 return BigInt::BigintSubOne(thread, bigValue).GetTaggedValue(); in RuntimeDec()
83 JSTaggedValue RuntimeStubs::RuntimeExp(JSThread *thread, JSTaggedValue base, JSTaggedValue exponent) in RuntimeExp() argument
85 JSHandle<JSTaggedValue> baseTag(thread, base); in RuntimeExp()
86 JSHandle<JSTaggedValue> exponentTag(thread, exponent); in RuntimeExp()
87 JSHandle<JSTaggedValue> valBase = JSTaggedValue::ToNumeric(thread, baseTag); in RuntimeExp()
88 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeExp()
89 JSHandle<JSTaggedValue> valExponent = JSTaggedValue::ToNumeric(thread, exponentTag); in RuntimeExp()
90 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeExp()
95 return BigInt::Exponentiate(thread, bigBaseVale, bigExponentValue).GetTaggedValue(); in RuntimeExp()
97 … THROW_TYPE_ERROR_AND_RETURN(thread, "Cannot mix BigInt and other types, use explicit conversions", in RuntimeExp()
119 JSTaggedValue RuntimeStubs::RuntimeIsIn(JSThread *thread, const JSHandle<JSTaggedValue> &prop, in RuntimeIsIn() argument
123 return RuntimeThrowTypeError(thread, "Cannot use 'in' operator in Non-Object"); in RuntimeIsIn()
125 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeIsIn()
126 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeIsIn()
127 bool ret = JSTaggedValue::HasProperty(thread, obj, propKey); in RuntimeIsIn()
128 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeIsIn()
132 JSTaggedValue RuntimeStubs::RuntimeInstanceof(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeInstanceof() argument
135 bool ret = JSObject::InstanceOf(thread, obj, target); in RuntimeInstanceof()
136 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInstanceof()
140 JSTaggedValue RuntimeStubs::RuntimeInstanceofByHandler(JSThread *thread, JSHandle<JSTaggedValue> ta… in RuntimeInstanceofByHandler() argument
145 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInstanceofByHandler()
149 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeInstanceofByHandler()
154 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeInstanceofByHandler()
155 … EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, instOfHandler, target, in RuntimeInstanceofByHandler()
157 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInstanceofByHandler()
161 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInstanceofByHandler()
167 …THROW_TYPE_ERROR_AND_RETURN(thread, "InstanceOf error when target is not Callable", JSTaggedValue:… in RuntimeInstanceofByHandler()
171 bool res = JSFunction::OrdinaryHasInstance(thread, target, object); in RuntimeInstanceofByHandler()
172 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInstanceofByHandler()
176 JSTaggedValue RuntimeStubs::RuntimeCreateGeneratorObj(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeCreateGeneratorObj() argument
178 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateGeneratorObj()
181 context->SetGeneratorObject(thread, obj.GetTaggedValue()); in RuntimeCreateGeneratorObj()
185 obj->SetGeneratorContext(thread, context); in RuntimeCreateGeneratorObj()
187 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateGeneratorObj()
191 JSTaggedValue RuntimeStubs::RuntimeCreateAsyncGeneratorObj(JSThread *thread, const JSHandle<JSTagge… in RuntimeCreateAsyncGeneratorObj() argument
193 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateAsyncGeneratorObj()
196 context->SetGeneratorObject(thread, obj.GetTaggedValue()); in RuntimeCreateAsyncGeneratorObj()
200 obj->SetGeneratorContext(thread, context); in RuntimeCreateAsyncGeneratorObj()
202 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateAsyncGeneratorObj()
206 JSTaggedValue RuntimeStubs::RuntimeGetTemplateObject(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeGetTemplateObject() argument
208 JSHandle<JSTaggedValue> templateObj = TemplateString::GetTemplateObject(thread, literal); in RuntimeGetTemplateObject()
209 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetTemplateObject()
213 JSTaggedValue RuntimeStubs::RuntimeGetNextPropName(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetNextPropName() argument
216 … JSTaggedValue res = JSForInIterator::NextInternal(thread, JSHandle<JSForInIterator>::Cast(iter)); in RuntimeGetNextPropName()
217 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetNextPropName()
221 JSTaggedValue RuntimeStubs::RuntimeIterNext(JSThread *thread, const JSHandle<JSTaggedValue> &iter) in RuntimeIterNext() argument
223 JSHandle<JSTaggedValue> resultObj = JSIterator::IteratorNext(thread, iter); in RuntimeIterNext()
224 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeIterNext()
228 JSTaggedValue RuntimeStubs::RuntimeCloseIterator(JSThread *thread, const JSHandle<JSTaggedValue> &i… in RuntimeCloseIterator() argument
230 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCloseIterator()
231 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeCloseIterator()
234 if (thread->HasPendingException()) { in RuntimeCloseIterator()
236 CompletionRecordType::THROW, JSHandle<JSTaggedValue>(thread, thread->GetException()))); in RuntimeCloseIterator()
241 JSHandle<JSTaggedValue> result = JSIterator::IteratorClose(thread, iter, record); in RuntimeCloseIterator()
242 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloseIterator()
249 JSTaggedValue RuntimeStubs::RuntimeSuperCallSpread(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeSuperCallSpread() argument
253 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeSuperCallSpread()
254 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallSpread()
256 …THROW_TYPE_ERROR_AND_RETURN(thread, "Super constructor is not JSFunction", JSTaggedValue::Exceptio… in RuntimeSuperCallSpread()
259 JSHandle<TaggedArray> argv(thread, RuntimeGetCallSpreadArgs(thread, array)); in RuntimeSuperCallSpread()
260 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallSpread()
262 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeSuperCallSpread()
264 EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newTarget, argsLength); in RuntimeSuperCallSpread()
265 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallSpread()
268 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallSpread()
273 JSTaggedValue RuntimeStubs::RuntimeOptSuperCallSpread(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeOptSuperCallSpread() argument
277 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeOptSuperCallSpread()
278 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCallSpread()
280 …THROW_TYPE_ERROR_AND_RETURN(thread, "Super constructor is not JSFunction", JSTaggedValue::Exceptio… in RuntimeOptSuperCallSpread()
283 JSHandle<TaggedArray> argv(thread, taggedArray.GetTaggedValue()); in RuntimeOptSuperCallSpread()
284 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCallSpread()
286 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptSuperCallSpread()
288 EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newTarget, argsLength); in RuntimeOptSuperCallSpread()
289 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCallSpread()
292 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCallSpread()
297 JSTaggedValue RuntimeStubs::RuntimeDelObjProp(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeDelObjProp() argument
300 JSHandle<JSTaggedValue> jsObj(JSTaggedValue::ToObject(thread, obj)); in RuntimeDelObjProp()
301 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
302 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeDelObjProp()
303 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
304 bool ret = JSTaggedValue::DeletePropertyOrThrow(thread, jsObj, propKey); in RuntimeDelObjProp()
305 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
309 JSTaggedValue RuntimeStubs::RuntimeNewObjApply(JSThread *thread, const JSHandle<JSTaggedValue> &fun… in RuntimeNewObjApply() argument
312 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewObjApply()
314 return RuntimeThrowTypeError(thread, "Cannot Newobjspread"); in RuntimeNewObjApply()
320 auto prop = JSTaggedValue::GetProperty(thread, array, i).GetValue(); in RuntimeNewObjApply()
321 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
322 argsArray->Set(thread, i, prop); in RuntimeNewObjApply()
323 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
325 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeNewObjApply()
326 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, func, undefined, func, len… in RuntimeNewObjApply()
327 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
332 JSTaggedValue RuntimeStubs::RuntimeCreateIterResultObj(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeCreateIterResultObj() argument
337 JSHandle<JSObject> iter = JSIterator::CreateIterResultObject(thread, value, done); in RuntimeCreateIterResultObj()
338 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateIterResultObj()
342 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionAwaitUncaught(JSThread *thread, in RuntimeAsyncFunctionAwaitUncaught() argument
346 JSAsyncFunction::AsyncFunctionAwait(thread, asyncFuncObj, value); in RuntimeAsyncFunctionAwaitUncaught()
347 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
349 JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj); in RuntimeAsyncFunctionAwaitUncaught()
350 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
352 JSHandle<TaggedQueue> queue(thread, generator->GetAsyncGeneratorQueue()); in RuntimeAsyncFunctionAwaitUncaught()
356 JSHandle<AsyncGeneratorRequest> next(thread, queue->Front()); in RuntimeAsyncFunctionAwaitUncaught()
357 JSHandle<PromiseCapability> completion(thread, next->GetCapability()); in RuntimeAsyncFunctionAwaitUncaught()
358 JSHandle<JSPromise> promise(thread, completion->GetPromise()); in RuntimeAsyncFunctionAwaitUncaught()
362 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in RuntimeAsyncFunctionAwaitUncaught()
364 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
368 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionResolveOrReject(JSThread *thread, in RuntimeAsyncFunctionResolveOrReject() argument
372 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in RuntimeAsyncFunctionResolveOrReject()
375 …JSHandle<ResolvingFunctionsRecord> reactions = JSPromise::CreateResolvingFunctions(thread, promise… in RuntimeAsyncFunctionResolveOrReject()
376 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeAsyncFunctionResolveOrReject()
380 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetResolveFunction()); in RuntimeAsyncFunctionResolveOrReject()
382 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetRejectFunction()); in RuntimeAsyncFunctionResolveOrReject()
384 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeAsyncFunctionResolveOrReject()
385 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, activeFunc, thisArg, undef… in RuntimeAsyncFunctionResolveOrReject()
386 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionResolveOrReject()
390 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionResolveOrReject()
394 JSTaggedValue RuntimeStubs::RuntimeAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValue> … in RuntimeAsyncGeneratorResolve() argument
397 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeAsyncGeneratorResolve()
401 …JSHandle<GeneratorContext> genContextHandle(thread, asyncGeneratorObjHandle->GetGeneratorContext()… in RuntimeAsyncGeneratorResolve()
403 SaveFrameToContext(thread, genContextHandle); in RuntimeAsyncGeneratorResolve()
408 …return JSAsyncGeneratorObject::AsyncGeneratorResolve(thread, asyncGeneratorObjHandle, valueHandle,… in RuntimeAsyncGeneratorResolve()
411 JSTaggedValue RuntimeStubs::RuntimeAsyncGeneratorReject(JSThread *thread, JSHandle<JSTaggedValue> a… in RuntimeAsyncGeneratorReject() argument
414 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeAsyncGeneratorReject()
419 … return JSAsyncGeneratorObject::AsyncGeneratorReject(thread, asyncGeneratorObjHandle, valueHandle); in RuntimeAsyncGeneratorReject()
422 JSTaggedValue RuntimeStubs::RuntimeCopyDataProperties(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeCopyDataProperties() argument
427 JSHandle<JSTaggedValue> from(JSTaggedValue::ToObject(thread, src)); in RuntimeCopyDataProperties()
428 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
429 JSHandle<TaggedArray> keys = JSTaggedValue::GetOwnPropertyKeys(thread, from); in RuntimeCopyDataProperties()
430 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
432 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in RuntimeCopyDataProperties()
435 PropertyDescriptor desc(thread); in RuntimeCopyDataProperties()
437 bool success = JSTaggedValue::GetOwnProperty(thread, from, key, desc); in RuntimeCopyDataProperties()
438 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
443 JSTaggedValue::DefineOwnProperty(thread, dst, key, desc); in RuntimeCopyDataProperties()
444 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
451 JSTaggedValue RuntimeStubs::RuntimeStArraySpread(JSThread *thread, const JSHandle<JSTaggedValue> &d… in RuntimeStArraySpread() argument
454 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeStArraySpread()
455 JSHandle<JSTaggedValue> undefinedHandle(thread, JSTaggedValue::Undefined()); in RuntimeStArraySpread()
459 THROW_TYPE_ERROR_AND_RETURN(thread, "src is not iterable", JSTaggedValue::Exception()); in RuntimeStArraySpread()
462 THROW_TYPE_ERROR_AND_RETURN(thread, "dst is not iterable", JSTaggedValue::Exception()); in RuntimeStArraySpread()
465 JSHandle<EcmaString> srcString = JSTaggedValue::ToString(thread, src); in RuntimeStArraySpread()
466 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
467 JSHandle<EcmaString> srcFlat = JSHandle<EcmaString>(thread, in RuntimeStArraySpread()
468 EcmaStringAccessor::Flatten(thread->GetEcmaVM(), srcString)); in RuntimeStArraySpread()
474 JSTaggedValue::SetProperty(thread, dst, dstLen + i, strValue, true); in RuntimeStArraySpread()
475 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
477 JSHandle<JSTaggedValue> length(thread, JSTaggedValue(dstLen + strLen)); in RuntimeStArraySpread()
479 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in RuntimeStArraySpread()
480 JSTaggedValue::SetProperty(thread, dst, lengthKey, length); in RuntimeStArraySpread()
485 if (index.GetInt() == 0 && src->IsStableJSArray(thread)) { in RuntimeStArraySpread()
486 JSHandle<TaggedArray> srcElements(thread, JSHandle<JSObject>::Cast(src)->GetElements()); in RuntimeStArraySpread()
490 dstArray->SetElements(thread, dstElements); in RuntimeStArraySpread()
491 dstArray->SetArrayLength(thread, length); in RuntimeStArraySpread()
494 ElementAccessor::CopyJSArrayObject(thread, srcObj, dstObj, length); in RuntimeStArraySpread()
496 JSHandle<JSTaggedValue> reg(thread, ElementAccessor::Get(srcObj, i)); in RuntimeStArraySpread()
498 …JSHandle<JSTaggedValue> reg2(thread, JSArray::FastGetPropertyByValue(thread, src, i).GetTaggedValu… in RuntimeStArraySpread()
499 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
501 ElementAccessor::Set(thread, dstObj, i, undefinedHandle, true); in RuntimeStArraySpread()
503 ElementAccessor::Set(thread, dstObj, i, reg2, true); in RuntimeStArraySpread()
506 ElementAccessor::Set(thread, dstObj, i, reg, true); in RuntimeStArraySpread()
513 auto globalConst = thread->GlobalConstants(); in RuntimeStArraySpread()
519 JSHandle<JSTaggedValue> valuesMethod = JSObject::GetMethod(thread, src, valuesStr); in RuntimeStArraySpread()
520 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
521 iter = JSIterator::GetIterator(thread, src, valuesMethod); in RuntimeStArraySpread()
522 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
524 iter = JSIterator::GetIterator(thread, src); in RuntimeStArraySpread()
525 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
528 JSMutableHandle<JSTaggedValue> indexHandle(thread, index); in RuntimeStArraySpread()
530 PropertyDescriptor desc(thread); in RuntimeStArraySpread()
534 iterResult = JSIterator::IteratorStep(thread, iter); in RuntimeStArraySpread()
535 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
539 bool success = JSTaggedValue::GetOwnProperty(thread, iterResult, valueStr, desc); in RuntimeStArraySpread()
540 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
542 JSTaggedValue::DefineOwnProperty(thread, dst, indexHandle, desc); in RuntimeStArraySpread()
543 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
550 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in RuntimeStArraySpread()
551 JSTaggedValue::SetProperty(thread, dst, lengthKey, indexHandle); in RuntimeStArraySpread()
556 JSTaggedValue RuntimeStubs::RuntimeGetIteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetIteratorNext() argument
560 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeGetIteratorNext()
561 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in RuntimeGetIteratorNext()
562 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIteratorNext()
564 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIteratorNext()
566 return RuntimeThrowTypeError(thread, "the Iterator is not an ecmaobject."); in RuntimeGetIteratorNext()
571 JSTaggedValue RuntimeStubs::RuntimeSetObjectWithProto(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeSetObjectWithProto() argument
578 …THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetProtoWithSendable), JSTaggedValue::Excep… in RuntimeSetObjectWithProto()
580 JSObject::SetPrototype(thread, obj, proto); in RuntimeSetObjectWithProto()
581 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSetObjectWithProto()
585 JSTaggedValue RuntimeStubs::RuntimeLdObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeLdObjByValue() argument
593 … JSTaggedValue::RequireObjectCoercible(thread, obj, "Cannot load property of null or undefined"); in RuntimeLdObjByValue()
594 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
598 res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), object); in RuntimeLdObjByValue()
599 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
601 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeLdObjByValue()
602 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
603 res = JSTaggedValue::GetProperty(thread, object, propKey).GetValue().GetTaggedValue(); in RuntimeLdObjByValue()
605 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
609 JSTaggedValue RuntimeStubs::RuntimeStObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStObjByValue() argument
617 … JSTaggedValue::RequireObjectCoercible(thread, obj, "Cannot store property of null or undefined"); in RuntimeStObjByValue()
618 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
620 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, prop)); in RuntimeStObjByValue()
621 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
623 JSTaggedValue::SetProperty(thread, object, propKey, value, true); in RuntimeStObjByValue()
624 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
628 JSTaggedValue RuntimeStubs::RuntimeStOwnByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStOwnByValue() argument
632 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeStOwnByValue()
636 …return RuntimeThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeEr… in RuntimeStOwnByValue()
642 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByValue()
643 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key); in RuntimeStOwnByValue()
644 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValue()
645 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeStOwnByValue()
646 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValue()
648 return RuntimeThrowTypeError(thread, "StOwnByValue failed"); in RuntimeStOwnByValue()
653 JSTaggedValue RuntimeStubs::RuntimeLdSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeLdSuperByValue() argument
658 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in RuntimeLdSuperByValue()
659 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in RuntimeLdSuperByValue()
660 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
661 JSTaggedValue::RequireObjectCoercible(thread, superBase); in RuntimeLdSuperByValue()
662 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
663 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, key)); in RuntimeLdSuperByValue()
664 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
666 …JSTaggedValue res = JSTaggedValue::GetProperty(thread, superBase, propKey, obj).GetValue().GetTagg… in RuntimeLdSuperByValue()
667 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
671 JSTaggedValue RuntimeStubs::RuntimeStSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeStSuperByValue() argument
677 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in RuntimeStSuperByValue()
678 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in RuntimeStSuperByValue()
679 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
680 JSTaggedValue::RequireObjectCoercible(thread, superBase); in RuntimeStSuperByValue()
681 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
682 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, key)); in RuntimeStSuperByValue()
683 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
686 JSTaggedValue::SetProperty(thread, superBase, propKey, value, obj, true); in RuntimeStSuperByValue()
687 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
691 JSTaggedValue RuntimeStubs::RuntimeLdObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeLdObjByIndex() argument
696 res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), obj); in RuntimeLdObjByIndex()
698 res = JSTaggedValue::GetProperty(thread, obj, idx).GetValue().GetTaggedValue(); in RuntimeLdObjByIndex()
700 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByIndex()
704 JSTaggedValue RuntimeStubs::RuntimeLdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue p… in RuntimeLdObjByName() argument
707 JSHandle<JSTaggedValue> objHandle(thread, obj); in RuntimeLdObjByName()
710 … res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), objHandle); in RuntimeLdObjByName()
712 JSHandle<JSTaggedValue> propHandle(thread, prop); in RuntimeLdObjByName()
713 res = JSTaggedValue::GetProperty(thread, objHandle, propHandle).GetValue().GetTaggedValue(); in RuntimeLdObjByName()
715 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByName()
719 JSTaggedValue RuntimeStubs::RuntimeStObjByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeStObjByName() argument
723 JSTaggedValue::SetProperty(thread, obj, prop, value, true); in RuntimeStObjByName()
724 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByName()
728 JSTaggedValue RuntimeStubs::RuntimeStObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStObjByIndex() argument
731 JSTaggedValue::SetProperty(thread, obj, idx, value, true); in RuntimeStObjByIndex()
732 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByIndex()
736 JSTaggedValue RuntimeStubs::RuntimeStOwnByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStOwnByIndex() argument
743 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByIndex()
744 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, idx, desc); in RuntimeStOwnByIndex()
745 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByIndex()
747 return RuntimeThrowTypeError(thread, "SetOwnByIndex failed"); in RuntimeStOwnByIndex()
752 JSTaggedValue RuntimeStubs::RuntimeStGlobalRecord(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeStGlobalRecord() argument
755 ObjectFactory* factory = thread->GetEcmaVM()->GetFactory(); in RuntimeStGlobalRecord()
756 if (thread->GetEcmaVM()->GetJSOptions().IsEnableLoweringBuiltin()) { in RuntimeStGlobalRecord()
760 … auto box = factory->NewPropertyBox(JSHandle<JSTaggedValue>(thread, JSTaggedValue::Hole())); in RuntimeStGlobalRecord()
761 thread->GetBuiltinEntriesPointer()->ClearByIndex(index, box.GetTaggedValue()); in RuntimeStGlobalRecord()
765 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeStGlobalRecord()
772 return RuntimeThrowSyntaxError(thread, "Duplicate identifier"); in RuntimeStGlobalRecord()
779 JSHandle<GlobalDictionary> dictHandle(thread, dict); in RuntimeStGlobalRecord()
784 …dict = *GlobalDictionary::PutIfAbsent(thread, dictHandle, prop, JSHandle<JSTaggedValue>(box), attr… in RuntimeStGlobalRecord()
785 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStGlobalRecord()
786 env->SetGlobalRecord(thread, JSTaggedValue(dict)); in RuntimeStGlobalRecord()
790 JSTaggedValue RuntimeStubs::RuntimeNeg(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeNeg() argument
792 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeNeg()
793 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNeg()
796 return BigInt::UnaryMinus(thread, bigValue).GetTaggedValue(); in RuntimeNeg()
816 JSTaggedValue RuntimeStubs::RuntimeNot(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeNot() argument
818 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeNot()
819 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNot()
822 return BigInt::BitwiseNOT(thread, bigValue).GetTaggedValue(); in RuntimeNot()
824 int32_t number = JSTaggedValue::ToInt32(thread, inputVal); in RuntimeNot()
828 JSTaggedValue RuntimeStubs::RuntimeResolveClass(JSThread *thread, const JSHandle<JSFunction> &ctor, in RuntimeResolveClass() argument
835 FrameHandler frameHandler(thread); in RuntimeResolveClass()
837 …JSHandle<JSTaggedValue> ecmaModule(thread, JSFunction::Cast(currentFunc.GetTaggedObject())->GetMod… in RuntimeResolveClass()
839 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(ctor), base); in RuntimeResolveClass()
840 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeResolveClass()
850 func->SetLexicalEnv(thread, lexenv.GetTaggedValue()); in RuntimeResolveClass()
851 func->SetModule(thread, ecmaModule); in RuntimeResolveClass()
858 JSTaggedValue RuntimeStubs::RuntimeCloneClassFromTemplate(JSThread *thread, const JSHandle<JSFuncti… in RuntimeCloneClassFromTemplate() argument
862 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCloneClassFromTemplate()
863 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeCloneClassFromTemplate()
866 JSHandle<JSObject> clsPrototype(thread, ctor->GetFunctionPrototype()); in RuntimeCloneClassFromTemplate()
870 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
873 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
876 …JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, cloneClass, cloneClassPrototype.GetTagged… in RuntimeCloneClassFromTemplate()
877 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
879 PropertyDescriptor ctorDesc(thread, JSHandle<JSTaggedValue>(cloneClass), true, false, true); in RuntimeCloneClassFromTemplate()
880 JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(cloneClassPrototype), in RuntimeCloneClassFromTemplate()
882 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
884 cloneClass->SetHomeObject(thread, cloneClassPrototype); in RuntimeCloneClassFromTemplate()
887 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cloneClass), base); in RuntimeCloneClassFromTemplate()
888 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
903 JSTaggedValue RuntimeStubs::RuntimeCreateClassWithBuffer(JSThread *thread, in RuntimeCreateClassWithBuffer() argument
912 …THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(NotSendableSubClass), JSTaggedValue::Except… in RuntimeCreateClassWithBuffer()
914 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeCreateClassWithBuffer()
915 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateClassWithBuffer()
919 auto methodObj = ConstantPool::GetMethodFromCache(thread, constpool.GetTaggedValue(), methodId); in RuntimeCreateClassWithBuffer()
920 JSHandle<JSTaggedValue> method(thread, methodObj); in RuntimeCreateClassWithBuffer()
923 JSMutableHandle<JSTaggedValue> ihc(thread, JSTaggedValue::Undefined()); in RuntimeCreateClassWithBuffer()
924 JSMutableHandle<JSTaggedValue> chc(thread, JSTaggedValue::Undefined()); in RuntimeCreateClassWithBuffer()
926 JSHandle<ConstantPool> cp(thread, in RuntimeCreateClassWithBuffer()
927 … thread->GetCurrentEcmaContext()->FindOrCreateUnsharedConstpool(constpoolHandle.GetTaggedValue())); in RuntimeCreateClassWithBuffer()
930 JSHandle<AOTLiteralInfo> aotLiteralInfo(thread, val); in RuntimeCreateClassWithBuffer()
935 JSHandle<JSTaggedValue> sendableEnv(thread, JSTaggedValue::Undefined()); in RuntimeCreateClassWithBuffer()
938 sendableEnv = JSHandle<JSTaggedValue>(thread, moduleRecord->GetSendableEnv()); in RuntimeCreateClassWithBuffer()
940 …JSTaggedValue literalObj = ConstantPool::GetClassLiteralFromCache(thread, cp, literalId, entry, se… in RuntimeCreateClassWithBuffer()
942 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreateClassWithBuffer()
943 JSHandle<TaggedArray> arrayHandle(thread, classLiteral->GetArray()); in RuntimeCreateClassWithBuffer()
946 …ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, arrayHandle, literalLeng… in RuntimeCreateClassWithBuffer()
950 cls = ClassHelper::DefineClassWithIHClass(thread, base, extractor, lexenv, ihc, chc); in RuntimeCreateClassWithBuffer()
952 cls = ClassHelper::DefineClassFromExtractor(thread, base, extractor, lexenv); in RuntimeCreateClassWithBuffer()
954 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
955 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base); in RuntimeCreateClassWithBuffer()
956 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
958 cls->SetLexicalEnv(thread, lexenv.GetTaggedValue()); in RuntimeCreateClassWithBuffer()
959 cls->SetModule(thread, module.GetTaggedValue()); in RuntimeCreateClassWithBuffer()
960 RuntimeSetClassConstructorLength(thread, cls.GetTaggedValue(), length.GetTaggedValue()); in RuntimeCreateClassWithBuffer()
961 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
966 void RuntimeStubs::SetProfileTypeInfoCellToFunction(JSThread *thread, const JSHandle<JSFunction> &j… in SetProfileTypeInfoCellToFunction() argument
980 JSHandle<Method> method(thread, jsFunc->GetMethod()); in SetProfileTypeInfoCellToFunction()
982 profileTypeInfo = RuntimeNotifyInlineCache(thread, jsFunc, slotSize); in SetProfileTypeInfoCellToFunction()
987 JSHandle<ProfileTypeInfo> profileTypeArray(thread, profileTypeInfo); in SetProfileTypeInfoCellToFunction()
990 JSHandle<JSTaggedValue> handleUndefined(thread, JSTaggedValue::Undefined()); in SetProfileTypeInfoCellToFunction()
992 thread->GetEcmaVM()->GetFactory()->NewProfileTypeInfoCell(handleUndefined); in SetProfileTypeInfoCellToFunction()
993 profileTypeArray->Set(thread, slotId, newProfileTypeInfoCell); in SetProfileTypeInfoCellToFunction()
994 definedFunc->SetRawProfileTypeInfo(thread, newProfileTypeInfoCell); in SetProfileTypeInfoCellToFunction()
997 cellPtr->UpdateProfileTypeInfoCellType(thread); in SetProfileTypeInfoCellToFunction()
998 definedFunc->SetRawProfileTypeInfo(thread, slotValue); in SetProfileTypeInfoCellToFunction()
1002 JSTaggedValue RuntimeStubs::RuntimeCreateSharedClass(JSThread *thread, in RuntimeCreateSharedClass() argument
1009 …THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(ClassNotDerivedFromShared), JSTaggedValue::… in RuntimeCreateSharedClass()
1011 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeCreateSharedClass()
1012 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateSharedClass()
1015 auto methodObj = ConstantPool::GetMethodFromCache(thread, constpool.GetTaggedValue(), methodId); in RuntimeCreateSharedClass()
1016 JSHandle<JSTaggedValue> method(thread, methodObj); in RuntimeCreateSharedClass()
1020 JSHandle<JSTaggedValue> sendableEnv(thread, JSTaggedValue::Undefined()); in RuntimeCreateSharedClass()
1023 sendableEnv = JSHandle<JSTaggedValue>(thread, moduleRecord->GetSendableEnv()); in RuntimeCreateSharedClass()
1026 thread, constpoolHandle, literalId, entry, sendableEnv, ClassKind::SENDABLE); in RuntimeCreateSharedClass()
1027 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreateSharedClass()
1028 JSHandle<TaggedArray> arrayHandle(thread, classLiteral->GetArray()); in RuntimeCreateSharedClass()
1035 ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, arrayHandle, in RuntimeCreateSharedClass()
1038 …JSHandle<TaggedArray> fieldTypeArray = ConstantPool::GetFieldLiteral(thread, constpoolHandle, fiel… in RuntimeCreateSharedClass()
1039 …rray> staticFieldArray = SendableClassDefiner::ExtractStaticFieldTypeArray(thread, fieldTypeArray); in RuntimeCreateSharedClass()
1041 SendableClassDefiner::DefineSendableClassFromExtractor(thread, extractor, staticFieldArray); in RuntimeCreateSharedClass()
1042 ModuleManager *moduleManager = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeCreateSharedClass()
1046 sendableClsModuleRecord->SetSendableEnv(thread, sendableEnv); in RuntimeCreateSharedClass()
1048 cls->SetModule(thread, sendableClsModule.GetTaggedValue()); in RuntimeCreateSharedClass()
1049 RuntimeSetClassConstructorLength(thread, cls.GetTaggedValue(), JSTaggedValue(length)); in RuntimeCreateSharedClass()
1050 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateSharedClass()
1051 …RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base, ClassKind::SEND… in RuntimeCreateSharedClass()
1052 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateSharedClass()
1060 …SendableClassDefiner::DefineSendableInstanceHClass(thread, fieldTypeArray, instanceLength, cls, ba… in RuntimeCreateSharedClass()
1064 JSTaggedValue RuntimeStubs::RuntimeSetClassInheritanceRelationship(JSThread *thread, in RuntimeSetClassInheritanceRelationship() argument
1069 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeSetClassInheritanceRelationship()
1070 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeSetClassInheritanceRelationship()
1098 parentPrototype = JSHandle<JSTaggedValue>(thread, JSTaggedValue::Null()); in RuntimeSetClassInheritanceRelationship()
1101 return RuntimeThrowTypeError(thread, "parent class is not constructor"); in RuntimeSetClassInheritanceRelationship()
1104 parentPrototype = JSTaggedValue::GetProperty(thread, parent, in RuntimeSetClassInheritanceRelationship()
1106 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSetClassInheritanceRelationship()
1108 return RuntimeThrowTypeError(thread, "parent class have no valid prototype"); in RuntimeSetClassInheritanceRelationship()
1112 ctor->GetTaggedObject()->GetClass()->SetPrototype(thread, parent); // __proto__ in RuntimeSetClassInheritanceRelationship()
1114 JSHandle<JSObject> clsPrototype(thread, JSHandle<JSFunction>(ctor)->GetFunctionPrototype()); in RuntimeSetClassInheritanceRelationship()
1115 clsPrototype->GetClass()->SetPrototype(thread, parentPrototype); in RuntimeSetClassInheritanceRelationship()
1120 … JSHClass::EnableProtoChangeMarker(thread, JSHandle<JSHClass>(thread, constructor->GetClass())); in RuntimeSetClassInheritanceRelationship()
1122 JSHClass::EnableProtoChangeMarker(thread, in RuntimeSetClassInheritanceRelationship()
1123 … JSHandle<JSHClass>(thread, constructor->GetFunctionPrototype().GetTaggedObject()->GetClass())); in RuntimeSetClassInheritanceRelationship()
1133 JSHandle<JSHClass> ihcHandle(thread, ihc); in RuntimeSetClassInheritanceRelationship()
1134 JSHClass::EnableProtoChangeMarker(thread, ihcHandle); in RuntimeSetClassInheritanceRelationship()
1137 JSHandle<JSObject> protoHandle(thread, protoOrHClass); in RuntimeSetClassInheritanceRelationship()
1139 …JSHClass::EnablePHCProtoChangeMarker(thread, JSHandle<JSHClass>(thread, protoHandle->GetJSHClass()… in RuntimeSetClassInheritanceRelationship()
1146 JSTaggedValue RuntimeStubs::RuntimeSetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, in RuntimeSetClassConstructorLength() argument
1153 cls->SetPropertyInlinedProps(thread, JSFunction::LENGTH_INLINE_PROPERTY_INDEX, length); in RuntimeSetClassConstructorLength()
1155 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeSetClassConstructorLength()
1156 cls->UpdatePropertyInDictionary(thread, globalConst->GetLengthString(), length); in RuntimeSetClassConstructorLength()
1161 JSTaggedValue RuntimeStubs::RuntimeNotifyInlineCache(JSThread *thread, const JSHandle<JSFunction> &… in RuntimeNotifyInlineCache() argument
1169 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNotifyInlineCache()
1183 … JSFunction::SetProfileTypeInfo(thread, function, JSHandle<JSTaggedValue>::Cast(profileTypeInfo)); in RuntimeNotifyInlineCache()
1187 JSTaggedValue RuntimeStubs::RuntimeStOwnByValueWithNameSet(JSThread *thread, const JSHandle<JSTagge… in RuntimeStOwnByValueWithNameSet() argument
1191 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeStOwnByValueWithNameSet()
1195 …return RuntimeThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeEr… in RuntimeStOwnByValueWithNameSet()
1201 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByValueWithNameSet()
1202 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key); in RuntimeStOwnByValueWithNameSet()
1203 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValueWithNameSet()
1204 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeStOwnByValueWithNameSet()
1205 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValueWithNameSet()
1207 return RuntimeThrowTypeError(thread, "StOwnByValueWithNameSet failed"); in RuntimeStOwnByValueWithNameSet()
1211 …propKey = JSHandle<JSTaggedValue>(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValu… in RuntimeStOwnByValueWithNameSet()
1213 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(value), propKey, in RuntimeStOwnByValueWithNameSet()
1214 … JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in RuntimeStOwnByValueWithNameSet()
1219 JSTaggedValue RuntimeStubs::RuntimeStOwnByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeStOwnByName() argument
1228 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByName()
1229 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, prop, desc); in RuntimeStOwnByName()
1230 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByName()
1232 return RuntimeThrowTypeError(thread, "SetOwnByName failed"); in RuntimeStOwnByName()
1237 JSTaggedValue RuntimeStubs::RuntimeStOwnByNameWithNameSet(JSThread *thread, in RuntimeStOwnByNameWithNameSet() argument
1243 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in RuntimeStOwnByNameWithNameSet()
1244 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByNameWithNameSet()
1248 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in RuntimeStOwnByNameWithNameSet()
1249 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc); in RuntimeStOwnByNameWithNameSet()
1250 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByNameWithNameSet()
1252 return RuntimeThrowTypeError(thread, "SetOwnByNameWithNameSet failed"); in RuntimeStOwnByNameWithNameSet()
1254 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(valueHandle), propKey, in RuntimeStOwnByNameWithNameSet()
1255 JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in RuntimeStOwnByNameWithNameSet()
1259 JSTaggedValue RuntimeStubs::RuntimeSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedValue>… in RuntimeSuspendGenerator() argument
1264 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSuspendGenerator()
1266 SaveFrameToContext(thread, genContextHandle); in RuntimeSuspendGenerator()
1272 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
1278 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSuspendGenerator()
1280 generatorObjectHandle->SetTaskInfo(thread->GetTaskInfo()); in RuntimeSuspendGenerator()
1282 SaveFrameToContext(thread, genContextHandle); in RuntimeSuspendGenerator()
1287 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
1290 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
1294 return RuntimeThrowTypeError(thread, "RuntimeSuspendGenerator failed"); in RuntimeSuspendGenerator()
1297 void RuntimeStubs::RuntimeSetGeneratorState(JSThread *thread, const JSHandle<JSTaggedValue> &genObj, in RuntimeSetGeneratorState() argument
1301 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSetGeneratorState()
1326 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, int32_t index) in RuntimeGetModuleNamespace() argument
1328 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(index); in RuntimeGetModuleNamespace()
1331 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, int32_t index, in RuntimeGetModuleNamespace() argument
1334 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(index, jsFunc); in RuntimeGetModuleNamespace()
1337 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName) in RuntimeGetModuleNamespace() argument
1339 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(localName); in RuntimeGetModuleNamespace()
1342 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName, in RuntimeGetModuleNamespace() argument
1345 … return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(localName, jsFunc); in RuntimeGetModuleNamespace()
1348 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value) in RuntimeStModuleVar() argument
1350 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(index, value); in RuntimeStModuleVar()
1353 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value, in RuntimeStModuleVar() argument
1356 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(index, value, jsFunc); in RuntimeStModuleVar()
1359 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value) in RuntimeStModuleVar() argument
1361 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(key, value); in RuntimeStModuleVar()
1364 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value, in RuntimeStModuleVar() argument
1367 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(key, value, jsFunc); in RuntimeStModuleVar()
1370 JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVar(JSThread *thread, int32_t index) in RuntimeLdLocalModuleVar() argument
1372 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInner(index); in RuntimeLdLocalModuleVar()
1375 inline JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVarWithModule(JSThread* thread, int32_t inde… in RuntimeLdLocalModuleVarWithModule() argument
1379 ModuleManager* mmgr = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeLdLocalModuleVarWithModule()
1384 return SourceTextModule::Cast(module)->GetModuleValue(thread, index, false); in RuntimeLdLocalModuleVarWithModule()
1387 JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVar(JSThread *thread, int32_t index, JSTaggedValue … in RuntimeLdLocalModuleVar() argument
1389 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInner(index, jsFunc); in RuntimeLdLocalModuleVar()
1392 JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVar(JSThread *thread, int32_t index) in RuntimeLdExternalModuleVar() argument
1394 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(index); in RuntimeLdExternalModuleVar()
1397 inline JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVarWithModule(JSThread* thread, int32_t i… in RuntimeLdExternalModuleVarWithModule() argument
1401 ModuleManager* mmgr = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeLdExternalModuleVarWithModule()
1405 moduleHdl = JSHandle<JSTaggedValue>(thread, module); in RuntimeLdExternalModuleVarWithModule()
1410 JSTaggedValue RuntimeStubs::RuntimeLdSendableExternalModuleVar(JSThread *thread, int32_t index, JST… in RuntimeLdSendableExternalModuleVar() argument
1412 return SharedModuleManager::GetInstance()->GetSendableModuleValue(thread, index, jsFunc); in RuntimeLdSendableExternalModuleVar()
1415 JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVar(JSThread *thread, int32_t index, JSTaggedVal… in RuntimeLdExternalModuleVar() argument
1417 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(index, jsFunc); in RuntimeLdExternalModuleVar()
1420 JSTaggedValue RuntimeStubs::RuntimeLdLazyExternalModuleVar(JSThread *thread, int32_t index, JSTagge… in RuntimeLdLazyExternalModuleVar() argument
1422 …return thread->GetCurrentEcmaContext()->GetModuleManager()->GetLazyModuleValueOutter(index, jsFunc… in RuntimeLdLazyExternalModuleVar()
1426 JSThread *thread, int32_t index, JSTaggedValue jsFunc) in RuntimeLdLazySendableExternalModuleVar() argument
1428 return SharedModuleManager::GetInstance()->GetLazySendableModuleValue(thread, index, jsFunc); in RuntimeLdLazySendableExternalModuleVar()
1431 JSTaggedValue RuntimeStubs::RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner) in RuntimeLdModuleVar() argument
1434 …JSTaggedValue moduleValue = thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInn… in RuntimeLdModuleVar()
1438 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(key); in RuntimeLdModuleVar()
1441 JSTaggedValue RuntimeStubs::RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner, in RuntimeLdModuleVar() argument
1446 thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInner(key, jsFunc); in RuntimeLdModuleVar()
1450 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(key, jsFunc); in RuntimeLdModuleVar()
1453 JSTaggedValue RuntimeStubs::RuntimeGetPropIterator(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetPropIterator() argument
1455 JSHandle<JSForInIterator> iteratorHandle = JSObject::EnumerateObjectProperties(thread, value); in RuntimeGetPropIterator()
1456 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetPropIterator()
1460 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionEnter(JSThread *thread) in RuntimeAsyncFunctionEnter() argument
1462 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeAsyncFunctionEnter()
1464 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeAsyncFunctionEnter()
1471 asyncFuncObj->SetPromise(thread, promiseObject); in RuntimeAsyncFunctionEnter()
1474 context->SetGeneratorObject(thread, asyncFuncObj); in RuntimeAsyncFunctionEnter()
1478 asyncFuncObj->SetGeneratorContext(thread, context); in RuntimeAsyncFunctionEnter()
1481 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionEnter()
1485 JSTaggedValue RuntimeStubs::RuntimeGetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &obj) in RuntimeGetIterator() argument
1487 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeGetIterator()
1490 JSTaggedValue::GetProperty(thread, obj, env->GetIteratorSymbol()).GetValue(); in RuntimeGetIterator()
1491 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIterator()
1496 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeGetIterator()
1497 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, valuesFunc, obj, undefined… in RuntimeGetIterator()
1501 JSTaggedValue RuntimeStubs::RuntimeGetAsyncIterator(JSThread *thread, const JSHandle<JSTaggedValue>… in RuntimeGetAsyncIterator() argument
1503 JSHandle<JSTaggedValue> asyncit = JSIterator::GetAsyncIterator(thread, obj); in RuntimeGetAsyncIterator()
1504 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetAsyncIterator()
1508 JSTaggedValue RuntimeStubs::RuntimeLdPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeLdPrivateProperty() argument
1518 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeLdPrivateProperty()
1519 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeLdPrivateProperty()
1521 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeLdPrivateProperty()
1523 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, handleKey, handleObj, unde… in RuntimeLdPrivateProperty()
1524 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdPrivateProperty()
1526 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdPrivateProperty()
1529 PropertyDescriptor desc(thread); in RuntimeLdPrivateProperty()
1531 !JSTaggedValue::GetOwnProperty(thread, handleObj, handleKey, desc)) { in RuntimeLdPrivateProperty()
1532 …THROW_TYPE_ERROR_AND_RETURN(thread, "invalid or cannot find private key", JSTaggedValue::Exception… in RuntimeLdPrivateProperty()
1535 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdPrivateProperty()
1539 JSTaggedValue RuntimeStubs::RuntimeStPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeStPrivateProperty() argument
1549 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeStPrivateProperty()
1550 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeStPrivateProperty()
1551 JSHandle<JSTaggedValue> handleValue(thread, value); in RuntimeStPrivateProperty()
1553 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeStPrivateProperty()
1555 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, handleKey, handleObj, unde… in RuntimeStPrivateProperty()
1556 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStPrivateProperty()
1559 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStPrivateProperty()
1562 PropertyDescriptor desc(thread); in RuntimeStPrivateProperty()
1564 !JSTaggedValue::GetOwnProperty(thread, handleObj, handleKey, desc)) { in RuntimeStPrivateProperty()
1565 …THROW_TYPE_ERROR_AND_RETURN(thread, "invalid or cannot find private key", JSTaggedValue::Exception… in RuntimeStPrivateProperty()
1568 bool res = JSTaggedValue::DefineOwnProperty(thread, handleObj, handleKey, desc); in RuntimeStPrivateProperty()
1569 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStPrivateProperty()
1573 JSTaggedValue RuntimeStubs::RuntimeTestIn(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeTestIn() argument
1577 …THROW_TYPE_ERROR_AND_RETURN(thread, "Cannot use 'in' operator in Non-Object", JSTaggedValue::Excep… in RuntimeTestIn()
1585 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeTestIn()
1586 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeTestIn()
1587 …bool res = JSTaggedValue::IsPropertyKey(handleKey) && JSTaggedValue::HasProperty(thread, handleObj… in RuntimeTestIn()
1588 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTestIn()
1592 void RuntimeStubs::RuntimeThrow(JSThread *thread, JSTaggedValue value) in RuntimeThrow() argument
1594 thread->SetException(value); in RuntimeThrow()
1597 void RuntimeStubs::RuntimeThrowThrowNotExists(JSThread *thread) in RuntimeThrowThrowNotExists() argument
1599 THROW_TYPE_ERROR(thread, "Throw method is not defined"); in RuntimeThrowThrowNotExists()
1602 void RuntimeStubs::RuntimeThrowPatternNonCoercible(JSThread *thread) in RuntimeThrowPatternNonCoercible() argument
1604 JSHandle<EcmaString> msg(thread->GlobalConstants()->GetHandledObjNotCoercibleString()); in RuntimeThrowPatternNonCoercible()
1605 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowPatternNonCoercible()
1606 THROW_NEW_ERROR_AND_RETURN(thread, in RuntimeThrowPatternNonCoercible()
1610 void RuntimeStubs::RuntimeThrowDeleteSuperProperty(JSThread *thread) in RuntimeThrowDeleteSuperProperty() argument
1612 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowDeleteSuperProperty()
1615 THROW_NEW_ERROR_AND_RETURN(thread, errorObj.GetTaggedValue()); in RuntimeThrowDeleteSuperProperty()
1618 void RuntimeStubs::RuntimeThrowUndefinedIfHole(JSThread *thread, const JSHandle<EcmaString> &obj) in RuntimeThrowUndefinedIfHole() argument
1620 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowUndefinedIfHole()
1624 THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::REFERENCE_ERROR, in RuntimeThrowUndefinedIfHole()
1628 void RuntimeStubs::RuntimeThrowIfNotObject(JSThread *thread) in RuntimeThrowIfNotObject() argument
1630 THROW_TYPE_ERROR(thread, "Inner return result is not object"); in RuntimeThrowIfNotObject()
1633 void RuntimeStubs::RuntimeThrowConstAssignment(JSThread *thread, const JSHandle<EcmaString> &value) in RuntimeThrowConstAssignment() argument
1635 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowConstAssignment()
1640 THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::TYPE_ERROR, in RuntimeThrowConstAssignment()
1644 JSTaggedValue RuntimeStubs::RuntimeLdGlobalRecord(JSThread *thread, JSTaggedValue key) in RuntimeLdGlobalRecord() argument
1646 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeLdGlobalRecord()
1656 JSTaggedValue RuntimeStubs::RuntimeTryLdGlobalByName(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeTryLdGlobalByName() argument
1659 OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop); in RuntimeTryLdGlobalByName()
1660 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTryLdGlobalByName()
1662 return RuntimeThrowReferenceError(thread, prop, " is not defined"); in RuntimeTryLdGlobalByName()
1667 JSTaggedValue RuntimeStubs::RuntimeTryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, in RuntimeTryUpdateGlobalRecord() argument
1670 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeTryUpdateGlobalRecord()
1677 return RuntimeThrowTypeError(thread, "const variable can not be modified"); in RuntimeTryUpdateGlobalRecord()
1681 box->SetValue(thread, value); in RuntimeTryUpdateGlobalRecord()
1682 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTryUpdateGlobalRecord()
1686 JSTaggedValue RuntimeStubs::RuntimeThrowReferenceError(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeThrowReferenceError() argument
1689 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowReferenceError()
1690 JSHandle<EcmaString> propName = JSTaggedValue::ToString(thread, prop); in RuntimeThrowReferenceError()
1691 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowReferenceError()
1694 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, in RuntimeThrowReferenceError()
1699 JSTaggedValue RuntimeStubs::RuntimeLdGlobalVarFromProto(JSThread *thread, const JSHandle<JSTaggedVa… in RuntimeLdGlobalVarFromProto() argument
1704 JSHandle<JSTaggedValue> obj(thread, JSObject::GetPrototype(global)); in RuntimeLdGlobalVarFromProto()
1705 OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop); in RuntimeLdGlobalVarFromProto()
1706 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdGlobalVarFromProto()
1710 JSTaggedValue RuntimeStubs::RuntimeStGlobalVar(JSThread *thread, const JSHandle<JSTaggedValue> &pro… in RuntimeStGlobalVar() argument
1713 JSHandle<JSTaggedValue> global(thread, thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalObject()); in RuntimeStGlobalVar()
1715 JSObject::GlobalSetProperty(thread, prop, value, true); in RuntimeStGlobalVar()
1716 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStGlobalVar()
1720 JSTaggedValue RuntimeStubs::RuntimeToNumber(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeToNumber() argument
1722 return JSTaggedValue::ToNumber(thread, value); in RuntimeToNumber()
1725 JSTaggedValue RuntimeStubs::RuntimeToNumeric(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeToNumeric() argument
1727 return JSTaggedValue::ToNumeric(thread, value).GetTaggedValue(); in RuntimeToNumeric()
1730 JSTaggedValue RuntimeStubs::RuntimeDynamicImport(JSThread *thread, const JSHandle<JSTaggedValue> &s… in RuntimeDynamicImport() argument
1733 EcmaVM *ecmaVm = thread->GetEcmaVM(); in RuntimeDynamicImport()
1743 JSMutableHandle<JSTaggedValue> dirPath(thread, thread->GlobalConstants()->GetUndefined()); in RuntimeDynamicImport()
1744 JSMutableHandle<JSTaggedValue> recordName(thread, thread->GlobalConstants()->GetUndefined()); in RuntimeDynamicImport()
1754 …JSHandle<PromiseCapability> promiseCapability = JSPromise::NewPromiseCapability(thread, promiseFun… in RuntimeDynamicImport()
1755 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDynamicImport()
1756 JSHandle<job::MicroJobQueue> job = thread->GetCurrentEcmaContext()->GetMicroJobQueue(); in RuntimeDynamicImport()
1759 argv->Set(thread, 0, promiseCapability->GetResolve()); in RuntimeDynamicImport()
1760 argv->Set(thread, 1, promiseCapability->GetReject()); // 1 : reject method in RuntimeDynamicImport()
1761 …argv->Set(thread, 2, dirPath); // 2 : current file path(containing file … in RuntimeDynamicImport()
1762 argv->Set(thread, 3, specifier); // 3 : request module's path in RuntimeDynamicImport()
1763 argv->Set(thread, 4, recordName); // 4 : js recordName or undefined in RuntimeDynamicImport()
1766 …job::MicroJobQueue::EnqueueJob(thread, job, job::QueueType::QUEUE_PROMISE, dynamicImportJob, argv); in RuntimeDynamicImport()
1771 JSTaggedValue RuntimeStubs::RuntimeEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeEq() argument
1774 bool ret = JSTaggedValue::Equal(thread, left, right); in RuntimeEq()
1775 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeEq()
1779 JSTaggedValue RuntimeStubs::RuntimeNotEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeNotEq() argument
1782 bool ret = JSTaggedValue::Equal(thread, left, right); in RuntimeNotEq()
1783 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNotEq()
1787 JSTaggedValue RuntimeStubs::RuntimeLess(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeLess() argument
1790 bool ret = JSTaggedValue::Compare(thread, left, right) == ComparisonResult::LESS; in RuntimeLess()
1791 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLess()
1795 JSTaggedValue RuntimeStubs::RuntimeLessEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeLessEq() argument
1798 bool ret = JSTaggedValue::Compare(thread, left, right) <= ComparisonResult::EQUAL; in RuntimeLessEq()
1799 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLessEq()
1803 JSTaggedValue RuntimeStubs::RuntimeGreater(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeGreater() argument
1806 bool ret = JSTaggedValue::Compare(thread, left, right) == ComparisonResult::GREAT; in RuntimeGreater()
1807 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGreater()
1811 JSTaggedValue RuntimeStubs::RuntimeGreaterEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeGreaterEq() argument
1814 ComparisonResult comparison = JSTaggedValue::Compare(thread, left, right); in RuntimeGreaterEq()
1816 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGreaterEq()
1820 JSTaggedValue RuntimeStubs::RuntimeAdd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAdd2() argument
1825 thread->GetEcmaVM(), JSHandle<EcmaString>(left), JSHandle<EcmaString>(right)); in RuntimeAdd2()
1826 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1829 JSHandle<JSTaggedValue> primitiveA0(thread, JSTaggedValue::ToPrimitive(thread, left)); in RuntimeAdd2()
1830 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1831 JSHandle<JSTaggedValue> primitiveA1(thread, JSTaggedValue::ToPrimitive(thread, right)); in RuntimeAdd2()
1832 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1835 JSHandle<EcmaString> stringA0 = JSTaggedValue::ToString(thread, primitiveA0); in RuntimeAdd2()
1836 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1837 JSHandle<EcmaString> stringA1 = JSTaggedValue::ToString(thread, primitiveA1); in RuntimeAdd2()
1838 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1839 EcmaString *resultStr = EcmaStringAccessor::Concat(thread->GetEcmaVM(), stringA0, stringA1); in RuntimeAdd2()
1840 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1843 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, primitiveA0); in RuntimeAdd2()
1844 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1845 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, primitiveA1); in RuntimeAdd2()
1846 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1851 return BigInt::Add(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeAdd2()
1853 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAdd2()
1860 JSTaggedValue RuntimeStubs::RuntimeShl2(JSThread *thread, in RuntimeShl2() argument
1864 JSHandle<JSTaggedValue> leftValue = JSTaggedValue::ToNumeric(thread, left); in RuntimeShl2()
1865 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1866 JSHandle<JSTaggedValue> rightValue = JSTaggedValue::ToNumeric(thread, right); in RuntimeShl2()
1867 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1872 return BigInt::LeftShift(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeShl2()
1874 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeShl2()
1876 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, leftValue); in RuntimeShl2()
1877 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1878 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, rightValue); in RuntimeShl2()
1879 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1890 JSTaggedValue RuntimeStubs::RuntimeShr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeShr2() argument
1893 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeShr2()
1894 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1895 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeShr2()
1896 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1899 return BigInt::UnsignedRightShift(thread); in RuntimeShr2()
1901 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeShr2()
1903 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeShr2()
1904 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1905 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeShr2()
1906 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1916 JSTaggedValue RuntimeStubs::RuntimeSub2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeSub2() argument
1919 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeSub2()
1920 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSub2()
1921 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeSub2()
1922 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSub2()
1927 return BigInt::Subtract(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeSub2()
1929 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeSub2()
1936 JSTaggedValue RuntimeStubs::RuntimeMul2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeMul2() argument
1939 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeMul2()
1940 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMul2()
1941 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeMul2()
1942 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMul2()
1948 return BigInt::Multiply(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeMul2()
1950 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeMul2()
1958 JSTaggedValue RuntimeStubs::RuntimeDiv2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeDiv2() argument
1961 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeDiv2()
1962 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDiv2()
1963 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeDiv2()
1964 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDiv2()
1969 return BigInt::Divide(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeDiv2()
1971 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeDiv2()
1986 JSTaggedValue RuntimeStubs::RuntimeMod2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeMod2() argument
1989 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeMod2()
1990 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMod2()
1991 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeMod2()
1992 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMod2()
1999 return BigInt::Remainder(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeMod2()
2001 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeMod2()
2015 JSTaggedValue RuntimeStubs::RuntimeAshr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAshr2() argument
2018 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeAshr2()
2019 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2020 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeAshr2()
2021 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2026 return BigInt::SignedRightShift(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeAshr2()
2028 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAshr2()
2030 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeAshr2()
2031 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2032 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeAshr2()
2033 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2041 JSTaggedValue RuntimeStubs::RuntimeAnd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAnd2() argument
2044 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeAnd2()
2045 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2046 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeAnd2()
2047 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2052 return BigInt::BitwiseAND(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeAnd2()
2054 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAnd2()
2056 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeAnd2()
2057 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2058 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeAnd2()
2059 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2067 JSTaggedValue RuntimeStubs::RuntimeOr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeOr2() argument
2070 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeOr2()
2071 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2072 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeOr2()
2073 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2078 return BigInt::BitwiseOR(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeOr2()
2080 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeOr2()
2082 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeOr2()
2083 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2084 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeOr2()
2085 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2093 JSTaggedValue RuntimeStubs::RuntimeXor2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeXor2() argument
2096 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeXor2()
2097 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2098 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeXor2()
2099 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2104 return BigInt::BitwiseXOR(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeXor2()
2106 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeXor2()
2108 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeXor2()
2109 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2110 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeXor2()
2111 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2119 JSTaggedValue RuntimeStubs::RuntimeToJSTaggedValueWithInt32(JSThread *thread, in RuntimeToJSTaggedValueWithInt32() argument
2122 int32_t res = JSTaggedValue::ToInt32(thread, value); in RuntimeToJSTaggedValueWithInt32()
2123 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeToJSTaggedValueWithInt32()
2127 JSTaggedValue RuntimeStubs::RuntimeToJSTaggedValueWithUint32(JSThread *thread, const JSHandle<JSTag… in RuntimeToJSTaggedValueWithUint32() argument
2129 uint32_t res = JSTaggedValue::ToUint32(thread, value); in RuntimeToJSTaggedValueWithUint32()
2130 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeToJSTaggedValueWithUint32()
2134 JSTaggedValue RuntimeStubs::RuntimeCreateEmptyObject([[maybe_unused]] JSThread *thread, ObjectFacto… in RuntimeCreateEmptyObject() argument
2142 JSTaggedValue RuntimeStubs::RuntimeCreateEmptyArray([[maybe_unused]] JSThread *thread, ObjectFactor… in RuntimeCreateEmptyArray() argument
2150 JSTaggedValue RuntimeStubs::RuntimeGetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actu… in RuntimeGetUnmapedArgs() argument
2153 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetUnmapedArgs()
2156 argumentsList->Set(thread, i, in RuntimeGetUnmapedArgs()
2159 return RuntimeGetUnmapedJSArgumentObj(thread, argumentsList); in RuntimeGetUnmapedArgs()
2162 JSTaggedValue RuntimeStubs::RuntimeCopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNu… in RuntimeCopyRestArgs() argument
2166 …thread, restNumArgs, [thread, sp, startIdx] (const JSHandle<TaggedArray> &newElements, uint32_t le… in RuntimeCopyRestArgs()
2169 newElements->Set(thread, i, JSTaggedValue(sp[startIdx + i])); in RuntimeCopyRestArgs()
2174 JSTaggedValue RuntimeStubs::RuntimeCreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, in RuntimeCreateArrayWithBuffer() argument
2179 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateArrayWithBuffer()
2184 JSTaggedValue RuntimeStubs::RuntimeCreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, in RuntimeCreateObjectWithBuffer() argument
2188 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectWithBuffer()
2193 JSTaggedValue RuntimeStubs::RuntimeNewLexicalEnv(JSThread *thread, uint16_t numVars) in RuntimeNewLexicalEnv() argument
2195 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewLexicalEnv()
2198 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in RuntimeNewLexicalEnv()
2199 newEnv->SetParentEnv(thread, currentLexenv); in RuntimeNewLexicalEnv()
2200 newEnv->SetScopeInfo(thread, JSTaggedValue::Hole()); in RuntimeNewLexicalEnv()
2201 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewLexicalEnv()
2205 JSTaggedValue RuntimeStubs::RuntimeNewSendableEnv(JSThread *thread, uint16_t numVars) in RuntimeNewSendableEnv() argument
2207 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewSendableEnv()
2210 JSTaggedValue module = JSFunction::Cast(thread->GetCurrentFunction())->GetModule(); in RuntimeNewSendableEnv()
2211 JSHandle<SourceTextModule> moduleHandle(thread, module); in RuntimeNewSendableEnv()
2212 newEnv->SetParentEnv(thread, moduleHandle->GetSendableEnv()); in RuntimeNewSendableEnv()
2213 newEnv->SetScopeInfo(thread, JSTaggedValue::Hole()); in RuntimeNewSendableEnv()
2214 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewSendableEnv()
2218 JSTaggedValue RuntimeStubs::RuntimeNewObjRange(JSThread *thread, const JSHandle<JSTaggedValue> &fun… in RuntimeNewObjRange() argument
2221 JSHandle<JSTaggedValue> preArgs(thread, JSTaggedValue::Undefined()); in RuntimeNewObjRange()
2222 JSHandle<TaggedArray> args = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length); in RuntimeNewObjRange()
2223 FrameHandler frameHandler(thread); in RuntimeNewObjRange()
2226 args->Set(thread, i, value); in RuntimeNewObjRange()
2228 auto tagged = RuntimeOptConstruct(thread, func, newTarget, preArgs, args); in RuntimeNewObjRange()
2229 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjRange()
2233 void RuntimeStubs::DefineFuncTryUseAOTHClass(JSThread* thread, in DefineFuncTryUseAOTHClass() argument
2242 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefineFuncTryUseAOTHClass()
2243 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in DefineFuncTryUseAOTHClass()
2244 func->SetProtoOrHClass(thread, ihc); in DefineFuncTryUseAOTHClass()
2248 JSHandle<JSObject> clsPrototype(thread, func->GetFunctionPrototype()); in DefineFuncTryUseAOTHClass()
2249 clsPrototype->GetClass()->SetPrototype(thread, parentPrototype); in DefineFuncTryUseAOTHClass()
2253 … PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(func), true, false, true); in DefineFuncTryUseAOTHClass()
2254 JSObject::DefineOwnProperty(thread, clsPrototype, constructorKey, descriptor); in DefineFuncTryUseAOTHClass()
2257 JSHClass::EnablePHCProtoChangeMarker(thread, in DefineFuncTryUseAOTHClass()
2258 JSHandle<JSHClass>(thread, parentPrototype->GetTaggedObject()->GetClass())); in DefineFuncTryUseAOTHClass()
2260 JSHClass::EnableProtoChangeMarker(thread, JSHandle<JSHClass>(ihc)); in DefineFuncTryUseAOTHClass()
2262 …JSHClass::EnablePHCProtoChangeMarker(thread, JSHandle<JSHClass>(thread, clsPrototype->GetClass())); in DefineFuncTryUseAOTHClass()
2264 //avoid one thread uses ihc twice or more times in DefineFuncTryUseAOTHClass()
2269 JSTaggedValue RuntimeStubs::RuntimeDefinefunc(JSThread *thread, const JSHandle<JSTaggedValue> &cons… in RuntimeDefinefunc() argument
2275 JSMutableHandle<JSTaggedValue> ihc(thread, JSTaggedValue::Undefined()); in RuntimeDefinefunc()
2276 JSMutableHandle<AOTLiteralInfo> aotLiteralInfo(thread, JSTaggedValue::Hole()); in RuntimeDefinefunc()
2280 …JSTaggedValue unsharedCp = thread->GetCurrentEcmaContext()->FindUnsharedConstpool(constpoolHandle.… in RuntimeDefinefunc()
2282 JSHandle<ConstantPool> unsharedCpHandle(thread, unsharedCp); in RuntimeDefinefunc()
2289 …JSTaggedValue method = ConstantPool::GetMethodFromCache(thread, constpoolHandle.GetTaggedValue(), … in RuntimeDefinefunc()
2290 const JSHandle<Method> methodHandle(thread, method); in RuntimeDefinefunc()
2291 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeDefinefunc()
2295 ModuleManager *moduleManager = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeDefinefunc()
2300 thread, JSHandle<SourceTextModule>::Cast(module)->GetSendableEnv()); in RuntimeDefinefunc()
2302 result->SetModule(thread, sendableFuncModule.GetTaggedValue()); in RuntimeDefinefunc()
2305 result->SetModule(thread, module.GetTaggedValue()); in RuntimeDefinefunc()
2306 result->SetLexicalEnv(thread, envHandle.GetTaggedValue()); in RuntimeDefinefunc()
2307 result->SetHomeObject(thread, homeObject.GetTaggedValue()); in RuntimeDefinefunc()
2309 DefineFuncTryUseAOTHClass(thread, result, ihc, aotLiteralInfo); in RuntimeDefinefunc()
2315 JSTaggedValue RuntimeStubs::RuntimeCreateRegExpWithLiteral(JSThread *thread, in RuntimeCreateRegExpWithLiteral() argument
2318 JSHandle<JSTaggedValue> flagsHandle(thread, JSTaggedValue(flags)); in RuntimeCreateRegExpWithLiteral()
2319 return builtins::BuiltinsRegExp::RegExpCreate(thread, pattern, flagsHandle); in RuntimeCreateRegExpWithLiteral()
2322 JSTaggedValue RuntimeStubs::RuntimeThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, in RuntimeThrowIfSuperNotCorrectCall() argument
2326 …return RuntimeThrowReferenceError(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined… in RuntimeThrowIfSuperNotCorrectCall()
2330 …return RuntimeThrowReferenceError(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined… in RuntimeThrowIfSuperNotCorrectCall()
2336 JSTaggedValue RuntimeStubs::RuntimeCreateObjectHavingMethod(JSThread *thread, ObjectFactory *factor… in RuntimeCreateObjectHavingMethod() argument
2341 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectHavingMethod()
2346 JSTaggedValue RuntimeStubs::CommonCreateObjectWithExcludedKeys(JSThread *thread, in CommonCreateObjectWithExcludedKeys() argument
2351 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CommonCreateObjectWithExcludedKeys()
2356 JSHandle<JSObject> obj(JSTaggedValue::ToObject(thread, objVal)); in CommonCreateObjectWithExcludedKeys()
2357 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2358 JSHandle<TaggedArray> allKeys = JSObject::GetOwnPropertyKeys(thread, obj); in CommonCreateObjectWithExcludedKeys()
2360 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in CommonCreateObjectWithExcludedKeys()
2365 … if (JSTaggedValue::Equal(thread, key, JSHandle<JSTaggedValue>(thread, excludedKeys->Get(j)))) { in CommonCreateObjectWithExcludedKeys()
2371 PropertyDescriptor desc(thread); in CommonCreateObjectWithExcludedKeys()
2372 bool success = JSObject::GetOwnProperty(thread, obj, key, desc); in CommonCreateObjectWithExcludedKeys()
2373 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2375 JSHandle<JSTaggedValue> value = JSObject::GetProperty(thread, obj, key).GetValue(); in CommonCreateObjectWithExcludedKeys()
2376 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2377 JSObject::SetProperty(thread, restObj, key, value, true); in CommonCreateObjectWithExcludedKeys()
2378 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2385 JSTaggedValue RuntimeStubs::RuntimeOptCreateObjectWithExcludedKeys(JSThread *thread, uintptr_t argv… in RuntimeOptCreateObjectWithExcludedKeys() argument
2387 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptCreateObjectWithExcludedKeys()
2396 excludedKeys->Set(thread, 0, excludedKey); in RuntimeOptCreateObjectWithExcludedKeys()
2399 excludedKeys->Set(thread, i, excludedKey); in RuntimeOptCreateObjectWithExcludedKeys()
2402 return CommonCreateObjectWithExcludedKeys(thread, objVal, numExcludedKeys, excludedKeys); in RuntimeOptCreateObjectWithExcludedKeys()
2405 JSTaggedValue RuntimeStubs::RuntimeCreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, in RuntimeCreateObjectWithExcludedKeys() argument
2409 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateObjectWithExcludedKeys()
2412 FrameHandler frameHandler(thread); in RuntimeCreateObjectWithExcludedKeys()
2416 excludedKeys->Set(thread, 0, excludedKey); in RuntimeCreateObjectWithExcludedKeys()
2419 excludedKeys->Set(thread, i, excludedKey); in RuntimeCreateObjectWithExcludedKeys()
2425 JSHandle<JSProxy> proxyVal(thread, finalVal.GetTaggedValue()); in RuntimeCreateObjectWithExcludedKeys()
2426 finalVal = proxyVal->GetSourceTarget(thread); in RuntimeCreateObjectWithExcludedKeys()
2429 return CommonCreateObjectWithExcludedKeys(thread, finalVal, numExcludedKeys, excludedKeys); in RuntimeCreateObjectWithExcludedKeys()
2432 JSTaggedValue RuntimeStubs::RuntimeDefineMethod(JSThread *thread, const JSHandle<Method> &methodHan… in RuntimeDefineMethod() argument
2437 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeDefineMethod()
2440 func->SetLexicalEnv(thread, env); in RuntimeDefineMethod()
2441 func->SetModule(thread, module); in RuntimeDefineMethod()
2456 JSTaggedValue RuntimeStubs::RuntimeCallSpread(JSThread *thread, in RuntimeCallSpread() argument
2462 THROW_TYPE_ERROR_AND_RETURN(thread, "cannot Callspread", JSTaggedValue::Exception()); in RuntimeCallSpread()
2465 JSHandle<TaggedArray> coretypesArray(thread, RuntimeGetCallSpreadArgs(thread, array)); in RuntimeCallSpread()
2466 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCallSpread()
2468 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeCallSpread()
2469 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, func, obj, undefined, leng… in RuntimeCallSpread()
2470 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCallSpread()
2475 void RuntimeStubs::RuntimeSetPatchModule(JSThread *thread, const JSHandle<JSFunction> &func) in RuntimeSetPatchModule() argument
2477 JSHandle<Method> methodHandle(thread, Method::Cast(func->GetMethod())); in RuntimeSetPatchModule()
2479 thread->GetCurrentEcmaContext()->FindPatchModule(MethodLiteral::GetRecordName( in RuntimeSetPatchModule()
2482 func->SetModule(thread, coldReloadRecordName.GetTaggedValue()); in RuntimeSetPatchModule()
2486 JSTaggedValue RuntimeStubs::RuntimeDefineGetterSetterByValue(JSThread *thread, const JSHandle<JSObj… in RuntimeDefineGetterSetterByValue() argument
2493 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeDefineGetterSetterByValue()
2494 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefineGetterSetterByValue()
2495 auto globalConst = thread->GlobalConstants(); in RuntimeDefineGetterSetterByValue()
2499 thread, in RuntimeDefineGetterSetterByValue()
2509 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in RuntimeDefineGetterSetterByValue()
2511 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(getter), propKey, in RuntimeDefineGetterSetterByValue()
2512 … JSHandle<JSTaggedValue>(thread, globalConst->GetGetString())); in RuntimeDefineGetterSetterByValue()
2518 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in RuntimeDefineGetterSetterByValue()
2520 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(setter), propKey, in RuntimeDefineGetterSetterByValue()
2521 … JSHandle<JSTaggedValue>(thread, globalConst->GetSetString())); in RuntimeDefineGetterSetterByValue()
2528 PropertyDescriptor desc(thread, true, enumerable, true); in RuntimeDefineGetterSetterByValue()
2540 JSObject::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeDefineGetterSetterByValue()
2544 JSHandle<JSHClass> phcHandle(thread, holderTraHClass); in RuntimeDefineGetterSetterByValue()
2545 JSHClass::EnablePHCProtoChangeMarker(thread, phcHandle); in RuntimeDefineGetterSetterByValue()
2547 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) { in RuntimeDefineGetterSetterByValue()
2549 thread->GetEcmaVM()->GetPGOProfiler()->ProfileDefineGetterSetter( in RuntimeDefineGetterSetterByValue()
2557 JSTaggedValue RuntimeStubs::RuntimeSuperCall(JSThread *thread, const JSHandle<JSTaggedValue> &func, in RuntimeSuperCall() argument
2561 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeSuperCall()
2562 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2564 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeSuperCall()
2566 FrameHandler frameHandler(thread); in RuntimeSuperCall()
2568 argv->Set(thread, i, frameHandler.GetVRegValue(firstVRegIdx + i)); in RuntimeSuperCall()
2571 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeSuperCall()
2572 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newT… in RuntimeSuperCall()
2573 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2576 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2581 JSTaggedValue RuntimeStubs::RuntimeOptSuperCall(JSThread *thread, const JSHandle<JSTaggedValue> &fu… in RuntimeOptSuperCall() argument
2586 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeOptSuperCall()
2587 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2588 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptSuperCall()
2589 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newT… in RuntimeOptSuperCall()
2590 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2593 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2597 JSTaggedValue RuntimeStubs::RuntimeThrowTypeError(JSThread *thread, const char *message) in RuntimeThrowTypeError() argument
2599 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowTypeError()
2600 THROW_TYPE_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in RuntimeThrowTypeError()
2603 JSTaggedValue RuntimeStubs::RuntimeGetCallSpreadArgs(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeGetCallSpreadArgs() argument
2607 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetCallSpreadArgs()
2609 JSHandle<JSTaggedValue> itor = JSIterator::GetIterator(thread, jsArray); in RuntimeGetCallSpreadArgs()
2610 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2613 if (jsArray->IsStableJSArray(thread) && itor->IsJSArrayIterator()) { in RuntimeGetCallSpreadArgs()
2615 ElementAccessor::CopyJSArrayToTaggedArray(thread, jsArrayObj, argv, argvMayMaxLength); in RuntimeGetCallSpreadArgs()
2619 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2620 JSMutableHandle<JSTaggedValue> next(thread, JSTaggedValue::Undefined()); in RuntimeGetCallSpreadArgs()
2621 JSMutableHandle<JSTaggedValue> nextArg(thread, JSTaggedValue::Undefined()); in RuntimeGetCallSpreadArgs()
2624 next.Update(JSIterator::IteratorStep(thread, itor).GetTaggedValue()); in RuntimeGetCallSpreadArgs()
2625 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2629 nextArg.Update(JSIterator::IteratorValue(thread, next).GetTaggedValue()); in RuntimeGetCallSpreadArgs()
2630 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2633 argv = argv->SetCapacity(thread, argv, argvMayMaxLength); in RuntimeGetCallSpreadArgs()
2635 argv->Set(thread, argvIndex++, nextArg); in RuntimeGetCallSpreadArgs()
2641 JSTaggedValue RuntimeStubs::RuntimeThrowSyntaxError(JSThread *thread, const char *message) in RuntimeThrowSyntaxError() argument
2643 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowSyntaxError()
2644 THROW_SYNTAX_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in RuntimeThrowSyntaxError()
2647 JSTaggedValue RuntimeStubs::RuntimeLdBigInt(JSThread *thread, const JSHandle<JSTaggedValue> &number… in RuntimeLdBigInt() argument
2649 return JSTaggedValue::ToBigInt(thread, numberBigInt); in RuntimeLdBigInt()
2652 JSTaggedValue RuntimeStubs::RuntimeCallBigIntAsIntN(JSThread *thread, JSTaggedValue bits, JSTaggedV… in RuntimeCallBigIntAsIntN() argument
2654 auto biginteger = JSHandle<BigInt>(thread, bigint); in RuntimeCallBigIntAsIntN()
2655 JSTaggedNumber bitness = JSTaggedValue::ToNumber(thread, bits); in RuntimeCallBigIntAsIntN()
2656 return BigInt::AsintN(thread, bitness, biginteger); in RuntimeCallBigIntAsIntN()
2659 JSTaggedValue RuntimeStubs::RuntimeCallBigIntAsUintN(JSThread *thread, JSTaggedValue bits, JSTagged… in RuntimeCallBigIntAsUintN() argument
2661 auto biginteger = JSHandle<BigInt>(thread, bigint); in RuntimeCallBigIntAsUintN()
2662 JSTaggedNumber bitness = JSTaggedValue::ToNumber(thread, bits); in RuntimeCallBigIntAsUintN()
2663 return BigInt::AsUintN(thread, bitness, biginteger); in RuntimeCallBigIntAsUintN()
2666 JSTaggedValue RuntimeStubs::RuntimeNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16… in RuntimeNewLexicalEnvWithName() argument
2668 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewLexicalEnvWithName()
2671 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in RuntimeNewLexicalEnvWithName()
2672 newEnv->SetParentEnv(thread, currentLexenv); in RuntimeNewLexicalEnvWithName()
2673 JSTaggedValue scopeInfo = ScopeInfoExtractor::GenerateScopeInfo(thread, scopeId); in RuntimeNewLexicalEnvWithName()
2674 newEnv->SetScopeInfo(thread, scopeInfo); in RuntimeNewLexicalEnvWithName()
2675 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewLexicalEnvWithName()
2679 JSTaggedValue RuntimeStubs::RuntimeOptGetUnmapedArgs(JSThread *thread, uint32_t actualNumArgs) in RuntimeOptGetUnmapedArgs() argument
2681 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptGetUnmapedArgs()
2684 auto argv = GetActualArgvFromStub(thread); in RuntimeOptGetUnmapedArgs()
2690 argumentsList->Set(thread, idx++, args); in RuntimeOptGetUnmapedArgs()
2692 return RuntimeGetUnmapedJSArgumentObj(thread, argumentsList); in RuntimeOptGetUnmapedArgs()
2695 JSTaggedValue RuntimeStubs::RuntimeGetUnmapedJSArgumentObj(JSThread *thread, const JSHandle<TaggedA… in RuntimeGetUnmapedJSArgumentObj() argument
2697 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetUnmapedJSArgumentObj()
2698 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeGetUnmapedJSArgumentObj()
2707 …obj->SetPropertyInlinedProps(thread, JSArguments::LENGTH_INLINE_PROPERTY_INDEX, JSTaggedValue(len)… in RuntimeGetUnmapedJSArgumentObj()
2713 obj->SetElements(thread, argumentsList.GetTaggedValue()); in RuntimeGetUnmapedJSArgumentObj()
2717 obj->SetPropertyInlinedProps(thread, JSArguments::ITERATOR_INLINE_PROPERTY_INDEX, in RuntimeGetUnmapedJSArgumentObj()
2722 …obj->SetPropertyInlinedProps(thread, JSArguments::CALLER_INLINE_PROPERTY_INDEX, accessorCaller.Get… in RuntimeGetUnmapedJSArgumentObj()
2726 …obj->SetPropertyInlinedProps(thread, JSArguments::CALLEE_INLINE_PROPERTY_INDEX, accessorCallee.Get… in RuntimeGetUnmapedJSArgumentObj()
2727 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetUnmapedJSArgumentObj()
2732 JSTaggedValue RuntimeStubs::RuntimeOptNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uin… in RuntimeOptNewLexicalEnvWithName() argument
2736 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptNewLexicalEnvWithName()
2739 newEnv->SetParentEnv(thread, currentLexEnv.GetTaggedValue()); in RuntimeOptNewLexicalEnvWithName()
2740 JSTaggedValue scopeInfo = RuntimeOptGenerateScopeInfo(thread, scopeId, func.GetTaggedValue()); in RuntimeOptNewLexicalEnvWithName()
2741 newEnv->SetScopeInfo(thread, scopeInfo); in RuntimeOptNewLexicalEnvWithName()
2742 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptNewLexicalEnvWithName()
2747 JSTaggedValue RuntimeStubs::RuntimeOptCopyRestArgs(JSThread *thread, uint32_t actualArgc, uint32_t … in RuntimeOptCopyRestArgs() argument
2754 JSHandle<JSTaggedValue> restArray = JSArray::ArrayCreate(thread, JSTaggedNumber(actualRestNum)); in RuntimeOptCopyRestArgs()
2756 auto argv = GetActualArgv(thread); in RuntimeOptCopyRestArgs()
2758 JSMutableHandle<JSTaggedValue> element(thread, JSTaggedValue::Undefined()); in RuntimeOptCopyRestArgs()
2764 JSObject::SetProperty(thread, restArray, idx++, element, true); in RuntimeOptCopyRestArgs()
2766 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptCopyRestArgs()
2770 JSTaggedValue RuntimeStubs::RuntimeOptSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeOptSuspendGenerator() argument
2779 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2786 generatorObjectHandle->SetTaskInfo(thread->GetTaskInfo()); in RuntimeOptSuspendGenerator()
2790 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2793 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2797 return RuntimeThrowTypeError(thread, "RuntimeSuspendGenerator failed"); in RuntimeOptSuspendGenerator()
2800 JSTaggedValue RuntimeStubs::RuntimeOptAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValu… in RuntimeOptAsyncGeneratorResolve() argument
2803 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeOptAsyncGeneratorResolve()
2807 …JSHandle<GeneratorContext> genContextHandle(thread, asyncGeneratorObjHandle->GetGeneratorContext()… in RuntimeOptAsyncGeneratorResolve()
2810 …return JSAsyncGeneratorObject::AsyncGeneratorResolve(thread, asyncGeneratorObjHandle, valueHandle,… in RuntimeOptAsyncGeneratorResolve()
2813 JSTaggedValue RuntimeStubs::RuntimeOptConstruct(JSThread *thread, JSHandle<JSTaggedValue> ctor, in RuntimeOptConstruct() argument
2822 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstruct()
2826 …return RuntimeOptConstructGeneric(thread, JSHandle<JSFunction>::Cast(ctor), newTarget, preArgs, ar… in RuntimeOptConstruct()
2830 thread, JSHandle<JSBoundFunction>::Cast(ctor), newTarget, preArgs, args); in RuntimeOptConstruct()
2833 … return RuntimeOptConstructProxy(thread, JSHandle<JSProxy>::Cast(ctor), newTarget, preArgs, args); in RuntimeOptConstruct()
2835 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor NonConstructor", JSTaggedValue::Exception()); in RuntimeOptConstruct()
2838 JSTaggedValue RuntimeStubs::RuntimeOptConstructProxy(JSThread *thread, JSHandle<JSProxy> ctor, in RuntimeOptConstructProxy() argument
2843 JSHandle<JSTaggedValue> handler(thread, ctor->GetHandler()); in RuntimeOptConstructProxy()
2845 … THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor: handler is null", JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2848 JSHandle<JSTaggedValue> target(thread, ctor->GetTarget()); in RuntimeOptConstructProxy()
2851 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledProxyConstructString()); in RuntimeOptConstructProxy()
2852 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key); in RuntimeOptConstructProxy()
2855 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2861 return RuntimeOptConstruct(thread, target, newTgt, preArgs, args); in RuntimeOptConstructProxy()
2868 JSHandle<TaggedArray> arr = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(size); in RuntimeOptConstructProxy()
2873 arr->Set(thread, i, value); in RuntimeOptConstructProxy()
2879 arr->Set(thread, i + preArgsSize, value); in RuntimeOptConstructProxy()
2881 JSHandle<JSArray> newArr = JSArray::CreateArrayFromList(thread, arr); in RuntimeOptConstructProxy()
2885 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptConstructProxy()
2886 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, handler, undefined… in RuntimeOptConstructProxy()
2887 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2891 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2894 THROW_TYPE_ERROR_AND_RETURN(thread, "new object is not object", JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2900 JSTaggedValue RuntimeStubs::RuntimeOptConstructBoundFunction(JSThread *thread, JSHandle<JSBoundFunc… in RuntimeOptConstructBoundFunction() argument
2905 JSHandle<JSTaggedValue> target(thread, ctor->GetBoundTarget()); in RuntimeOptConstructBoundFunction()
2907 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstructBoundFunction()
2910 JSHandle<TaggedArray> boundArgs(thread, ctor->GetBoundArguments()); in RuntimeOptConstructBoundFunction()
2911 JSMutableHandle<JSTaggedValue> newPreArgs(thread, preArgs.GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2916 … TaggedArray::Append(thread, boundArgs, JSHandle<TaggedArray>::Cast(preArgs)).GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2918 JSMutableHandle<JSTaggedValue> newTargetMutable(thread, newTgt.GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2922 return RuntimeOptConstruct(thread, target, newTargetMutable, newPreArgs, args); in RuntimeOptConstructBoundFunction()
2925 JSTaggedValue RuntimeStubs::GetResultValue(JSThread *thread, bool isAotMethod, JSHandle<JSFunction>… in GetResultValue() argument
2932 const JSTaggedType *prevFp = thread->GetLastLeaveFrame(); in GetResultValue()
2941 resultValue = thread->GetEcmaVM()->FastCallAot(size, values.data(), prevFp); in GetResultValue()
2943 …resultValue = thread->GetCurrentEcmaContext()->ExecuteAot(size, values.data(), prevFp, needPushArg… in GetResultValue()
2947 … EcmaInterpreter::NewRuntimeCallInfo(thread, JSHandle<JSTaggedValue>(ctor), obj, newTgt, size); in GetResultValue()
2948 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetResultValue()
2955 JSTaggedValue RuntimeStubs::RuntimeOptConstructGeneric(JSThread *thread, JSHandle<JSFunction> ctor, in RuntimeOptConstructGeneric() argument
2960 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstructGeneric()
2963 JSHandle<JSTaggedValue> obj(thread, JSTaggedValue::Undefined()); in RuntimeOptConstructGeneric()
2965 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptConstructGeneric()
2967 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructGeneric()
3004 …JSTaggedValue resultValue = RuntimeStubs::GetResultValue(thread, isCompiledCode, ctor, values, new… in RuntimeOptConstructGeneric()
3005 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructGeneric()
3018 … THROW_TYPE_ERROR_AND_RETURN(thread, "function is non-constructor", JSTaggedValue::Exception()); in RuntimeOptConstructGeneric()
3023 JSTaggedValue RuntimeStubs::RuntimeOptNewObjRange(JSThread *thread, uintptr_t argv, uint32_t argc) in RuntimeOptNewObjRange() argument
3026 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptNewObjRange()
3030 JSHandle<TaggedArray> args = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(arrLength); in RuntimeOptNewObjRange()
3032 args->Set(thread, i, GetArg(argv, argc, i + firstArgOffset)); in RuntimeOptNewObjRange()
3034 JSTaggedValue object = RuntimeOptConstruct(thread, ctor, ctor, undefined, args); in RuntimeOptNewObjRange()
3035 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptNewObjRange()
3037 THROW_TYPE_ERROR_AND_RETURN(thread, "Derived constructor must return object or undefined", in RuntimeOptNewObjRange()
3043 JSTaggedValue RuntimeStubs::RuntimeOptGenerateScopeInfo(JSThread *thread, uint16_t scopeId, JSTagge… in RuntimeOptGenerateScopeInfo() argument
3045 EcmaVM *ecmaVm = thread->GetEcmaVM(); in RuntimeOptGenerateScopeInfo()
3049 JSHandle<ConstantPool> constpool(thread, method->GetConstantPool()); in RuntimeOptGenerateScopeInfo()
3052 LiteralDataExtractor::GetDatasIgnoreType(thread, jsPandaFile, id, constpool); in RuntimeOptGenerateScopeInfo()
3075 JSTaggedType *RuntimeStubs::GetActualArgv(JSThread *thread) in GetActualArgv() argument
3077 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetActualArgv()
3078 FrameIterator it(current, thread); in GetActualArgv()
3091 JSTaggedType *RuntimeStubs::GetActualArgvFromStub(JSThread *thread) in GetActualArgvFromStub() argument
3093 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetActualArgvFromStub()
3094 FrameIterator it(current, thread); in GetActualArgvFromStub()
3108 OptimizedJSFunctionFrame *RuntimeStubs::GetOptimizedJSFunctionFrame(JSThread *thread) in GetOptimizedJSFunctionFrame() argument
3110 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetOptimizedJSFunctionFrame()
3111 FrameIterator it(current, thread); in GetOptimizedJSFunctionFrame()
3118 OptimizedJSFunctionFrame *RuntimeStubs::GetOptimizedJSFunctionFrameNoGC(JSThread *thread) in GetOptimizedJSFunctionFrameNoGC() argument
3120 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetOptimizedJSFunctionFrameNoGC()
3121 FrameIterator it(current, thread); in GetOptimizedJSFunctionFrameNoGC()
3128 JSTaggedValue RuntimeStubs::RuntimeLdPatchVar(JSThread *thread, uint32_t index) in RuntimeLdPatchVar() argument
3131 JSHandle<TaggedArray>::Cast(thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalPatch()); in RuntimeLdPatchVar()
3133 return globalPatch->Get(thread, index); in RuntimeLdPatchVar()
3136 JSTaggedValue RuntimeStubs::RuntimeStPatchVar(JSThread *thread, uint32_t index, const JSHandle<JSTa… in RuntimeStPatchVar() argument
3138 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeStPatchVar()
3142 globalPatch = TaggedArray::SetCapacity(thread, globalPatch, index + 1); in RuntimeStPatchVar()
3144 globalPatch->Set(thread, index, value); in RuntimeStPatchVar()
3145 env->SetGlobalPatch(thread, globalPatch.GetTaggedValue()); in RuntimeStPatchVar()
3149 JSTaggedValue RuntimeStubs::RuntimeNotifyConcurrentResult(JSThread *thread, JSTaggedValue result, J… in RuntimeNotifyConcurrentResult() argument
3151 thread->GetEcmaVM()->TriggerConcurrentCallback(result, hint); in RuntimeNotifyConcurrentResult()
3155 JSTaggedValue RuntimeStubs::RuntimeUpdateAOTHClass(JSThread *thread, in RuntimeUpdateAOTHClass() argument
3159 if (JSHClass::IsNeedNotifyHclassChangedForAotTransition(thread, oldhclass, key)) { in RuntimeUpdateAOTHClass()
3160 JSHClass::NotifyHclassChanged(thread, oldhclass, newhclass, key); in RuntimeUpdateAOTHClass()
3162 JSHClass::RefreshUsers(thread, oldhclass, newhclass); in RuntimeUpdateAOTHClass()
3164 JSHClass::EnablePHCProtoChangeMarker(thread, newhclass); in RuntimeUpdateAOTHClass()
3169 JSTaggedValue RuntimeStubs::RuntimeDefineField(JSThread *thread, JSTaggedValue obj, in RuntimeDefineField() argument
3175 … THROW_TYPE_ERROR_AND_RETURN(thread, "DefineField: obj is not Object", JSTaggedValue::Exception()); in RuntimeDefineField()
3177 JSHandle<JSObject> handleObj(thread, obj); in RuntimeDefineField()
3178 JSHandle<JSTaggedValue> handleValue(thread, value); in RuntimeDefineField()
3179 …<JSTaggedValue> handleKey = JSTaggedValue::ToPropertyKey(thread, JSHandle<JSTaggedValue>(thread, p… in RuntimeDefineField()
3180 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefineField()
3182 … JSObject::CreateDataPropertyOrThrow(thread, handleObj, handleKey, handleValue, SCheckMode::CHECK); in RuntimeDefineField()
3183 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefineField()
3188 JSTaggedValue RuntimeStubs::RuntimeCreatePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeCreatePrivateProperty() argument
3191 ObjectFactory* factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreatePrivateProperty()
3192 JSHandle<LexicalEnv> handleLexicalEnv(thread, lexicalEnv); in RuntimeCreatePrivateProperty()
3193 JSHandle<ConstantPool> handleConstpool(thread, constpool); in RuntimeCreatePrivateProperty()
3194 JSHandle<JSTaggedValue> handleModule(thread, module); in RuntimeCreatePrivateProperty()
3196 thread, thread->GetCurrentEcmaContext()->FindOrCreateUnsharedConstpool(constpool)); in RuntimeCreatePrivateProperty()
3205 JSHandle<TaggedArray> aotSymbolInfoHandle(thread, aotSymbolInfo); in RuntimeCreatePrivateProperty()
3206 FrameHandler frameHandler(thread); in RuntimeCreatePrivateProperty()
3215 symbolHandle = JSHandle<JSSymbol>(thread, symbol); in RuntimeCreatePrivateProperty()
3221 handleLexicalEnv->SetProperties(thread, index, symbolHandle.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3225 ConstantPool::GetClassLiteralFromCache(thread, unsharedConstpoolHandle, literalId, entry); in RuntimeCreatePrivateProperty()
3226 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreatePrivateProperty()
3227 JSHandle<TaggedArray> literalBuffer(thread, classLiteral->GetArray()); in RuntimeCreatePrivateProperty()
3236 JSMutableHandle<JSTaggedValue> literalValue(thread, JSTaggedValue::Undefined()); in RuntimeCreatePrivateProperty()
3242 func->SetLexicalEnv(thread, handleLexicalEnv.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3243 func->SetModule(thread, handleModule.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3246 … handleLexicalEnv->SetProperties(thread, startIndex + count + i, literalValue.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3254 symbolHandle = JSHandle<JSSymbol>(thread, symbol); in RuntimeCreatePrivateProperty()
3260 handleLexicalEnv->SetProperties(thread, index, symbolHandle.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3265 JSTaggedValue RuntimeStubs::RuntimeDefinePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeDefinePrivateProperty() argument
3275 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeDefinePrivateProperty()
3276 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeDefinePrivateProperty()
3277 JSHandle<JSTaggedValue> handleValue(thread, value); in RuntimeDefinePrivateProperty()
3278 PropertyDescriptor desc(thread); in RuntimeDefinePrivateProperty()
3280 JSTaggedValue::GetOwnProperty(thread, handleObj, handleKey, desc)) { in RuntimeDefinePrivateProperty()
3281 …THROW_TYPE_ERROR_AND_RETURN(thread, "invalid private key or already exists", JSTaggedValue::Except… in RuntimeDefinePrivateProperty()
3283 bool extensible = handleObj->IsExtensible(thread); in RuntimeDefinePrivateProperty()
3285 …THROW_TYPE_ERROR_AND_RETURN(thread, "DefinePrivateProperty obj is undefined", JSTaggedValue::Excep… in RuntimeDefinePrivateProperty()
3288 THROW_TYPE_ERROR_AND_RETURN(thread, "shared obj cannot use # to define private property", in RuntimeDefinePrivateProperty()
3295 bool result = JSObject::CreateDataPropertyOrThrow(thread, JSHandle<JSObject>::Cast(handleObj), in RuntimeDefinePrivateProperty()
3297 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefinePrivateProperty()
3301 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefinePrivateProperty()
3305 JSTaggedValue RuntimeStubs::RuntimeNotifyDebuggerStatement(JSThread *thread) in RuntimeNotifyDebuggerStatement() argument
3307 FrameHandler frameHandler(thread); in RuntimeNotifyDebuggerStatement()
3317 auto *debuggerMgr = thread->GetEcmaVM()->GetJsDebuggerManager(); in RuntimeNotifyDebuggerStatement()
3318 debuggerMgr->GetNotificationManager()->DebuggerStmtEvent(thread, method, bcOffset); in RuntimeNotifyDebuggerStatement()
3335 JSHandle<JSTaggedValue> RuntimeStubs::GetOrCreateNumberString(JSThread *thread, JSHandle<JSTaggedVa… in GetOrCreateNumberString() argument
3338 JSMutableHandle<JSTaggedValue> presentString(thread, JSTaggedValue::Undefined()); in GetOrCreateNumberString()
3343 presentString.Update(JSTaggedValue::ToString(thread, presentValue).GetTaggedValue()); in GetOrCreateNumberString()
3349 JSTaggedValue RuntimeStubs::TryCopyCOWArray(JSThread *thread, JSHandle<JSArray> holderHandler, bool… in TryCopyCOWArray() argument
3352 JSArray::CheckAndCopyArray(thread, holderHandler); in TryCopyCOWArray()
3358 JSTaggedValue RuntimeStubs::ArrayNumberSort(JSThread *thread, JSHandle<JSObject> thisObj, uint32_t … in ArrayNumberSort() argument
3360 JSMutableHandle<JSTaggedValue> presentValue(thread, JSTaggedValue::Undefined()); in ArrayNumberSort()
3361 JSMutableHandle<JSTaggedValue> middleValue(thread, JSTaggedValue::Undefined()); in ArrayNumberSort()
3362 JSMutableHandle<JSTaggedValue> previousValue(thread, JSTaggedValue::Undefined()); in ArrayNumberSort()
3364 JSMutableHandle<TaggedArray> elements(thread, thisObj->GetElements()); in ArrayNumberSort()
3370 …JSHandle<JSTaggedValue> presentString = GetOrCreateNumberString(thread, presentValue, cachedString… in ArrayNumberSort()
3374 … JSHandle<JSTaggedValue> middleString = GetOrCreateNumberString(thread, middleValue, cachedString); in ArrayNumberSort()
3375 … double compareResult = ArrayHelper::StringSortCompare(thread, middleString, presentString); in ArrayNumberSort()
3376 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception()); in ArrayNumberSort()
3386 elements.Update(TryCopyCOWArray(thread, JSHandle<JSArray>(thisObj), isCOWArray)); in ArrayNumberSort()
3387 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception()); in ArrayNumberSort()
3388 elements->Set(thread, j, previousValue); in ArrayNumberSort()
3390 elements.Update(TryCopyCOWArray(thread, JSHandle<JSArray>(thisObj), isCOWArray)); in ArrayNumberSort()
3391 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception()); in ArrayNumberSort()
3392 elements->Set(thread, endIndex, presentValue); in ArrayNumberSort()
3400 auto thread = JSThread::GlueToJSThread(argGlue); in RuntimeTryGetInternString() local
3402 thread->GetEcmaVM()->GetEcmaStringTable()->TryGetInternString(thread, string); in RuntimeTryGetInternString()