Lines Matching defs:thread

29 void JSFunction::InitializeJSFunction(JSThread *thread, const JSHandle<JSFunction> &func, FunctionKind kind)
31 InitializeWithDefaultValue(thread, func);
32 auto globalConst = thread->GlobalConstants();
37 func->SetPropertyInlinedProps(thread, PROTOTYPE_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
39 func->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
41 func->SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
44 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
45 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
48 JSObject::SetPrototype(thread, initialGeneratorFuncPrototype, env->GetAsyncGeneratorPrototype());
49 func->SetProtoOrHClass(thread, initialGeneratorFuncPrototype);
53 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
54 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
57 JSObject::SetPrototype(thread, initialGeneratorFuncPrototype, env->GetGeneratorPrototype());
58 func->SetProtoOrHClass(thread, initialGeneratorFuncPrototype);
61 PropertyDescriptor desc(thread, accessor, kind != FunctionKind::BUILTIN_CONSTRUCTOR, false, false);
63 thread, JSHandle<JSObject>(func), globalConst->GetHandledPrototypeString(), desc, SCheckMode::SKIP);
68 func->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
70 func->SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
74 void JSFunction::InitializeSFunction(JSThread *thread, const JSHandle<JSFunction> &func, FunctionKind kind)
76 InitializeWithDefaultValue(thread, func);
77 auto globalConst = thread->GlobalConstants();
81 func->SetPropertyInlinedProps(thread, PROTOTYPE_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
84 func->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
86 func->SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue());
90 void JSFunction::InitializeWithDefaultValue(JSThread *thread, const JSHandle<JSFunction> &func)
92 func->SetProtoOrHClass(thread, JSTaggedValue::Hole(), SKIP_BARRIER);
93 func->SetHomeObject(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
95 func->SetLexicalEnv(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
96 func->SetMachineCode(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
97 func->SetBaselineCode(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
98 func->SetRawProfileTypeInfo(thread, thread->GlobalConstants()->GetEmptyProfileTypeInfoCell(), SKIP_BARRIER);
99 func->SetMethod(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
100 func->SetModule(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
101 func->SetProtoTransRootHClass(thread, JSTaggedValue::Undefined(), SKIP_BARRIER);
107 JSHandle<JSObject> JSFunction::NewJSFunctionPrototype(JSThread *thread, const JSHandle<JSFunction> &func)
109 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
110 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
117 JSHandle<JSObject> funPro = thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(objFun);
118 SetFunctionPrototypeOrInstanceHClass(thread, func, funPro.GetTaggedValue());
122 PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(func), true, false, true);
123 JSObject::DefineOwnProperty(thread, funPro, constructorKey, descriptor);
128 JSHClass *JSFunction::GetOrCreateInitialJSHClass(JSThread *thread, const JSHandle<JSFunction> &fun)
138 proto = JSHandle<JSTaggedValue>::Cast(NewJSFunctionPrototype(thread, fun));
139 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) {
140 thread->GetEcmaVM()->GetPGOProfiler()->ProfileClassRootHClass(fun.GetTaggedType(),
144 proto = JSHandle<JSTaggedValue>(thread, fun->GetProtoOrHClass());
148 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
150 fun->SetProtoOrHClass(thread, hclass);
151 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) {
153 thread->GetEcmaVM()->GetPGOProfiler()->ProfileClassRootHClass(fun.GetTaggedType(), hclass.GetTaggedType());
155 thread->GetEcmaVM()->GetPGOProfiler()->ProfileProtoTransitionClass(fun, hclass, proto);
161 JSTaggedValue JSFunction::PrototypeGetter(JSThread *thread, const JSHandle<JSObject> &self)
165 JSHandle<JSTaggedValue> proto = JSHandle<JSTaggedValue>::Cast(NewJSFunctionPrototype(thread, func));
166 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) {
167 thread->GetEcmaVM()->GetPGOProfiler()->ProfileClassRootHClass(func.GetTaggedType(),
174 bool JSFunction::PrototypeSetter(JSThread *thread, const JSHandle<JSObject> &self, const JSHandle<JSTaggedValue> &value,
181 JSHandle<JSHClass> hclass(thread, JSHClass::Cast(protoOrHClass.GetTaggedObject()));
182 JSHandle<JSHClass> newClass = JSHClass::SetPrototypeWithNotification(thread, hclass, value);
183 func->SetProtoOrHClass(thread, newClass);
185 if (!hclass->IsTS() && thread->GetEcmaVM()->IsEnablePGOProfiler()) {
187 thread->GetEcmaVM()->GetPGOProfiler()->InsertSkipCtorMethodIdSafe(ctorMethodId);
191 func->SetProtoOrHClass(thread, value.GetTaggedValue());
195 bool enablePgo = thread->GetEcmaVM()->IsEnablePGOProfiler();
196 JSMutableHandle<JSTaggedValue> oldPrototype(thread, func->GetProtoOrHClass());
199 oldPrototype.Update(JSHandle<JSTaggedValue>::Cast(NewJSFunctionPrototype(thread, func)));
201 JSHandle<JSTaggedValue> baseIhc(thread, value->GetTaggedObject()->GetClass());
202 func->SetProtoOrHClass(thread, value.GetTaggedValue());
203 JSHClass::OptimizePrototypeForIC(thread, value, true);
204 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) {
205 thread->GetEcmaVM()->GetPGOProfiler()->ProfileProtoTransitionPrototype(func, value, oldPrototype, baseIhc);
211 void JSFunction::SetFunctionPrototypeOrInstanceHClass(const JSThread *thread, const JSHandle<JSFunction> &fun,
214 JSHandle<JSTaggedValue> protoHandle(thread, protoOrHClass);
215 fun->SetProtoOrHClass(thread, protoHandle.GetTaggedValue());
217 protoHandle = JSHandle<JSTaggedValue>(thread,
221 JSHClass::OptimizePrototypeForIC(thread, protoHandle);
225 EcmaString* JSFunction::GetFunctionNameString(JSThread *thread, JSHandle<EcmaString> concatString,
234 JSHandle<JSTaggedValue> methodName(thread,
243 JSTaggedValue JSFunction::NameGetter(JSThread *thread, const JSHandle<JSObject> &self)
246 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
247 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
249 JSHandle<JSTaggedValue> target(thread, boundFunction->GetBoundTarget());
252 JSHandle<JSTaggedValue> boundName = thread->GlobalConstants()->GetHandledBoundString();
253 JSHandle<JSTaggedValue> targetName = JSObject::GetProperty(thread, target, nameKey).GetValue();
254 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
256 JSHandle<EcmaString> handlePrefixString = JSTaggedValue::ToString(thread, boundName);
262 newString = GetFunctionNameString(thread, concatString, factory, target);
281 return thread->GlobalConstants()->GetEmptyString();
283 ObjectFactory* factory = thread->GetEcmaVM()->GetFactory();
287 JSHandle<EcmaString>(thread->GlobalConstants()->GetHandledGetWithSpaceString()), nameHdl).GetTaggedValue();
291 JSHandle<EcmaString>(thread->GlobalConstants()->GetHandledSetWithSpaceString()), nameHdl).GetTaggedValue();
296 JSTaggedValue JSFunction::LengthGetter(JSThread *thread, const JSHandle<JSObject> &self)
300 JSMutableHandle<JSBoundFunction> boundFunction(thread, self.GetTaggedValue());
301 JSHandle<JSTaggedValue> arguments(thread, boundFunction->GetBoundArguments());
308 JSHandle<JSTaggedValue> target(thread, boundFunction->GetBoundTarget());
309 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString();
312 JSTaggedValue::HasOwnProperty(thread, target, lengthKey);
313 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
316 JSHandle<JSTaggedValue> targetLength = JSTaggedValue::GetProperty(thread, target, lengthKey).GetValue();
317 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
320 std::max(0.0, JSTaggedValue::ToNumber(thread, targetLength).GetNumber() -
322 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
332 bool JSFunction::OrdinaryHasInstance(JSThread *thread, const JSHandle<JSTaggedValue> &constructor,
344 STACK_LIMIT_CHECK(thread, false);
345 JSHandle<JSBoundFunction> boundFunction(thread, JSBoundFunction::Cast(constructor->GetTaggedObject()));
347 return JSObject::InstanceOf(thread, obj, JSHandle<JSTaggedValue>(thread, boundTarget));
355 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
357 JSMutableHandle<JSTaggedValue> constructorPrototype(thread, JSTaggedValue::Undefined());
359 JSHandle<JSFunction> ctor(thread, constructor->GetTaggedObject());
360 JSHandle<JSTaggedValue> ctorProtoOrHclass(thread, ctor->GetProtoOrHClass());
369 constructorPrototype.Update(JSTaggedValue::GetProperty(thread, constructor, prototypeString).GetValue());
372 constructorPrototype.Update(JSTaggedValue::GetProperty(thread, constructor, prototypeString).GetValue());
377 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
381 THROW_TYPE_ERROR_AND_RETURN(thread, "HasInstance: is not Object", false);
389 JSMutableHandle<JSTaggedValue> object(thread, obj.GetTaggedValue());
391 object.Update(JSTaggedValue::GetPrototype(thread, object));
392 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
400 bool JSFunction::MakeConstructor(JSThread *thread, const JSHandle<JSFunction> &func,
405 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv();
406 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
411 ASSERT_PRINT(JSObject::HasProperty(thread, JSHandle<JSObject>(func), constructorKey),
419 PropertyDescriptor constructorDesc(thread, JSHandle<JSTaggedValue>::Cast(func), writable, false, true);
420 status = JSTaggedValue::DefinePropertyOrThrow(thread, objPrototype, constructorKey, constructorDesc);
422 PropertyDescriptor constructorDesc(thread, JSHandle<JSTaggedValue>::Cast(func), writable, false, true);
423 status = JSTaggedValue::DefinePropertyOrThrow(thread, proto, constructorKey, constructorDesc);
425 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
431 SetFunctionPrototypeOrInstanceHClass(thread, func, proto.GetTaggedValue());
443 JSThread *thread = info->GetThread();
445 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
450 RETURN_STACK_BEFORE_THROW_IF_ASM(thread);
451 THROW_TYPE_ERROR_AND_RETURN(thread, "Callable is false", JSTaggedValue::Exception());
456 RETURN_STACK_BEFORE_THROW_IF_ASM(thread);
457 THROW_TYPE_ERROR_AND_RETURN(thread, "class constructor cannot call", JSTaggedValue::Exception());
468 JSThread *thread = info->GetThread();
476 RETURN_STACK_BEFORE_THROW_IF_ASM(thread);
477 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception());
497 JSThread *thread = info->GetThread();
499 JSHandle<JSTaggedValue> func(JSTaggedValue::GetProperty(thread, thisArg, key).GetValue());
500 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
505 JSTaggedValue JSFunction::InvokeOptimizedEntrypoint(JSThread *thread, JSHandle<JSFunction> mainFunc,
508 ASSERT(thread->IsInManagedState());
511 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
514 thread->SetException(error.GetTaggedValue());
516 return thread->GetException();
520 const JSTaggedType *prevFp = thread->GetLastLeaveFrame();
524 RuntimeStubs::StartCallTimer(thread->GetGlueAddr(), mainFunc.GetTaggedType(), true);
529 res = thread->GetEcmaVM()->FastCallAot(actualNumArgs, args.data(), prevFp);
533 res = thread->GetCurrentEcmaContext()->ExecuteAot(actualNumArgs, args.data(), prevFp, false);
536 RuntimeStubs::EndCallTimer(thread->GetGlueAddr(), mainFunc.GetTaggedType());
538 if (thread->HasPendingException()) {
539 return thread->GetException();
575 JSTaggedValue JSFunction::InvokeOptimizedEntrypoint(JSThread *thread, JSHandle<JSFunction> func,
578 ASSERT(thread->IsInManagedState());
583 const JSTaggedType *prevFp = thread->GetLastLeaveFrame();
585 RuntimeStubs::StartCallTimer(thread->GetGlueAddr(), func.GetTaggedType(), true);
589 info = EcmaInterpreter::ReBuildRuntimeCallInfo(thread, info, numArgs);
590 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
594 resultValue = thread->GetEcmaVM()->FastCallAot(info->GetArgsNumber(), stackArgs + 1, prevFp);
596 resultValue = thread->GetCurrentEcmaContext()->ExecuteAot(info->GetArgsNumber(),
600 RuntimeStubs::EndCallTimer(thread->GetGlueAddr(), func.GetTaggedType());
609 JSThread *thread = info->GetThread();
611 JSHandle<JSFunction> func(thread, info->GetFunction().GetTaggedValue());
615 RETURN_STACK_BEFORE_THROW_IF_ASM(thread);
616 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception());
619 JSHandle<JSTaggedValue> obj(thread, JSTaggedValue::Undefined());
621 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
623 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
629 resultValue = InvokeOptimizedEntrypoint(thread, func, info);
630 const JSTaggedType *curSp = thread->GetCurrentSPFrame();
633 thread->SetCurrentSPFrame(prevSp);
637 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
648 THROW_TYPE_ERROR_AND_RETURN(thread,
654 RETURN_STACK_BEFORE_THROW_IF_ASM(thread);
655 THROW_TYPE_ERROR_AND_RETURN(thread, "function is non-constructor", JSTaggedValue::Exception());
660 JSHandle<JSTaggedValue> JSFunctionBase::GetFunctionName(JSThread *thread, const JSHandle<JSFunctionBase> &func)
662 JSHandle<JSTaggedValue> nameKey = thread->GlobalConstants()->GetHandledNameString();
664 return JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(func), nameKey).GetValue();
667 bool JSFunctionBase::SetFunctionName(JSThread *thread, const JSHandle<JSFunctionBase> &func,
673 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
674 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
686 JSHandle<EcmaString> descriptionHandle(thread, description);
700 JSHandle<EcmaString> handlePrefixString = JSTaggedValue::ToString(thread, prefix);
707 JSHandle<JSTaggedValue> nameHandle(thread, newString);
719 PropertyDescriptor nameDesc(thread, nameHandle, false, false, true);
721 return JSTaggedValue::DefinePropertyOrThrow(thread, funcHandle, nameKey, nameDesc);
724 bool JSFunction::SetFunctionLength(JSThread *thread, const JSHandle<JSFunction> &func, JSTaggedValue length, bool cfg)
728 JSHandle<JSTaggedValue> lengthKeyHandle = thread->GlobalConstants()->GetHandledLengthString();
729 ASSERT_PRINT(!JSTaggedValue::Less(thread, JSHandle<JSTaggedValue>(thread, length),
730 JSHandle<JSTaggedValue>(thread, JSTaggedValue(0))),
732 PropertyDescriptor lengthDesc(thread, JSHandle<JSTaggedValue>(thread, length), false, false, cfg);
734 return JSTaggedValue::DefinePropertyOrThrow(thread, funcHandle, lengthKeyHandle, lengthDesc);
740 JSThread *thread = info->GetThread();
742 JSHandle<JSTaggedValue> target(thread, func->GetBoundTarget());
744 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception());
747 JSMutableHandle<JSTaggedValue> newTargetMutable(thread, newTarget.GetTaggedValue());
752 JSHandle<TaggedArray> boundArgs(thread, func->GetBoundArguments());
755 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined();
764 thread->SetCurrentSPFrame(prevSp);
766 EcmaInterpreter::NewRuntimeCallInfo(thread, target, undefined, newTargetMutable, argsLength);
767 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
777 void JSProxyRevocFunction::ProxyRevocFunctions(const JSThread *thread, const JSHandle<JSProxyRevocFunction> &revoker)
787 revoker->SetRevocableProxy(thread, JSTaggedValue::Null());
791 JSHandle<JSProxy> proxyHandle(thread, proxy);
794 proxyHandle->SetTarget(thread, JSTaggedValue::Null());
795 proxyHandle->SetHandler(thread, JSTaggedValue::Null());
806 JSTaggedValue JSIntlBoundFunction::IntlNameGetter(JSThread *thread, [[maybe_unused]] const JSHandle<JSObject> &self)
808 return thread->GlobalConstants()->GetEmptyString();
811 void JSFunction::SetFunctionNameNoPrefix(JSThread *thread, JSFunction *func, JSTaggedValue name)
814 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
815 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
817 JSHandle<JSTaggedValue> funcHandle(thread, func);
819 JSMutableHandle<JSTaggedValue> nameHandle(thread, JSTaggedValue::Undefined());
823 JSHandle<JSTaggedValue> nameBegin(thread, name);
831 JSHandle<EcmaString>(thread, JSSymbol::Cast(nameBegin->GetTaggedObject())->GetDescription()));
836 PropertyDescriptor nameDesc(thread, nameHandle, false, false, true);
837 JSTaggedValue::DefinePropertyOrThrow(thread, funcHandle, globalConst->GetHandledNameString(), nameDesc);
841 JSHandle<JSHClass> JSFunction::GetInstanceJSHClass(JSThread *thread, JSHandle<JSFunction> constructor,
844 JSHandle<JSHClass> ctorInitialJSHClass(thread, JSFunction::GetOrCreateInitialJSHClass(thread, constructor));
854 JSMutableHandle<JSTaggedValue> mutableNewTarget(thread, newTarget.GetTaggedValue());
855 JSMutableHandle<JSTaggedValue> mutableNewTargetProto(thread, JSTaggedValue::Undefined());
857 mutableNewTargetProto.Update(JSTaggedValue::GetPrototype(thread, mutableNewTarget));
858 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSHClass, thread);
860 return GetOrCreateDerivedJSHClass(thread, newTargetFunc, ctorInitialJSHClass);
868 JSMutableHandle<JSTaggedValue> prototype(thread, JSTaggedValue::Undefined());
873 prototype.Update(PrototypeGetter(thread, JSHandle<JSObject>::Cast(newTargetFunc)));
878 JSTaggedValue::GetProperty(thread, newTarget, thread->GlobalConstants()->GetHandledPrototypeString())
880 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSHClass, thread);
883 ctorInitialJSHClass = JSHandle<JSHClass>(thread, JSFunction::GetOrCreateInitialJSHClass(thread, constructor));
890 JSHandle<JSHClass> newJSHClass = JSHClass::Clone(thread, ctorInitialJSHClass);
892 newJSHClass->SetPrototype(thread, prototype);
897 JSHandle<JSHClass> JSFunction::GetOrCreateDerivedJSHClass(JSThread *thread, JSHandle<JSFunction> derived,
903 return JSHandle<JSHClass>(thread, protoOrHClass);
906 JSHandle<JSHClass> newJSHClass = JSHClass::Clone(thread, ctorInitialJSHClass);
909 JSHandle<JSTaggedValue> prototype(thread, derived->GetProtoOrHClass());
911 newJSHClass->SetPrototype(thread, prototype);
912 derived->SetProtoOrHClass(thread, newJSHClass);
914 if (thread->GetEcmaVM()->IsEnablePGOProfiler()) {
915 thread->GetEcmaVM()->GetPGOProfiler()->ProfileClassRootHClass(derived.GetTaggedType(),
936 void JSFunction::InitializeJSFunction(JSThread *thread, [[maybe_unused]] const JSHandle<GlobalEnv> &env,
939 InitializeJSFunction(thread, func, kind);
942 bool JSFunction::NameSetter(JSThread *thread, const JSHandle<JSObject> &self, const JSHandle<JSTaggedValue> &value,
947 JSHandle<JSTaggedValue> nameString = thread->GlobalConstants()->GetHandledNameString();
948 return self->UpdatePropertyInDictionary(thread, nameString.GetTaggedValue(), value.GetTaggedValue());
950 self->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, value.GetTaggedValue());
955 void JSFunction::SetFunctionLength(const JSThread *thread, JSTaggedValue length)
958 SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, length);
961 void JSFunction::SetFunctionExtraInfo(JSThread *thread, void *nativeFunc, const NativePointerCallback &deleter,
965 EcmaVM *vm = thread->GetEcmaVM();
966 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(hashField));
967 JSHandle<ECMAObject> obj(thread, this);
971 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, pointer.GetTaggedValue().GetRawData());
976 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, pointer.GetTaggedValue().GetRawData());
983 array->Set(thread, nativeFieldCount + FUNCTION_EXTRA_INDEX, pointer);
988 newArray->Set(thread, i, array->Get(i));
990 newArray->Set(thread, nativeFieldCount + HASH_INDEX, array->Get(nativeFieldCount + HASH_INDEX));
991 newArray->Set(thread, nativeFieldCount + FUNCTION_EXTRA_INDEX, pointer);
992 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, newArray.GetTaggedValue().GetRawData());
997 newArray->Set(thread, HASH_INDEX, value);
998 newArray->Set(thread, FUNCTION_EXTRA_INDEX, pointer);
999 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, newArray.GetTaggedValue().GetRawData());
1004 JSThread *thread, void *nativeFunc, const NativePointerCallback &deleter, void *data, size_t nativeBindingsize)
1007 EcmaVM *vm = thread->GetEcmaVM();
1008 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(hashField));
1009 JSHandle<ECMAObject> obj(thread, this);
1013 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, pointer.GetTaggedValue().GetRawData());
1018 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, pointer.GetTaggedValue().GetRawData());
1025 array->Set(thread, nativeFieldCount + FUNCTION_EXTRA_INDEX, pointer);
1031 newArray->Set(thread, i, array->Get(i));
1033 newArray->Set(thread, nativeFieldCount + HASH_INDEX, array->Get(nativeFieldCount + HASH_INDEX));
1034 newArray->Set(thread, nativeFieldCount + FUNCTION_EXTRA_INDEX, pointer);
1035 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, newArray.GetTaggedValue().GetRawData());
1040 newArray->Set(thread, HASH_INDEX, value);
1041 newArray->Set(thread, FUNCTION_EXTRA_INDEX, pointer);
1042 Barriers::SetObject<true>(thread, *obj, HASH_OFFSET, newArray.GetTaggedValue().GetRawData());
1046 void JSFunction::SetProfileTypeInfo(const JSThread *thread, const JSHandle<JSFunction> &func,
1049 JSHandle<ProfileTypeInfoCell> handleRaw(thread, func->GetRawProfileTypeInfo());
1050 if (handleRaw->IsEmptyProfileTypeInfoCell(thread)) {
1052 thread->GetEcmaVM()->GetFactory()->NewProfileTypeInfoCell(value);
1053 func->SetRawProfileTypeInfo(thread, handleProfileTypeInfoCell, WRITE_BARRIER);
1056 handleRaw->SetValue(thread, value, mode);
1059 void JSFunction::UpdateProfileTypeInfoCell(JSThread *thread, JSHandle<FunctionTemplate> literalFunc,
1065 if (profileTypeInfoCell->IsEmptyProfileTypeInfoCell(thread)) {
1066 JSHandle<JSTaggedValue> handleUndefined(thread, JSTaggedValue::Undefined());
1068 thread->GetEcmaVM()->GetFactory()->NewProfileTypeInfoCell(handleUndefined);
1069 literalFunc->SetRawProfileTypeInfo(thread, newProfileTypeInfoCell);
1070 targetFunc->SetRawProfileTypeInfo(thread, newProfileTypeInfoCell);
1072 ProfileTypeInfoCell::Cast(profileTypeInfoCell)->UpdateProfileTypeInfoCellType(thread);
1073 targetFunc->SetRawProfileTypeInfo(thread, profileTypeInfoCellVal);
1077 void JSFunction::SetJitMachineCodeCache(const JSThread *thread, const JSHandle<MachineCode> &machineCode)
1079 JSHandle<ProfileTypeInfoCell> handleRaw(thread, GetRawProfileTypeInfo());
1080 ASSERT(!handleRaw->IsEmptyProfileTypeInfoCell(thread));
1081 handleRaw->SetMachineCode(thread, machineCode.GetTaggedValue().CreateAndGetWeakRef(), WRITE_BARRIER);
1118 void JSFunction::InitializeForConcurrentFunction(JSThread *thread, JSHandle<JSFunction> &func)
1120 JSHandle<Method> method(thread, func->GetMethod());
1121 JSMutableHandle<JSTaggedValue> sendableEnv(thread, JSTaggedValue::Undefined());
1145 ecmascript::ModuleManager *moduleManager = thread->GetCurrentEcmaContext()->GetModuleManager();
1155 RETURN_IF_ABRUPT_COMPLETION(thread);
1156 ecmascript::SourceTextModule::Instantiate(thread, moduleRecord);
1159 ecmascript::SourceTextModule::EvaluateForConcurrent(thread, module, method);
1162 SourceTextModule::Cast(sendableClassRecord.GetTaggedValue())->SetSendableEnv(thread, sendableEnv);
1163 func->SetModule(thread, sendableClassRecord);
1165 func->SetModule(thread, moduleRecord);
1169 auto *notificationMgr = thread->GetEcmaVM()->GetJsDebuggerManager()->GetNotificationManager();
1198 void JSFunction::SetJitCompiledFuncEntry(JSThread *thread, JSHandle<MachineCode> &machineCode, bool isFastCall)
1203 SetMachineCode(thread, machineCode);
1213 void JSFunction::ClearMachineCode(const JSThread *thread)
1215 SetMachineCode(thread, JSTaggedValue::Undefined());