From 1ac66b5cc6b5cc5f6664e8e1581fdcec7e4480c1 Mon Sep 17 00:00:00 2001 From: Orlovsky Maxim Date: Tue, 20 Feb 2024 16:28:55 +0300 Subject: [PATCH] Issue: #I91POS Description: Merged compiler contexts to increase maintainability of the es2panda compiler pipeline Testing: Full tests passed, regression testing successfull. Signed-off-by: Orlovsky Maxim ChangeId: I23d95bdfb83b71783cc0b1cf3296901391c0f29e --- runtime/CMakeLists.txt | 2 +- runtime/js_eval.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index e9f0eb1c9..315d8a056 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -228,7 +228,7 @@ panda_target_include_directories(arkruntime_obj PUBLIC ${ECMA_GEN_DIR} ) -panda_target_link_libraries(arkruntime_obj es2panda-lib arkassembler) +panda_target_link_libraries(arkruntime_obj es2panda-public arkassembler) set(RUNTIME_TEMPLATES intrinsics_gen.cpp.erb diff --git a/runtime/js_eval.cpp b/runtime/js_eval.cpp index 568df2539..9104fd27f 100644 --- a/runtime/js_eval.cpp +++ b/runtime/js_eval.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 @@ -21,6 +21,7 @@ #include "plugins/ecmascript/runtime/interpreter/interpreter-inl.h" #include "es2panda.h" #include "assembler/assembly-emitter.h" +#include "util/options.h" namespace ark::ecmascript { JSTaggedValue EvalUtils::GetEvaluatedScript(JSThread *thread, const JSHandle &str, @@ -30,7 +31,9 @@ JSTaggedValue EvalUtils::GetEvaluatedScript(JSThread *thread, const JSHandle program(compiler.Compile(input, options, parserStatus)); + auto fullOptions = es2panda::util::Options {}; + fullOptions.SetCompilerOptions(options); + std::unique_ptr program {compiler.Compile(input, fullOptions, parserStatus)}; ObjectFactory *objectFactory = thread->GetEcmaVM()->GetFactory(); if (!program) { -- Gitee