mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-06 23:54:03 +00:00
Optimize ArkJS VM build time
Issue: https://gitee.com/open_harmony/dashboard?issue_id=IACDZP Change-Id: I729c3a2741cb2571d6f7184b2726e5f06eca802a Signed-off-by: Andrey Efremov <efremov.andrey@huawei-partners.com>
This commit is contained in:
parent
2a5995a1b5
commit
d8cf9a50f7
2
BUILD.gn
2
BUILD.gn
@ -793,6 +793,7 @@ ecma_source = [
|
||||
"ecmascript/js_map_iterator.cpp",
|
||||
"ecmascript/jsnapi_sendable.cpp",
|
||||
"ecmascript/method.cpp",
|
||||
"ecmascript/js_native_pointer.cpp",
|
||||
"ecmascript/js_object.cpp",
|
||||
"ecmascript/js_primitive_ref.cpp",
|
||||
"ecmascript/js_promise.cpp",
|
||||
@ -914,6 +915,7 @@ ecma_source = [
|
||||
"ecmascript/tagged_hash_array.cpp",
|
||||
"ecmascript/tagged_list.cpp",
|
||||
"ecmascript/tagged_node.cpp",
|
||||
"ecmascript/tagged_array.cpp",
|
||||
"ecmascript/tagged_tree.cpp",
|
||||
"ecmascript/template_string.cpp",
|
||||
"ecmascript/vtable.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
|
||||
@ -15,7 +15,8 @@
|
||||
|
||||
#include "ecmascript/async_generator_helper.h"
|
||||
#include "ecmascript/builtins/builtins_promise.h"
|
||||
#include "ecmascript/interpreter/interpreter-inl.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_async_generator_object.h"
|
||||
#include "ecmascript/js_iterator.h"
|
||||
#include "ecmascript/js_promise.h"
|
||||
#include "ecmascript/tagged_queue.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
|
||||
@ -27,6 +27,7 @@
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/object_fast_operator-inl.h"
|
||||
#include "ecmascript/shared_objects/js_shared_array.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
namespace panda::ecmascript::base {
|
||||
int64_t ArrayHelper::GetStartIndex(JSThread *thread, const JSHandle<JSTaggedValue> &startIndexHandle,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -16,12 +16,9 @@
|
||||
#ifndef ECMASCRIPT_BASE_BUILTINS_BASE_H
|
||||
#define ECMASCRIPT_BASE_BUILTINS_BASE_H
|
||||
|
||||
#include "ecmascript/base/string_helper.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_string.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env_constants-inl.h"
|
||||
#include "ecmascript/js_symbol.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/runtime_call_id.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,9 +18,9 @@
|
||||
|
||||
#include "ecmascript/base/error_type.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_string.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
#include "ecmascript/mem/c_string.h"
|
||||
#include "ecmascript/interpreter/frame_handler.h"
|
||||
|
||||
namespace panda::ecmascript::base {
|
||||
constexpr char DEFAULT_EMPTY_STACK_TRACE[] = "stack is empty"; // NOLINT (modernize-avoid-c-arrays)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -19,11 +19,13 @@
|
||||
#include "ecmascript/base/json_helper.h"
|
||||
#include "ecmascript/base/number_helper.h"
|
||||
#include "ecmascript/builtins/builtins_errors.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_string-inl.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/element_accessor-inl.h"
|
||||
#include "ecmascript/global_dictionary-inl.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_array.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -16,6 +16,7 @@
|
||||
#ifndef ECMASCRIPT_BASE_FAST_JSON_STRINGIFY_H
|
||||
#define ECMASCRIPT_BASE_FAST_JSON_STRINGIFY_H
|
||||
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -22,6 +22,7 @@
|
||||
#include "zlib.h"
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "ecmascript/base/json_helper.h"
|
||||
#include "ecmascript/base/utf_helper.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -24,6 +24,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/element_accessor-inl.h"
|
||||
#include "ecmascript/global_dictionary-inl.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_array.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -27,9 +27,11 @@
|
||||
#include "ecmascript/base/dtoa_helper.h"
|
||||
#include "ecmascript/base/string_helper.h"
|
||||
#include "ecmascript/builtins/builtins_number.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_string_table.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
namespace panda::ecmascript::base {
|
||||
using NumberToStringResultCache = builtins::NumberToStringResultCache;
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
#include "ecmascript/base/sort_helper.h"
|
||||
#include "ecmascript/base/array_helper.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
namespace panda::ecmascript::base {
|
||||
void TimSort::Sort(JSThread *thread, JSHandle<TaggedArray> &elements, const JSHandle<JSTaggedValue> &fn)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -25,11 +25,10 @@
|
||||
#include <vector>
|
||||
|
||||
#include "ecmascript/base/utf_helper.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/js_thread.h"
|
||||
#include "ecmascript/mem/assert_scope.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/mem/c_containers.h"
|
||||
#include "ecmascript/mem/c_string.h"
|
||||
|
||||
#include "securec.h"
|
||||
#include "unicode/unistr.h"
|
||||
|
||||
namespace panda::ecmascript::base {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -17,6 +17,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_array.h"
|
||||
#include "ecmascript/tests/test_helper.h"
|
||||
#include "ecmascript/js_typed_array.h"
|
||||
|
||||
using namespace panda::ecmascript;
|
||||
using namespace panda::ecmascript::base;
|
||||
|
@ -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
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include "ecmascript/base/atomic_helper.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_typed_array.h"
|
||||
#include "ecmascript/tests/test_helper.h"
|
||||
|
||||
using namespace panda::ecmascript;
|
||||
|
@ -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
|
||||
@ -16,6 +16,7 @@
|
||||
#include "ecmascript/base/typed_array_helper-inl.h"
|
||||
#include "ecmascript/builtins/builtins_arraybuffer.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_array.h"
|
||||
#include "ecmascript/tests/test_helper.h"
|
||||
|
||||
using namespace panda::ecmascript;
|
||||
|
@ -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
|
||||
@ -28,6 +28,7 @@
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_array_iterator.h"
|
||||
#include "ecmascript/js_arraybuffer.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_hclass.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include "ecmascript/builtins/builtins_proxy.h"
|
||||
#include "ecmascript/builtins/builtins_reflect.h"
|
||||
#include "ecmascript/builtins/builtins_regexp.h"
|
||||
#include "ecmascript/builtins/builtins_regexp-inl.h"
|
||||
#include "ecmascript/builtins/builtins_set.h"
|
||||
#include "ecmascript/builtins/builtins_sharedarraybuffer.h"
|
||||
#include "ecmascript/builtins/builtins_shared_typedarray.h"
|
||||
@ -85,6 +86,7 @@
|
||||
#include "ecmascript/js_set.h"
|
||||
#include "ecmascript/js_set_iterator.h"
|
||||
#include "ecmascript/js_string_iterator.h"
|
||||
#include "ecmascript/js_symbol.h"
|
||||
#include "ecmascript/js_async_from_sync_iterator.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/js_typed_array.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
#include "ecmascript/js_hclass.h"
|
||||
#include "ecmascript/js_symbol.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/js_thread.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,6 +18,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "ecmascript/dfx/vmstat/opt_code_profiler.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/element_accessor-inl.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/base/string_helper.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
|
||||
@ -21,6 +21,7 @@
|
||||
#include "ecmascript/base/number_helper.h"
|
||||
#include "ecmascript/base/typed_array_helper-inl.h"
|
||||
#include "ecmascript/base/typed_array_helper.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_macros.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_string.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
|
||||
@ -25,6 +25,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_arraybuffer.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_tagged_number.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -22,6 +22,7 @@
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/js_async_from_sync_iterator.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_iterator.h"
|
||||
#include "ecmascript/js_promise.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
|
@ -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
|
||||
@ -17,6 +17,7 @@
|
||||
#include "ecmascript/base/builtins_base.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_iterator.h"
|
||||
#include "ecmascript/js_promise.h"
|
||||
|
||||
|
@ -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
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
#include "ecmascript/base/atomic_helper.h"
|
||||
#include "ecmascript/base/typed_array_helper-inl.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "libpandabase/utils/time.h"
|
||||
#include "ecmascript/checkpoint/thread_state_transition.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -19,6 +19,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_collator.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_intl.h"
|
||||
#include "ecmascript/mem/barriers-inl.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -20,6 +20,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_date.h"
|
||||
#include "ecmascript/js_date_time_format.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_intl.h"
|
||||
#include "ecmascript/mem/barriers-inl.h"
|
||||
|
||||
|
@ -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
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/js_finalization_registry.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -23,8 +23,10 @@
|
||||
#include "ecmascript/base/number_helper.h"
|
||||
#include "ecmascript/base/string_helper.h"
|
||||
#include "ecmascript/ecma_macros.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/mem/c_containers.h"
|
||||
#include "ecmascript/module/js_module_deregister.h"
|
||||
#include "ecmascript/module/module_path_helper.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
#include "ecmascript/builtins/builtins.h"
|
||||
#include "ecmascript/global_dictionary-inl.h"
|
||||
#include "ecmascript/layout_info-inl.h"
|
||||
#include "ecmascript/tagged_dictionary.h"
|
||||
#include "ecmascript/ecma_macros.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_map.h"
|
||||
#include "ecmascript/js_map_iterator.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -16,12 +16,15 @@
|
||||
#include "ecmascript/builtins/builtins_number.h"
|
||||
|
||||
#include "ecmascript/base/number_helper.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_macros.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
#include "ecmascript/js_hclass.h"
|
||||
#include "ecmascript/js_primitive_ref.h"
|
||||
#include "ecmascript/js_tagged_number.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/mem/c_containers.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -20,6 +20,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_array.h"
|
||||
#include "ecmascript/js_intl.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_locale.h"
|
||||
#include "ecmascript/js_number_format.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ecmascript/builtins/builtins_promise_handler.h"
|
||||
#include "ecmascript/builtins/builtins_promise_job.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include "ecmascript/builtins/builtins_promise_handler.h"
|
||||
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/jobs/micro_job_queue.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -16,6 +16,7 @@
|
||||
#include "ecmascript/builtins/builtins_reflect.h"
|
||||
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
|
||||
namespace panda::ecmascript::builtins {
|
||||
|
50
ecmascript/builtins/builtins_regexp-inl.h
Normal file
50
ecmascript/builtins/builtins_regexp-inl.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ECMASCRIPT_BUILTINS_BUILTINS_REGEXP_INL_H
|
||||
#define ECMASCRIPT_BUILTINS_BUILTINS_REGEXP_INL_H
|
||||
|
||||
#include "ecmascript/ecma_context.h"
|
||||
|
||||
namespace panda::ecmascript::builtins {
|
||||
|
||||
/* static */
|
||||
template <int N>
|
||||
JSTaggedValue RegExpGlobalResult::GetCapture(JSThread *thread)
|
||||
{
|
||||
JSHandle<builtins::RegExpGlobalResult> globalTable(thread->GetCurrentEcmaContext()->GetRegExpGlobalResult());
|
||||
JSTaggedValue res = globalTable->Get(CAPTURE_START_INDEX + N - 1);
|
||||
int captureNum = globalTable->GetTotalCaptureCounts().GetInt();
|
||||
if (res.IsHole() && (N < captureNum)) {
|
||||
int startIndex = globalTable->GetStartOfCaptureIndex(N).GetInt();
|
||||
int endIndex = globalTable->GetEndOfCaptureIndex(N).GetInt();
|
||||
int len = endIndex - startIndex;
|
||||
if (len < 0) {
|
||||
res = JSTaggedValue::Undefined();
|
||||
} else {
|
||||
res = JSTaggedValue(EcmaStringAccessor::FastSubString(thread->GetEcmaVM(),
|
||||
JSHandle<EcmaString>(thread, EcmaString::Cast(globalTable->GetInputString())),
|
||||
static_cast<uint32_t>(startIndex), static_cast<uint32_t>(len)));
|
||||
}
|
||||
globalTable->Set(thread, CAPTURE_START_INDEX + N - 1, res);
|
||||
} else if (res.IsHole()) {
|
||||
res = thread->GetEcmaVM()->GetFactory()->GetEmptyString().GetTaggedValue();
|
||||
globalTable->Set(thread, CAPTURE_START_INDEX + N - 1, res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace panda::ecmascript::builtins
|
||||
#endif // ECMASCRIPT_BUILTINS_BUILTINS_REGEXP_INL_H
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -14,10 +14,12 @@
|
||||
*/
|
||||
|
||||
#include "ecmascript/builtins/builtins_regexp.h"
|
||||
#include "ecmascript/builtins/builtins_regexp-inl.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "ecmascript/ecma_string-inl.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
@ -33,6 +35,7 @@
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/object_fast_operator-inl.h"
|
||||
#include "ecmascript/property_detector-inl.h"
|
||||
#include "ecmascript/regexp/regexp_executor.h"
|
||||
#include "ecmascript/regexp/regexp_parser_cache.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -20,8 +20,8 @@
|
||||
#include "ecmascript/builtins/builtins_string.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/regexp/regexp_executor.h"
|
||||
#include "ecmascript/regexp/regexp_parser.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
namespace panda::ecmascript::builtins {
|
||||
class BuiltinsRegExp : public base::BuiltinsBase {
|
||||
@ -357,29 +357,7 @@ public:
|
||||
}
|
||||
|
||||
template <int N>
|
||||
static JSTaggedValue GetCapture(JSThread *thread)
|
||||
{
|
||||
JSHandle<builtins::RegExpGlobalResult> globalTable(thread->GetCurrentEcmaContext()->GetRegExpGlobalResult());
|
||||
JSTaggedValue res = globalTable->Get(CAPTURE_START_INDEX + N - 1);
|
||||
int captureNum = globalTable->GetTotalCaptureCounts().GetInt();
|
||||
if (res.IsHole() && (N < captureNum)) {
|
||||
int startIndex = globalTable->GetStartOfCaptureIndex(N).GetInt();
|
||||
int endIndex = globalTable->GetEndOfCaptureIndex(N).GetInt();
|
||||
int len = endIndex - startIndex;
|
||||
if (len < 0) {
|
||||
res = JSTaggedValue::Undefined();
|
||||
} else {
|
||||
res = JSTaggedValue(EcmaStringAccessor::FastSubString(thread->GetEcmaVM(),
|
||||
JSHandle<EcmaString>(thread, EcmaString::Cast(globalTable->GetInputString())),
|
||||
static_cast<uint32_t>(startIndex), static_cast<uint32_t>(len)));
|
||||
}
|
||||
globalTable->Set(thread, CAPTURE_START_INDEX + N - 1, res);
|
||||
} else if (res.IsHole()) {
|
||||
res = thread->GetEcmaVM()->GetFactory()->GetEmptyString().GetTaggedValue();
|
||||
globalTable->Set(thread, CAPTURE_START_INDEX + N - 1, res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
static JSTaggedValue GetCapture(JSThread *thread);
|
||||
|
||||
void SetTotalCaptureCounts(JSThread *thread, JSTaggedValue counts)
|
||||
{
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_arraybuffer.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_tagged_number.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_set.h"
|
||||
#include "ecmascript/js_set_iterator.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/shared_objects/concurrent_api_scope.h"
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "ecmascript/builtins/builtins_shared_set.h"
|
||||
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
|
||||
|
@ -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
|
||||
@ -20,6 +20,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_arraybuffer.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_tagged_number.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -28,6 +28,7 @@
|
||||
#include "ecmascript/builtins/builtins_symbol.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_string-inl.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/fast_runtime_stub-inl.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -23,6 +23,7 @@
|
||||
#include "ecmascript/js_tagged_number.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
#include "ecmascript/tagged_array-inl.h"
|
||||
|
||||
namespace panda::ecmascript::builtins {
|
||||
JSTaggedValue BuiltinsStringIterator::Next(EcmaRuntimeCallInfo *argv)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -20,6 +20,7 @@
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_map_iterator.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/js_weak_container.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,7 +18,9 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_function.h"
|
||||
#include "ecmascript/js_set_iterator.h"
|
||||
#include "ecmascript/js_tagged_value-inl.h"
|
||||
#include "ecmascript/js_weak_container.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
#include "ecmascript/object_factory.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -33,7 +33,9 @@
|
||||
#include "ecmascript/shared_objects/js_shared_typed_array.h"
|
||||
#include "ecmascript/js_async_function.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/layout_info.h"
|
||||
#include "ecmascript/symbol_table.h"
|
||||
#include "ecmascript/builtins/builtins_shared_array.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -22,6 +22,7 @@
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_array.h"
|
||||
#include "ecmascript/js_object-inl.h"
|
||||
#include "ecmascript/js_primitive_ref.h"
|
||||
#include "ecmascript/js_regexp.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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 "ecmascript/compiler/bc_call_signature.h"
|
||||
#include "ecmascript/deoptimizer/calleeReg.h"
|
||||
#include "ecmascript/compiler/aot_file/func_entry_des.h"
|
||||
#include "ecmascript/stackmap/ark_stackmap.h"
|
||||
|
||||
namespace panda::ecmascript {
|
||||
class PUBLIC_API AOTFileInfo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 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
|
||||
@ -26,7 +26,7 @@
|
||||
#include "ecmascript/compiler/aot_snapshot/snapshot_global_data.h"
|
||||
#include "ecmascript/compiler/bc_call_signature.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/common_stubs.h"
|
||||
#include "ecmascript/compiler/common_stub_csigns.h"
|
||||
#include "ecmascript/compiler/compiler_log.h"
|
||||
#include "ecmascript/deoptimizer/deoptimizer.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
@ -57,6 +57,19 @@ using SnapshotGlobalData = kungfu::SnapshotGlobalData;
|
||||
JsAotReaderCallback AOTFileManager::jsAotReader_ = nullptr;
|
||||
#endif
|
||||
|
||||
void AOTLiteralInfo::InitializeWithSpecialValue(JSTaggedValue initValue, uint32_t capacity, uint32_t extraLength)
|
||||
{
|
||||
TaggedArray::InitializeWithSpecialValue(initValue, capacity + RESERVED_LENGTH, extraLength);
|
||||
SetIhc(JSTaggedValue::Undefined());
|
||||
SetChc(JSTaggedValue::Undefined());
|
||||
SetLiteralType(JSTaggedValue(INVALID_LITERAL_TYPE));
|
||||
}
|
||||
|
||||
void AOTLiteralInfo::SetObjectToCache(JSThread *thread, uint32_t index, JSTaggedValue value)
|
||||
{
|
||||
Set(thread, index, value);
|
||||
}
|
||||
|
||||
void AOTFileManager::Iterate(const RootVisitor &v)
|
||||
{
|
||||
for (auto &iter : aiDatum_) {
|
||||
@ -424,7 +437,7 @@ void AOTFileManager::AdjustBCStubAndDebuggerStubEntries(JSThread *thread,
|
||||
auto defaultBCStubDes = stubs[BytecodeStubCSigns::SingleStepDebugging];
|
||||
auto defaultBCDebuggerStubDes = stubs[BytecodeStubCSigns::BCDebuggerEntry];
|
||||
auto defaultBCDebuggerExceptionStubDes = stubs[BytecodeStubCSigns::BCDebuggerExceptionEntry];
|
||||
ASSERT(defaultBCStubDes.kind_ == CallSignature::TargetKind::BYTECODE_HELPER_HANDLER);
|
||||
ASSERT(defaultBCStubDes.kind_ == kungfu::CallSignature::TargetKind::BYTECODE_HELPER_HANDLER);
|
||||
if (asmInterOpt.handleStart >= 0 && asmInterOpt.handleStart <= asmInterOpt.handleEnd) {
|
||||
for (int i = asmInterOpt.handleStart; i <= asmInterOpt.handleEnd; i++) {
|
||||
thread->SetBCStubEntry(static_cast<size_t>(i), defaultBCStubDes.codeAddr_);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 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
|
||||
@ -38,6 +38,9 @@
|
||||
namespace panda::ecmascript {
|
||||
class JSpandafile;
|
||||
class JSThread;
|
||||
namespace kungfu {
|
||||
class ArkStackMapParser;
|
||||
} // namespace kungfu
|
||||
|
||||
/* AOTLiteralInfo (TaggedArray)
|
||||
* +--------------------------------------------------+------
|
||||
@ -74,13 +77,8 @@ public:
|
||||
return TaggedArray::ComputeSize(JSTaggedValue::TaggedTypeSize(), cacheSize + RESERVED_LENGTH);
|
||||
}
|
||||
|
||||
inline void InitializeWithSpecialValue(JSTaggedValue initValue, uint32_t capacity, uint32_t extraLength = 0)
|
||||
{
|
||||
TaggedArray::InitializeWithSpecialValue(initValue, capacity + RESERVED_LENGTH, extraLength);
|
||||
SetIhc(JSTaggedValue::Undefined());
|
||||
SetChc(JSTaggedValue::Undefined());
|
||||
SetLiteralType(JSTaggedValue(INVALID_LITERAL_TYPE));
|
||||
}
|
||||
void InitializeWithSpecialValue(JSTaggedValue initValue, uint32_t capacity,
|
||||
uint32_t extraLength = 0);
|
||||
|
||||
inline uint32_t GetCacheLength() const
|
||||
{
|
||||
@ -117,10 +115,7 @@ public:
|
||||
return JSTaggedValue(Barriers::GetValue<JSTaggedType>(GetData(), GetLiteralTypeOffset())).GetInt();
|
||||
}
|
||||
|
||||
inline void SetObjectToCache(JSThread *thread, uint32_t index, JSTaggedValue value)
|
||||
{
|
||||
Set(thread, index, value);
|
||||
}
|
||||
void SetObjectToCache(JSThread *thread, uint32_t index, JSTaggedValue value);
|
||||
|
||||
inline JSTaggedValue GetObjectFromCache(uint32_t index) const
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
namespace panda::ecmascript {
|
||||
struct FuncEntryDes {
|
||||
using CallSignature = kungfu::CallSignature;
|
||||
|
||||
uint64_t codeAddr_ {};
|
||||
CallSignature::TargetKind kind_;
|
||||
bool isMainFunc_ {};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
#include "ecmascript/common.h"
|
||||
#include "ecmascript/compiler/aot_snapshot/aot_snapshot_constants.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/global_env_constants-inl.h"
|
||||
#include "ecmascript/jspandafile/program_object.h"
|
||||
#include "ecmascript/log_wrapper.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
#include "ecmascript/compiler/pgo_type/pgo_type_location.h"
|
||||
#include "ecmascript/compiler/pgo_type/pgo_type_manager.h"
|
||||
#include "ecmascript/ecma_context.h"
|
||||
#include "ecmascript/js_hclass-inl.h"
|
||||
#include "ecmascript/jspandafile/program_object.h"
|
||||
#include "ecmascript/ts_types/global_type_info.h"
|
||||
#include "ecmascript/global_env_constants-inl.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -16,9 +16,11 @@
|
||||
#define ECMASCRIPT_COMPILER_AOT_SNAPSHOT_AOT_SNAPSHOT_DATA_H
|
||||
|
||||
#include "ecmascript/compiler/aot_snapshot/snapshot_global_data.h"
|
||||
#include "ecmascript/compiler/pgo_type/pgo_type_location.h"
|
||||
#include "ecmascript/jspandafile/js_pandafile.h"
|
||||
#include "ecmascript/mem/c_containers.h"
|
||||
#include "ecmascript/pgo_profiler/pgo_profiler_decoder.h"
|
||||
#include "libpandafile/bytecode_instruction.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
using ApEntityId = pgo::ApEntityId;
|
||||
|
@ -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
|
||||
@ -66,7 +66,7 @@ void ExtendedAssembler::BindAssemblerStub(int id)
|
||||
Bind(target);
|
||||
auto callSigns = module_->GetCSigns();
|
||||
auto cs = callSigns[id];
|
||||
isGhcCallingConv_ = cs->GetCallConv() == CallSignature::CallConv::GHCCallConv;
|
||||
isGhcCallingConv_ = cs->GetCallConv() == kungfu::CallSignature::CallConv::GHCCallConv;
|
||||
}
|
||||
|
||||
void ExtendedAssembler::PushFpAndLr()
|
||||
|
@ -16,7 +16,9 @@
|
||||
#ifndef ECMASCRIPT_COMPILER_ASSEMBLER_MACRO_ASSEMBLER_H
|
||||
#define ECMASCRIPT_COMPILER_ASSEMBLER_MACRO_ASSEMBLER_H
|
||||
|
||||
#include "ecmascript/compiler/bytecodes.h"
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/mem/native_area_allocator.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
|
@ -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
|
||||
@ -90,7 +90,7 @@ void ExtendedAssembler::BindAssemblerStub(int id)
|
||||
auto callSigns = module_->GetCSigns();
|
||||
auto cs = callSigns[id];
|
||||
isGhcCallingConv_ = cs->GetCallConv() ==
|
||||
CallSignature::CallConv::GHCCallConv;
|
||||
kungfu::CallSignature::CallConv::GHCCallConv;
|
||||
}
|
||||
|
||||
void ExtendedAssembler::PushArgc(int32_t argc, Register tempArgcRegister)
|
||||
|
@ -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
|
||||
@ -23,7 +23,7 @@
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/frames.h"
|
||||
#include "ecmascript/stubs/runtime_stubs.h"
|
||||
#include "ecmascript/stubs/runtime_stub_list.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
class CompilationConfig;
|
||||
|
@ -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
|
||||
@ -16,6 +16,7 @@
|
||||
#include "ecmascript/compiler/async_function_lowering.h"
|
||||
|
||||
#include "ecmascript/js_generator_object.h"
|
||||
#include "ecmascript/compiler/circuit_builder-inl.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
void AsyncFunctionLowering::ProcessAll()
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "ecmascript/ecma_vm.h"
|
||||
#include "ecmascript/compiler/assembler/macro_assembler.h"
|
||||
#include "ecmascript/method.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
enum class SpecialRegister : uint8_t {
|
||||
|
@ -27,6 +27,7 @@ namespace panda::ecmascript::kungfu {
|
||||
|
||||
class BaselineStubBuilder : public StubBuilder {
|
||||
public:
|
||||
static_assert(false);
|
||||
BaselineStubBuilder(CallSignature *callSignature, Environment *env)
|
||||
: StubBuilder(callSignature, env) {}
|
||||
~BaselineStubBuilder() override = default;
|
||||
|
57
ecmascript/compiler/baseline/baseline_stub_csigns.h
Normal file
57
ecmascript/compiler/baseline/baseline_stub_csigns.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ECMASCRIPT_COMPILER_BASELINE_BASELINE_STUB_CSIGNS_H
|
||||
#define ECMASCRIPT_COMPILER_BASELINE_BASELINE_STUB_CSIGNS_H
|
||||
|
||||
#include "ecmascript/compiler/baseline/baseline_compiler_builtins.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
#define BASELINE_STUB_ID_LIST(V) \
|
||||
BASELINE_COMPILER_BUILTIN_LIST(V)
|
||||
|
||||
class BaselineStubCSigns {
|
||||
public:
|
||||
enum ID {
|
||||
#define DEF_STUB_ID(name) name,
|
||||
BASELINE_STUB_ID_LIST(DEF_STUB_ID)
|
||||
#undef DEF_STUB_ID
|
||||
NUM_OF_STUBS
|
||||
};
|
||||
|
||||
static void Initialize();
|
||||
|
||||
static void GetCSigns(std::vector<const CallSignature*>& callSigns);
|
||||
|
||||
static const CallSignature *Get(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return &callSigns_[index];
|
||||
}
|
||||
|
||||
static const std::string &GetName(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return callSigns_[index].GetName();
|
||||
}
|
||||
|
||||
private:
|
||||
static CallSignature callSigns_[NUM_OF_STUBS];
|
||||
};
|
||||
|
||||
} // namespace panda::ecmascript::kungfu
|
||||
#endif // ECMASCRIPT_COMPILER_BASELINE_BASELINE_STUB_CSIGNS_H
|
@ -22,6 +22,7 @@
|
||||
#include "ecmascript/compiler/operations_stub_builder.h"
|
||||
#include "ecmascript/compiler/profiler_stub_builder.h"
|
||||
#include "ecmascript/dfx/vm_thread_control.h"
|
||||
#include "ecmascript/interpreter/interpreter.h"
|
||||
#include "ecmascript/js_async_generator_object.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
@ -17,53 +17,13 @@
|
||||
#define ECMASCRIPT_COMPILER_BASELINE_BASELINE_STUBS_H
|
||||
|
||||
#include "ecmascript/compiler/baseline/baseline_compiler_builtins.h"
|
||||
#include "ecmascript/compiler/baseline/baseline_stub_csigns.h"
|
||||
#include "ecmascript/compiler/stub_builder.h"
|
||||
#include "ecmascript/base/config.h"
|
||||
#include "ecmascript/compiler/bc_call_signature.h"
|
||||
#include "ecmascript/compiler/profiler_operation.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/compiler/circuit_builder_helper.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
#define DEFINE_PARAMETERS(...) \
|
||||
enum ParameterIndex { \
|
||||
##__VA_ARGS__, \
|
||||
PARAMETER_COUNT \
|
||||
};
|
||||
|
||||
#define BASELINE_STUB_ID_LIST(V) \
|
||||
BASELINE_COMPILER_BUILTIN_LIST(V)
|
||||
|
||||
class BaselineStubCSigns {
|
||||
public:
|
||||
enum ID {
|
||||
#define DEF_STUB_ID(name) name,
|
||||
BASELINE_STUB_ID_LIST(DEF_STUB_ID)
|
||||
#undef DEF_STUB_ID
|
||||
NUM_OF_STUBS
|
||||
};
|
||||
|
||||
static void Initialize();
|
||||
|
||||
static void GetCSigns(std::vector<const CallSignature*>& callSigns);
|
||||
|
||||
static const CallSignature *Get(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return &callSigns_[index];
|
||||
}
|
||||
|
||||
static const std::string &GetName(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return callSigns_[index].GetName();
|
||||
}
|
||||
|
||||
private:
|
||||
static CallSignature callSigns_[NUM_OF_STUBS];
|
||||
};
|
||||
|
||||
class BaselineStubBuilder : public StubBuilder {
|
||||
public:
|
||||
BaselineStubBuilder(CallSignature *callSignature, Environment *env)
|
||||
|
@ -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
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/interpreter_stub.h"
|
||||
#include "ecmascript/stubs/runtime_stubs.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
CallSignature BytecodeStubCSigns::callSigns_[BytecodeStubCSigns::NUM_OF_VALID_STUBS];
|
||||
|
@ -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
|
||||
@ -17,7 +17,7 @@
|
||||
#define ECMASCRIPT_COMPILER_BC_CALL_SIGNATURE_H
|
||||
|
||||
#include "ecmascript/base/config.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
#define IGNORE_BC_STUB(...)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -19,6 +19,7 @@
|
||||
#include "ecmascript/compiler/gate.h"
|
||||
#include "ecmascript/compiler/share_gate_meta_data.h"
|
||||
#include "ecmascript/compiler/stub_builder-inl.h"
|
||||
#include "ecmascript/compiler/builtins/builtins_stubs.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
class BuiltinsArrayStubBuilder : public BuiltinsStubBuilder {
|
||||
|
@ -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
|
||||
@ -16,7 +16,6 @@
|
||||
#include "ecmascript/compiler/builtins/builtins_stubs.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/global_env_fields.h"
|
||||
#include "ecmascript/stubs/runtime_stubs.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
CallSignature BuiltinsStubCSigns::callSigns_[BuiltinsStubCSigns::NUM_OF_BUILTINS_STUBS];
|
||||
|
@ -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
|
||||
@ -17,8 +17,7 @@
|
||||
#define ECMASCRIPT_COMPILER_BUILTINS_CALL_SIGNATURE_H
|
||||
|
||||
#include "ecmascript/base/config.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/global_env_constants.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
#include "ecmascript/compiler/builtins/builtins_collection_stub_builder.h"
|
||||
|
||||
#include "ecmascript/compiler/builtins/builtins_stubs.h"
|
||||
#include "ecmascript/compiler/new_object_stub_builder.h"
|
||||
#include "ecmascript/linked_hash_table.h"
|
||||
#include "ecmascript/js_map.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-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
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#ifndef ECMASCRIPT_COMPILER_BUILTINS_COLLECTION_STUB_BUILDER_H
|
||||
#define ECMASCRIPT_COMPILER_BUILTINS_COLLECTION_STUB_BUILDER_H
|
||||
#include "ecmascript/compiler/builtins/builtins_stubs.h"
|
||||
#include "ecmascript/compiler/stub_builder-inl.h"
|
||||
#include "ecmascript/compiler/builtins/linked_hashtable_stub_builder.h"
|
||||
|
||||
|
@ -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
|
||||
@ -16,6 +16,7 @@
|
||||
#ifndef ECMASCRIPT_COMPILER_BUILTINS_STRING_STUB_BUILDER_H
|
||||
#define ECMASCRIPT_COMPILER_BUILTINS_STRING_STUB_BUILDER_H
|
||||
#include "ecmascript/compiler/stub_builder-inl.h"
|
||||
#include "ecmascript/compiler/builtins/builtins_stubs.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
class FlatStringStubBuilder;
|
||||
|
@ -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
|
||||
@ -92,6 +92,67 @@ void name##StubBuilder::GenerateCircuitImpl(GateRef glue, GateRef nativeCode, Ga
|
||||
#endif
|
||||
#endif
|
||||
|
||||
GateRef BuiltinsStubBuilder::GetCallArg0(GateRef numArg)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(0)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG0_OR_ARGV));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
auto res = *result;
|
||||
env->SubCfgExit();
|
||||
return res;
|
||||
}
|
||||
|
||||
GateRef BuiltinsStubBuilder::GetCallArg1(GateRef numArg)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(1)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG1));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
auto res = *result;
|
||||
env->SubCfgExit();
|
||||
return res;
|
||||
}
|
||||
|
||||
GateRef BuiltinsStubBuilder::GetCallArg2(GateRef numArg)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
// 2: 2 args
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(2)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG2));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
auto res = *result;
|
||||
env->SubCfgExit();
|
||||
return res;
|
||||
}
|
||||
|
||||
GateRef BuiltinsStubBuilder::GetArgFromArgv(GateRef index, GateRef numArgs, bool needCheck)
|
||||
{
|
||||
if (!needCheck) {
|
||||
|
@ -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
|
||||
@ -16,11 +16,10 @@
|
||||
#ifndef ECMASCRIPT_COMPILER_BUILTINS_STUB_H
|
||||
#define ECMASCRIPT_COMPILER_BUILTINS_STUB_H
|
||||
|
||||
#include "ecmascript/base/config.h"
|
||||
#include "ecmascript/compiler/builtins/builtins_call_signature.h"
|
||||
#include "ecmascript/compiler/interpreter_stub.h"
|
||||
#include "ecmascript/compiler/circuit_builder_helper.h"
|
||||
#include "ecmascript/compiler/stub_builder.h"
|
||||
#include "ecmascript/ecma_runtime_call_info.h"
|
||||
#include "ecmascript/ecma_string.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
class BuiltinsStubBuilder : public StubBuilder {
|
||||
@ -65,66 +64,9 @@ public:
|
||||
return Load(VariableType::JS_ANY(), info, thisOffset);
|
||||
}
|
||||
|
||||
inline GateRef GetCallArg0(GateRef numArg)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(0)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG0_OR_ARGV));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
auto res = *result;
|
||||
env->SubCfgExit();
|
||||
return res;
|
||||
}
|
||||
|
||||
inline GateRef GetCallArg1(GateRef numArg)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(1)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG1));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
auto res = *result;
|
||||
env->SubCfgExit();
|
||||
return res;
|
||||
}
|
||||
|
||||
inline GateRef GetCallArg2(GateRef numArg)
|
||||
{
|
||||
auto env = GetEnvironment();
|
||||
Label subentry(env);
|
||||
env->SubCfgEntry(&subentry);
|
||||
DEFVARIABLE(result, VariableType::JS_ANY(), Undefined());
|
||||
Label isValid(env);
|
||||
Label exit(env);
|
||||
// 2: 2 args
|
||||
BRANCH(Int32GreaterThan(TruncPtrToInt32(numArg), Int32(2)), &isValid, &exit);
|
||||
Bind(&isValid);
|
||||
{
|
||||
result = TaggedArgument(static_cast<size_t>(BuiltinsArgs::ARG2));
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(&exit);
|
||||
auto res = *result;
|
||||
env->SubCfgExit();
|
||||
return res;
|
||||
}
|
||||
GateRef GetCallArg0(GateRef numArg);
|
||||
GateRef GetCallArg1(GateRef numArg);
|
||||
GateRef GetCallArg2(GateRef numArg);
|
||||
|
||||
inline GateRef GetArgv()
|
||||
{
|
||||
|
@ -16,6 +16,7 @@
|
||||
#ifndef ECMASCRIPT_COMPILER_BUILTINS_TYPEDARRAY_STUB_BUILDER_H
|
||||
#define ECMASCRIPT_COMPILER_BUILTINS_TYPEDARRAY_STUB_BUILDER_H
|
||||
|
||||
#include "ecmascript/compiler/builtins/builtins_stubs.h"
|
||||
#include "ecmascript/compiler/stub_builder-inl.h"
|
||||
#include "ecmascript/js_arraybuffer.h"
|
||||
#include "ecmascript/js_typed_array.h"
|
||||
|
@ -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
|
||||
@ -18,7 +18,6 @@
|
||||
|
||||
#include <string>
|
||||
#include "ecmascript/compiler/argument_accessor.h"
|
||||
#include "ecmascript/compiler/builtins/builtins_call_signature.h"
|
||||
#include "ecmascript/compiler/circuit_builder-inl.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -18,6 +18,7 @@
|
||||
#include "ecmascript/base/number_helper.h"
|
||||
#include "ecmascript/compiler/gate_accessor.h"
|
||||
#include "ecmascript/deoptimizer/deoptimizer.h"
|
||||
#include "ecmascript/interpreter/interpreter-inl.h"
|
||||
#include "libpandafile/bytecode_instruction-inl.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -28,10 +28,10 @@
|
||||
#include "ecmascript/compiler/ecma_opcode_des.h"
|
||||
#include "ecmascript/compiler/frame_states.h"
|
||||
#include "ecmascript/compiler/pgo_type/pgo_type_recorder.h"
|
||||
#include "ecmascript/interpreter/interpreter-inl.h"
|
||||
#include "ecmascript/jit/jit_profiler.h"
|
||||
#include "ecmascript/jspandafile/js_pandafile.h"
|
||||
#include "ecmascript/jspandafile/method_literal.h"
|
||||
#include "libpandafile/index_accessor.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
struct ExceptionItem {
|
||||
|
@ -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
|
||||
@ -15,10 +15,13 @@
|
||||
|
||||
#include "ecmascript/compiler/bytecode_info_collector.h"
|
||||
|
||||
#include "ecmascript/interpreter/interpreter-inl.h"
|
||||
#include "ecmascript/jspandafile/literal_data_extractor.h"
|
||||
#include "ecmascript/module/module_path_helper.h"
|
||||
#include "ecmascript/pgo_profiler/pgo_profiler_decoder.h"
|
||||
#include "libpandafile/code_data_accessor.h"
|
||||
#include "libpandafile/class_data_accessor-inl.h"
|
||||
#include "libpandafile/index_accessor.h"
|
||||
#include "libpandafile/method_data_accessor-inl.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
template<class T, class... Args>
|
||||
|
@ -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
|
||||
@ -17,6 +17,7 @@
|
||||
#define ECMASCRIPT_COMPILER_BYTECODE_INFO_COLLECTOR_H
|
||||
|
||||
#include "ecmascript/compiler/aot_snapshot/snapshot_constantpool_data.h"
|
||||
#include "ecmascript/compiler/bytecodes.h"
|
||||
#include "ecmascript/compiler/pgo_bc_info.h"
|
||||
#include "ecmascript/jspandafile/js_pandafile.h"
|
||||
#include "ecmascript/jspandafile/method_literal.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
#include "ecmascript/compiler/builtins/builtins_call_signature.h"
|
||||
#include "ecmascript/compiler/circuit_builder-inl.h"
|
||||
#include "ecmascript/compiler/common_stubs.h"
|
||||
#include "ecmascript/compiler/hcr_circuit_builder.h"
|
||||
#include "ecmascript/compiler/lcr_circuit_builder.h"
|
||||
#include "ecmascript/compiler/mcr_circuit_builder.h"
|
||||
@ -33,6 +32,7 @@
|
||||
#include "ecmascript/js_primitive_ref.h"
|
||||
#include "ecmascript/js_thread.h"
|
||||
#include "ecmascript/jspandafile/program_object.h"
|
||||
#include "ecmascript/lexical_env.h"
|
||||
#include "ecmascript/mem/region.h"
|
||||
#include "ecmascript/message_string.h"
|
||||
#include "ecmascript/method.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -24,15 +24,11 @@
|
||||
#include "ecmascript/compiler/gate.h"
|
||||
#include "ecmascript/compiler/gate_accessor.h"
|
||||
#include "ecmascript/compiler/lcr_gate_meta_data.h"
|
||||
#include "ecmascript/compiler/pgo_type/pgo_type_location.h"
|
||||
#include "ecmascript/compiler/share_gate_meta_data.h"
|
||||
#include "ecmascript/compiler/variable_type.h"
|
||||
#include "ecmascript/global_env_constants.h"
|
||||
#include "ecmascript/js_hclass.h"
|
||||
#include "ecmascript/js_runtime_options.h"
|
||||
#include "ecmascript/js_tagged_value.h"
|
||||
#include "ecmascript/jspandafile/constpool_value.h"
|
||||
#include "ecmascript/tagged_array.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
using namespace panda::ecmascript;
|
||||
@ -829,7 +825,7 @@ public:
|
||||
inline GateRef IntPtrAnd(GateRef x, GateRef y);
|
||||
inline GateRef IntPtrNot(GateRef x);
|
||||
inline GateRef IntPtrEqual(GateRef x, GateRef y);
|
||||
inline GateRef DoubleTrunc(GateRef gate, GateRef value, const char* comment = nullptr);
|
||||
GateRef DoubleTrunc(GateRef gate, GateRef value, const char* comment = nullptr);
|
||||
GateRef AddWithOverflow(GateRef left, GateRef right);
|
||||
GateRef SubWithOverflow(GateRef left, GateRef right);
|
||||
GateRef MulWithOverflow(GateRef left, GateRef right);
|
||||
@ -861,11 +857,11 @@ public:
|
||||
inline GateRef GetDoubleOfTInt(GateRef x);
|
||||
inline GateRef GetDoubleOfTDouble(GateRef x);
|
||||
inline GateRef GetBooleanOfTBoolean(GateRef x);
|
||||
inline GateRef GetDoubleOfTNumber(GateRef x);
|
||||
inline GateRef DoubleToInt(GateRef x, Label *exit);
|
||||
inline GateRef DoubleToInt(GateRef glue, GateRef x, size_t typeBits);
|
||||
inline GateRef DoubleCheckINFInRangeInt32(GateRef x);
|
||||
inline GateRef DoubleInRangeInt32(GateRef x);
|
||||
GateRef GetDoubleOfTNumber(GateRef x);
|
||||
GateRef DoubleToInt(GateRef x, Label *exit);
|
||||
GateRef DoubleToInt(GateRef glue, GateRef x, size_t typeBits);
|
||||
GateRef DoubleCheckINFInRangeInt32(GateRef x);
|
||||
GateRef DoubleInRangeInt32(GateRef x);
|
||||
inline GateRef Int32ToTaggedPtr(GateRef x);
|
||||
inline GateRef Int64ToTaggedPtr(GateRef x);
|
||||
inline GateRef Int32ToTaggedInt(GateRef x);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -14,9 +14,22 @@
|
||||
*/
|
||||
|
||||
#include "ecmascript/compiler/circuit_builder_helper.h"
|
||||
#include "ecmascript/js_runtime_options.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
CompilationConfig::CompilationConfig(const std::string &triple, const JSRuntimeOptions *options)
|
||||
: tripleStr_(triple), triple_(GetTripleFromString(triple))
|
||||
{
|
||||
if (options != nullptr) {
|
||||
isTraceBc_ = options->IsTraceBC();
|
||||
profiling_ = options->GetOptCodeProfiler();
|
||||
stressDeopt_ = options->GetStressDeopt();
|
||||
verifyVTable_ = options->GetVerifyVTable();
|
||||
typedOpProfiling_ = options->GetTypedOpProfiler();
|
||||
}
|
||||
}
|
||||
|
||||
Environment::Environment(size_t arguments, CircuitBuilder *builder)
|
||||
: circuit_(builder->GetCircuit()), circuitBuilder_(builder), arguments_(arguments)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -17,24 +17,16 @@
|
||||
#define ECMASCRIPT_COMPILER_CIRCUIT_BUILDER_HELPER_H
|
||||
|
||||
#include "ecmascript/compiler/circuit_builder.h"
|
||||
#include "ecmascript/mem/region.h"
|
||||
#include "ecmascript/method.h"
|
||||
|
||||
namespace panda::ecmascript {
|
||||
class JSRuntimeOptions;
|
||||
} // namespace panda::ecmascript
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
class CompilationConfig {
|
||||
public:
|
||||
explicit CompilationConfig(const std::string &triple, const JSRuntimeOptions *options = nullptr)
|
||||
: tripleStr_(triple), triple_(GetTripleFromString(triple))
|
||||
{
|
||||
if (options != nullptr) {
|
||||
isTraceBc_ = options->IsTraceBC();
|
||||
profiling_ = options->GetOptCodeProfiler();
|
||||
stressDeopt_ = options->GetStressDeopt();
|
||||
verifyVTable_ = options->GetVerifyVTable();
|
||||
typedOpProfiling_ = options->GetTypedOpProfiler();
|
||||
}
|
||||
}
|
||||
explicit CompilationConfig(const std::string &triple, const JSRuntimeOptions *options = nullptr);
|
||||
~CompilationConfig() = default;
|
||||
|
||||
inline bool Is32Bit() const
|
||||
@ -354,7 +346,7 @@ public:
|
||||
rawLabels_.emplace_back(impl);
|
||||
return impl;
|
||||
}
|
||||
inline void SubCfgEntry(Label *entry)
|
||||
void SubCfgEntry(Label *entry)
|
||||
{
|
||||
if (currentLabel_ != nullptr) {
|
||||
GateRef control = currentLabel_->GetControl();
|
||||
@ -365,7 +357,7 @@ public:
|
||||
currentLabel_->SetDepend(depend);
|
||||
}
|
||||
}
|
||||
inline void SubCfgExit()
|
||||
void SubCfgExit()
|
||||
{
|
||||
if (currentLabel_ != nullptr) {
|
||||
GateRef control = currentLabel_->GetControl();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -53,6 +53,7 @@
|
||||
#include "llvm/IR/Verifier.h"
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
|
||||
#include "ecmascript/compiler/aot_file/aot_file_info.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/codegen/llvm/llvm_ir_builder.h"
|
||||
#include "ecmascript/compiler/compiler_log.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -22,12 +22,11 @@
|
||||
#include "ecmascript/compiler/baseline/baseline_call_signature.h"
|
||||
#include "ecmascript/compiler/circuit.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/common_stubs.h"
|
||||
#include "ecmascript/compiler/debug_info.h"
|
||||
#include "ecmascript/compiler/gate.h"
|
||||
#include "ecmascript/compiler/share_gate_meta_data.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/compiler/baseline/baseline_stubs.h"
|
||||
#include "ecmascript/compiler/baseline/baseline_stub_csigns.h"
|
||||
#include "ecmascript/deoptimizer/deoptimizer.h"
|
||||
#include "ecmascript/frames.h"
|
||||
#include "ecmascript/js_thread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ecmascript/compiler/gate.h"
|
||||
#include "ecmascript/compiler/stub_builder.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/common_stubs.h"
|
||||
#include "ecmascript/compiler/common_stub_csigns.h"
|
||||
#include "ecmascript/compiler/interpreter_stub.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/compiler/ir_module.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -23,7 +23,7 @@
|
||||
#include "ecmascript/compiler/baseline/baseline_call_signature.h"
|
||||
#include "ecmascript/compiler/circuit.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/common_stubs.h"
|
||||
#include "ecmascript/compiler/common_stub_csigns.h"
|
||||
#include "ecmascript/compiler/debug_info.h"
|
||||
#include "ecmascript/compiler/gate.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -23,7 +23,6 @@
|
||||
#include "ecmascript/compiler/gate.h"
|
||||
#include "ecmascript/compiler/stub_builder.h"
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
#include "ecmascript/compiler/common_stubs.h"
|
||||
#include "ecmascript/compiler/interpreter_stub.h"
|
||||
#include "ecmascript/compiler/rt_call_signature.h"
|
||||
#include "ecmascript/compiler/ir_builder.h"
|
||||
|
151
ecmascript/compiler/common_stub_csigns.h
Normal file
151
ecmascript/compiler/common_stub_csigns.h
Normal file
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (c) 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ECMASCRIPT_COMPILER_COMMON_STUB_CSIGNS_H
|
||||
#define ECMASCRIPT_COMPILER_COMMON_STUB_CSIGNS_H
|
||||
|
||||
#include "ecmascript/compiler/call_signature.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
#define COMMON_STUB_LIST(V) \
|
||||
V(Add) \
|
||||
V(Sub) \
|
||||
V(Mul) \
|
||||
V(Div) \
|
||||
V(Mod) \
|
||||
V(Equal) \
|
||||
V(NotEqual) \
|
||||
V(StrictEqual) \
|
||||
V(StrictNotEqual) \
|
||||
V(Less) \
|
||||
V(LessEq) \
|
||||
V(Greater) \
|
||||
V(GreaterEq) \
|
||||
V(Shl) \
|
||||
V(Shr) \
|
||||
V(Ashr) \
|
||||
V(And) \
|
||||
V(Or) \
|
||||
V(Xor) \
|
||||
V(Instanceof) \
|
||||
V(TypeOf) \
|
||||
V(Inc) \
|
||||
V(Dec) \
|
||||
V(Neg) \
|
||||
V(Not) \
|
||||
V(ToBooleanTrue) \
|
||||
V(ToBooleanFalse) \
|
||||
V(GetPropertyByName) \
|
||||
V(DeprecatedGetPropertyByName) \
|
||||
V(SetPropertyByName) \
|
||||
V(DeprecatedSetPropertyByName) \
|
||||
V(SetPropertyByNameWithOwn) \
|
||||
V(GetPropertyByIndex) \
|
||||
V(SetPropertyByIndex) \
|
||||
V(SetPropertyByIndexWithOwn) \
|
||||
V(GetPropertyByValue) \
|
||||
V(DeprecatedGetPropertyByValue) \
|
||||
V(SetPropertyByValue) \
|
||||
V(DeprecatedSetPropertyByValue) \
|
||||
V(TryLdGlobalByName) \
|
||||
V(TryStGlobalByName) \
|
||||
V(LdGlobalVar) \
|
||||
V(LdObjByIndex) \
|
||||
V(StGlobalVar) \
|
||||
V(StObjByIndex) \
|
||||
V(StOwnByIndex) \
|
||||
V(StOwnByName) \
|
||||
V(StOwnByNameWithNameSet) \
|
||||
V(StOwnByValue) \
|
||||
V(StOwnByValueWithNameSet) \
|
||||
V(SetPropertyByValueWithOwn) \
|
||||
V(TryLoadICByName) \
|
||||
V(TryLoadICByValue) \
|
||||
V(TryStoreICByName) \
|
||||
V(TryStoreICByValue) \
|
||||
V(SetValueWithBarrier) \
|
||||
V(SetNonSValueWithBarrier) \
|
||||
V(SetValueWithEdenBarrier) \
|
||||
V(SetNonSValueWithEdenBarrier) \
|
||||
V(SetSValueWithBarrier) \
|
||||
V(NewLexicalEnv) \
|
||||
V(CopyRestArgs) \
|
||||
V(GetUnmappedArgs) \
|
||||
V(GetCallSpreadArgs) \
|
||||
V(NewThisObjectChecked) \
|
||||
V(ConstructorCheck) \
|
||||
V(CreateEmptyArray) \
|
||||
V(CreateArrayWithBuffer) \
|
||||
V(NewJSObject) \
|
||||
V(JsBoundCallInternal) \
|
||||
V(JsProxyCallInternal) \
|
||||
V(CreateStringBySingleCharCode) \
|
||||
V(Getpropiterator) \
|
||||
V(Getnextpropname) \
|
||||
V(CreateJSSetIterator) \
|
||||
V(JSSetEntries) \
|
||||
V(CreateJSMapIterator) \
|
||||
V(JSMapKeys) \
|
||||
V(JSMapValues) \
|
||||
V(JSMapGet) \
|
||||
V(JSMapHas) \
|
||||
V(JSSetHas) \
|
||||
V(JSSetAdd) \
|
||||
V(JSMapDelete) \
|
||||
V(JSSetDelete) \
|
||||
V(CreateJSTypedArrayEntries) \
|
||||
V(CreateJSTypedArrayKeys) \
|
||||
V(CreateJSTypedArrayValues) \
|
||||
V(GetSingleCharCodeByIndex) \
|
||||
V(FastStringEqual) \
|
||||
V(FastStringAdd) \
|
||||
V(Definefunc) \
|
||||
V(DeleteObjectProperty) \
|
||||
V(SameValue) \
|
||||
V(StringIteratorNext)
|
||||
|
||||
#define COMMON_STUB_ID_LIST(V) \
|
||||
COMMON_STUB_LIST(V)
|
||||
|
||||
class CommonStubCSigns {
|
||||
public:
|
||||
enum ID {
|
||||
#define DEF_STUB_ID(name) name,
|
||||
COMMON_STUB_ID_LIST(DEF_STUB_ID)
|
||||
#undef DEF_STUB_ID
|
||||
NUM_OF_STUBS
|
||||
};
|
||||
|
||||
static void Initialize();
|
||||
|
||||
static void GetCSigns(std::vector<const CallSignature*>& callSigns);
|
||||
|
||||
static const CallSignature *Get(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return &callSigns_[index];
|
||||
}
|
||||
|
||||
static const std::string &GetName(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return callSigns_[index].GetName();
|
||||
}
|
||||
|
||||
private:
|
||||
static CallSignature callSigns_[NUM_OF_STUBS];
|
||||
};
|
||||
} // namespace panda::ecmascript::kungfu
|
||||
#endif // ECMASCRIPT_COMPILER_COMMON_STUB_CSIGNS_H
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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
|
||||
@ -16,108 +16,10 @@
|
||||
#ifndef ECMASCRIPT_COMPILER_COMMON_STUBS_H
|
||||
#define ECMASCRIPT_COMPILER_COMMON_STUBS_H
|
||||
|
||||
#include "ecmascript/compiler/common_stub_csigns.h"
|
||||
#include "ecmascript/compiler/stub_builder.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
#define COMMON_STUB_LIST(V) \
|
||||
V(Add) \
|
||||
V(Sub) \
|
||||
V(Mul) \
|
||||
V(Div) \
|
||||
V(Mod) \
|
||||
V(Equal) \
|
||||
V(NotEqual) \
|
||||
V(StrictEqual) \
|
||||
V(StrictNotEqual) \
|
||||
V(Less) \
|
||||
V(LessEq) \
|
||||
V(Greater) \
|
||||
V(GreaterEq) \
|
||||
V(Shl) \
|
||||
V(Shr) \
|
||||
V(Ashr) \
|
||||
V(And) \
|
||||
V(Or) \
|
||||
V(Xor) \
|
||||
V(Instanceof) \
|
||||
V(TypeOf) \
|
||||
V(Inc) \
|
||||
V(Dec) \
|
||||
V(Neg) \
|
||||
V(Not) \
|
||||
V(ToBooleanTrue) \
|
||||
V(ToBooleanFalse) \
|
||||
V(GetPropertyByName) \
|
||||
V(DeprecatedGetPropertyByName) \
|
||||
V(SetPropertyByName) \
|
||||
V(DeprecatedSetPropertyByName) \
|
||||
V(SetPropertyByNameWithOwn) \
|
||||
V(GetPropertyByIndex) \
|
||||
V(SetPropertyByIndex) \
|
||||
V(SetPropertyByIndexWithOwn) \
|
||||
V(GetPropertyByValue) \
|
||||
V(DeprecatedGetPropertyByValue) \
|
||||
V(SetPropertyByValue) \
|
||||
V(DeprecatedSetPropertyByValue) \
|
||||
V(TryLdGlobalByName) \
|
||||
V(TryStGlobalByName) \
|
||||
V(LdGlobalVar) \
|
||||
V(LdObjByIndex) \
|
||||
V(StGlobalVar) \
|
||||
V(StObjByIndex) \
|
||||
V(StOwnByIndex) \
|
||||
V(StOwnByName) \
|
||||
V(StOwnByNameWithNameSet) \
|
||||
V(StOwnByValue) \
|
||||
V(StOwnByValueWithNameSet) \
|
||||
V(SetPropertyByValueWithOwn) \
|
||||
V(TryLoadICByName) \
|
||||
V(TryLoadICByValue) \
|
||||
V(TryStoreICByName) \
|
||||
V(TryStoreICByValue) \
|
||||
V(SetValueWithBarrier) \
|
||||
V(SetNonSValueWithBarrier) \
|
||||
V(SetValueWithEdenBarrier) \
|
||||
V(SetNonSValueWithEdenBarrier) \
|
||||
V(SetSValueWithBarrier) \
|
||||
V(NewLexicalEnv) \
|
||||
V(CopyRestArgs) \
|
||||
V(GetUnmappedArgs) \
|
||||
V(GetCallSpreadArgs) \
|
||||
V(NewThisObjectChecked) \
|
||||
V(ConstructorCheck) \
|
||||
V(CreateEmptyArray) \
|
||||
V(CreateArrayWithBuffer) \
|
||||
V(NewJSObject) \
|
||||
V(JsBoundCallInternal) \
|
||||
V(JsProxyCallInternal) \
|
||||
V(CreateStringBySingleCharCode) \
|
||||
V(Getpropiterator) \
|
||||
V(Getnextpropname) \
|
||||
V(CreateJSSetIterator) \
|
||||
V(JSSetEntries) \
|
||||
V(CreateJSMapIterator) \
|
||||
V(JSMapKeys) \
|
||||
V(JSMapValues) \
|
||||
V(JSMapGet) \
|
||||
V(JSMapHas) \
|
||||
V(JSSetHas) \
|
||||
V(JSSetAdd) \
|
||||
V(JSMapDelete) \
|
||||
V(JSSetDelete) \
|
||||
V(CreateJSTypedArrayEntries) \
|
||||
V(CreateJSTypedArrayKeys) \
|
||||
V(CreateJSTypedArrayValues) \
|
||||
V(GetSingleCharCodeByIndex) \
|
||||
V(FastStringEqual) \
|
||||
V(FastStringAdd) \
|
||||
V(Definefunc) \
|
||||
V(DeleteObjectProperty) \
|
||||
V(SameValue) \
|
||||
V(StringIteratorNext)
|
||||
|
||||
#define COMMON_STUB_ID_LIST(V) \
|
||||
COMMON_STUB_LIST(V)
|
||||
|
||||
#define DECLARE_STUB_CLASS(name) \
|
||||
class name##StubBuilder : public StubBuilder { \
|
||||
@ -132,33 +34,5 @@ namespace panda::ecmascript::kungfu {
|
||||
COMMON_STUB_LIST(DECLARE_STUB_CLASS)
|
||||
#undef DECLARE_STUB_CLASS
|
||||
|
||||
class CommonStubCSigns {
|
||||
public:
|
||||
enum ID {
|
||||
#define DEF_STUB_ID(name) name,
|
||||
COMMON_STUB_ID_LIST(DEF_STUB_ID)
|
||||
#undef DEF_STUB_ID
|
||||
NUM_OF_STUBS
|
||||
};
|
||||
|
||||
static void Initialize();
|
||||
|
||||
static void GetCSigns(std::vector<const CallSignature*>& callSigns);
|
||||
|
||||
static const CallSignature *Get(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return &callSigns_[index];
|
||||
}
|
||||
|
||||
static const std::string &GetName(size_t index)
|
||||
{
|
||||
ASSERT(index < NUM_OF_STUBS);
|
||||
return callSigns_[index].GetName();
|
||||
}
|
||||
|
||||
private:
|
||||
static CallSignature callSigns_[NUM_OF_STUBS];
|
||||
};
|
||||
} // namespace panda::ecmascript::kungfu
|
||||
#endif // ECMASCRIPT_COMPILER_COMMON_STUBS_H
|
||||
|
@ -16,8 +16,9 @@
|
||||
#ifndef ECMASCRIPT_COMPILER_COMPILATION_ENV_H
|
||||
#define ECMASCRIPT_COMPILER_COMPILATION_ENV_H
|
||||
|
||||
#include "ecmascript/js_thread.h"
|
||||
#include "ecmascript/global_env.h"
|
||||
#include "ecmascript/js_handle.h"
|
||||
#include "ecmascript/jspandafile/method_literal.h"
|
||||
#include "ecmascript/pgo_profiler/pgo_utils.h"
|
||||
|
||||
namespace panda::ecmascript {
|
||||
@ -28,6 +29,8 @@ class ConstantPool;
|
||||
namespace pgo {
|
||||
class PGOProfiler;
|
||||
};
|
||||
class JSThread;
|
||||
|
||||
class CompilationEnv {
|
||||
public:
|
||||
CompilationEnv(EcmaVM *vm);
|
||||
|
@ -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
|
||||
@ -28,7 +28,6 @@
|
||||
#include "ecmascript/log_wrapper.h"
|
||||
#include "ecmascript/mem/clock_scope.h"
|
||||
#include "ecmascript/mem/c_string.h"
|
||||
#include "ecmascript/compiler/circuit_builder-inl.h"
|
||||
#include "ecmascript/compiler/argument_accessor.h"
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
129
ecmascript/compiler/deopt_type.h
Normal file
129
ecmascript/compiler/deopt_type.h
Normal file
@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (c) 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ECMASCRIPT_COMPILER_DEOPT_TYPE_H
|
||||
#define ECMASCRIPT_COMPILER_DEOPT_TYPE_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace panda::ecmascript::kungfu {
|
||||
|
||||
#define GATE_META_DATA_DEOPT_REASON(V) \
|
||||
V(NotInt1, NOTINT1) \
|
||||
V(NotInt2, NOTINT2) \
|
||||
V(NotInt3, NOTINT3) \
|
||||
V(NotInt4, NOTINT4) \
|
||||
V(NotInt5, NOTINT5) \
|
||||
V(NotInt6, NOTINT6) \
|
||||
V(NotDouble1, NOTDOUBLE1) \
|
||||
V(NotDouble2, NOTDOUBLE2) \
|
||||
V(NotDouble3, NOTDOUBLE3) \
|
||||
V(NotNumber1, NOTNUMBER1) \
|
||||
V(NotNumber2, NOTNUMBER2) \
|
||||
V(NotNumberOrString, NOTNUMBERORSTRING) \
|
||||
V(CannotStoreSpecailHole, CANNOTSTORESPECAILHOLE) \
|
||||
V(NotBool1, NOTBOOL1) \
|
||||
V(NotBool2, NOTBOOL2) \
|
||||
V(NotHeapObject1, NOTHEAPOBJECT1) \
|
||||
V(NotStableArray1, NOTSARRAY1) \
|
||||
V(NotStableArray2, NOTSARRAY2) \
|
||||
V(ElementsKindMismatchedAtLoad, ELEMENSKINDMISMATCHEDATLOAD) \
|
||||
V(ElementsKindMismatchedAtStore, ELEMENSKINDMISMATCHEDATSTORE) \
|
||||
V(InconsistentElementsKind, INCONSISTENTELEMENTSKIND) \
|
||||
V(NotArray1, NOTARRAY1) \
|
||||
V(NotArray2, NOTARRAY2) \
|
||||
V(InconsistentOnHeap1, INCONSISTENTONHEAP1) \
|
||||
V(InconsistentHClass1, INCONSISTENTHCLASS1) \
|
||||
V(InconsistentHClass2, INCONSISTENTHCLASS2) \
|
||||
V(InconsistentHClass3, INCONSISTENTHCLASS3) \
|
||||
V(InconsistentHClass4, INCONSISTENTHCLASS4) \
|
||||
V(InconsistentHClass5, INCONSISTENTHCLASS5) \
|
||||
V(InconsistentHClass6, INCONSISTENTHCLASS6) \
|
||||
V(InconsistentHClass7, INCONSISTENTHCLASS7) \
|
||||
V(InconsistentHClass8, INCONSISTENTHCLASS8) \
|
||||
V(InconsistentHClass9, INCONSISTENTHCLASS9) \
|
||||
V(InconsistentHClass10, INCONSISTENTHCLASS10) \
|
||||
V(InconsistentHClass11, INCONSISTENTHCLASS11) \
|
||||
V(InconsistentHClass12, INCONSISTENTHCLASS12) \
|
||||
V(NotEcmaObject1, NOTECMAOBJECT1) \
|
||||
V(NotNewObj1, NOTNEWOBJ1) \
|
||||
V(NotNewObj2, NOTNEWOBJ2) \
|
||||
V(NotNewObj3, NOTNEWOBJ3) \
|
||||
V(NotLegalIndex1, NOTLEGALIDX1) \
|
||||
V(NotNegativeOverflow1, NOTNEGOV1) \
|
||||
V(NotCallTarget1, NOTCALLTGT1) \
|
||||
V(NotJSCallTarget1, NOTJSCALLTGT1) \
|
||||
V(NotJSCallTarget2, NOTJSCALLTGT2) \
|
||||
V(NotJSCallTarget3, NOTJSCALLTGT3) \
|
||||
V(NotJSCallTarget4, NOTJSCALLTGT4) \
|
||||
V(NotJSNewCallTarget, NOTJSNEWCALLTGT) \
|
||||
V(DivideZero1, DIVZERO1) \
|
||||
V(DivideZero2, DIVZERO2) \
|
||||
V(InlineFail1, INLINEFAIL1) \
|
||||
V(InlineFail2, INLINEFAIL2) \
|
||||
V(NotJSFastCallTarget1, NOTJSFASTCALLTGT1) \
|
||||
V(NotJSFastCallTarget2, NOTJSFASTCALLTGT2) \
|
||||
V(NotJSFastCallTarget3, NOTJSFASTCALLTGT3) \
|
||||
V(LexVarIsHole1, LEXVARISHOLE1) \
|
||||
V(ModZero1, MODZERO1) \
|
||||
V(RemainderIsNegativeZero, REMAINDERISNEGATIVEZERO) \
|
||||
V(Int32Overflow1, INT32OVERFLOW1) \
|
||||
V(NotString1, NOTSTRING1) \
|
||||
V(InconsistentType1, INCONSISTENTTYPE1) \
|
||||
V(NotNull1, NOTNULL1) \
|
||||
V(NotNull2, NOTNULL2) \
|
||||
V(BuiltinInstanceHClassMismatch, BUILTININSTANCEHCLASSMISMATCH) \
|
||||
V(BuiltinInstanceHClassMismatch2, BUILTININSTANCEHCLASSMISMATCH2) \
|
||||
V(BuiltinPrototypeHClassMismatch1, BUILTINPROTOHCLASSMISMATCH1) \
|
||||
V(BuiltinPrototypeHClassMismatch2, BUILTINPROTOHCLASSMISMATCH2) \
|
||||
V(ProtoTypeChanged1, PROTOTYPECHANGED1) \
|
||||
V(ProtoTypeChanged2, PROTOTYPECHANGED2) \
|
||||
V(BuiltinIsHole1, BUILTINISHOLE1) \
|
||||
V(NewBuiltinCtorFail1, NEWBUILTINCTORFAIL1) \
|
||||
V(NewBuiltinCtorObject, NEWBUILTINCTOROBJECT) \
|
||||
V(NewBuiltinCtorArray, NEWBUILTINCTORARRAY) \
|
||||
V(NewBuiltinCtorFloat32Array, NEWBUILTINCTORFLOAT32ARRAY) \
|
||||
V(NewBuiltinCtorBoolean, NEWBUILTINCTORBOOLEAN) \
|
||||
V(IsUndefinedOrHole, ISUNDEFINEDORHOLE) \
|
||||
V(IsNotUndefinedOrHole, ISNOTUNDEFINEDORHOLE) \
|
||||
V(BuiltinInliningTypeGuard, BUILTIN_INLINING_TYPE_GUARD) \
|
||||
V(RangeError, RANGE_ERROR) \
|
||||
V(NotBigInt, NOT_BIG_INT) \
|
||||
V(OsrLoopExit, OSRLOOPEXIT) \
|
||||
V(IsNotMap, ISNOTMAP) \
|
||||
V(IsNotEcmaObject, ISNOTECMAOBJECT) \
|
||||
V(IsNotDataView, ISNOTDATAVIEW) \
|
||||
V(IndexLessZero, INDEXLESSZERO) \
|
||||
V(ArrayBufferIsDetached, ARRAYBUFFERISDETACHED) \
|
||||
V(TotalSizeOverflow, TOTALSIZEOVERFLOW) \
|
||||
V(NotJSFunction, NOTJSFUNCTION) \
|
||||
V(NotSymbol, NOTSYMBOL) \
|
||||
V(IndexNotInt, INDEXNOTINT) \
|
||||
V(InitAotFailed, INIT_AOT_FAILED) \
|
||||
V(NotEcmaObject, NOT_ECMA_OBJECT) \
|
||||
V(NotCallable, NOTCALLABLE) \
|
||||
V(ArrayLengthOverMax, ARRAYLENGTHOVERMAX) \
|
||||
V(ArrayLengthNotWritable, ARRAYLENGTHNOTWRITABLE)
|
||||
|
||||
enum class DeoptType : uint8_t {
|
||||
NONE = 0,
|
||||
#define DECLARE_DEOPT_TYPE(NAME, TYPE) TYPE,
|
||||
GATE_META_DATA_DEOPT_REASON(DECLARE_DEOPT_TYPE)
|
||||
#undef DECLARE_DEOPT_TYPE
|
||||
};
|
||||
|
||||
} // namespace panda::ecmascript::kungfu
|
||||
|
||||
#endif // ECMASCRIPT_COMPILER_DEOPT_TYPE_H
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user