From 66303a26b28674a80120117a17898632c19b30c4 Mon Sep 17 00:00:00 2001 From: zhuoli Date: Sat, 26 Nov 2022 19:48:05 +0800 Subject: [PATCH 1/3] Fix missing regKind for regAlloc ISSUE: I630JA Signed-off-by: zhuoli Change-Id: If2adc40dce2416d34cc826403676751c48906e4f --- es2panda/compiler/core/regAllocator.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/es2panda/compiler/core/regAllocator.h b/es2panda/compiler/core/regAllocator.h index 202d43a126..dd0f440c5f 100644 --- a/es2panda/compiler/core/regAllocator.h +++ b/es2panda/compiler/core/regAllocator.h @@ -85,17 +85,16 @@ private: std::vector *regsKind = nullptr) { Formats formats = ins->GetFormats(); - limit_ = 0; for (const auto &format : formats) { + limit_ = 0; for (const auto &formatItem : format.GetFormatItem()) { if (regsKind && formatItem.IsVReg()) { regsKind->push_back(formatItem.Kind()); } - if (formatItem.IsVReg()) { + if (formatItem.IsVReg() && limit_ == 0) { limit_ = 1 << formatItem.Bitwidth(); - break; } } -- Gitee From 8207b993ebe56ea27b4b06de4e9e4bd3b33d190e Mon Sep 17 00:00:00 2001 From: zhuoli Date: Mon, 28 Nov 2022 12:07:04 +0800 Subject: [PATCH 2/3] Remove static linkage for ark binaries ISSUE: I630JA Signed-off-by: zhuoli Change-Id: Iff2f36bb3bcdb06853117d686ab6ac3fc90f34df --- es2panda/BUILD.gn | 13 ------------- merge_abc/BUILD.gn | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 86804569e5..ea57205436 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -436,22 +436,9 @@ ohos_executable("es2panda") { } else { libs = [ libcpp_static_lib ] } - - # for statically linking pthread - ldflags += [ - "-Wl,--whole-archive", - "-lrt", - "-lpthread", - "-Wl,--no-whole-archive", - ] - } - - if (!is_mac) { - static_link = true } if (!use_musl) { - static_link = false ldflags += [ "-lc++" ] } diff --git a/merge_abc/BUILD.gn b/merge_abc/BUILD.gn index be0d3d7297..67efc3cb02 100644 --- a/merge_abc/BUILD.gn +++ b/merge_abc/BUILD.gn @@ -186,26 +186,13 @@ ohos_executable("merge_abc") { } defines = [ "PANDA_TARGET_LINUX" ] - - # for statically linking pthread - ldflags += [ - "-Wl,--whole-archive", - "-lrt", - "-lpthread", - "-Wl,--no-whole-archive", - ] } else if (is_mac) { defines = [ "PANDA_TARGET_MACOS" ] } else if (is_mingw) { defines = [ "PANDA_TARGET_WINDOWS" ] } - if (!is_mac) { - static_link = true - } - if (!use_musl) { - static_link = false ldflags += [ "-lc++" ] } -- Gitee From 1728c15890daaca807b6f9c14bf05fef132594dc Mon Sep 17 00:00:00 2001 From: zhuoli Date: Mon, 28 Nov 2022 12:07:59 +0800 Subject: [PATCH 3/3] Fix codecheck Signed-off-by: zhuoli Change-Id: I1912a86b5cf6b42e7a0371c4bb2373bb742d1668 --- es2panda/compiler/core/function.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/es2panda/compiler/core/function.cpp b/es2panda/compiler/core/function.cpp index e9bd8fb4a3..b7b8e9c393 100644 --- a/es2panda/compiler/core/function.cpp +++ b/es2panda/compiler/core/function.cpp @@ -82,11 +82,8 @@ static void CompileFunctionParameterDeclaration(PandaGen *pg, const ir::ScriptFu if (param->IsAssignmentPattern()) { RegScope rs(pg); - if (ref.Kind() == ReferenceKind::DESTRUCTURING) { - pg->LoadAccumulator(func, paramReg); - } else { - ref.GetValue(); - } + ref.Kind() == ReferenceKind::DESTRUCTURING ? + pg->LoadAccumulator(func, paramReg) : ref.GetValue(); auto *nonDefaultLabel = pg->AllocLabel(); -- Gitee