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); diff --git a/runtime/ecma_language_context.cpp b/runtime/ecma_language_context.cpp index 3a6841137f110bd8d0241171ad13997167cf7994..983db405c67509ef2a4c50cd8078604240fad78f 100644 --- a/runtime/ecma_language_context.cpp +++ b/runtime/ecma_language_context.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 @@ -88,14 +88,15 @@ void EcmaLanguageContext::ThrowStackOverflowException(ManagedThread *thread) con "Maximum call stack size exceeded"); } -PandaUniquePtr EcmaLanguageContext::CreateITableBuilder() const +PandaUniquePtr EcmaLanguageContext::CreateITableBuilder( + [[maybe_unused]] ClassLinkerErrorHandler *errHandler) const { return MakePandaUnique(); } -PandaUniquePtr EcmaLanguageContext::CreateVTableBuilder() const +PandaUniquePtr EcmaLanguageContext::CreateVTableBuilder(ClassLinkerErrorHandler *errHandler) const { - return MakePandaUnique(); + return MakePandaUnique(errHandler); } size_t EcmaLanguageContext::GetStringSize(const ObjectHeader *stringObject) const diff --git a/runtime/ecma_language_context.h b/runtime/ecma_language_context.h index 64790b468fcd00e852e59180dd3b3e00a8d74441..d6dbbf27a3c0282b32c142f80db734e7e5154bbe 100644 --- a/runtime/ecma_language_context.h +++ b/runtime/ecma_language_context.h @@ -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 @@ -276,9 +276,10 @@ public: return panda_file::File::READ_WRITE; } - PandaUniquePtr CreateITableBuilder() const override; + PandaUniquePtr CreateITableBuilder( + [[maybe_unused]] ClassLinkerErrorHandler *errHandler) const override; - PandaUniquePtr CreateVTableBuilder() const override; + PandaUniquePtr CreateVTableBuilder(ClassLinkerErrorHandler *errHandler) const override; bool InitializeClass(ClassLinker *classLinker, ManagedThread *thread, Class *klass) const override { diff --git a/runtime/napi/jsnapi.cpp b/runtime/napi/jsnapi.cpp index 3714477dc2fed995c98717a8f23ba3b1f54a3f34..a84f311a8d43e5fc74a2153a3e01a855faf9ed6c 100644 --- a/runtime/napi/jsnapi.cpp +++ b/runtime/napi/jsnapi.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 @@ -100,9 +100,9 @@ template using JSHandle = ecmascript::JSHandle; namespace { -constexpr uint32_t INTERNAL_POOL_SIZE = 0; -constexpr uint32_t CODE_POOL_SIZE = 2000000; -constexpr uint32_t COMPILER_POOL_SIZE = 2000000; +constexpr uint32_t INTERNAL_POOL_SIZE = 2_MB; +constexpr uint32_t CODE_POOL_SIZE = 2_MB; +constexpr uint32_t COMPILER_POOL_SIZE = 2_MB; // NOLINTNEXTLINE(fuchsia-statically-constructed-objects) constexpr std::string_view ENTRY_POINTER = "_GLOBAL::func_main_0";