diff --git a/compiler/optimizer/ecma_pipeline.cpp b/compiler/optimizer/ecma_pipeline.cpp index fc8619f16b3a7cef96009b2014286d4d334d95bd..2d27dce374fa2019fb002ac29d062f36ea43b4fa 100644 --- a/compiler/optimizer/ecma_pipeline.cpp +++ b/compiler/optimizer/ecma_pipeline.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -26,6 +26,7 @@ #include "optimizer/optimizations/checks_elimination.h" #include "optimizer/optimizations/code_sink.h" #include "optimizer/optimizations/deoptimize_elimination.h" +#include "optimizer/optimizations/savestate_optimization.h" #include "optimizer/optimizations/cleanup.h" #include "optimizer/optimizations/if_conversion.h" #include "optimizer/optimizations/licm.h" @@ -103,7 +104,9 @@ bool EcmaPipeline::RunOptimizations() if (graph->IsAotMode()) { graph->RunPass(); } - if (graph->RunPass()) { + bool deoptElim = graph->RunPass(); + bool saveStateOpt = graph->RunPass(); + if (deoptElim || saveStateOpt) { graph->RunPass(); } diff --git a/runtime/builtins/builtins_typedarray.cpp b/runtime/builtins/builtins_typedarray.cpp index 5f21eccc1defa9221bb1aec9244c4a1416ba66e8..a3fd8fe3c37327e5b622d882b26153973911a448 100644 --- a/runtime/builtins/builtins_typedarray.cpp +++ b/runtime/builtins/builtins_typedarray.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -1387,6 +1387,7 @@ JSTaggedValue typed_array::proto::Subarray(EcmaRuntimeCallInfo *argv) std::array args = {buffer.GetRawData(), JSTaggedValue(beginByteOffset).GetRawData(), JSTaggedValue(newLength).GetRawData()}; + JSSpanHandle argsHandle(thread, Span(reinterpret_cast(args.data()), args.size())); JSHandle newArr = TypedArrayHelper::TypedArraySpeciesCreate(thread, thisObj, args.size(), args.data()); // 3: three args RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);