Previewer load merged abc from buffer

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5UO63

Signed-off-by: panzhenyu1 <panzhenyu1@huawei.com>
Change-Id: I2cd6212bb94f32537390df143af71d990dcf59d5
This commit is contained in:
panzhenyu1 2022-10-09 15:58:02 +08:00
parent f4371933e3
commit eedee40505

View File

@ -97,7 +97,16 @@ Expected<JSTaggedValue, bool> JSPandaFileExecutor::ExecuteModuleBuffer(
JSThread *thread, const void *buffer, size_t size, const CString &filename)
{
LOG_ECMA(DEBUG) << "JSPandaFileExecutor::ExecuteModuleBuffer filename" << filename.c_str();
CString name = JSPandaFile::MERGE_ABC_PATH;
CString name;
#if !WIN_OR_MAC_PLATFORM
name = JSPandaFile::MERGE_ABC_PATH;
#elif defined(PANDA_TARGET_WINDOWS)
CString assetPath = thread->GetEcmaVM()->GetAssetPath().c_str();
name = assetPath + "\\modules.abc";
#else
CString assetPath = thread->GetEcmaVM()->GetAssetPath().c_str();
name = assetPath + "/modules.abc";
#endif
CString entry = ConvertToString(JSPandaFile::ParseOhmUrl(filename.c_str()));
const JSPandaFile *jsPandaFile =
JSPandaFileManager::GetInstance()->LoadJSPandaFile(thread, name, entry.c_str(), buffer, size);