!10151 修复抖音aot后cppcrash问题

Merge pull request !10151 from zhao1d/zld1
This commit is contained in:
openharmony_ci 2024-11-08 02:28:32 +00:00 committed by Gitee
commit c45e2140c1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 12 additions and 0 deletions

View File

@ -1942,6 +1942,12 @@ JSHandle<JSHClass> ObjectFactory::CreateDefaultClassConstructorHClass(JSHClass *
return defaultHclass;
}
void ObjectFactory::SetCodeEntryToFunctionFromMethod(const JSHandle<JSFunction> &func, const JSHandle<Method> &mothed)
{
uintptr_t entry = mothed->GetCodeEntryOrLiteral();
func->SetCodeEntry(entry);
}
JSHandle<JSFunction> ObjectFactory::NewJSFunctionByHClass(const JSHandle<Method> &method,
const JSHandle<JSHClass> &clazz,
MemSpaceType type)
@ -1969,6 +1975,8 @@ JSHandle<JSFunction> ObjectFactory::NewJSFunctionByHClass(const JSHandle<Method>
if (method->IsAotWithCallField()) {
thread_->GetEcmaVM()->GetAOTFileManager()->
SetAOTFuncEntry(method->GetJSPandaFile(), *function, *method);
} else {
SetCodeEntryToFunctionFromMethod(function, method);
}
return function;
}

View File

@ -892,6 +892,8 @@ public:
JSHandle<SendableEnv> NewSendableEnv(int numSlots);
JSHandle<JSFunction> NewJSSendableFunction(const JSHandle<Method> &methodHandle);
void SetCodeEntryToFunctionFromMethod(const JSHandle<JSFunction> &func, const JSHandle<Method> &mothed);
private:
friend class GlobalEnv;
friend class GlobalEnvConstants;

View File

@ -245,6 +245,8 @@ JSHandle<JSFunction> ObjectFactory::NewSFunctionByHClass(const JSHandle<Method>
if (method->IsAotWithCallField()) {
thread_->GetEcmaVM()->GetAOTFileManager()->
SetAOTFuncEntry(method->GetJSPandaFile(), *function, *method);
} else {
SetCodeEntryToFunctionFromMethod(function, method);
}
return function;
}