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::RuntimeSuperCallForwardAllArgs(JSThread *thread, JSTaggedType *sp, in RuntimeSuperCallForwardAllArgs() argument
303 …THROW_TYPE_ERROR_AND_RETURN(thread, "Super constructor is not a constructor", JSTaggedValue::Excep… in RuntimeSuperCallForwardAllArgs()
307 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeSuperCallForwardAllArgs()
309 EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newTarget, restNumArgs); in RuntimeSuperCallForwardAllArgs()
310 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallForwardAllArgs()
318 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallForwardAllArgs()
322 JSTaggedValue RuntimeStubs::RuntimeDelObjProp(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeDelObjProp() argument
325 JSHandle<JSTaggedValue> jsObj(JSTaggedValue::ToObject(thread, obj)); in RuntimeDelObjProp()
326 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
327 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeDelObjProp()
328 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
329 bool ret = JSTaggedValue::DeletePropertyOrThrow(thread, jsObj, propKey); in RuntimeDelObjProp()
330 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
334 JSTaggedValue RuntimeStubs::RuntimeNewObjApply(JSThread *thread, const JSHandle<JSTaggedValue> &fun… in RuntimeNewObjApply() argument
337 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewObjApply()
339 return RuntimeThrowTypeError(thread, "Cannot Newobjspread"); in RuntimeNewObjApply()
345 auto prop = JSTaggedValue::GetProperty(thread, array, i).GetValue(); in RuntimeNewObjApply()
346 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
347 argsArray->Set(thread, i, prop); in RuntimeNewObjApply()
348 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
350 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeNewObjApply()
351 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, func, undefined, func, len… in RuntimeNewObjApply()
352 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
357 JSTaggedValue RuntimeStubs::RuntimeCreateIterResultObj(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeCreateIterResultObj() argument
362 JSHandle<JSObject> iter = JSIterator::CreateIterResultObject(thread, value, done); in RuntimeCreateIterResultObj()
363 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateIterResultObj()
367 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionAwaitUncaught(JSThread *thread, in RuntimeAsyncFunctionAwaitUncaught() argument
371 JSAsyncFunction::AsyncFunctionAwait(thread, asyncFuncObj, value); in RuntimeAsyncFunctionAwaitUncaught()
372 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
374 JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj); in RuntimeAsyncFunctionAwaitUncaught()
375 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
377 JSHandle<TaggedQueue> queue(thread, generator->GetAsyncGeneratorQueue()); in RuntimeAsyncFunctionAwaitUncaught()
381 JSHandle<AsyncGeneratorRequest> next(thread, queue->Front()); in RuntimeAsyncFunctionAwaitUncaught()
382 JSHandle<PromiseCapability> completion(thread, next->GetCapability()); in RuntimeAsyncFunctionAwaitUncaught()
383 JSHandle<JSPromise> promise(thread, completion->GetPromise()); in RuntimeAsyncFunctionAwaitUncaught()
387 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in RuntimeAsyncFunctionAwaitUncaught()
389 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
393 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionResolveOrReject(JSThread *thread, in RuntimeAsyncFunctionResolveOrReject() argument
397 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in RuntimeAsyncFunctionResolveOrReject()
399 if (thread->GetEcmaVM()->GetJSOptions().EnablePendingCheak()) { in RuntimeAsyncFunctionResolveOrReject()
400 thread->GetEcmaVM()->RemoveAsyncStackTrace(promise); in RuntimeAsyncFunctionResolveOrReject()
403 …JSHandle<ResolvingFunctionsRecord> reactions = JSPromise::CreateResolvingFunctions(thread, promise… in RuntimeAsyncFunctionResolveOrReject()
404 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeAsyncFunctionResolveOrReject()
408 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetResolveFunction()); in RuntimeAsyncFunctionResolveOrReject()
410 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetRejectFunction()); in RuntimeAsyncFunctionResolveOrReject()
412 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeAsyncFunctionResolveOrReject()
413 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, activeFunc, thisArg, undef… in RuntimeAsyncFunctionResolveOrReject()
414 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionResolveOrReject()
418 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionResolveOrReject()
422 JSTaggedValue RuntimeStubs::RuntimeAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValue> … in RuntimeAsyncGeneratorResolve() argument
425 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeAsyncGeneratorResolve()
429 …JSHandle<GeneratorContext> genContextHandle(thread, asyncGeneratorObjHandle->GetGeneratorContext()… in RuntimeAsyncGeneratorResolve()
431 SaveFrameToContext(thread, genContextHandle); in RuntimeAsyncGeneratorResolve()
436 …return JSAsyncGeneratorObject::AsyncGeneratorResolve(thread, asyncGeneratorObjHandle, valueHandle,… in RuntimeAsyncGeneratorResolve()
439 JSTaggedValue RuntimeStubs::RuntimeAsyncGeneratorReject(JSThread *thread, JSHandle<JSTaggedValue> a… in RuntimeAsyncGeneratorReject() argument
442 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeAsyncGeneratorReject()
447 … return JSAsyncGeneratorObject::AsyncGeneratorReject(thread, asyncGeneratorObjHandle, valueHandle); in RuntimeAsyncGeneratorReject()
450 JSTaggedValue RuntimeStubs::RuntimeCopyDataProperties(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeCopyDataProperties() argument
455 JSHandle<JSTaggedValue> from(JSTaggedValue::ToObject(thread, src)); in RuntimeCopyDataProperties()
456 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
457 JSHandle<TaggedArray> keys = JSTaggedValue::GetOwnPropertyKeys(thread, from); in RuntimeCopyDataProperties()
458 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
460 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in RuntimeCopyDataProperties()
463 PropertyDescriptor desc(thread); in RuntimeCopyDataProperties()
465 bool success = JSTaggedValue::GetOwnProperty(thread, from, key, desc); in RuntimeCopyDataProperties()
466 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
471 JSTaggedValue::DefineOwnProperty(thread, dst, key, desc); in RuntimeCopyDataProperties()
472 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
479 JSTaggedValue RuntimeStubs::RuntimeStArraySpread(JSThread *thread, const JSHandle<JSTaggedValue> &d… in RuntimeStArraySpread() argument
482 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeStArraySpread()
483 JSHandle<JSTaggedValue> undefinedHandle(thread, JSTaggedValue::Undefined()); in RuntimeStArraySpread()
487 THROW_TYPE_ERROR_AND_RETURN(thread, "src is not iterable", JSTaggedValue::Exception()); in RuntimeStArraySpread()
490 THROW_TYPE_ERROR_AND_RETURN(thread, "dst is not iterable", JSTaggedValue::Exception()); in RuntimeStArraySpread()
493 JSHandle<EcmaString> srcString = JSTaggedValue::ToString(thread, src); in RuntimeStArraySpread()
494 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
495 JSHandle<EcmaString> srcFlat = JSHandle<EcmaString>(thread, in RuntimeStArraySpread()
496 EcmaStringAccessor::Flatten(thread->GetEcmaVM(), srcString)); in RuntimeStArraySpread()
502 JSTaggedValue::SetProperty(thread, dst, dstLen + i, strValue, true); in RuntimeStArraySpread()
503 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
505 JSHandle<JSTaggedValue> length(thread, JSTaggedValue(dstLen + strLen)); in RuntimeStArraySpread()
507 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in RuntimeStArraySpread()
508 JSTaggedValue::SetProperty(thread, dst, lengthKey, length); in RuntimeStArraySpread()
513 if (index.GetInt() == 0 && src->IsStableJSArray(thread)) { in RuntimeStArraySpread()
514 JSHandle<TaggedArray> srcElements(thread, JSHandle<JSObject>::Cast(src)->GetElements()); in RuntimeStArraySpread()
518 dstArray->SetElements(thread, dstElements); in RuntimeStArraySpread()
519 dstArray->SetArrayLength(thread, length); in RuntimeStArraySpread()
522 ElementAccessor::CopyJSArrayObject(thread, srcObj, dstObj, length); in RuntimeStArraySpread()
524 JSHandle<JSTaggedValue> reg(thread, ElementAccessor::Get(thread, srcObj, i)); in RuntimeStArraySpread()
526 …JSHandle<JSTaggedValue> reg2(thread, JSArray::FastGetPropertyByValue(thread, src, i).GetTaggedValu… in RuntimeStArraySpread()
527 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
529 ElementAccessor::Set(thread, dstObj, i, undefinedHandle, true); in RuntimeStArraySpread()
531 ElementAccessor::Set(thread, dstObj, i, reg2, true); in RuntimeStArraySpread()
534 ElementAccessor::Set(thread, dstObj, i, reg, true); in RuntimeStArraySpread()
541 auto globalConst = thread->GlobalConstants(); in RuntimeStArraySpread()
547 JSHandle<JSTaggedValue> valuesMethod = JSObject::GetMethod(thread, src, valuesStr); in RuntimeStArraySpread()
548 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
549 iter = JSIterator::GetIterator(thread, src, valuesMethod); in RuntimeStArraySpread()
550 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
552 iter = JSIterator::GetIterator(thread, src); in RuntimeStArraySpread()
553 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
556 JSMutableHandle<JSTaggedValue> indexHandle(thread, index); in RuntimeStArraySpread()
558 PropertyDescriptor desc(thread); in RuntimeStArraySpread()
562 iterResult = JSIterator::IteratorStep(thread, iter); in RuntimeStArraySpread()
563 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
567 bool success = JSTaggedValue::GetOwnProperty(thread, iterResult, valueStr, desc); in RuntimeStArraySpread()
568 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
570 JSTaggedValue::DefineOwnProperty(thread, dst, indexHandle, desc); in RuntimeStArraySpread()
571 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
578 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in RuntimeStArraySpread()
579 JSTaggedValue::SetProperty(thread, dst, lengthKey, indexHandle); in RuntimeStArraySpread()
584 JSTaggedValue RuntimeStubs::RuntimeGetIteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetIteratorNext() argument
588 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeGetIteratorNext()
589 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in RuntimeGetIteratorNext()
591 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIteratorNext()
593 return RuntimeThrowTypeError(thread, "the Iterator is not an ecmaobject."); in RuntimeGetIteratorNext()
598 JSTaggedValue RuntimeStubs::RuntimeSetObjectWithProto(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeSetObjectWithProto() argument
605 …THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(SetProtoWithSendable), JSTaggedValue::Excep… in RuntimeSetObjectWithProto()
607 JSObject::SetPrototype(thread, obj, proto, true); in RuntimeSetObjectWithProto()
608 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSetObjectWithProto()
612 JSTaggedValue RuntimeStubs::RuntimeLdObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeLdObjByValue() argument
620 … JSTaggedValue::RequireObjectCoercible(thread, obj, "Cannot load property of null or undefined"); in RuntimeLdObjByValue()
621 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
625 res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), object); in RuntimeLdObjByValue()
626 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
628 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeLdObjByValue()
629 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
630 res = JSTaggedValue::GetProperty(thread, object, propKey).GetValue().GetTaggedValue(); in RuntimeLdObjByValue()
632 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
636 JSTaggedValue RuntimeStubs::RuntimeStObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStObjByValue() argument
644 … JSTaggedValue::RequireObjectCoercible(thread, obj, "Cannot store property of null or undefined"); in RuntimeStObjByValue()
645 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
647 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, prop)); in RuntimeStObjByValue()
648 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
650 JSTaggedValue::SetProperty(thread, object, propKey, value, true); in RuntimeStObjByValue()
651 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
655 JSTaggedValue RuntimeStubs::RuntimeStOwnByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStOwnByValue() argument
659 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeStOwnByValue()
663 …return RuntimeThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeEr… in RuntimeStOwnByValue()
669 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByValue()
670 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key); in RuntimeStOwnByValue()
671 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValue()
672 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeStOwnByValue()
673 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValue()
675 return RuntimeThrowTypeError(thread, "StOwnByValue failed"); in RuntimeStOwnByValue()
680 JSTaggedValue RuntimeStubs::RuntimeLdSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeLdSuperByValue() argument
685 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in RuntimeLdSuperByValue()
686 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in RuntimeLdSuperByValue()
687 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
688 JSTaggedValue::RequireObjectCoercible(thread, superBase); in RuntimeLdSuperByValue()
689 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
690 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, key)); in RuntimeLdSuperByValue()
691 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
693 …JSTaggedValue res = JSTaggedValue::GetProperty(thread, superBase, propKey, obj).GetValue().GetTagg… in RuntimeLdSuperByValue()
694 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
698 JSTaggedValue RuntimeStubs::RuntimeStSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeStSuperByValue() argument
704 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in RuntimeStSuperByValue()
705 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in RuntimeStSuperByValue()
706 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
707 JSTaggedValue::RequireObjectCoercible(thread, superBase); in RuntimeStSuperByValue()
708 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
709 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, key)); in RuntimeStSuperByValue()
710 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
713 JSTaggedValue::SetProperty(thread, superBase, propKey, value, obj, true); in RuntimeStSuperByValue()
714 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
718 JSTaggedValue RuntimeStubs::RuntimeLdObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeLdObjByIndex() argument
723 res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), obj); in RuntimeLdObjByIndex()
725 res = JSTaggedValue::GetProperty(thread, obj, idx).GetValue().GetTaggedValue(); in RuntimeLdObjByIndex()
727 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByIndex()
731 JSTaggedValue RuntimeStubs::RuntimeLdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue p… in RuntimeLdObjByName() argument
734 JSHandle<JSTaggedValue> objHandle(thread, obj); in RuntimeLdObjByName()
737 … res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), objHandle); in RuntimeLdObjByName()
739 JSHandle<JSTaggedValue> propHandle(thread, prop); in RuntimeLdObjByName()
740 res = JSTaggedValue::GetProperty(thread, objHandle, propHandle).GetValue().GetTaggedValue(); in RuntimeLdObjByName()
742 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByName()
746 JSTaggedValue RuntimeStubs::RuntimeStObjByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeStObjByName() argument
750 JSTaggedValue::SetProperty(thread, obj, prop, value, true); in RuntimeStObjByName()
751 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByName()
755 JSTaggedValue RuntimeStubs::RuntimeStObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStObjByIndex() argument
758 JSTaggedValue::SetProperty(thread, obj, idx, value, true); in RuntimeStObjByIndex()
759 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByIndex()
763 JSTaggedValue RuntimeStubs::RuntimeStOwnByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStOwnByIndex() argument
770 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByIndex()
771 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, idx, desc); in RuntimeStOwnByIndex()
772 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByIndex()
774 return RuntimeThrowTypeError(thread, "SetOwnByIndex failed"); in RuntimeStOwnByIndex()
779 JSTaggedValue RuntimeStubs::RuntimeStGlobalRecord(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeStGlobalRecord() argument
782 ObjectFactory* factory = thread->GetEcmaVM()->GetFactory(); in RuntimeStGlobalRecord()
783 if (thread->GetEcmaVM()->GetJSOptions().IsEnableLoweringBuiltin()) { in RuntimeStGlobalRecord()
787 … auto box = factory->NewPropertyBox(JSHandle<JSTaggedValue>(thread, JSTaggedValue::Hole())); in RuntimeStGlobalRecord()
788 thread->GetBuiltinEntriesPointer()->ClearByIndex(index, box.GetTaggedValue()); in RuntimeStGlobalRecord()
792 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeStGlobalRecord()
799 return RuntimeThrowSyntaxError(thread, "Duplicate identifier"); in RuntimeStGlobalRecord()
806 JSHandle<GlobalDictionary> dictHandle(thread, dict); in RuntimeStGlobalRecord()
811 …dict = *GlobalDictionary::PutIfAbsent(thread, dictHandle, prop, JSHandle<JSTaggedValue>(box), attr… in RuntimeStGlobalRecord()
812 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStGlobalRecord()
813 env->SetGlobalRecord(thread, JSTaggedValue(dict)); in RuntimeStGlobalRecord()
817 JSTaggedValue RuntimeStubs::RuntimeNeg(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeNeg() argument
819 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeNeg()
820 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNeg()
823 return BigInt::UnaryMinus(thread, bigValue).GetTaggedValue(); in RuntimeNeg()
843 JSTaggedValue RuntimeStubs::RuntimeNot(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeNot() argument
845 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeNot()
846 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNot()
849 return BigInt::BitwiseNOT(thread, bigValue).GetTaggedValue(); in RuntimeNot()
851 int32_t number = JSTaggedValue::ToInt32(thread, inputVal); in RuntimeNot()
855 JSTaggedValue RuntimeStubs::RuntimeResolveClass(JSThread *thread, const JSHandle<JSFunction> &ctor, in RuntimeResolveClass() argument
862 FrameHandler frameHandler(thread); in RuntimeResolveClass()
864 …JSHandle<JSTaggedValue> ecmaModule(thread, JSFunction::Cast(currentFunc.GetTaggedObject())->GetMod… in RuntimeResolveClass()
866 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(ctor), base); in RuntimeResolveClass()
867 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeResolveClass()
877 func->SetLexicalEnv(thread, lexenv.GetTaggedValue()); in RuntimeResolveClass()
878 func->SetModule(thread, ecmaModule); in RuntimeResolveClass()
885 JSTaggedValue RuntimeStubs::RuntimeCloneClassFromTemplate(JSThread *thread, const JSHandle<JSFuncti… in RuntimeCloneClassFromTemplate() argument
889 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCloneClassFromTemplate()
890 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeCloneClassFromTemplate()
893 JSHandle<JSObject> clsPrototype(thread, ctor->GetFunctionPrototype()); in RuntimeCloneClassFromTemplate()
897 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
900 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
903 …JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, cloneClass, cloneClassPrototype.GetTagged… in RuntimeCloneClassFromTemplate()
904 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
906 PropertyDescriptor ctorDesc(thread, JSHandle<JSTaggedValue>(cloneClass), true, false, true); in RuntimeCloneClassFromTemplate()
907 JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(cloneClassPrototype), in RuntimeCloneClassFromTemplate()
909 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
911 cloneClass->SetHomeObject(thread, cloneClassPrototype); in RuntimeCloneClassFromTemplate()
914 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cloneClass), base); in RuntimeCloneClassFromTemplate()
915 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
930 JSTaggedValue RuntimeStubs::RuntimeCreateClassWithBuffer(JSThread *thread, in RuntimeCreateClassWithBuffer() argument
939 …THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(NotSendableSubClass), JSTaggedValue::Except… in RuntimeCreateClassWithBuffer()
941 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeCreateClassWithBuffer()
942 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateClassWithBuffer()
946 auto methodObj = ConstantPool::GetMethodFromCache(thread, constpool.GetTaggedValue(), methodId); in RuntimeCreateClassWithBuffer()
947 JSHandle<JSTaggedValue> method(thread, methodObj); in RuntimeCreateClassWithBuffer()
950 JSMutableHandle<JSTaggedValue> ihc(thread, JSTaggedValue::Undefined()); in RuntimeCreateClassWithBuffer()
951 JSMutableHandle<JSTaggedValue> chc(thread, JSTaggedValue::Undefined()); in RuntimeCreateClassWithBuffer()
953 JSHandle<ConstantPool> cp(thread, in RuntimeCreateClassWithBuffer()
954 … thread->GetCurrentEcmaContext()->FindOrCreateUnsharedConstpool(constpoolHandle.GetTaggedValue())); in RuntimeCreateClassWithBuffer()
957 JSHandle<AOTLiteralInfo> aotLiteralInfo(thread, val); in RuntimeCreateClassWithBuffer()
962 JSTaggedValue literalObj = ConstantPool::GetClassLiteralFromCache(thread, cp, literalId, entry); in RuntimeCreateClassWithBuffer()
964 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreateClassWithBuffer()
965 JSHandle<TaggedArray> arrayHandle(thread, classLiteral->GetArray()); in RuntimeCreateClassWithBuffer()
968 …ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, arrayHandle, literalLeng… in RuntimeCreateClassWithBuffer()
972 cls = ClassHelper::DefineClassWithIHClass(thread, base, extractor, lexenv, ihc, chc); in RuntimeCreateClassWithBuffer()
974 cls = ClassHelper::DefineClassFromExtractor(thread, base, extractor, lexenv); in RuntimeCreateClassWithBuffer()
977 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
978 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base); in RuntimeCreateClassWithBuffer()
979 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
981 cls->SetLexicalEnv(thread, lexenv.GetTaggedValue()); in RuntimeCreateClassWithBuffer()
982 cls->SetModule(thread, module.GetTaggedValue()); in RuntimeCreateClassWithBuffer()
983 RuntimeSetClassConstructorLength(thread, cls.GetTaggedValue(), length.GetTaggedValue()); in RuntimeCreateClassWithBuffer()
984 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
989 void RuntimeStubs::SetProfileTypeInfoCellToFunction(JSThread *thread, const JSHandle<JSFunction> &j… in SetProfileTypeInfoCellToFunction() argument
1003 JSHandle<Method> method(thread, jsFunc->GetMethod()); in SetProfileTypeInfoCellToFunction()
1005 profileTypeInfo = RuntimeNotifyInlineCache(thread, jsFunc, slotSize); in SetProfileTypeInfoCellToFunction()
1010 JSHandle<ProfileTypeInfo> profileTypeArray(thread, profileTypeInfo); in SetProfileTypeInfoCellToFunction()
1013 JSHandle<JSTaggedValue> handleUndefined(thread, JSTaggedValue::Undefined()); in SetProfileTypeInfoCellToFunction()
1015 thread->GetEcmaVM()->GetFactory()->NewProfileTypeInfoCell(handleUndefined); in SetProfileTypeInfoCellToFunction()
1016 profileTypeArray->Set(thread, slotId, newProfileTypeInfoCell); in SetProfileTypeInfoCellToFunction()
1017 definedFunc->SetRawProfileTypeInfo(thread, newProfileTypeInfoCell); in SetProfileTypeInfoCellToFunction()
1020 cellPtr->UpdateProfileTypeInfoCellType(thread); in SetProfileTypeInfoCellToFunction()
1021 definedFunc->SetRawProfileTypeInfo(thread, slotValue); in SetProfileTypeInfoCellToFunction()
1025 JSTaggedValue RuntimeStubs::RuntimeCreateSharedClass(JSThread *thread, in RuntimeCreateSharedClass() argument
1032 …THROW_TYPE_ERROR_AND_RETURN(thread, GET_MESSAGE_STRING(ClassNotDerivedFromShared), JSTaggedValue::… in RuntimeCreateSharedClass()
1034 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeCreateSharedClass()
1035 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateSharedClass()
1038 auto methodObj = ConstantPool::GetMethodFromCache(thread, constpool.GetTaggedValue(), methodId); in RuntimeCreateSharedClass()
1039 JSHandle<JSTaggedValue> method(thread, methodObj); in RuntimeCreateSharedClass()
1043 JSHandle<JSTaggedValue> sendableEnv(thread, JSTaggedValue::Undefined()); in RuntimeCreateSharedClass()
1046 sendableEnv = JSHandle<JSTaggedValue>(thread, moduleRecord->GetSendableEnv()); in RuntimeCreateSharedClass()
1049 thread, constpoolHandle, literalId, entry, sendableEnv, ClassKind::SENDABLE); in RuntimeCreateSharedClass()
1050 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreateSharedClass()
1051 JSHandle<TaggedArray> arrayHandle(thread, classLiteral->GetArray()); in RuntimeCreateSharedClass()
1058 ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, arrayHandle, in RuntimeCreateSharedClass()
1061 …JSHandle<TaggedArray> fieldTypeArray = ConstantPool::GetFieldLiteral(thread, constpoolHandle, fiel… in RuntimeCreateSharedClass()
1062 …rray> staticFieldArray = SendableClassDefiner::ExtractStaticFieldTypeArray(thread, fieldTypeArray); in RuntimeCreateSharedClass()
1064 SendableClassDefiner::DefineSendableClassFromExtractor(thread, extractor, staticFieldArray); in RuntimeCreateSharedClass()
1065 ModuleManager *moduleManager = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeCreateSharedClass()
1069 sendableClsModuleRecord->SetSendableEnv(thread, sendableEnv); in RuntimeCreateSharedClass()
1071 cls->SetModule(thread, sendableClsModule.GetTaggedValue()); in RuntimeCreateSharedClass()
1072 RuntimeSetClassConstructorLength(thread, cls.GetTaggedValue(), JSTaggedValue(length)); in RuntimeCreateSharedClass()
1073 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateSharedClass()
1074 …RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base, ClassKind::SEND… in RuntimeCreateSharedClass()
1075 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateSharedClass()
1083 …SendableClassDefiner::DefineSendableInstanceHClass(thread, fieldTypeArray, instanceLength, cls, ba… in RuntimeCreateSharedClass()
1087 JSTaggedValue RuntimeStubs::RuntimeSetClassInheritanceRelationship(JSThread *thread, in RuntimeSetClassInheritanceRelationship() argument
1092 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeSetClassInheritanceRelationship()
1093 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeSetClassInheritanceRelationship()
1121 parentPrototype = JSHandle<JSTaggedValue>(thread, JSTaggedValue::Null()); in RuntimeSetClassInheritanceRelationship()
1124 return RuntimeThrowTypeError(thread, "parent class is not constructor"); in RuntimeSetClassInheritanceRelationship()
1127 parentPrototype = JSTaggedValue::GetProperty(thread, parent, in RuntimeSetClassInheritanceRelationship()
1129 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSetClassInheritanceRelationship()
1131 return RuntimeThrowTypeError(thread, "parent class have no valid prototype"); in RuntimeSetClassInheritanceRelationship()
1135 ctor->GetTaggedObject()->GetClass()->SetPrototype(thread, parent); // __proto__ in RuntimeSetClassInheritanceRelationship()
1137 JSHandle<JSObject> clsPrototype(thread, JSHandle<JSFunction>(ctor)->GetFunctionPrototype()); in RuntimeSetClassInheritanceRelationship()
1138 clsPrototype->GetClass()->SetPrototype(thread, parentPrototype); in RuntimeSetClassInheritanceRelationship()
1143 … JSHClass::EnableProtoChangeMarker(thread, JSHandle<JSHClass>(thread, constructor->GetClass())); in RuntimeSetClassInheritanceRelationship()
1145 JSHClass::EnableProtoChangeMarker(thread, in RuntimeSetClassInheritanceRelationship()
1146 … JSHandle<JSHClass>(thread, constructor->GetFunctionPrototype().GetTaggedObject()->GetClass())); in RuntimeSetClassInheritanceRelationship()
1156 JSHandle<JSHClass> ihcHandle(thread, ihc); in RuntimeSetClassInheritanceRelationship()
1157 JSHClass::EnableProtoChangeMarker(thread, ihcHandle); in RuntimeSetClassInheritanceRelationship()
1160 JSHandle<JSObject> protoHandle(thread, protoOrHClass); in RuntimeSetClassInheritanceRelationship()
1162 …JSHClass::EnablePHCProtoChangeMarker(thread, JSHandle<JSHClass>(thread, protoHandle->GetJSHClass()… in RuntimeSetClassInheritanceRelationship()
1169 JSTaggedValue RuntimeStubs::RuntimeSetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, in RuntimeSetClassConstructorLength() argument
1176 cls->SetPropertyInlinedProps(thread, JSFunction::LENGTH_INLINE_PROPERTY_INDEX, length); in RuntimeSetClassConstructorLength()
1178 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeSetClassConstructorLength()
1179 cls->UpdatePropertyInDictionary(thread, globalConst->GetLengthString(), length); in RuntimeSetClassConstructorLength()
1184 JSTaggedValue RuntimeStubs::RuntimeNotifyInlineCache(JSThread *thread, const JSHandle<JSFunction> &… in RuntimeNotifyInlineCache() argument
1189 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNotifyInlineCache()
1203 … JSFunction::SetProfileTypeInfo(thread, function, JSHandle<JSTaggedValue>::Cast(profileTypeInfo)); in RuntimeNotifyInlineCache()
1207 JSTaggedValue RuntimeStubs::RuntimeStOwnByValueWithNameSet(JSThread *thread, const JSHandle<JSTagge… in RuntimeStOwnByValueWithNameSet() argument
1211 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeStOwnByValueWithNameSet()
1215 …return RuntimeThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeEr… in RuntimeStOwnByValueWithNameSet()
1221 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByValueWithNameSet()
1222 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key); in RuntimeStOwnByValueWithNameSet()
1223 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValueWithNameSet()
1224 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeStOwnByValueWithNameSet()
1225 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByValueWithNameSet()
1227 return RuntimeThrowTypeError(thread, "StOwnByValueWithNameSet failed"); in RuntimeStOwnByValueWithNameSet()
1231 …propKey = JSHandle<JSTaggedValue>(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValu… in RuntimeStOwnByValueWithNameSet()
1233 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(value), propKey, in RuntimeStOwnByValueWithNameSet()
1234 … JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in RuntimeStOwnByValueWithNameSet()
1239 JSTaggedValue RuntimeStubs::RuntimeStOwnByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeStOwnByName() argument
1248 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByName()
1249 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, prop, desc); in RuntimeStOwnByName()
1250 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByName()
1252 return RuntimeThrowTypeError(thread, "SetOwnByName failed"); in RuntimeStOwnByName()
1257 JSTaggedValue RuntimeStubs::RuntimeStOwnByNameWithNameSet(JSThread *thread, in RuntimeStOwnByNameWithNameSet() argument
1263 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in RuntimeStOwnByNameWithNameSet()
1264 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByNameWithNameSet()
1268 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in RuntimeStOwnByNameWithNameSet()
1269 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc); in RuntimeStOwnByNameWithNameSet()
1270 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStOwnByNameWithNameSet()
1272 return RuntimeThrowTypeError(thread, "SetOwnByNameWithNameSet failed"); in RuntimeStOwnByNameWithNameSet()
1274 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(valueHandle), propKey, in RuntimeStOwnByNameWithNameSet()
1275 JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in RuntimeStOwnByNameWithNameSet()
1279 JSTaggedValue RuntimeStubs::RuntimeSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedValue>… in RuntimeSuspendGenerator() argument
1284 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSuspendGenerator()
1286 SaveFrameToContext(thread, genContextHandle); in RuntimeSuspendGenerator()
1292 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
1298 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSuspendGenerator()
1300 generatorObjectHandle->SetTaskInfo(thread->GetTaskInfo()); in RuntimeSuspendGenerator()
1302 SaveFrameToContext(thread, genContextHandle); in RuntimeSuspendGenerator()
1307 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
1310 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
1314 return RuntimeThrowTypeError(thread, "RuntimeSuspendGenerator failed"); in RuntimeSuspendGenerator()
1317 void RuntimeStubs::RuntimeSetGeneratorState(JSThread *thread, const JSHandle<JSTaggedValue> &genObj, in RuntimeSetGeneratorState() argument
1321 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSetGeneratorState()
1346 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, int32_t index) in RuntimeGetModuleNamespace() argument
1348 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(index); in RuntimeGetModuleNamespace()
1351 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, int32_t index, in RuntimeGetModuleNamespace() argument
1354 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(index, jsFunc); in RuntimeGetModuleNamespace()
1357 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName) in RuntimeGetModuleNamespace() argument
1359 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(localName); in RuntimeGetModuleNamespace()
1362 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName, in RuntimeGetModuleNamespace() argument
1365 … return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleNamespace(localName, jsFunc); in RuntimeGetModuleNamespace()
1368 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value) in RuntimeStModuleVar() argument
1370 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(index, value); in RuntimeStModuleVar()
1373 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value, in RuntimeStModuleVar() argument
1376 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(index, value, jsFunc); in RuntimeStModuleVar()
1379 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value) in RuntimeStModuleVar() argument
1381 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(key, value); in RuntimeStModuleVar()
1384 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value, in RuntimeStModuleVar() argument
1387 thread->GetCurrentEcmaContext()->GetModuleManager()->StoreModuleValue(key, value, jsFunc); in RuntimeStModuleVar()
1390 JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVar(JSThread *thread, int32_t index) in RuntimeLdLocalModuleVar() argument
1392 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInner(index); in RuntimeLdLocalModuleVar()
1395 inline JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVarWithModule(JSThread* thread, int32_t inde… in RuntimeLdLocalModuleVarWithModule() argument
1399 ModuleManager* mmgr = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeLdLocalModuleVarWithModule()
1404 return SourceTextModule::Cast(module)->GetModuleValue(thread, index, false); in RuntimeLdLocalModuleVarWithModule()
1407 JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVar(JSThread *thread, int32_t index, JSTaggedValue … in RuntimeLdLocalModuleVar() argument
1409 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInner(index, jsFunc); in RuntimeLdLocalModuleVar()
1412 JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVar(JSThread *thread, int32_t index) in RuntimeLdExternalModuleVar() argument
1414 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(index); in RuntimeLdExternalModuleVar()
1417 inline JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVarWithModule(JSThread* thread, int32_t i… in RuntimeLdExternalModuleVarWithModule() argument
1421 ModuleManager* mmgr = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeLdExternalModuleVarWithModule()
1425 moduleHdl = JSHandle<JSTaggedValue>(thread, module); in RuntimeLdExternalModuleVarWithModule()
1430 JSTaggedValue RuntimeStubs::RuntimeLdSendableExternalModuleVar(JSThread *thread, int32_t index, JST… in RuntimeLdSendableExternalModuleVar() argument
1432 return SharedModuleManager::GetInstance()->GetSendableModuleValue(thread, index, jsFunc); in RuntimeLdSendableExternalModuleVar()
1435 JSTaggedValue RuntimeStubs::RuntimeLdSendableLocalModuleVar(JSThread* thread, int32_t index, JSTagg… in RuntimeLdSendableLocalModuleVar() argument
1437 return SharedModuleManager::GetInstance()->GetSendableModuleValueInner(thread, index, jsFunc); in RuntimeLdSendableLocalModuleVar()
1440 JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVar(JSThread *thread, int32_t index, JSTaggedVal… in RuntimeLdExternalModuleVar() argument
1442 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(index, jsFunc); in RuntimeLdExternalModuleVar()
1445 JSTaggedValue RuntimeStubs::RuntimeLdLazyExternalModuleVar(JSThread *thread, int32_t index, JSTagge… in RuntimeLdLazyExternalModuleVar() argument
1447 …return thread->GetCurrentEcmaContext()->GetModuleManager()->GetLazyModuleValueOutter(index, jsFunc… in RuntimeLdLazyExternalModuleVar()
1451 JSThread *thread, int32_t index, JSTaggedValue jsFunc) in RuntimeLdLazySendableExternalModuleVar() argument
1453 return SharedModuleManager::GetInstance()->GetLazySendableModuleValue(thread, index, jsFunc); in RuntimeLdLazySendableExternalModuleVar()
1456 JSTaggedValue RuntimeStubs::RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner) in RuntimeLdModuleVar() argument
1459 …JSTaggedValue moduleValue = thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInn… in RuntimeLdModuleVar()
1463 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(key); in RuntimeLdModuleVar()
1466 JSTaggedValue RuntimeStubs::RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner, in RuntimeLdModuleVar() argument
1471 thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueInner(key, jsFunc); in RuntimeLdModuleVar()
1475 return thread->GetCurrentEcmaContext()->GetModuleManager()->GetModuleValueOutter(key, jsFunc); in RuntimeLdModuleVar()
1478 JSTaggedValue RuntimeStubs::RuntimeGetPropIterator(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetPropIterator() argument
1480 JSHandle<JSForInIterator> iteratorHandle = JSObject::EnumerateObjectProperties(thread, value); in RuntimeGetPropIterator()
1481 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetPropIterator()
1485 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionEnter(JSThread *thread) in RuntimeAsyncFunctionEnter() argument
1487 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeAsyncFunctionEnter()
1489 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeAsyncFunctionEnter()
1493 if (thread->GetEcmaVM()->GetJSOptions().EnablePendingCheak()) { in RuntimeAsyncFunctionEnter()
1494 thread->GetEcmaVM()->InsertAsyncStackTrace(promiseObject); in RuntimeAsyncFunctionEnter()
1499 asyncFuncObj->SetPromise(thread, promiseObject); in RuntimeAsyncFunctionEnter()
1502 context->SetGeneratorObject(thread, asyncFuncObj); in RuntimeAsyncFunctionEnter()
1506 asyncFuncObj->SetGeneratorContext(thread, context); in RuntimeAsyncFunctionEnter()
1509 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionEnter()
1513 JSTaggedValue RuntimeStubs::RuntimeGetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &obj) in RuntimeGetIterator() argument
1515 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeGetIterator()
1518 JSTaggedValue::GetProperty(thread, obj, env->GetIteratorSymbol()).GetValue(); in RuntimeGetIterator()
1519 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIterator()
1524 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeGetIterator()
1525 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, valuesFunc, obj, undefined… in RuntimeGetIterator()
1529 JSTaggedValue RuntimeStubs::RuntimeGetAsyncIterator(JSThread *thread, const JSHandle<JSTaggedValue>… in RuntimeGetAsyncIterator() argument
1531 JSHandle<JSTaggedValue> asyncit = JSIterator::GetAsyncIterator(thread, obj); in RuntimeGetAsyncIterator()
1532 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetAsyncIterator()
1536 JSTaggedValue RuntimeStubs::RuntimeLdPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeLdPrivateProperty() argument
1546 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeLdPrivateProperty()
1547 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeLdPrivateProperty()
1549 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeLdPrivateProperty()
1551 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, handleKey, handleObj, unde… in RuntimeLdPrivateProperty()
1553 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdPrivateProperty()
1556 PropertyDescriptor desc(thread); in RuntimeLdPrivateProperty()
1558 !JSTaggedValue::GetOwnProperty(thread, handleObj, handleKey, desc)) { in RuntimeLdPrivateProperty()
1559 …THROW_TYPE_ERROR_AND_RETURN(thread, "invalid or cannot find private key", JSTaggedValue::Exception… in RuntimeLdPrivateProperty()
1562 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdPrivateProperty()
1566 JSTaggedValue RuntimeStubs::RuntimeStPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeStPrivateProperty() argument
1576 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeStPrivateProperty()
1577 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeStPrivateProperty()
1578 JSHandle<JSTaggedValue> handleValue(thread, value); in RuntimeStPrivateProperty()
1580 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeStPrivateProperty()
1582 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, handleKey, handleObj, unde… in RuntimeStPrivateProperty()
1583 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStPrivateProperty()
1586 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStPrivateProperty()
1589 PropertyDescriptor desc(thread); in RuntimeStPrivateProperty()
1591 !JSTaggedValue::GetOwnProperty(thread, handleObj, handleKey, desc)) { in RuntimeStPrivateProperty()
1592 …THROW_TYPE_ERROR_AND_RETURN(thread, "invalid or cannot find private key", JSTaggedValue::Exception… in RuntimeStPrivateProperty()
1595 bool res = JSTaggedValue::DefineOwnProperty(thread, handleObj, handleKey, desc); in RuntimeStPrivateProperty()
1596 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStPrivateProperty()
1600 JSTaggedValue RuntimeStubs::RuntimeTestIn(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeTestIn() argument
1604 …THROW_TYPE_ERROR_AND_RETURN(thread, "Cannot use 'in' operator in Non-Object", JSTaggedValue::Excep… in RuntimeTestIn()
1612 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeTestIn()
1613 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeTestIn()
1614 …bool res = JSTaggedValue::IsPropertyKey(handleKey) && JSTaggedValue::HasProperty(thread, handleObj… in RuntimeTestIn()
1615 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTestIn()
1619 void RuntimeStubs::RuntimeThrow(JSThread *thread, JSTaggedValue value) in RuntimeThrow() argument
1621 thread->SetException(value); in RuntimeThrow()
1624 void RuntimeStubs::RuntimeThrowThrowNotExists(JSThread *thread) in RuntimeThrowThrowNotExists() argument
1626 THROW_TYPE_ERROR(thread, "Throw method is not defined"); in RuntimeThrowThrowNotExists()
1629 void RuntimeStubs::RuntimeThrowPatternNonCoercible(JSThread *thread) in RuntimeThrowPatternNonCoercible() argument
1631 JSHandle<EcmaString> msg(thread->GlobalConstants()->GetHandledObjNotCoercibleString()); in RuntimeThrowPatternNonCoercible()
1632 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowPatternNonCoercible()
1633 THROW_NEW_ERROR_AND_RETURN(thread, in RuntimeThrowPatternNonCoercible()
1637 void RuntimeStubs::RuntimeThrowDeleteSuperProperty(JSThread *thread) in RuntimeThrowDeleteSuperProperty() argument
1639 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowDeleteSuperProperty()
1642 THROW_NEW_ERROR_AND_RETURN(thread, errorObj.GetTaggedValue()); in RuntimeThrowDeleteSuperProperty()
1645 void RuntimeStubs::RuntimeThrowUndefinedIfHole(JSThread *thread, const JSHandle<EcmaString> &obj) in RuntimeThrowUndefinedIfHole() argument
1647 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowUndefinedIfHole()
1651 THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::REFERENCE_ERROR, in RuntimeThrowUndefinedIfHole()
1655 void RuntimeStubs::RuntimeThrowIfNotObject(JSThread *thread) in RuntimeThrowIfNotObject() argument
1657 THROW_TYPE_ERROR(thread, "Inner return result is not object"); in RuntimeThrowIfNotObject()
1660 void RuntimeStubs::RuntimeThrowConstAssignment(JSThread *thread, const JSHandle<EcmaString> &value) in RuntimeThrowConstAssignment() argument
1662 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowConstAssignment()
1667 THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::TYPE_ERROR, in RuntimeThrowConstAssignment()
1671 JSTaggedValue RuntimeStubs::RuntimeLdGlobalRecord(JSThread *thread, JSTaggedValue key) in RuntimeLdGlobalRecord() argument
1673 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeLdGlobalRecord()
1683 JSTaggedValue RuntimeStubs::RuntimeTryLdGlobalByName(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeTryLdGlobalByName() argument
1686 OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop); in RuntimeTryLdGlobalByName()
1687 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTryLdGlobalByName()
1689 return RuntimeThrowReferenceError(thread, prop, " is not defined"); in RuntimeTryLdGlobalByName()
1694 JSTaggedValue RuntimeStubs::RuntimeTryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, in RuntimeTryUpdateGlobalRecord() argument
1697 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeTryUpdateGlobalRecord()
1704 return RuntimeThrowTypeError(thread, "const variable can not be modified"); in RuntimeTryUpdateGlobalRecord()
1708 box->SetValue(thread, value); in RuntimeTryUpdateGlobalRecord()
1709 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTryUpdateGlobalRecord()
1713 JSTaggedValue RuntimeStubs::RuntimeThrowReferenceError(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeThrowReferenceError() argument
1716 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowReferenceError()
1717 JSHandle<EcmaString> propName = JSTaggedValue::ToString(thread, prop); in RuntimeThrowReferenceError()
1718 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowReferenceError()
1721 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, in RuntimeThrowReferenceError()
1726 JSTaggedValue RuntimeStubs::RuntimeLdGlobalVarFromProto(JSThread *thread, const JSHandle<JSTaggedVa… in RuntimeLdGlobalVarFromProto() argument
1731 JSHandle<JSTaggedValue> obj(thread, JSObject::GetPrototype(global)); in RuntimeLdGlobalVarFromProto()
1732 OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop); in RuntimeLdGlobalVarFromProto()
1733 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdGlobalVarFromProto()
1737 JSTaggedValue RuntimeStubs::RuntimeStGlobalVar(JSThread *thread, const JSHandle<JSTaggedValue> &pro… in RuntimeStGlobalVar() argument
1740 JSHandle<JSTaggedValue> global(thread, thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalObject()); in RuntimeStGlobalVar()
1742 JSObject::GlobalSetProperty(thread, prop, value, true); in RuntimeStGlobalVar()
1743 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStGlobalVar()
1747 JSTaggedValue RuntimeStubs::RuntimeToNumber(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeToNumber() argument
1749 return JSTaggedValue::ToNumber(thread, value); in RuntimeToNumber()
1752 JSTaggedValue RuntimeStubs::RuntimeToNumeric(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeToNumeric() argument
1754 return JSTaggedValue::ToNumeric(thread, value).GetTaggedValue(); in RuntimeToNumeric()
1757 JSTaggedValue RuntimeStubs::RuntimeDynamicImport(JSThread *thread, const JSHandle<JSTaggedValue> &s… in RuntimeDynamicImport() argument
1760 EcmaVM *ecmaVm = thread->GetEcmaVM(); in RuntimeDynamicImport()
1770 JSMutableHandle<JSTaggedValue> dirPath(thread, thread->GlobalConstants()->GetUndefined()); in RuntimeDynamicImport()
1771 JSMutableHandle<JSTaggedValue> recordName(thread, thread->GlobalConstants()->GetUndefined()); in RuntimeDynamicImport()
1781 …JSHandle<PromiseCapability> promiseCapability = JSPromise::NewPromiseCapability(thread, promiseFun… in RuntimeDynamicImport()
1782 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDynamicImport()
1783 JSHandle<job::MicroJobQueue> job = thread->GetCurrentEcmaContext()->GetMicroJobQueue(); in RuntimeDynamicImport()
1786 argv->Set(thread, 0, promiseCapability->GetResolve()); in RuntimeDynamicImport()
1787 argv->Set(thread, 1, promiseCapability->GetReject()); // 1 : reject method in RuntimeDynamicImport()
1788 …argv->Set(thread, 2, dirPath); // 2 : current file path(containing file … in RuntimeDynamicImport()
1789 argv->Set(thread, 3, specifier); // 3 : request module's path in RuntimeDynamicImport()
1790 argv->Set(thread, 4, recordName); // 4 : js recordName or undefined in RuntimeDynamicImport()
1793 …job::MicroJobQueue::EnqueueJob(thread, job, job::QueueType::QUEUE_PROMISE, dynamicImportJob, argv); in RuntimeDynamicImport()
1798 JSTaggedValue RuntimeStubs::RuntimeEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeEq() argument
1801 bool ret = JSTaggedValue::Equal(thread, left, right); in RuntimeEq()
1802 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeEq()
1806 JSTaggedValue RuntimeStubs::RuntimeNotEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeNotEq() argument
1809 bool ret = JSTaggedValue::Equal(thread, left, right); in RuntimeNotEq()
1810 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNotEq()
1814 JSTaggedValue RuntimeStubs::RuntimeLess(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeLess() argument
1817 bool ret = JSTaggedValue::Compare(thread, left, right) == ComparisonResult::LESS; in RuntimeLess()
1818 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLess()
1822 JSTaggedValue RuntimeStubs::RuntimeLessEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeLessEq() argument
1825 bool ret = JSTaggedValue::Compare(thread, left, right) <= ComparisonResult::EQUAL; in RuntimeLessEq()
1826 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLessEq()
1830 JSTaggedValue RuntimeStubs::RuntimeGreater(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeGreater() argument
1833 bool ret = JSTaggedValue::Compare(thread, left, right) == ComparisonResult::GREAT; in RuntimeGreater()
1834 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGreater()
1838 JSTaggedValue RuntimeStubs::RuntimeGreaterEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeGreaterEq() argument
1841 ComparisonResult comparison = JSTaggedValue::Compare(thread, left, right); in RuntimeGreaterEq()
1843 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGreaterEq()
1847 JSTaggedValue RuntimeStubs::RuntimeAdd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAdd2() argument
1852 thread->GetEcmaVM(), JSHandle<EcmaString>(left), JSHandle<EcmaString>(right)); in RuntimeAdd2()
1853 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1856 JSHandle<JSTaggedValue> primitiveA0(thread, JSTaggedValue::ToPrimitive(thread, left)); in RuntimeAdd2()
1857 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1858 JSHandle<JSTaggedValue> primitiveA1(thread, JSTaggedValue::ToPrimitive(thread, right)); in RuntimeAdd2()
1859 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1862 JSHandle<EcmaString> stringA0 = JSTaggedValue::ToString(thread, primitiveA0); in RuntimeAdd2()
1863 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1864 JSHandle<EcmaString> stringA1 = JSTaggedValue::ToString(thread, primitiveA1); in RuntimeAdd2()
1865 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1866 EcmaString *resultStr = EcmaStringAccessor::Concat(thread->GetEcmaVM(), stringA0, stringA1); in RuntimeAdd2()
1867 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1870 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, primitiveA0); in RuntimeAdd2()
1871 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1872 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, primitiveA1); in RuntimeAdd2()
1873 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1878 return BigInt::Add(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeAdd2()
1880 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAdd2()
1887 JSTaggedValue RuntimeStubs::RuntimeShl2(JSThread *thread, in RuntimeShl2() argument
1891 JSHandle<JSTaggedValue> leftValue = JSTaggedValue::ToNumeric(thread, left); in RuntimeShl2()
1892 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1893 JSHandle<JSTaggedValue> rightValue = JSTaggedValue::ToNumeric(thread, right); in RuntimeShl2()
1894 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1899 return BigInt::LeftShift(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeShl2()
1901 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeShl2()
1903 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, leftValue); in RuntimeShl2()
1904 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1905 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, rightValue); in RuntimeShl2()
1906 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1917 JSTaggedValue RuntimeStubs::RuntimeShr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeShr2() argument
1920 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeShr2()
1921 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1922 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeShr2()
1923 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1926 return BigInt::UnsignedRightShift(thread); in RuntimeShr2()
1928 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeShr2()
1930 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeShr2()
1931 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1932 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeShr2()
1933 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1943 JSTaggedValue RuntimeStubs::RuntimeSub2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeSub2() argument
1946 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeSub2()
1947 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSub2()
1948 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeSub2()
1949 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSub2()
1954 return BigInt::Subtract(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeSub2()
1956 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeSub2()
1963 JSTaggedValue RuntimeStubs::RuntimeMul2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeMul2() argument
1966 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeMul2()
1967 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMul2()
1968 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeMul2()
1969 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMul2()
1975 return BigInt::Multiply(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeMul2()
1977 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeMul2()
1985 JSTaggedValue RuntimeStubs::RuntimeDiv2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeDiv2() argument
1988 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeDiv2()
1989 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDiv2()
1990 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeDiv2()
1991 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDiv2()
1996 return BigInt::Divide(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeDiv2()
1998 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeDiv2()
2013 JSTaggedValue RuntimeStubs::RuntimeMod2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeMod2() argument
2016 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeMod2()
2017 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMod2()
2018 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeMod2()
2019 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMod2()
2026 return BigInt::Remainder(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeMod2()
2028 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeMod2()
2042 JSTaggedValue RuntimeStubs::RuntimeAshr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAshr2() argument
2045 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeAshr2()
2046 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2047 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeAshr2()
2048 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2053 return BigInt::SignedRightShift(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeAshr2()
2055 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAshr2()
2057 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeAshr2()
2058 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2059 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeAshr2()
2060 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
2068 JSTaggedValue RuntimeStubs::RuntimeAnd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAnd2() argument
2071 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeAnd2()
2072 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2073 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeAnd2()
2074 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2079 return BigInt::BitwiseAND(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeAnd2()
2081 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAnd2()
2083 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeAnd2()
2084 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2085 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeAnd2()
2086 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
2094 JSTaggedValue RuntimeStubs::RuntimeOr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeOr2() argument
2097 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeOr2()
2098 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2099 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeOr2()
2100 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2105 return BigInt::BitwiseOR(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeOr2()
2107 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeOr2()
2109 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeOr2()
2110 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2111 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeOr2()
2112 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
2120 JSTaggedValue RuntimeStubs::RuntimeXor2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeXor2() argument
2123 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeXor2()
2124 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2125 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeXor2()
2126 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2131 return BigInt::BitwiseXOR(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeXor2()
2133 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeXor2()
2135 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeXor2()
2136 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2137 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeXor2()
2138 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
2146 JSTaggedValue RuntimeStubs::RuntimeToJSTaggedValueWithInt32(JSThread *thread, in RuntimeToJSTaggedValueWithInt32() argument
2149 int32_t res = JSTaggedValue::ToInt32(thread, value); in RuntimeToJSTaggedValueWithInt32()
2150 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeToJSTaggedValueWithInt32()
2154 JSTaggedValue RuntimeStubs::RuntimeToJSTaggedValueWithUint32(JSThread *thread, const JSHandle<JSTag… in RuntimeToJSTaggedValueWithUint32() argument
2156 uint32_t res = JSTaggedValue::ToUint32(thread, value); in RuntimeToJSTaggedValueWithUint32()
2157 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeToJSTaggedValueWithUint32()
2161 JSTaggedValue RuntimeStubs::RuntimeCreateEmptyObject([[maybe_unused]] JSThread *thread, ObjectFacto… in RuntimeCreateEmptyObject() argument
2169 JSTaggedValue RuntimeStubs::RuntimeCreateEmptyArray([[maybe_unused]] JSThread *thread, ObjectFactor… in RuntimeCreateEmptyArray() argument
2177 JSTaggedValue RuntimeStubs::RuntimeGetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actu… in RuntimeGetUnmapedArgs() argument
2180 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetUnmapedArgs()
2183 argumentsList->Set(thread, i, in RuntimeGetUnmapedArgs()
2186 return RuntimeGetUnmapedJSArgumentObj(thread, argumentsList); in RuntimeGetUnmapedArgs()
2189 JSTaggedValue RuntimeStubs::RuntimeCopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNu… in RuntimeCopyRestArgs() argument
2193 …thread, restNumArgs, [thread, sp, startIdx] (const JSHandle<TaggedArray> &newElements, uint32_t le… in RuntimeCopyRestArgs()
2196 newElements->Set(thread, i, JSTaggedValue(sp[startIdx + i])); in RuntimeCopyRestArgs()
2201 JSTaggedValue RuntimeStubs::RuntimeCreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, in RuntimeCreateArrayWithBuffer() argument
2206 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateArrayWithBuffer()
2211 JSTaggedValue RuntimeStubs::RuntimeCreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, in RuntimeCreateObjectWithBuffer() argument
2215 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectWithBuffer()
2220 JSTaggedValue RuntimeStubs::RuntimeNewLexicalEnv(JSThread *thread, uint16_t numVars) in RuntimeNewLexicalEnv() argument
2222 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewLexicalEnv()
2225 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in RuntimeNewLexicalEnv()
2226 newEnv->SetParentEnv(thread, currentLexenv); in RuntimeNewLexicalEnv()
2227 newEnv->SetScopeInfo(thread, JSTaggedValue::Hole()); in RuntimeNewLexicalEnv()
2228 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewLexicalEnv()
2232 JSTaggedValue RuntimeStubs::RuntimeNewSendableEnv(JSThread *thread, uint16_t numVars) in RuntimeNewSendableEnv() argument
2234 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewSendableEnv()
2237 JSTaggedValue module = JSFunction::Cast(thread->GetCurrentFunction())->GetModule(); in RuntimeNewSendableEnv()
2238 JSHandle<SourceTextModule> moduleHandle(thread, module); in RuntimeNewSendableEnv()
2239 newEnv->SetParentEnv(thread, moduleHandle->GetSendableEnv()); in RuntimeNewSendableEnv()
2240 newEnv->SetScopeInfo(thread, JSTaggedValue::Hole()); in RuntimeNewSendableEnv()
2241 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewSendableEnv()
2245 JSTaggedValue RuntimeStubs::RuntimeNewObjRange(JSThread *thread, const JSHandle<JSTaggedValue> &fun… in RuntimeNewObjRange() argument
2248 JSHandle<JSTaggedValue> preArgs(thread, JSTaggedValue::Undefined()); in RuntimeNewObjRange()
2249 JSHandle<TaggedArray> args = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length); in RuntimeNewObjRange()
2250 FrameHandler frameHandler(thread); in RuntimeNewObjRange()
2253 args->Set(thread, i, value); in RuntimeNewObjRange()
2255 auto tagged = RuntimeOptConstruct(thread, func, newTarget, preArgs, args); in RuntimeNewObjRange()
2256 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjRange()
2260 void RuntimeStubs::DefineFuncTryUseAOTHClass(JSThread* thread, in DefineFuncTryUseAOTHClass() argument
2269 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in DefineFuncTryUseAOTHClass()
2270 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in DefineFuncTryUseAOTHClass()
2271 func->SetProtoOrHClass(thread, ihc); in DefineFuncTryUseAOTHClass()
2275 JSHandle<JSObject> clsPrototype(thread, func->GetFunctionPrototype()); in DefineFuncTryUseAOTHClass()
2276 clsPrototype->GetClass()->SetPrototype(thread, parentPrototype); in DefineFuncTryUseAOTHClass()
2280 … PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(func), true, false, true); in DefineFuncTryUseAOTHClass()
2281 JSObject::DefineOwnProperty(thread, clsPrototype, constructorKey, descriptor); in DefineFuncTryUseAOTHClass()
2284 JSHClass::EnablePHCProtoChangeMarker(thread, in DefineFuncTryUseAOTHClass()
2285 JSHandle<JSHClass>(thread, parentPrototype->GetTaggedObject()->GetClass())); in DefineFuncTryUseAOTHClass()
2287 JSHClass::EnableProtoChangeMarker(thread, JSHandle<JSHClass>(ihc)); in DefineFuncTryUseAOTHClass()
2289 …JSHClass::EnablePHCProtoChangeMarker(thread, JSHandle<JSHClass>(thread, clsPrototype->GetClass())); in DefineFuncTryUseAOTHClass()
2291 //avoid one thread uses ihc twice or more times in DefineFuncTryUseAOTHClass()
2296 JSTaggedValue RuntimeStubs::RuntimeDefinefunc(JSThread *thread, const JSHandle<JSTaggedValue> &cons… in RuntimeDefinefunc() argument
2302 JSMutableHandle<JSTaggedValue> ihc(thread, JSTaggedValue::Undefined()); in RuntimeDefinefunc()
2303 JSMutableHandle<AOTLiteralInfo> aotLiteralInfo(thread, JSTaggedValue::Hole()); in RuntimeDefinefunc()
2307 …JSTaggedValue unsharedCp = thread->GetCurrentEcmaContext()->FindUnsharedConstpool(constpoolHandle.… in RuntimeDefinefunc()
2309 JSHandle<ConstantPool> unsharedCpHandle(thread, unsharedCp); in RuntimeDefinefunc()
2316 …JSTaggedValue method = ConstantPool::GetMethodFromCache(thread, constpoolHandle.GetTaggedValue(), … in RuntimeDefinefunc()
2317 const JSHandle<Method> methodHandle(thread, method); in RuntimeDefinefunc()
2318 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeDefinefunc()
2322 ModuleManager *moduleManager = thread->GetCurrentEcmaContext()->GetModuleManager(); in RuntimeDefinefunc()
2327 thread, JSHandle<SourceTextModule>::Cast(module)->GetSendableEnv()); in RuntimeDefinefunc()
2329 result->SetModule(thread, sendableFuncModule.GetTaggedValue()); in RuntimeDefinefunc()
2332 result->SetModule(thread, module.GetTaggedValue()); in RuntimeDefinefunc()
2333 result->SetLexicalEnv(thread, envHandle.GetTaggedValue()); in RuntimeDefinefunc()
2334 result->SetHomeObject(thread, homeObject.GetTaggedValue()); in RuntimeDefinefunc()
2336 DefineFuncTryUseAOTHClass(thread, result, ihc, aotLiteralInfo); in RuntimeDefinefunc()
2342 JSTaggedValue RuntimeStubs::RuntimeCreateRegExpWithLiteral(JSThread *thread, in RuntimeCreateRegExpWithLiteral() argument
2345 JSHandle<JSTaggedValue> flagsHandle(thread, JSTaggedValue(flags)); in RuntimeCreateRegExpWithLiteral()
2346 return builtins::BuiltinsRegExp::RegExpCreate(thread, pattern, flagsHandle); in RuntimeCreateRegExpWithLiteral()
2349 JSTaggedValue RuntimeStubs::RuntimeThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, in RuntimeThrowIfSuperNotCorrectCall() argument
2353 …return RuntimeThrowReferenceError(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined… in RuntimeThrowIfSuperNotCorrectCall()
2357 …return RuntimeThrowReferenceError(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined… in RuntimeThrowIfSuperNotCorrectCall()
2363 JSTaggedValue RuntimeStubs::RuntimeCreateObjectHavingMethod(JSThread *thread, ObjectFactory *factor… in RuntimeCreateObjectHavingMethod() argument
2368 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectHavingMethod()
2373 JSTaggedValue RuntimeStubs::CommonCreateObjectWithExcludedKeys(JSThread *thread, in CommonCreateObjectWithExcludedKeys() argument
2378 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CommonCreateObjectWithExcludedKeys()
2383 JSHandle<JSObject> obj(JSTaggedValue::ToObject(thread, objVal)); in CommonCreateObjectWithExcludedKeys()
2384 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2385 JSHandle<TaggedArray> allKeys = JSObject::GetOwnPropertyKeys(thread, obj); in CommonCreateObjectWithExcludedKeys()
2387 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in CommonCreateObjectWithExcludedKeys()
2392 … if (JSTaggedValue::Equal(thread, key, JSHandle<JSTaggedValue>(thread, excludedKeys->Get(j)))) { in CommonCreateObjectWithExcludedKeys()
2398 PropertyDescriptor desc(thread); in CommonCreateObjectWithExcludedKeys()
2399 bool success = JSObject::GetOwnProperty(thread, obj, key, desc); in CommonCreateObjectWithExcludedKeys()
2400 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2402 JSHandle<JSTaggedValue> value = JSObject::GetProperty(thread, obj, key).GetValue(); in CommonCreateObjectWithExcludedKeys()
2403 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2404 JSObject::SetProperty(thread, restObj, key, value, true); in CommonCreateObjectWithExcludedKeys()
2405 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CommonCreateObjectWithExcludedKeys()
2412 JSTaggedValue RuntimeStubs::RuntimeOptCreateObjectWithExcludedKeys(JSThread *thread, uintptr_t argv… in RuntimeOptCreateObjectWithExcludedKeys() argument
2414 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptCreateObjectWithExcludedKeys()
2423 excludedKeys->Set(thread, 0, excludedKey); in RuntimeOptCreateObjectWithExcludedKeys()
2426 excludedKeys->Set(thread, i, excludedKey); in RuntimeOptCreateObjectWithExcludedKeys()
2429 return CommonCreateObjectWithExcludedKeys(thread, objVal, numExcludedKeys, excludedKeys); in RuntimeOptCreateObjectWithExcludedKeys()
2432 JSTaggedValue RuntimeStubs::RuntimeCreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, in RuntimeCreateObjectWithExcludedKeys() argument
2436 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateObjectWithExcludedKeys()
2439 FrameHandler frameHandler(thread); in RuntimeCreateObjectWithExcludedKeys()
2443 excludedKeys->Set(thread, 0, excludedKey); in RuntimeCreateObjectWithExcludedKeys()
2446 excludedKeys->Set(thread, i, excludedKey); in RuntimeCreateObjectWithExcludedKeys()
2452 JSHandle<JSProxy> proxyVal(thread, finalVal.GetTaggedValue()); in RuntimeCreateObjectWithExcludedKeys()
2453 finalVal = proxyVal->GetSourceTarget(thread); in RuntimeCreateObjectWithExcludedKeys()
2456 return CommonCreateObjectWithExcludedKeys(thread, finalVal, numExcludedKeys, excludedKeys); in RuntimeCreateObjectWithExcludedKeys()
2459 JSTaggedValue RuntimeStubs::RuntimeDefineMethod(JSThread *thread, const JSHandle<Method> &methodHan… in RuntimeDefineMethod() argument
2464 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeDefineMethod()
2467 func->SetLexicalEnv(thread, env); in RuntimeDefineMethod()
2468 func->SetModule(thread, module); in RuntimeDefineMethod()
2483 JSTaggedValue RuntimeStubs::RuntimeCallSpread(JSThread *thread, in RuntimeCallSpread() argument
2489 THROW_TYPE_ERROR_AND_RETURN(thread, "cannot Callspread", JSTaggedValue::Exception()); in RuntimeCallSpread()
2492 JSHandle<TaggedArray> coretypesArray(thread, RuntimeGetCallSpreadArgs(thread, array)); in RuntimeCallSpread()
2493 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCallSpread()
2495 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeCallSpread()
2496 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, func, obj, undefined, leng… in RuntimeCallSpread()
2497 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCallSpread()
2502 void RuntimeStubs::RuntimeSetPatchModule(JSThread *thread, const JSHandle<JSFunction> &func) in RuntimeSetPatchModule() argument
2504 JSHandle<Method> methodHandle(thread, Method::Cast(func->GetMethod())); in RuntimeSetPatchModule()
2506 thread->GetCurrentEcmaContext()->FindPatchModule(MethodLiteral::GetRecordName( in RuntimeSetPatchModule()
2509 func->SetModule(thread, coldReloadRecordName.GetTaggedValue()); in RuntimeSetPatchModule()
2513 JSTaggedValue RuntimeStubs::RuntimeDefineGetterSetterByValue(JSThread *thread, const JSHandle<JSObj… in RuntimeDefineGetterSetterByValue() argument
2520 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeDefineGetterSetterByValue()
2521 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefineGetterSetterByValue()
2522 auto globalConst = thread->GlobalConstants(); in RuntimeDefineGetterSetterByValue()
2526 thread, in RuntimeDefineGetterSetterByValue()
2536 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in RuntimeDefineGetterSetterByValue()
2538 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(getter), propKey, in RuntimeDefineGetterSetterByValue()
2539 … JSHandle<JSTaggedValue>(thread, globalConst->GetGetString())); in RuntimeDefineGetterSetterByValue()
2545 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in RuntimeDefineGetterSetterByValue()
2547 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(setter), propKey, in RuntimeDefineGetterSetterByValue()
2548 … JSHandle<JSTaggedValue>(thread, globalConst->GetSetString())); in RuntimeDefineGetterSetterByValue()
2555 PropertyDescriptor desc(thread, true, enumerable, true); in RuntimeDefineGetterSetterByValue()
2567 JSObject::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeDefineGetterSetterByValue()
2571 JSHandle<JSHClass> phcHandle(thread, holderTraHClass); in RuntimeDefineGetterSetterByValue()
2572 JSHClass::EnablePHCProtoChangeMarker(thread, phcHandle); in RuntimeDefineGetterSetterByValue()
2574 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) { in RuntimeDefineGetterSetterByValue()
2576 thread->GetEcmaVM()->GetPGOProfiler()->ProfileDefineGetterSetter( in RuntimeDefineGetterSetterByValue()
2584 JSTaggedValue RuntimeStubs::RuntimeSuperCall(JSThread *thread, const JSHandle<JSTaggedValue> &func, in RuntimeSuperCall() argument
2588 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeSuperCall()
2589 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2591 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeSuperCall()
2593 FrameHandler frameHandler(thread); in RuntimeSuperCall()
2595 argv->Set(thread, i, frameHandler.GetVRegValue(firstVRegIdx + i)); in RuntimeSuperCall()
2598 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeSuperCall()
2599 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newT… in RuntimeSuperCall()
2600 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2603 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2608 JSTaggedValue RuntimeStubs::RuntimeOptSuperCall(JSThread *thread, const JSHandle<JSTaggedValue> &fu… in RuntimeOptSuperCall() argument
2613 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeOptSuperCall()
2614 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2615 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptSuperCall()
2616 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newT… in RuntimeOptSuperCall()
2617 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2620 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2624 JSTaggedValue RuntimeStubs::RuntimeThrowTypeError(JSThread *thread, const char *message) in RuntimeThrowTypeError() argument
2626 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowTypeError()
2627 THROW_TYPE_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in RuntimeThrowTypeError()
2630 JSTaggedValue RuntimeStubs::RuntimeGetCallSpreadArgs(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeGetCallSpreadArgs() argument
2634 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetCallSpreadArgs()
2636 JSHandle<JSTaggedValue> itor = JSIterator::GetIterator(thread, jsArray); in RuntimeGetCallSpreadArgs()
2637 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2640 if (jsArray->IsStableJSArray(thread) && itor->IsJSArrayIterator()) { in RuntimeGetCallSpreadArgs()
2642 ElementAccessor::CopyJSArrayToTaggedArray(thread, jsArrayObj, argv, argvMayMaxLength); in RuntimeGetCallSpreadArgs()
2646 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2647 JSMutableHandle<JSTaggedValue> next(thread, JSTaggedValue::Undefined()); in RuntimeGetCallSpreadArgs()
2648 JSMutableHandle<JSTaggedValue> nextArg(thread, JSTaggedValue::Undefined()); in RuntimeGetCallSpreadArgs()
2651 next.Update(JSIterator::IteratorStep(thread, itor).GetTaggedValue()); in RuntimeGetCallSpreadArgs()
2652 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2656 nextArg.Update(JSIterator::IteratorValue(thread, next).GetTaggedValue()); in RuntimeGetCallSpreadArgs()
2657 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2660 argv = argv->SetCapacity(thread, argv, argvMayMaxLength); in RuntimeGetCallSpreadArgs()
2662 argv->Set(thread, argvIndex++, nextArg); in RuntimeGetCallSpreadArgs()
2668 JSTaggedValue RuntimeStubs::RuntimeThrowSyntaxError(JSThread *thread, const char *message) in RuntimeThrowSyntaxError() argument
2670 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowSyntaxError()
2671 THROW_SYNTAX_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in RuntimeThrowSyntaxError()
2674 JSTaggedValue RuntimeStubs::RuntimeLdBigInt(JSThread *thread, const JSHandle<JSTaggedValue> &number… in RuntimeLdBigInt() argument
2676 return JSTaggedValue::ToBigInt(thread, numberBigInt); in RuntimeLdBigInt()
2679 JSTaggedValue RuntimeStubs::RuntimeCallBigIntAsIntN(JSThread *thread, JSTaggedValue bits, JSTaggedV… in RuntimeCallBigIntAsIntN() argument
2681 auto biginteger = JSHandle<BigInt>(thread, bigint); in RuntimeCallBigIntAsIntN()
2682 JSTaggedNumber bitness = JSTaggedValue::ToNumber(thread, bits); in RuntimeCallBigIntAsIntN()
2683 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCallBigIntAsIntN()
2684 return BigInt::AsintN(thread, bitness, biginteger); in RuntimeCallBigIntAsIntN()
2687 JSTaggedValue RuntimeStubs::RuntimeCallBigIntAsUintN(JSThread *thread, JSTaggedValue bits, JSTagged… in RuntimeCallBigIntAsUintN() argument
2689 auto biginteger = JSHandle<BigInt>(thread, bigint); in RuntimeCallBigIntAsUintN()
2690 JSTaggedNumber bitness = JSTaggedValue::ToNumber(thread, bits); in RuntimeCallBigIntAsUintN()
2691 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCallBigIntAsUintN()
2692 return BigInt::AsUintN(thread, bitness, biginteger); in RuntimeCallBigIntAsUintN()
2695 JSTaggedValue RuntimeStubs::RuntimeNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16… in RuntimeNewLexicalEnvWithName() argument
2697 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewLexicalEnvWithName()
2700 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in RuntimeNewLexicalEnvWithName()
2701 newEnv->SetParentEnv(thread, currentLexenv); in RuntimeNewLexicalEnvWithName()
2702 JSTaggedValue scopeInfo = ScopeInfoExtractor::GenerateScopeInfo(thread, scopeId); in RuntimeNewLexicalEnvWithName()
2703 newEnv->SetScopeInfo(thread, scopeInfo); in RuntimeNewLexicalEnvWithName()
2704 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewLexicalEnvWithName()
2708 JSTaggedValue RuntimeStubs::RuntimeOptGetUnmapedArgs(JSThread *thread, uint32_t actualNumArgs) in RuntimeOptGetUnmapedArgs() argument
2710 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptGetUnmapedArgs()
2713 auto argv = GetActualArgvFromStub(thread); in RuntimeOptGetUnmapedArgs()
2719 argumentsList->Set(thread, idx++, args); in RuntimeOptGetUnmapedArgs()
2721 return RuntimeGetUnmapedJSArgumentObj(thread, argumentsList); in RuntimeOptGetUnmapedArgs()
2724 JSTaggedValue RuntimeStubs::RuntimeGetUnmapedJSArgumentObj(JSThread *thread, const JSHandle<TaggedA… in RuntimeGetUnmapedJSArgumentObj() argument
2726 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetUnmapedJSArgumentObj()
2727 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeGetUnmapedJSArgumentObj()
2737 thread, JSTaggedValue(len)); in RuntimeGetUnmapedJSArgumentObj()
2743 obj->SetElements(thread, argumentsList.GetTaggedValue()); in RuntimeGetUnmapedJSArgumentObj()
2748 thread, globalEnv->GetArrayProtoValuesFunction().GetTaggedValue()); in RuntimeGetUnmapedJSArgumentObj()
2753 thread, accessorCaller.GetTaggedValue()); in RuntimeGetUnmapedJSArgumentObj()
2758 thread, accessorCallee.GetTaggedValue()); in RuntimeGetUnmapedJSArgumentObj()
2759 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetUnmapedJSArgumentObj()
2764 JSTaggedValue RuntimeStubs::RuntimeOptNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uin… in RuntimeOptNewLexicalEnvWithName() argument
2768 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptNewLexicalEnvWithName()
2771 newEnv->SetParentEnv(thread, currentLexEnv.GetTaggedValue()); in RuntimeOptNewLexicalEnvWithName()
2772 JSTaggedValue scopeInfo = RuntimeOptGenerateScopeInfo(thread, scopeId, func.GetTaggedValue()); in RuntimeOptNewLexicalEnvWithName()
2773 newEnv->SetScopeInfo(thread, scopeInfo); in RuntimeOptNewLexicalEnvWithName()
2774 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptNewLexicalEnvWithName()
2779 JSTaggedValue RuntimeStubs::RuntimeOptCopyRestArgs(JSThread *thread, uint32_t actualArgc, uint32_t … in RuntimeOptCopyRestArgs() argument
2786 JSHandle<JSTaggedValue> restArray = JSArray::ArrayCreate(thread, JSTaggedNumber(actualRestNum)); in RuntimeOptCopyRestArgs()
2788 auto argv = GetActualArgv(thread); in RuntimeOptCopyRestArgs()
2790 JSMutableHandle<JSTaggedValue> element(thread, JSTaggedValue::Undefined()); in RuntimeOptCopyRestArgs()
2796 JSObject::SetProperty(thread, restArray, idx++, element, true); in RuntimeOptCopyRestArgs()
2798 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptCopyRestArgs()
2802 JSTaggedValue RuntimeStubs::RuntimeOptSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeOptSuspendGenerator() argument
2811 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2818 generatorObjectHandle->SetTaskInfo(thread->GetTaskInfo()); in RuntimeOptSuspendGenerator()
2822 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2825 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2829 return RuntimeThrowTypeError(thread, "RuntimeSuspendGenerator failed"); in RuntimeOptSuspendGenerator()
2832 JSTaggedValue RuntimeStubs::RuntimeOptAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValu… in RuntimeOptAsyncGeneratorResolve() argument
2835 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeOptAsyncGeneratorResolve()
2839 …JSHandle<GeneratorContext> genContextHandle(thread, asyncGeneratorObjHandle->GetGeneratorContext()… in RuntimeOptAsyncGeneratorResolve()
2842 …return JSAsyncGeneratorObject::AsyncGeneratorResolve(thread, asyncGeneratorObjHandle, valueHandle,… in RuntimeOptAsyncGeneratorResolve()
2845 JSTaggedValue RuntimeStubs::RuntimeOptConstruct(JSThread *thread, JSHandle<JSTaggedValue> ctor, in RuntimeOptConstruct() argument
2854 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstruct()
2858 …return RuntimeOptConstructGeneric(thread, JSHandle<JSFunction>::Cast(ctor), newTarget, preArgs, ar… in RuntimeOptConstruct()
2862 thread, JSHandle<JSBoundFunction>::Cast(ctor), newTarget, preArgs, args); in RuntimeOptConstruct()
2865 … return RuntimeOptConstructProxy(thread, JSHandle<JSProxy>::Cast(ctor), newTarget, preArgs, args); in RuntimeOptConstruct()
2867 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor NonConstructor", JSTaggedValue::Exception()); in RuntimeOptConstruct()
2870 JSTaggedValue RuntimeStubs::RuntimeOptConstructProxy(JSThread *thread, JSHandle<JSProxy> ctor, in RuntimeOptConstructProxy() argument
2874 STACK_LIMIT_CHECK(thread, JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2876 JSHandle<JSTaggedValue> handler(thread, ctor->GetHandler()); in RuntimeOptConstructProxy()
2878 … THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor: handler is null", JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2881 JSHandle<JSTaggedValue> target(thread, ctor->GetTarget()); in RuntimeOptConstructProxy()
2884 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledProxyConstructString()); in RuntimeOptConstructProxy()
2885 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key); in RuntimeOptConstructProxy()
2888 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2894 return RuntimeOptConstruct(thread, target, newTgt, preArgs, args); in RuntimeOptConstructProxy()
2901 JSHandle<TaggedArray> arr = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(size); in RuntimeOptConstructProxy()
2906 arr->Set(thread, i, value); in RuntimeOptConstructProxy()
2912 arr->Set(thread, i + preArgsSize, value); in RuntimeOptConstructProxy()
2914 JSHandle<JSArray> newArr = JSArray::CreateArrayFromList(thread, arr); in RuntimeOptConstructProxy()
2918 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptConstructProxy()
2919 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, handler, undefined… in RuntimeOptConstructProxy()
2920 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2924 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2927 THROW_TYPE_ERROR_AND_RETURN(thread, "new object is not object", JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2933 JSTaggedValue RuntimeStubs::RuntimeOptConstructBoundFunction(JSThread *thread, JSHandle<JSBoundFunc… in RuntimeOptConstructBoundFunction() argument
2938 JSHandle<JSTaggedValue> target(thread, ctor->GetBoundTarget()); in RuntimeOptConstructBoundFunction()
2940 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstructBoundFunction()
2943 JSHandle<TaggedArray> boundArgs(thread, ctor->GetBoundArguments()); in RuntimeOptConstructBoundFunction()
2944 JSMutableHandle<JSTaggedValue> newPreArgs(thread, preArgs.GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2949 … TaggedArray::Append(thread, boundArgs, JSHandle<TaggedArray>::Cast(preArgs)).GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2951 JSMutableHandle<JSTaggedValue> newTargetMutable(thread, newTgt.GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2955 return RuntimeOptConstruct(thread, target, newTargetMutable, newPreArgs, args); in RuntimeOptConstructBoundFunction()
2958 JSTaggedValue RuntimeStubs::GetResultValue(JSThread *thread, bool isAotMethod, JSHandle<JSFunction>… in GetResultValue() argument
2965 const JSTaggedType *prevFp = thread->GetLastLeaveFrame(); in GetResultValue()
2974 resultValue = thread->GetEcmaVM()->FastCallAot(size, values.data(), prevFp); in GetResultValue()
2976 …resultValue = thread->GetCurrentEcmaContext()->ExecuteAot(size, values.data(), prevFp, needPushArg… in GetResultValue()
2980 … EcmaInterpreter::NewRuntimeCallInfo(thread, JSHandle<JSTaggedValue>(ctor), obj, newTgt, size); in GetResultValue()
2981 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetResultValue()
2988 JSTaggedValue RuntimeStubs::RuntimeOptConstructGeneric(JSThread *thread, JSHandle<JSFunction> ctor, in RuntimeOptConstructGeneric() argument
2993 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstructGeneric()
2996 JSHandle<JSTaggedValue> obj(thread, JSTaggedValue::Undefined()); in RuntimeOptConstructGeneric()
2998 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptConstructGeneric()
3000 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructGeneric()
3037 …JSTaggedValue resultValue = RuntimeStubs::GetResultValue(thread, isCompiledCode, ctor, values, new… in RuntimeOptConstructGeneric()
3038 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructGeneric()
3051 … THROW_TYPE_ERROR_AND_RETURN(thread, "function is non-constructor", JSTaggedValue::Exception()); in RuntimeOptConstructGeneric()
3056 JSTaggedValue RuntimeStubs::RuntimeOptNewObjRange(JSThread *thread, uintptr_t argv, uint32_t argc) in RuntimeOptNewObjRange() argument
3059 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptNewObjRange()
3063 JSHandle<TaggedArray> args = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(arrLength); in RuntimeOptNewObjRange()
3065 args->Set(thread, i, GetArg(argv, argc, i + firstArgOffset)); in RuntimeOptNewObjRange()
3067 JSTaggedValue object = RuntimeOptConstruct(thread, ctor, ctor, undefined, args); in RuntimeOptNewObjRange()
3068 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptNewObjRange()
3070 THROW_TYPE_ERROR_AND_RETURN(thread, "Derived constructor must return object or undefined", in RuntimeOptNewObjRange()
3076 JSTaggedValue RuntimeStubs::RuntimeOptGenerateScopeInfo(JSThread *thread, uint16_t scopeId, JSTagge… in RuntimeOptGenerateScopeInfo() argument
3078 EcmaVM *ecmaVm = thread->GetEcmaVM(); in RuntimeOptGenerateScopeInfo()
3082 JSHandle<ConstantPool> constpool(thread, method->GetConstantPool()); in RuntimeOptGenerateScopeInfo()
3085 LiteralDataExtractor::GetDatasIgnoreType(thread, jsPandaFile, id, constpool); in RuntimeOptGenerateScopeInfo()
3108 JSTaggedType *RuntimeStubs::GetActualArgv(JSThread *thread) in GetActualArgv() argument
3110 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetActualArgv()
3111 FrameIterator it(current, thread); in GetActualArgv()
3124 JSTaggedType *RuntimeStubs::GetActualArgvFromStub(JSThread *thread) in GetActualArgvFromStub() argument
3126 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetActualArgvFromStub()
3127 FrameIterator it(current, thread); in GetActualArgvFromStub()
3141 OptimizedJSFunctionFrame *RuntimeStubs::GetOptimizedJSFunctionFrame(JSThread *thread) in GetOptimizedJSFunctionFrame() argument
3143 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetOptimizedJSFunctionFrame()
3144 FrameIterator it(current, thread); in GetOptimizedJSFunctionFrame()
3151 OptimizedJSFunctionFrame *RuntimeStubs::GetOptimizedJSFunctionFrameNoGC(JSThread *thread) in GetOptimizedJSFunctionFrameNoGC() argument
3153 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetOptimizedJSFunctionFrameNoGC()
3154 FrameIterator it(current, thread); in GetOptimizedJSFunctionFrameNoGC()
3161 JSTaggedValue RuntimeStubs::RuntimeLdPatchVar(JSThread *thread, uint32_t index) in RuntimeLdPatchVar() argument
3164 JSHandle<TaggedArray>::Cast(thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalPatch()); in RuntimeLdPatchVar()
3166 return globalPatch->Get(thread, index); in RuntimeLdPatchVar()
3169 JSTaggedValue RuntimeStubs::RuntimeStPatchVar(JSThread *thread, uint32_t index, const JSHandle<JSTa… in RuntimeStPatchVar() argument
3171 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeStPatchVar()
3175 globalPatch = TaggedArray::SetCapacity(thread, globalPatch, index + 1); in RuntimeStPatchVar()
3177 globalPatch->Set(thread, index, value); in RuntimeStPatchVar()
3178 env->SetGlobalPatch(thread, globalPatch.GetTaggedValue()); in RuntimeStPatchVar()
3182 JSTaggedValue RuntimeStubs::RuntimeNotifyConcurrentResult(JSThread *thread, JSTaggedValue result, J… in RuntimeNotifyConcurrentResult() argument
3184 thread->GetEcmaVM()->TriggerConcurrentCallback(result, hint); in RuntimeNotifyConcurrentResult()
3188 JSTaggedValue RuntimeStubs::RuntimeUpdateAOTHClass(JSThread *thread, in RuntimeUpdateAOTHClass() argument
3192 JSHClass::ProcessAotHClassTransition(thread, oldhclass, newhclass, key); in RuntimeUpdateAOTHClass()
3197 JSTaggedValue RuntimeStubs::RuntimeDefineField(JSThread *thread, JSTaggedValue obj, in RuntimeDefineField() argument
3203 … THROW_TYPE_ERROR_AND_RETURN(thread, "DefineField: obj is not Object", JSTaggedValue::Exception()); in RuntimeDefineField()
3205 JSHandle<JSObject> handleObj(thread, obj); in RuntimeDefineField()
3206 JSHandle<JSTaggedValue> handleValue(thread, value); in RuntimeDefineField()
3207 …<JSTaggedValue> handleKey = JSTaggedValue::ToPropertyKey(thread, JSHandle<JSTaggedValue>(thread, p… in RuntimeDefineField()
3208 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefineField()
3210 … JSObject::CreateDataPropertyOrThrow(thread, handleObj, handleKey, handleValue, SCheckMode::CHECK); in RuntimeDefineField()
3211 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefineField()
3216 JSTaggedValue RuntimeStubs::RuntimeCreatePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeCreatePrivateProperty() argument
3219 ObjectFactory* factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreatePrivateProperty()
3220 JSHandle<LexicalEnv> handleLexicalEnv(thread, lexicalEnv); in RuntimeCreatePrivateProperty()
3221 JSHandle<ConstantPool> handleConstpool(thread, constpool); in RuntimeCreatePrivateProperty()
3222 JSHandle<JSTaggedValue> handleModule(thread, module); in RuntimeCreatePrivateProperty()
3224 thread, thread->GetCurrentEcmaContext()->FindOrCreateUnsharedConstpool(constpool)); in RuntimeCreatePrivateProperty()
3233 JSHandle<TaggedArray> aotSymbolInfoHandle(thread, aotSymbolInfo); in RuntimeCreatePrivateProperty()
3234 FrameHandler frameHandler(thread); in RuntimeCreatePrivateProperty()
3243 symbolHandle = JSHandle<JSSymbol>(thread, symbol); in RuntimeCreatePrivateProperty()
3249 handleLexicalEnv->SetProperties(thread, index, symbolHandle.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3253 ConstantPool::GetClassLiteralFromCache(thread, unsharedConstpoolHandle, literalId, entry); in RuntimeCreatePrivateProperty()
3254 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreatePrivateProperty()
3255 JSHandle<TaggedArray> literalBuffer(thread, classLiteral->GetArray()); in RuntimeCreatePrivateProperty()
3264 JSMutableHandle<JSTaggedValue> literalValue(thread, JSTaggedValue::Undefined()); in RuntimeCreatePrivateProperty()
3270 func->SetLexicalEnv(thread, handleLexicalEnv.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3271 func->SetModule(thread, handleModule.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3274 … handleLexicalEnv->SetProperties(thread, startIndex + count + i, literalValue.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3282 symbolHandle = JSHandle<JSSymbol>(thread, symbol); in RuntimeCreatePrivateProperty()
3288 handleLexicalEnv->SetProperties(thread, index, symbolHandle.GetTaggedValue()); in RuntimeCreatePrivateProperty()
3293 JSTaggedValue RuntimeStubs::RuntimeDefinePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, in RuntimeDefinePrivateProperty() argument
3303 …JSHandle<JSTaggedValue> handleObj(thread, obj.IsJSProxy() ? JSProxy::Cast(obj)->GetPrivateField() … in RuntimeDefinePrivateProperty()
3304 JSHandle<JSTaggedValue> handleKey(thread, key); in RuntimeDefinePrivateProperty()
3305 JSHandle<JSTaggedValue> handleValue(thread, value); in RuntimeDefinePrivateProperty()
3306 PropertyDescriptor desc(thread); in RuntimeDefinePrivateProperty()
3308 JSTaggedValue::GetOwnProperty(thread, handleObj, handleKey, desc)) { in RuntimeDefinePrivateProperty()
3309 …THROW_TYPE_ERROR_AND_RETURN(thread, "invalid private key or already exists", JSTaggedValue::Except… in RuntimeDefinePrivateProperty()
3311 bool extensible = handleObj->IsExtensible(thread); in RuntimeDefinePrivateProperty()
3313 …THROW_TYPE_ERROR_AND_RETURN(thread, "DefinePrivateProperty obj is undefined", JSTaggedValue::Excep… in RuntimeDefinePrivateProperty()
3316 THROW_TYPE_ERROR_AND_RETURN(thread, "shared obj cannot use # to define private property", in RuntimeDefinePrivateProperty()
3323 bool result = JSObject::CreateDataPropertyOrThrow(thread, JSHandle<JSObject>::Cast(handleObj), in RuntimeDefinePrivateProperty()
3325 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefinePrivateProperty()
3329 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDefinePrivateProperty()
3333 JSTaggedValue RuntimeStubs::RuntimeNotifyDebuggerStatement(JSThread *thread) in RuntimeNotifyDebuggerStatement() argument
3335 FrameHandler frameHandler(thread); in RuntimeNotifyDebuggerStatement()
3345 auto *debuggerMgr = thread->GetEcmaVM()->GetJsDebuggerManager(); in RuntimeNotifyDebuggerStatement()
3346 debuggerMgr->GetNotificationManager()->DebuggerStmtEvent(thread, method, bcOffset); in RuntimeNotifyDebuggerStatement()
3363 JSHandle<JSTaggedValue> RuntimeStubs::GetOrCreateNumberString(JSThread *thread, JSHandle<JSTaggedVa… in GetOrCreateNumberString() argument
3366 JSMutableHandle<JSTaggedValue> presentString(thread, JSTaggedValue::Undefined()); in GetOrCreateNumberString()
3371 presentString.Update(JSTaggedValue::ToString(thread, presentValue).GetTaggedValue()); in GetOrCreateNumberString()
3377 JSTaggedValue RuntimeStubs::TryCopyCOWArray(JSThread *thread, JSHandle<JSArray> holderHandler, bool… in TryCopyCOWArray() argument
3380 JSArray::CheckAndCopyArray(thread, holderHandler); in TryCopyCOWArray()
3386 JSTaggedValue RuntimeStubs::ArrayNumberSort(JSThread *thread, JSHandle<JSObject> thisObj, uint32_t … in ArrayNumberSort() argument
3388 JSMutableHandle<JSTaggedValue> presentValue(thread, JSTaggedValue::Undefined()); in ArrayNumberSort()
3389 JSMutableHandle<JSTaggedValue> middleValue(thread, JSTaggedValue::Undefined()); in ArrayNumberSort()
3390 JSMutableHandle<JSTaggedValue> previousValue(thread, JSTaggedValue::Undefined()); in ArrayNumberSort()
3392 JSMutableHandle<TaggedArray> elements(thread, thisObj->GetElements()); in ArrayNumberSort()
3398 …JSHandle<JSTaggedValue> presentString = GetOrCreateNumberString(thread, presentValue, cachedString… in ArrayNumberSort()
3402 … JSHandle<JSTaggedValue> middleString = GetOrCreateNumberString(thread, middleValue, cachedString); in ArrayNumberSort()
3403 … double compareResult = ArrayHelper::StringSortCompare(thread, middleString, presentString); in ArrayNumberSort()
3404 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception()); in ArrayNumberSort()
3414 elements.Update(TryCopyCOWArray(thread, JSHandle<JSArray>(thisObj), isCOWArray)); in ArrayNumberSort()
3415 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception()); in ArrayNumberSort()
3416 elements->Set(thread, j, previousValue); in ArrayNumberSort()
3418 elements.Update(TryCopyCOWArray(thread, JSHandle<JSArray>(thisObj), isCOWArray)); in ArrayNumberSort()
3419 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Exception()); in ArrayNumberSort()
3420 elements->Set(thread, endIndex, presentValue); in ArrayNumberSort()
3428 auto thread = JSThread::GlueToJSThread(argGlue); in RuntimeTryGetInternString() local
3430 thread->GetEcmaVM()->GetEcmaStringTable()->TryGetInternString(thread, string); in RuntimeTryGetInternString()