From 940276a2f73f29eaf877a651b99c7a6edf7dbeed Mon Sep 17 00:00:00 2001 From: Svetlana Rokashevich Date: Mon, 15 Jan 2024 14:47:15 +0300 Subject: [PATCH] Replace namespace panda with ark Apply clang-force-format Signed-off-by: Svetlana Rokashevich --- assembler/extension/ecmascript_meta.cpp | 4 +- assembler/extension/ecmascript_meta.h | 4 +- compiler/codegen_intrinsics_ecmascript.cpp | 10 +- compiler/ecmascript_call_params.h | 12 +- .../ecmascript_codegen_extensions.cpp | 4 +- .../ecmascript_environment.h | 16 +- .../ecmascript_irtoc_interface.h | 40 +- .../thread_environment_api.h | 6 +- compiler/inline_intrinsics_ecmascript.cpp | 14 +- .../code_generator/compiler_base_types.cpp | 58 +-- .../code_generator/compiler_base_types.h | 4 +- compiler/optimizer/ecma_pipeline.cpp | 4 +- compiler/optimizer/ecma_pipeline.h | 4 +- compiler/optimizer/ir/dyn_datatype.h | 156 +++---- .../ir_builder/ecmascript_inst_builder.cpp | 13 +- .../ir_builder/ecmascript_inst_templates.yaml | 4 +- .../optimizer/optimizations/ecma_inlining.cpp | 4 +- .../optimizer/optimizations/ecma_inlining.h | 4 +- .../optimizations/inline_call_intrinsics.cpp | 12 +- .../optimizations/inline_call_intrinsics.h | 4 +- .../ecmascript_inst_builder_gen.cpp.erb | 4 +- ecmascript_plugin_options.yaml | 72 ++-- ecmastdlib/ecmastdlib_inline_gen.h.erb | 4 +- irtoc_scripts/common.irt | 4 +- irtoc_scripts/interpreter_handlers.irt | 6 +- runtime/accessor_data.h | 4 +- runtime/asm_defines/asm_defines.def | 238 +++++------ runtime/base/array_helper.cpp | 4 +- runtime/base/array_helper.h | 4 +- runtime/base/builtins_base.cpp | 4 +- runtime/base/builtins_base.h | 4 +- runtime/base/config.h | 4 +- runtime/base/error_helper.cpp | 6 +- runtime/base/error_helper.h | 4 +- runtime/base/error_type.h | 4 +- runtime/base/json_parser.cpp | 4 +- runtime/base/json_parser.h | 4 +- runtime/base/json_stringifier.cpp | 4 +- runtime/base/json_stringifier.h | 4 +- runtime/base/number_helper.cpp | 4 +- runtime/base/number_helper.h | 4 +- runtime/base/object_helper.cpp | 4 +- runtime/base/object_helper.h | 4 +- runtime/base/string_helper.cpp | 10 +- runtime/base/string_helper.h | 10 +- runtime/base/typed_array_helper-inl.h | 4 +- runtime/base/typed_array_helper.cpp | 6 +- runtime/base/typed_array_helper.h | 4 +- runtime/bridge.h | 4 +- ...dle_call_ecma_call0dyn_pref_none_aarch64.S | 2 +- ...e_call_ecma_call0thisdyn_pref_v8_aarch64.S | 2 +- .../handle_call_ecma_calldyn_helper_aarch64.S | 2 +- ...ecma_callirangedyn_pref_imm16_v8_aarch64.S | 2 +- ..._callithisrangedyn_pref_imm16_v8_aarch64.S | 2 +- ...dle_call_ecma_callthisdyn_helper_aarch64.S | 2 +- ...cma_newobjdynrange_pref_imm16_v8_aarch64.S | 2 +- ...andle_call_ecma_call0dyn_pref_none_amd64.S | 2 +- ...dle_call_ecma_call0thisdyn_pref_v8_amd64.S | 2 +- .../handle_call_ecma_calldyn_helper_amd64.S | 2 +- ...l_ecma_callirangedyn_pref_imm16_v8_amd64.S | 2 +- ...ma_callithisrangedyn_pref_imm16_v8_amd64.S | 2 +- ...andle_call_ecma_callthisdyn_helper_amd64.S | 2 +- ..._ecma_newobjdynrange_pref_imm16_v8_amd64.S | 2 +- runtime/bridge/arch/arm/builtin_bridge_arm.S | 2 +- runtime/bridge/ecma_bridge_helpers.cpp | 4 +- runtime/builtins.cpp | 6 +- runtime/builtins.h | 4 +- runtime/builtins/builtins_ark_tools.cpp | 4 +- runtime/builtins/builtins_array.cpp | 4 +- runtime/builtins/builtins_arraybuffer.cpp | 4 +- .../builtins_async_from_sync_iterator.cpp | 4 +- runtime/builtins/builtins_async_function.cpp | 4 +- runtime/builtins/builtins_async_generator.cpp | 4 +- runtime/builtins/builtins_async_iterator.cpp | 4 +- runtime/builtins/builtins_bigint.cpp | 4 +- runtime/builtins/builtins_boolean.cpp | 4 +- runtime/builtins/builtins_collator.cpp | 4 +- runtime/builtins/builtins_dataview.cpp | 4 +- runtime/builtins/builtins_date.cpp | 6 +- .../builtins/builtins_date_time_format.cpp | 4 +- runtime/builtins/builtins_errors.cpp | 4 +- .../builtins_finalization_registry.cpp | 4 +- runtime/builtins/builtins_function.cpp | 4 +- runtime/builtins/builtins_generator.cpp | 4 +- runtime/builtins/builtins_global.cpp | 4 +- runtime/builtins/builtins_intl.cpp | 4 +- runtime/builtins/builtins_iterator.cpp | 4 +- runtime/builtins/builtins_json.cpp | 10 +- runtime/builtins/builtins_locale.cpp | 4 +- runtime/builtins/builtins_map.cpp | 4 +- runtime/builtins/builtins_math.cpp | 4 +- runtime/builtins/builtins_number.cpp | 4 +- runtime/builtins/builtins_number_format.cpp | 4 +- runtime/builtins/builtins_object.cpp | 4 +- runtime/builtins/builtins_plural_rules.cpp | 4 +- runtime/builtins/builtins_promise.cpp | 4 +- runtime/builtins/builtins_promise_handler.cpp | 4 +- runtime/builtins/builtins_promise_job.cpp | 4 +- runtime/builtins/builtins_proxy.cpp | 4 +- runtime/builtins/builtins_reflect.cpp | 4 +- runtime/builtins/builtins_regexp.cpp | 4 +- runtime/builtins/builtins_regexp.h | 6 +- .../builtins_relative_time_format.cpp | 4 +- runtime/builtins/builtins_runtime_testing.cpp | 4 +- runtime/builtins/builtins_set.cpp | 4 +- runtime/builtins/builtins_string.cpp | 4 +- runtime/builtins/builtins_string_iterator.cpp | 4 +- runtime/builtins/builtins_symbol.cpp | 4 +- runtime/builtins/builtins_typedarray.cpp | 4 +- runtime/builtins/builtins_weak_map.cpp | 4 +- runtime/builtins/builtins_weak_ref.cpp | 4 +- runtime/builtins/builtins_weak_set.cpp | 4 +- .../builtins_inline_intrinsics_gen.inl.erb | 6 +- runtime/class_info_extractor.cpp | 4 +- runtime/class_info_extractor.h | 4 +- .../class_linker/panda_file_translator.cpp | 38 +- runtime/class_linker/panda_file_translator.h | 4 +- runtime/class_linker/program_object-inl.h | 4 +- runtime/class_linker/program_object.h | 4 +- runtime/common.h | 4 +- .../compiler/ecmascript_runtime_interface.cpp | 84 ++-- .../compiler/ecmascript_runtime_interface.h | 43 +- runtime/containers/containers_arraylist.cpp | 4 +- runtime/containers/containers_arraylist.h | 4 +- runtime/containers/containers_private.cpp | 4 +- runtime/containers/containers_private.h | 4 +- runtime/dump.cpp | 8 +- runtime/ecma_call_params.h | 4 +- runtime/ecma_call_profiling_table.cpp | 6 +- runtime/ecma_call_profiling_table.h | 4 +- runtime/ecma_class_linker_extension.cpp | 12 +- runtime/ecma_class_linker_extension.h | 8 +- runtime/ecma_compiler.cpp | 6 +- runtime/ecma_compiler.h | 4 +- runtime/ecma_entrypoints.cpp | 4 +- runtime/ecma_entrypoints.h | 4 +- runtime/ecma_entrypoints.yaml | 12 +- runtime/ecma_exceptions.cpp | 4 +- runtime/ecma_exceptions.h | 4 +- runtime/ecma_global_storage-inl.h | 4 +- runtime/ecma_global_storage.h | 4 +- runtime/ecma_handle_scope-inl.h | 4 +- runtime/ecma_handle_scope.h | 4 +- runtime/ecma_language_context-inl.h | 4 +- runtime/ecma_language_context.cpp | 6 +- runtime/ecma_language_context.h | 6 +- runtime/ecma_macro_accessors.h | 6 +- runtime/ecma_macros.h | 4 +- runtime/ecma_module.cpp | 4 +- runtime/ecma_module.h | 4 +- runtime/ecma_profiling.cpp | 4 +- runtime/ecma_profiling.h | 16 +- runtime/ecma_runtime.yaml | 382 +++++++++--------- runtime/ecma_runtime_call_info.h | 4 +- runtime/ecma_string-inl.h | 12 +- runtime/ecma_string.cpp | 4 +- runtime/ecma_string.h | 10 +- runtime/ecma_string_table.cpp | 12 +- runtime/ecma_string_table.h | 8 +- runtime/ecma_vm.cpp | 18 +- runtime/ecma_vm.h | 24 +- runtime/free_object.cpp | 4 +- runtime/free_object.h | 8 +- runtime/generator_helper.cpp | 4 +- runtime/generator_helper.h | 4 +- runtime/global_dictionary-inl.h | 4 +- runtime/global_dictionary.h | 4 +- runtime/global_env.cpp | 4 +- runtime/global_env.h | 4 +- runtime/global_env_constants-inl.h | 4 +- runtime/global_env_constants.cpp | 4 +- runtime/global_env_constants.h | 4 +- runtime/global_handle_collection.h | 4 +- runtime/handle_storage_check.h | 4 +- runtime/ic/ic_binary_op-inl.h | 4 +- runtime/ic/ic_binary_op.h | 4 +- runtime/ic/ic_compare_op.cpp | 4 +- runtime/ic/ic_compare_op.h | 4 +- runtime/ic/ic_handler-inl.h | 4 +- runtime/ic/ic_handler.h | 4 +- runtime/ic/ic_runtime.cpp | 4 +- runtime/ic/ic_runtime.h | 4 +- runtime/ic/ic_runtime_stub-inl.h | 4 +- runtime/ic/ic_runtime_stub.cpp | 4 +- runtime/ic/ic_runtime_stub.h | 4 +- runtime/ic/invoke_cache.h | 4 +- runtime/ic/profile_type_info.cpp | 4 +- runtime/ic/profile_type_info.h | 4 +- runtime/ic/properties_cache-inl.h | 4 +- runtime/ic/properties_cache.h | 4 +- runtime/ic/property_box.cpp | 4 +- runtime/ic/property_box.h | 4 +- runtime/ic/proto_change_details.cpp | 4 +- runtime/ic/proto_change_details.h | 4 +- .../include/tooling/pt_ecmascript_extension.h | 6 +- runtime/internal_call_params.cpp | 4 +- runtime/internal_call_params.h | 4 +- runtime/interpreter/ecma-interpreter-inl.h | 10 +- runtime/interpreter/ecma-interpreter.h | 4 +- runtime/interpreter/fast_runtime_stub-inl.h | 4 +- runtime/interpreter/fast_runtime_stub.h | 4 +- runtime/interpreter/interpreter-inl.h | 8 +- runtime/interpreter/interpreter.h | 4 +- runtime/interpreter/js_decode_call_instr.h | 4 +- runtime/interpreter/js_frame-inl.h | 4 +- runtime/interpreter/js_frame.h | 4 +- runtime/interpreter/slow_runtime_helper.cpp | 4 +- runtime/interpreter/slow_runtime_helper.h | 4 +- runtime/interpreter/slow_runtime_stub.cpp | 4 +- runtime/interpreter/slow_runtime_stub.h | 4 +- runtime/intrinsics-inl.h | 4 +- runtime/jobs/micro_job_queue.cpp | 4 +- runtime/jobs/micro_job_queue.h | 4 +- runtime/jobs/pending_job.h | 4 +- runtime/js_arguments.cpp | 4 +- runtime/js_arguments.h | 4 +- runtime/js_array.cpp | 8 +- runtime/js_array.h | 8 +- runtime/js_array_iterator.cpp | 4 +- runtime/js_array_iterator.h | 4 +- runtime/js_arraybuffer.cpp | 4 +- runtime/js_arraybuffer.h | 4 +- runtime/js_arraylist.cpp | 4 +- runtime/js_arraylist.h | 4 +- .../js_async_from_sync_iterator_object.cpp | 4 +- runtime/js_async_from_sync_iterator_object.h | 4 +- runtime/js_async_function.cpp | 4 +- runtime/js_async_function.h | 4 +- runtime/js_async_generator_object.cpp | 6 +- runtime/js_async_generator_object.h | 4 +- runtime/js_bigint.cpp | 4 +- runtime/js_bigint.h | 4 +- runtime/js_collator.cpp | 4 +- runtime/js_collator.h | 4 +- runtime/js_dataview.cpp | 4 +- runtime/js_dataview.h | 4 +- runtime/js_date.cpp | 4 +- runtime/js_date.h | 4 +- runtime/js_date_time_format.cpp | 4 +- runtime/js_date_time_format.h | 4 +- runtime/js_eval.cpp | 4 +- runtime/js_eval.h | 8 +- runtime/js_finalization_registry.cpp | 4 +- runtime/js_finalization_registry.h | 4 +- runtime/js_for_in_iterator.cpp | 4 +- runtime/js_for_in_iterator.h | 4 +- runtime/js_function.cpp | 4 +- runtime/js_function.h | 6 +- runtime/js_function_extra_info.h | 4 +- runtime/js_function_kind.h | 4 +- runtime/js_generator_object.cpp | 4 +- runtime/js_generator_object.h | 4 +- runtime/js_global_object.h | 4 +- runtime/js_handle.h | 8 +- runtime/js_hclass-inl.h | 4 +- runtime/js_hclass.cpp | 4 +- runtime/js_hclass.h | 6 +- runtime/js_intl.h | 4 +- runtime/js_invoker.cpp | 4 +- runtime/js_invoker.h | 4 +- runtime/js_iterator.cpp | 4 +- runtime/js_iterator.h | 4 +- runtime/js_locale.cpp | 4 +- runtime/js_locale.h | 4 +- runtime/js_map.cpp | 4 +- runtime/js_map.h | 4 +- runtime/js_map_iterator.cpp | 4 +- runtime/js_map_iterator.h | 4 +- runtime/js_method.cpp | 4 +- runtime/js_method.h | 8 +- runtime/js_native_pointer.h | 4 +- runtime/js_number_format.cpp | 4 +- runtime/js_number_format.h | 4 +- runtime/js_object-inl.h | 4 +- runtime/js_object.cpp | 6 +- runtime/js_object.h | 12 +- runtime/js_plural_rules.cpp | 4 +- runtime/js_plural_rules.h | 4 +- runtime/js_primitive_ref.cpp | 4 +- runtime/js_primitive_ref.h | 4 +- runtime/js_promise.cpp | 4 +- runtime/js_promise.h | 4 +- runtime/js_proxy.cpp | 4 +- runtime/js_proxy.h | 4 +- runtime/js_realm.h | 4 +- runtime/js_regexp.h | 4 +- runtime/js_regexp_iterator.cpp | 4 +- runtime/js_regexp_iterator.h | 4 +- runtime/js_relative_time_format.cpp | 4 +- runtime/js_relative_time_format.h | 4 +- runtime/js_runtime_options.h | 6 +- runtime/js_serializer.cpp | 4 +- runtime/js_serializer.h | 4 +- runtime/js_set.cpp | 4 +- runtime/js_set.h | 4 +- runtime/js_set_iterator.cpp | 4 +- runtime/js_set_iterator.h | 4 +- runtime/js_stable_array.cpp | 4 +- runtime/js_stable_array.h | 4 +- runtime/js_string_iterator.cpp | 4 +- runtime/js_string_iterator.h | 4 +- runtime/js_symbol.h | 4 +- runtime/js_tagged_number.h | 4 +- runtime/js_tagged_value-inl.h | 4 +- runtime/js_tagged_value.cpp | 4 +- runtime/js_tagged_value.h | 4 +- runtime/js_thread.cpp | 4 +- runtime/js_thread.h | 8 +- runtime/js_typed_array.cpp | 4 +- runtime/js_typed_array.h | 4 +- runtime/js_weak_container.cpp | 4 +- runtime/js_weak_container.h | 4 +- runtime/layout_info-inl.h | 4 +- runtime/layout_info.cpp | 4 +- runtime/layout_info.h | 4 +- runtime/lexical_env.h | 4 +- runtime/linked_hash_table-inl.h | 6 +- runtime/linked_hash_table.cpp | 4 +- runtime/linked_hash_table.h | 4 +- runtime/literal_data_extractor.cpp | 17 +- runtime/literal_data_extractor.h | 4 +- runtime/mem/barriers-inl.h | 4 +- runtime/mem/barriers.h | 4 +- runtime/mem/ecma_reference_processor.cpp | 65 ++- runtime/mem/ecma_reference_processor.h | 18 +- runtime/mem/ecma_string.cpp | 4 +- runtime/mem/ecma_string.h | 4 +- runtime/mem/mem.h | 4 +- runtime/mem/mem_manager-inl.h | 4 +- runtime/mem/mem_manager.cpp | 4 +- runtime/mem/mem_manager.h | 4 +- runtime/mem/object_helpers.h | 4 +- runtime/mem/object_xray-inl.h | 4 +- runtime/mem/object_xray.h | 4 +- runtime/mem/slots.h | 4 +- runtime/mem/tagged_object-inl.h | 4 +- runtime/mem/tagged_object.h | 4 +- runtime/message_string.cpp | 4 +- runtime/message_string.h | 4 +- runtime/napi/include/jsnapi.h | 4 +- runtime/napi/jsnapi.cpp | 6 +- runtime/napi/jsnapi_debugger_agent.cpp | 4 +- runtime/napi/jsnapi_debugger_agent.h | 4 +- runtime/napi/jsnapi_helper-inl.h | 4 +- runtime/napi/jsnapi_helper.h | 4 +- runtime/object_factory-inl.h | 4 +- runtime/object_factory.cpp | 36 +- runtime/object_factory.h | 30 +- runtime/object_operator.cpp | 4 +- runtime/object_operator.h | 4 +- runtime/object_wrapper.h | 4 +- runtime/profiling/plugin_destroy_profile.h | 2 +- .../profiling/plugin_find_method_in_profile.h | 2 +- runtime/property_attributes.h | 4 +- runtime/record.h | 4 +- runtime/regexp/regexp_executor.cpp | 4 +- runtime/regexp/regexp_executor.h | 6 +- runtime/regexp/regexp_parser_cache.cpp | 4 +- runtime/regexp/regexp_parser_cache.h | 4 +- runtime/runtime_call_id.h | 4 +- runtime/symbol_table-inl.h | 4 +- runtime/symbol_table.h | 4 +- runtime/tagged_array-inl.h | 4 +- runtime/tagged_array.h | 4 +- runtime/tagged_dictionary.cpp | 4 +- runtime/tagged_dictionary.h | 4 +- runtime/tagged_hash_table-inl.h | 4 +- runtime/tagged_hash_table.h | 4 +- runtime/tagged_queue-inl.h | 4 +- runtime/tagged_queue.h | 4 +- runtime/template_map.h | 4 +- runtime/template_string.cpp | 4 +- runtime/template_string.h | 4 +- runtime/templates/intrinsics_gen.cpp.erb | 4 +- runtime/tooling/pt_ecmascript_extension.cpp | 6 +- runtime/tooling/pt_js_extractor.h | 8 +- runtime/transitions_dictionary.h | 4 +- runtime/vmstat/caller_stat.cpp | 4 +- runtime/vmstat/caller_stat.h | 4 +- runtime/vmstat/runtime_stat.cpp | 4 +- runtime/vmstat/runtime_stat.h | 4 +- runtime/weak_vector-inl.h | 4 +- runtime/weak_vector.cpp | 4 +- runtime/weak_vector.h | 4 +- tests/assembler/emitter_test_ecmascript.cpp | 10 +- .../codegen_test_ecmascript.cpp | 14 +- .../reg_encoder_test_ecmascript.cpp | 4 +- .../compiler/branch_elimination_ecma_test.cpp | 4 +- .../compiler/checks_elimination_ecma_test.cpp | 4 +- tests/compiler/codegen_ecma_test.cpp | 4 +- .../inline_call_intrinsics_ecma_test.cpp | 4 +- .../compiler/inline_intrinsics_ecma_test.cpp | 8 +- tests/compiler/ir_builder_ecma_test.cpp | 4 +- tests/compiler/lowering_ecma_test.cpp | 4 +- tests/compiler/peepholes_ecma_test.cpp | 4 +- .../compiler/phi_type_resolving_ecma_test.cpp | 4 +- tests/compiler/unit_ecma_test.cpp | 22 +- tests/compiler/unit_ecma_test.h | 4 +- tests/compiler/vn_test_ecma.cpp | 4 +- .../disassembler/disasm_test_lit_ecma.cpp.in | 2 +- .../runtime/builtins/builtins_array_test.cpp | 8 +- .../builtins/builtins_arraybuffer_test.cpp | 6 +- .../runtime/builtins/builtins_bigint_test.cpp | 8 +- .../builtins/builtins_boolean_test.cpp | 8 +- .../builtins/builtins_dataview_test.cpp | 8 +- tests/runtime/builtins/builtins_date_test.cpp | 8 +- .../runtime/builtins/builtins_errors_test.cpp | 8 +- .../builtins/builtins_function_test.cpp | 8 +- .../runtime/builtins/builtins_global_test.cpp | 10 +- .../builtins/builtins_iterator_test.cpp | 8 +- tests/runtime/builtins/builtins_json_test.cpp | 8 +- tests/runtime/builtins/builtins_map_test.cpp | 8 +- tests/runtime/builtins/builtins_math_test.cpp | 8 +- .../runtime/builtins/builtins_number_test.cpp | 8 +- .../runtime/builtins/builtins_object_test.cpp | 8 +- .../builtins/builtins_promise_test.cpp | 10 +- .../runtime/builtins/builtins_proxy_test.cpp | 8 +- .../builtins/builtins_reflect_test.cpp | 8 +- .../runtime/builtins/builtins_regexp_test.cpp | 8 +- tests/runtime/builtins/builtins_set_test.cpp | 8 +- .../runtime/builtins/builtins_string_test.cpp | 8 +- .../runtime/builtins/builtins_symbol_test.cpp | 8 +- .../builtins/builtins_typedarray_test.cpp | 8 +- .../builtins/builtins_weak_map_test.cpp | 8 +- .../builtins/builtins_weak_set_test.cpp | 8 +- tests/runtime/common/builtins_test.cpp | 14 +- .../runtime/common/concurrent_sweep_test.cpp | 6 +- .../ecma_empty_class_check.cpp | 8 +- tests/runtime/common/ecma_module_test.cpp | 24 +- tests/runtime/common/ecma_string_test.cpp | 6 +- .../common/gc/pending_exception_tests.cpp | 4 +- tests/runtime/common/glue_regs_test.cpp | 6 +- tests/runtime/common/huge_object_test.cpp | 14 +- tests/runtime/common/js_arguments_test.cpp | 20 +- .../runtime/common/js_array_iterator_test.cpp | 20 +- tests/runtime/common/js_array_test.cpp | 30 +- tests/runtime/common/js_dataview_test.cpp | 6 +- tests/runtime/common/js_date_test.cpp | 8 +- .../runtime/common/js_forin_iterator_test.cpp | 12 +- tests/runtime/common/js_function_test.cpp | 6 +- tests/runtime/common/js_handle_test.cpp | 6 +- tests/runtime/common/js_iterator_test.cpp | 6 +- tests/runtime/common/js_map_test.cpp | 6 +- tests/runtime/common/js_object_test.cpp | 6 +- .../runtime/common/js_primitive_ref_test.cpp | 6 +- tests/runtime/common/js_promise_test.cpp | 6 +- tests/runtime/common/js_proxy_test.cpp | 6 +- tests/runtime/common/js_serializer_test.cpp | 8 +- tests/runtime/common/js_set_iterator_test.cpp | 6 +- tests/runtime/common/js_set_test.cpp | 6 +- tests/runtime/common/js_symbol_test.cpp | 18 +- tests/runtime/common/js_tagged_queue_test.cpp | 6 +- tests/runtime/common/js_typed_array_test.cpp | 6 +- tests/runtime/common/large_object_test.cpp | 6 +- tests/runtime/common/lexical_env_test.cpp | 6 +- .../runtime/common/linked_hash_table_test.cpp | 6 +- tests/runtime/common/name_dictionary_test.cpp | 6 +- .../native_methods_api_no_crash.cpp | 8 +- tests/runtime/common/native_pointer_test.cpp | 8 +- tests/runtime/common/object_factory_test.cpp | 6 +- tests/runtime/common/separate_jsvm_test.cpp | 6 +- tests/runtime/common/symbol_table_test.cpp | 6 +- tests/runtime/common/tagged_value_test.cpp | 12 +- tests/runtime/common/test_helper.cpp | 12 +- tests/runtime/common/test_helper.h | 14 +- tests/runtime/common/weak_ref_gen_gc_test.cpp | 8 +- tests/runtime/common/weak_ref_stw_gc_test.cpp | 8 +- tests/runtime/ic/ic_binaryop_test.cpp | 6 +- tests/runtime/ic/ic_compareop_test.cpp | 6 +- tests/runtime/ic/ic_invoke_test.cpp | 6 +- tests/runtime/mem/g1gc_barrier_test.cpp | 4 +- tests/runtime/mem/object_helpers_test.cpp | 6 +- tests/runtime/mem/weak_containers_test.cpp | 8 +- tests/runtime/napi/jsnapi_tests.cpp | 6 +- tests/runtime/regexp/regexp_test.cpp | 8 +- .../tooling/api_tests/js/js_breakpoint_test.h | 4 +- .../api_tests/js/js_enumerate_frames_test.h | 4 +- .../api_tests/js/js_exception_events_test.h | 4 +- .../tooling/api_tests/js/js_frame_pop_test.h | 4 +- .../api_tests/js/js_get_current_frame_test.h | 4 +- .../api_tests/js/js_get_variable_test.h | 6 +- .../api_tests/js/js_method_event_test.h | 4 +- .../api_tests/js/js_restart_frame_test.h | 6 +- .../api_tests/js/js_set_notification_test.h | 4 +- .../api_tests/js/js_set_variable_test.h | 21 +- .../api_tests/js/js_single_step_test.h | 4 +- .../tooling/api_tests/js/js_vm_event_test.h | 4 +- tests/runtime/tooling/js_test_api.h | 19 +- tests/runtime/tooling/launcher.cpp | 4 +- .../tooling/options_test/options_test.cpp | 4 +- tests/runtime/tooling/test_list.cpp | 4 +- tests/runtime/tooling/test_list.h | 4 +- 492 files changed, 1911 insertions(+), 1919 deletions(-) diff --git a/assembler/extension/ecmascript_meta.cpp b/assembler/extension/ecmascript_meta.cpp index 3bfd5cf59..fe7602c35 100644 --- a/assembler/extension/ecmascript_meta.cpp +++ b/assembler/extension/ecmascript_meta.cpp @@ -15,8 +15,8 @@ #include "ecmascript_meta.h" -namespace panda::pandasm::extensions::ecmascript { +namespace ark::pandasm::extensions::ecmascript { #include -} // namespace panda::pandasm::extensions::ecmascript +} // namespace ark::pandasm::extensions::ecmascript diff --git a/assembler/extension/ecmascript_meta.h b/assembler/extension/ecmascript_meta.h index c43410770..39e424dd8 100644 --- a/assembler/extension/ecmascript_meta.h +++ b/assembler/extension/ecmascript_meta.h @@ -18,7 +18,7 @@ #include "meta.h" -namespace panda::pandasm::extensions::ecmascript { +namespace ark::pandasm::extensions::ecmascript { class RecordMetadata : public pandasm::RecordMetadata { public: @@ -226,6 +226,6 @@ protected: void RemoveFlags(std::string_view attribute, std::string_view value) override; }; -} // namespace panda::pandasm::extensions::ecmascript +} // namespace ark::pandasm::extensions::ecmascript #endif // PANDA_ECMASCRIPT_META_H diff --git a/compiler/codegen_intrinsics_ecmascript.cpp b/compiler/codegen_intrinsics_ecmascript.cpp index 399f89fd8..35a65097d 100644 --- a/compiler/codegen_intrinsics_ecmascript.cpp +++ b/compiler/codegen_intrinsics_ecmascript.cpp @@ -19,7 +19,7 @@ #include "runtime/include/thread.h" #include "plugins/ecmascript/runtime/mem/tagged_object.h" -namespace panda::compiler { +namespace ark::compiler { // NOTE(vpukhov): reuse irtoc iframe reg static void LoadIFramePtr(Codegen *cg, Reg dst) @@ -188,7 +188,7 @@ void Codegen::StLexDyn(IntrinsicInst *inst, [[maybe_unused]] Reg dst, SRCREGS sr ScopedTmpReg tmpReg(enc, ConvertDataType(DataType::REFERENCE, arch)); enc->EncodeLdr(tmpReg, false, memRef); auto slowPath = CreateSlowPath(inst, DeoptimizeType::HOLE); - enc->EncodeJump(slowPath->GetLabel(), tmpReg, Imm(panda::coretypes::TaggedValue::VALUE_HOLE), Condition::EQ); + enc->EncodeJump(slowPath->GetLabel(), tmpReg, Imm(ark::coretypes::TaggedValue::VALUE_HOLE), Condition::EQ); std::size_t accIndex = 0; enc->EncodeStr(src[accIndex], memRef); @@ -299,7 +299,7 @@ void Codegen::CreateFastPathStrictEq([[maybe_unused]] IntrinsicInst *inst, Reg d { auto entrypointId = EntrypointId::FAST_PATH_ECMA_STRICT_EQ; CallFastPath(inst, entrypointId, dst, {}, src[0], src[1U]); - GetEncoder()->EncodeOr(dst, dst, Imm(panda::coretypes::TaggedValue::VALUE_FALSE)); + GetEncoder()->EncodeOr(dst, dst, Imm(ark::coretypes::TaggedValue::VALUE_FALSE)); } void Codegen::CreateFastPathStrictNotEq([[maybe_unused]] IntrinsicInst *inst, Reg dst, SRCREGS src) @@ -307,7 +307,7 @@ void Codegen::CreateFastPathStrictNotEq([[maybe_unused]] IntrinsicInst *inst, Re auto entrypointId = EntrypointId::FAST_PATH_ECMA_STRICT_EQ; CallFastPath(inst, entrypointId, dst, {}, src[0], src[1U]); GetEncoder()->EncodeXor(dst, dst, Imm(1)); - GetEncoder()->EncodeOr(dst, dst, Imm(panda::coretypes::TaggedValue::VALUE_FALSE)); + GetEncoder()->EncodeOr(dst, dst, Imm(ark::coretypes::TaggedValue::VALUE_FALSE)); } -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/compiler/ecmascript_call_params.h b/compiler/ecmascript_call_params.h index 75b68afbe..327f81f2d 100644 --- a/compiler/ecmascript_call_params.h +++ b/compiler/ecmascript_call_params.h @@ -20,19 +20,19 @@ #include "plugins/ecmascript/runtime/ecma_call_params.h" // NOLINTNEXTLINE(modernize-concat-nested-namespaces) -namespace panda::compiler { +namespace ark::compiler { namespace ecmascript_call_params { enum : uint8_t { SLOT_FUNCTION = CallConvDynInfo::SLOT_CALLEE, - SLOT_NEWTARGET = ::panda::ecmascript::js_method_args::NEW_TARGET_IDX, - SLOT_THIS = ::panda::ecmascript::js_method_args::THIS_IDX, - SLOT_FIRST_ARG = ::panda::ecmascript::js_method_args::FIRST_ARG_IDX, + SLOT_NEWTARGET = ::ark::ecmascript::js_method_args::NEW_TARGET_IDX, + SLOT_THIS = ::ark::ecmascript::js_method_args::THIS_IDX, + SLOT_FIRST_ARG = ::ark::ecmascript::js_method_args::FIRST_ARG_IDX, }; } // namespace ecmascript_call_params static_assert(static_cast(ecmascript_call_params::SLOT_FUNCTION) == - static_cast(::panda::ecmascript::js_method_args::FUNC_IDX)); + static_cast(::ark::ecmascript::js_method_args::FUNC_IDX)); -} // namespace panda::compiler +} // namespace ark::compiler #endif // PANDA_COMPILER_ECMASCRIPT_CALL_PARAMS \ No newline at end of file diff --git a/compiler/ecmascript_extensions/ecmascript_codegen_extensions.cpp b/compiler/ecmascript_extensions/ecmascript_codegen_extensions.cpp index 38bc9fffd..dbce6aa56 100644 --- a/compiler/ecmascript_extensions/ecmascript_codegen_extensions.cpp +++ b/compiler/ecmascript_extensions/ecmascript_codegen_extensions.cpp @@ -17,7 +17,7 @@ #include "ecmascript_environment.h" #include "plugins/ecmascript/compiler/ecmascript_call_params.h" -namespace panda::compiler { +namespace ark::compiler { bool Codegen::GenerateLoadObjectDynamic(Inst *inst) { @@ -88,4 +88,4 @@ bool Codegen::GenerateStoreObjectDynamic(Inst *inst) return true; } -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/compiler/ecmascript_extensions/ecmascript_environment.h b/compiler/ecmascript_extensions/ecmascript_environment.h index 0190b8268..d1d6f8739 100644 --- a/compiler/ecmascript_extensions/ecmascript_environment.h +++ b/compiler/ecmascript_extensions/ecmascript_environment.h @@ -22,7 +22,7 @@ #include "libpandabase/mem/mem.h" #include "runtime/include/coretypes/tagged_value.h" -namespace panda { +namespace ark { class ObjectHeader; @@ -70,12 +70,12 @@ public: void SetLexicalEnv(ObjectHeader *le) { - lexicalEnv_ = panda::coretypes::TaggedValue(le); + lexicalEnv_ = ark::coretypes::TaggedValue(le); } void SetConstantPool(ObjectHeader *cp) { - constantPool_ = panda::coretypes::TaggedValue(cp); + constantPool_ = ark::coretypes::TaggedValue(cp); } ObjectHeader *GetThisFunc() const @@ -85,7 +85,7 @@ public: void SetThisFunc(ObjectHeader *thisFunc) { - thisFunc_ = panda::coretypes::TaggedValue(thisFunc); + thisFunc_ = ark::coretypes::TaggedValue(thisFunc); } static constexpr size_t GetSize() @@ -94,13 +94,13 @@ public: } private: - panda::coretypes::TaggedValue constantPool_; - panda::coretypes::TaggedValue lexicalEnv_; - panda::coretypes::TaggedValue thisFunc_; + ark::coretypes::TaggedValue constantPool_; + ark::coretypes::TaggedValue lexicalEnv_; + ark::coretypes::TaggedValue thisFunc_; }; } // namespace ecmascript -} // namespace panda +} // namespace ark #endif // PANDA_COMPILER_ECMASCRIPT_ENVIRONMENT_H diff --git a/compiler/ecmascript_extensions/ecmascript_irtoc_interface.h b/compiler/ecmascript_extensions/ecmascript_irtoc_interface.h index f26e8b568..6f8db6b40 100644 --- a/compiler/ecmascript_extensions/ecmascript_irtoc_interface.h +++ b/compiler/ecmascript_extensions/ecmascript_irtoc_interface.h @@ -22,35 +22,35 @@ size_t GetGlobalConstStringOffsetForAnyType(compiler::AnyBaseType type, Arch arc cross_values::GetJsthreadGlobalConstantsOffset(arch) + cross_values::GetGlobalConstConstantsOffset(arch); switch (type) { case compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::UNDEFINED_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::UNDEFINED_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::STRING_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::STRING_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_INT_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::SYMBOL_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::SYMBOL_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::FUNCTION_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::FUNCTION_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::BOOLEAN_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::BOOLEAN_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_NULL_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::BIGINT_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::BIGINT_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); default: UNREACHABLE(); } diff --git a/compiler/ecmascript_extensions/thread_environment_api.h b/compiler/ecmascript_extensions/thread_environment_api.h index d8cb2bbee..99098715f 100644 --- a/compiler/ecmascript_extensions/thread_environment_api.h +++ b/compiler/ecmascript_extensions/thread_environment_api.h @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/js_thread.h" -namespace panda::ecmascript { +namespace ark::ecmascript { #ifdef PANDA_QEMU_AARCH64_GCC_8 // Build PANDA_QEMU_AARCH64_GCC_8 hangs without this workaround. Please check issue #8094. @@ -35,7 +35,7 @@ inline JSTaggedValue GetGlobalObject(JSThread *thread) } #endif -inline JSHandle GetGlobalEnv(JSThread *thread) +inline JSHandle GetGlobalEnv(JSThread *thread) { return thread->GetEcmaVM()->GetGlobalEnv(); } @@ -50,6 +50,6 @@ inline JSThread *GetJSThread() return JSThread::Cast(ManagedThread::GetCurrent()); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // PANDA_COMPILER_THREAD_ENVIRONMENT_API_H diff --git a/compiler/inline_intrinsics_ecmascript.cpp b/compiler/inline_intrinsics_ecmascript.cpp index ea41f3595..277490216 100644 --- a/compiler/inline_intrinsics_ecmascript.cpp +++ b/compiler/inline_intrinsics_ecmascript.cpp @@ -20,7 +20,7 @@ #include "irtoc_ir_inline.h" #include "plugins/ecmascript/runtime/runtime_call_id.h" -namespace panda::compiler { +namespace ark::compiler { template bool InlineLdConstant(IntrinsicInst *intrinsic, AnyBaseType anyType, T value) { @@ -48,7 +48,7 @@ bool InlineLdConstant(IntrinsicInst *intrinsic, DataType::Any value) return true; } -using TaggedValue = panda::coretypes::TaggedValue; +using TaggedValue = ark::coretypes::TaggedValue; bool InlineIntrinsics::InlineLdTrue(IntrinsicInst *intrinsic) { @@ -591,7 +591,7 @@ void InlineIntrinsics::InlineObjByValueFromElements(IntrinsicInst *intrinsic) boundsCheck->InsertAfter(loadArray); auto cmpHoleInst = GetGraph()->CreateInstCompare( DataType::BOOL, pc, loadArray, - GetGraph()->FindOrCreateConstant(DataType::Any(panda::coretypes::TaggedValue::VALUE_HOLE)), DataType::ANY, + GetGraph()->FindOrCreateConstant(DataType::Any(ark::coretypes::TaggedValue::VALUE_HOLE)), DataType::ANY, ConditionCode::CC_EQ); loadArray->InsertAfter(cmpHoleInst); @@ -762,7 +762,7 @@ bool InlineIntrinsics::InlineNotEqDyn(IntrinsicInst *intrinsic, AnyBaseType type bool InlineIntrinsics::InlineToNumber(IntrinsicInst *intrinsic, AnyBaseType type1) { auto specialAllowed = (GetAllowedTypeForInput(intrinsic, 0) & profiling::AnyInputType::SPECIAL) != 0; - return panda::compiler::IrtocInlineToNumber(intrinsic, type1, specialAllowed); + return ark::compiler::IrtocInlineToNumber(intrinsic, type1, specialAllowed); } bool InlineIntrinsics::InlineLdLexDyn(IntrinsicInst *intrinsic) @@ -784,7 +784,7 @@ bool InlineIntrinsics::InlineLdLexDyn(IntrinsicInst *intrinsic) InstAppender appender(loadLexVar->GetBasicBlock(), loadLexVar); auto pc = intrinsic->GetPc(); - auto *hole = GetGraph()->FindOrCreateConstant(DataType::Any(panda::coretypes::TaggedValue::VALUE_HOLE)); + auto *hole = GetGraph()->FindOrCreateConstant(DataType::Any(ark::coretypes::TaggedValue::VALUE_HOLE)); auto *compare = GetGraph()->CreateInstCompare(DataType::BOOL, pc, loadLexVar, hole, DataType::ANY, ConditionCode::CC_EQ); appender.Append(compare); @@ -848,7 +848,7 @@ bool InlineIntrinsics::InlineStLexDyn(IntrinsicInst *intrinsic) GetGraph()->CreateInstLoadArray(DataType::ANY, pc, currentLexEnv, GetGraph()->FindOrCreateConstant(elemOffset)); appender.Append(getProp); - auto *hole = GetGraph()->FindOrCreateConstant(DataType::Any(panda::coretypes::TaggedValue::VALUE_HOLE)); + auto *hole = GetGraph()->FindOrCreateConstant(DataType::Any(ark::coretypes::TaggedValue::VALUE_HOLE)); auto *compare = GetGraph()->CreateInstCompare(DataType::BOOL, pc, getProp, hole, DataType::ANY, ConditionCode::CC_EQ); appender.Append(compare); @@ -1034,6 +1034,6 @@ void InlineIntrinsics::InlineTryLdGlobalField(IntrinsicInst *inst, uint32_t type inst->GetBasicBlock()->RemoveInst(inst); } -} // namespace panda::compiler +} // namespace ark::compiler #include "plugins/ecmascript/runtime/builtins/generated/builtins_inline_intrinsics_gen.inl" diff --git a/compiler/optimizer/code_generator/compiler_base_types.cpp b/compiler/optimizer/code_generator/compiler_base_types.cpp index 189912971..3f723aba6 100644 --- a/compiler/optimizer/code_generator/compiler_base_types.cpp +++ b/compiler/optimizer/code_generator/compiler_base_types.cpp @@ -21,7 +21,7 @@ #include "runtime/include/coretypes/tagged_value.h" #include "profiling/profiling.h" -namespace panda::compiler { +namespace ark::compiler { static void IsHasTagMaskGen(Encoder *enc, Reg dst, Reg src, Imm valTag, Imm valMask, LabelHolder::LabelId id = LabelHolder::INVALID_LABEL) @@ -74,7 +74,7 @@ static void CompareAnyTypeGenDouble(Encoder *enc, Reg dst, Reg src, profiling::A ASSERT(allowedInputType == profiling::AnyInputType::DEFAULT); } // (u16) tag + 0xffff is [0xffff for Object, 0xfffe for Int, other - Double] - enc->EncodeAdd(dstExt, src, Imm(panda::coretypes::TaggedValue::TAG_MASK)); + enc->EncodeAdd(dstExt, src, Imm(ark::coretypes::TaggedValue::TAG_MASK)); // Examine tag and shift it by one -> 0x7fff for both Object and Int enc->EncodeShr(dstExt, dstExt, Imm(SHIFT_VAL)); ScopedTmpReg regCmp(enc, TypeInfo(TypeInfo::TypeId::INT64)); @@ -97,8 +97,8 @@ static void CompareAnyTypeGenInt(Encoder *enc, Reg dst, Reg src, profiling::AnyI LabelHolder::LabelId id = LabelHolder::INVALID_LABEL) { if (allowedInputType == profiling::AnyInputType::DEFAULT) { - IsHasTagMaskGen(enc, dst, src, Imm(panda::coretypes::TaggedValue::TAG_INT), - Imm(panda::coretypes::TaggedValue::TAG_MASK), id); + IsHasTagMaskGen(enc, dst, src, Imm(ark::coretypes::TaggedValue::TAG_INT), + Imm(ark::coretypes::TaggedValue::TAG_MASK), id); return; } ASSERT(allowedInputType == profiling::AnyInputType::SPECIAL); @@ -118,9 +118,9 @@ static void CompareAnyTypeGenInt(Encoder *enc, Reg dst, Reg src, profiling::AnyI static void CompareAnyTypeGenBool(Encoder *enc, Reg dst, Reg src, LabelHolder::LabelId id = LabelHolder::INVALID_LABEL) { static constexpr uint64_t BOOL_DIFF_MASK = - ~(panda::coretypes::TaggedValue::VALUE_FALSE ^ panda::coretypes::TaggedValue::VALUE_TRUE); + ~(ark::coretypes::TaggedValue::VALUE_FALSE ^ ark::coretypes::TaggedValue::VALUE_TRUE); static constexpr uint64_t BOOL_MASK = - panda::coretypes::TaggedValue::VALUE_FALSE & panda::coretypes::TaggedValue::VALUE_TRUE; + ark::coretypes::TaggedValue::VALUE_FALSE & ark::coretypes::TaggedValue::VALUE_TRUE; ScopedTmpReg regCmp(enc, TypeInfo(TypeInfo::TypeId::INT64)); auto dstExt = dst.As(TypeInfo(TypeInfo::TypeId::INT64)); @@ -152,14 +152,14 @@ static void CheckAnyTypeGenObject(Encoder *enc, const Reg &src, LabelHolder::Lab ScopedTmpReg tmpReg(enc, TypeInfo(TypeInfo::TypeId::INT64)); // IsObject() - enc->EncodeAnd(tmpReg, src, Imm(panda::coretypes::TaggedValue::TAG_MASK)); - enc->EncodeJump(label, tmpReg, Imm(panda::coretypes::TaggedValue::TAG_OBJECT), Condition::NE); + enc->EncodeAnd(tmpReg, src, Imm(ark::coretypes::TaggedValue::TAG_MASK)); + enc->EncodeJump(label, tmpReg, Imm(ark::coretypes::TaggedValue::TAG_OBJECT), Condition::NE); // !IsSpecial // It's enough to check that `src` > `TAG_SPECIAL_MASK`, as it's guaranteed that special values // are not in object address space - ASSERT(!IsAddressInObjectsHeapOrNull(panda::coretypes::TaggedValue::TAG_SPECIAL_MASK)); - enc->EncodeJump(label, src, Imm(panda::coretypes::TaggedValue::TAG_SPECIAL_MASK), Condition::LE); + ASSERT(!IsAddressInObjectsHeapOrNull(ark::coretypes::TaggedValue::TAG_SPECIAL_MASK)); + enc->EncodeJump(label, src, Imm(ark::coretypes::TaggedValue::TAG_SPECIAL_MASK), Condition::LE); } // Jump out if (!IsHeapObject() or object.type, type) @@ -270,14 +270,14 @@ bool ecmascript::CompareAnyTypeGen(const CompareAnyTypeInst *cati, EncodeVisitor Encoder *enc = encV->GetEncoder(); switch (cati->GetAnyType()) { case AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: - IsEqualToValGen(enc, dst, src, Imm(panda::coretypes::TaggedValue::VALUE_UNDEFINED)); + IsEqualToValGen(enc, dst, src, Imm(ark::coretypes::TaggedValue::VALUE_UNDEFINED)); return true; case AnyBaseType::ECMASCRIPT_INT_TYPE: CompareAnyTypeGenInt(enc, dst, src, cati->GetAllowedInputType()); return true; case AnyBaseType::ECMASCRIPT_OBJECT_TYPE: - IsHasTagMaskGen(enc, dst, src, Imm(panda::coretypes::TaggedValue::TAG_OBJECT), - Imm(panda::coretypes::TaggedValue::TAG_MASK)); + IsHasTagMaskGen(enc, dst, src, Imm(ark::coretypes::TaggedValue::TAG_OBJECT), + Imm(ark::coretypes::TaggedValue::TAG_MASK)); return true; case AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: CompareAnyTypeGenObject(enc, dst, src); @@ -320,10 +320,10 @@ bool ecmascript::CompareAnyTypeGen(const CompareAnyTypeInst *cati, EncodeVisitor return true; } case AnyBaseType::ECMASCRIPT_NULL_TYPE: - IsEqualToValGen(enc, dst, src, Imm(panda::coretypes::TaggedValue::VALUE_NULL)); + IsEqualToValGen(enc, dst, src, Imm(ark::coretypes::TaggedValue::VALUE_NULL)); return true; case AnyBaseType::ECMASCRIPT_HOLE_TYPE: - IsEqualToValGen(enc, dst, src, Imm(panda::coretypes::TaggedValue::VALUE_HOLE)); + IsEqualToValGen(enc, dst, src, Imm(ark::coretypes::TaggedValue::VALUE_HOLE)); return true; default: return false; @@ -408,7 +408,7 @@ bool ecmascript::CastAnyTypeValueGen(const CastAnyTypeValueInst *cati, EncodeVis enc->EncodeJump(endLabel); enc->BindLabel(notIntLabel); } - enc->EncodeSub(regTmp, src, Imm(panda::coretypes::TaggedValue::DOUBLE_ENCODE_OFFSET)); + enc->EncodeSub(regTmp, src, Imm(ark::coretypes::TaggedValue::DOUBLE_ENCODE_OFFSET)); enc->BindLabel(returnLabel); enc->EncodeMov(dst, regTmp); enc->BindLabel(endLabel); @@ -445,26 +445,26 @@ bool ecmascript::CastValueToAnyTypeGen(const CastValueToAnyTypeInst *cvai, Encod auto *enc = encV->GetEncoder(); switch (cvai->GetAnyType()) { case AnyBaseType::ECMASCRIPT_NULL_TYPE: - enc->EncodeMov(dst, Imm(panda::coretypes::TaggedValue::VALUE_NULL)); + enc->EncodeMov(dst, Imm(ark::coretypes::TaggedValue::VALUE_NULL)); return true; case AnyBaseType::ECMASCRIPT_HOLE_TYPE: - enc->EncodeMov(dst, Imm(panda::coretypes::TaggedValue::VALUE_HOLE)); + enc->EncodeMov(dst, Imm(ark::coretypes::TaggedValue::VALUE_HOLE)); return true; case AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: - enc->EncodeMov(dst, Imm(panda::coretypes::TaggedValue::VALUE_UNDEFINED)); + enc->EncodeMov(dst, Imm(ark::coretypes::TaggedValue::VALUE_UNDEFINED)); return true; case AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE: - enc->EncodeOr(dst, src, Imm(panda::coretypes::TaggedValue::VALUE_FALSE)); + enc->EncodeOr(dst, src, Imm(ark::coretypes::TaggedValue::VALUE_FALSE)); return true; case AnyBaseType::ECMASCRIPT_INT_TYPE: { auto src32 = encV->GetCodegen()->ConvertRegister(cvai->GetSrcReg(0), DataType::INT32); enc->EncodeCast(dst, false, src32, false); - enc->EncodeOr(dst, dst, Imm(panda::coretypes::TaggedValue::TAG_INT)); + enc->EncodeOr(dst, dst, Imm(ark::coretypes::TaggedValue::TAG_INT)); return true; } case AnyBaseType::ECMASCRIPT_DOUBLE_TYPE: enc->EncodeMov(dst, src); - enc->EncodeAdd(dst, dst, Imm(panda::coretypes::TaggedValue::DOUBLE_ENCODE_OFFSET)); + enc->EncodeAdd(dst, dst, Imm(ark::coretypes::TaggedValue::DOUBLE_ENCODE_OFFSET)); return true; case AnyBaseType::ECMASCRIPT_STRING_TYPE: case AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: @@ -486,7 +486,7 @@ bool ecmascript::CastValueToAnyTypeGen(const CastValueToAnyTypeInst *cvai, Encod ASSERT(dst.GetSize() >= DOUBLE_WORD_SIZE); enc->EncodeMov(dst, src); } else { - enc->EncodeAnd(dst, src, Imm(panda::coretypes::TaggedValue::OBJECT_MASK)); + enc->EncodeAnd(dst, src, Imm(ark::coretypes::TaggedValue::OBJECT_MASK)); } return true; default: @@ -565,15 +565,15 @@ bool ecmascript::AnyTypeCheckGen(AnyTypeCheckInst *checkInst, EncodeVisitor *enc auto id = codegen->CreateSlowPath(checkInst, DeoptimizeType::ANY_TYPE_CHECK)->GetLabel(); switch (checkInst->GetAnyType()) { case AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: - IsEqualToValGen(enc, tmpReg, src, Imm(panda::coretypes::TaggedValue::VALUE_UNDEFINED), id); + IsEqualToValGen(enc, tmpReg, src, Imm(ark::coretypes::TaggedValue::VALUE_UNDEFINED), id); return true; case AnyBaseType::ECMASCRIPT_INT_TYPE: { CompareAnyTypeGenInt(enc, tmpReg, src, checkInst->GetAllowedInputType(), id); return true; } case AnyBaseType::ECMASCRIPT_OBJECT_TYPE: - IsHasTagMaskGen(enc, tmpReg, src, Imm(panda::coretypes::TaggedValue::TAG_OBJECT), - Imm(panda::coretypes::TaggedValue::TAG_MASK), id); + IsHasTagMaskGen(enc, tmpReg, src, Imm(ark::coretypes::TaggedValue::TAG_OBJECT), + Imm(ark::coretypes::TaggedValue::TAG_MASK), id); return true; case AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: CheckAnyTypeGenObject(enc, src, id); @@ -610,10 +610,10 @@ bool ecmascript::AnyTypeCheckGen(AnyTypeCheckInst *checkInst, EncodeVisitor *enc return true; } case AnyBaseType::ECMASCRIPT_NULL_TYPE: - IsEqualToValGen(enc, tmpReg, src, Imm(panda::coretypes::TaggedValue::VALUE_NULL), id); + IsEqualToValGen(enc, tmpReg, src, Imm(ark::coretypes::TaggedValue::VALUE_NULL), id); return true; case AnyBaseType::ECMASCRIPT_HOLE_TYPE: - IsEqualToValGen(enc, tmpReg, src, Imm(panda::coretypes::TaggedValue::VALUE_HOLE), id); + IsEqualToValGen(enc, tmpReg, src, Imm(ark::coretypes::TaggedValue::VALUE_HOLE), id); return true; case AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: CheckAnyTypeGenObjectType(codegen, enc, src, cross_values::GetJstypeJsFunction(codegen->GetArch()), id); @@ -678,4 +678,4 @@ bool ecmascript::IsDynHeapObject(AnyBaseType type) return type == compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE; } -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/compiler/optimizer/code_generator/compiler_base_types.h b/compiler/optimizer/code_generator/compiler_base_types.h index 79a4503ff..d98b3e6b4 100644 --- a/compiler/optimizer/code_generator/compiler_base_types.h +++ b/compiler/optimizer/code_generator/compiler_base_types.h @@ -18,7 +18,7 @@ #include "compiler/optimizer/code_generator/encode.h" #include "source_languages.h" -namespace panda::compiler { +namespace ark::compiler { class Inst; class CompareAnyTypeInst; @@ -45,6 +45,6 @@ bool HclassCheckGen(HclassCheckInst *checkInst, EncodeVisitor *encV); bool IsDynHeapObject(AnyBaseType type); } // namespace ecmascript -} // namespace panda::compiler +} // namespace ark::compiler #endif // PLUGINS_ECMASCRIPT_COMPILER_OPTIMIZER_CODE_GENERATOR_COMPILER_BASE_TYPES_H diff --git a/compiler/optimizer/ecma_pipeline.cpp b/compiler/optimizer/ecma_pipeline.cpp index 897c022aa..fc8619f16 100644 --- a/compiler/optimizer/ecma_pipeline.cpp +++ b/compiler/optimizer/ecma_pipeline.cpp @@ -49,7 +49,7 @@ #include "optimizer/optimizations/adjust_arefs.h" #include "plugins/ecmascript/compiler/optimizer/optimizations/inline_call_intrinsics.h" -namespace panda::compiler::ecmascript { +namespace ark::compiler::ecmascript { bool EcmaPipeline::RunOptimizations() { @@ -126,4 +126,4 @@ bool EcmaPipeline::RunOptimizations() return true; } -} // namespace panda::compiler::ecmascript +} // namespace ark::compiler::ecmascript diff --git a/compiler/optimizer/ecma_pipeline.h b/compiler/optimizer/ecma_pipeline.h index a31b1da65..c4acd89f8 100644 --- a/compiler/optimizer/ecma_pipeline.h +++ b/compiler/optimizer/ecma_pipeline.h @@ -18,7 +18,7 @@ #include "compiler/optimizer/pipeline.h" -namespace panda::compiler::ecmascript { +namespace ark::compiler::ecmascript { class EcmaPipeline : public Pipeline { public: @@ -31,6 +31,6 @@ public: bool RunOptimizations() override; }; -} // namespace panda::compiler::ecmascript +} // namespace ark::compiler::ecmascript #endif // PANDA_ECMA_PIPELINE_H diff --git a/compiler/optimizer/ir/dyn_datatype.h b/compiler/optimizer/ir/dyn_datatype.h index 3bc21d084..2518e8567 100644 --- a/compiler/optimizer/ir/dyn_datatype.h +++ b/compiler/optimizer/ir/dyn_datatype.h @@ -21,45 +21,45 @@ #include "ir-dyn-base-types.h" #include "profiling/profiling.h" -namespace panda::compiler::ecmascript { -static inline panda::compiler::AnyBaseType NumericDataTypeToAnyType(panda::compiler::DataType::Type type) +namespace ark::compiler::ecmascript { +static inline ark::compiler::AnyBaseType NumericDataTypeToAnyType(ark::compiler::DataType::Type type) { switch (type) { - case panda::compiler::DataType::Type::INT8: - case panda::compiler::DataType::Type::UINT8: - case panda::compiler::DataType::Type::INT16: - case panda::compiler::DataType::Type::UINT16: - case panda::compiler::DataType::Type::INT32: - return panda::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE; - case panda::compiler::DataType::Type::UINT32: - case panda::compiler::DataType::Type::INT64: - case panda::compiler::DataType::Type::UINT64: - case panda::compiler::DataType::Type::FLOAT32: + case ark::compiler::DataType::Type::INT8: + case ark::compiler::DataType::Type::UINT8: + case ark::compiler::DataType::Type::INT16: + case ark::compiler::DataType::Type::UINT16: + case ark::compiler::DataType::Type::INT32: + return ark::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE; + case ark::compiler::DataType::Type::UINT32: + case ark::compiler::DataType::Type::INT64: + case ark::compiler::DataType::Type::UINT64: + case ark::compiler::DataType::Type::FLOAT32: // There is no direct method of boxing these types. Cast to f64 is an // option, but for now we miss a mechanism to signal that the cast // is needed. NOTE(asoldatov): Implement when this becomes an issue. - return panda::compiler::AnyBaseType::UNDEFINED_TYPE; - case panda::compiler::DataType::Type::FLOAT64: - return panda::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE; + return ark::compiler::AnyBaseType::UNDEFINED_TYPE; + case ark::compiler::DataType::Type::FLOAT64: + return ark::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE; default: UNREACHABLE(); - return panda::compiler::AnyBaseType::UNDEFINED_TYPE; + return ark::compiler::AnyBaseType::UNDEFINED_TYPE; } } -static inline panda::compiler::AnyBaseType GetAnyStringType() +static inline ark::compiler::AnyBaseType GetAnyStringType() { - return panda::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE; + return ark::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE; } -static inline panda::compiler::AnyBaseType GetAnyBigintType() +static inline ark::compiler::AnyBaseType GetAnyBigintType() { - return panda::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE; + return ark::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE; } // For two types (at least one of which is int or double) inclusion relation on // masks returned by this function is eqivalent to this relation on types -static inline uint8_t GetPossibleTypeMask(panda::compiler::AnyBaseType type, profiling::AnyInputType allowedTypes) +static inline uint8_t GetPossibleTypeMask(ark::compiler::AnyBaseType type, profiling::AnyInputType allowedTypes) { enum Type : uint8_t { NONE = 0, @@ -76,18 +76,18 @@ static inline uint8_t GetPossibleTypeMask(panda::compiler::AnyBaseType type, pro SPECIAL_NUMBER = SPECIAL_INT | SPECIAL_DOUBLE }; switch (type) { - case panda::compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE: return Type::BOOLEAN; - case panda::compiler::AnyBaseType::ECMASCRIPT_NULL_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_NULL_TYPE: return Type::NULL_TYPE; - case panda::compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: return Type::UNDEFINED; - case panda::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE: if ((allowedTypes & profiling::AnyInputType::SPECIAL) != 0) { return Type::SPECIAL_INT; } return Type::INTEGER; - case panda::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE: if ((allowedTypes & profiling::AnyInputType::INTEGER) != 0) { if ((allowedTypes & profiling::AnyInputType::SPECIAL) != 0) { return Type::SPECIAL_NUMBER; @@ -103,8 +103,8 @@ static inline uint8_t GetPossibleTypeMask(panda::compiler::AnyBaseType type, pro } } -static inline std::optional IsAnyTypeCanBeSubtypeOf(panda::compiler::AnyBaseType superType, - panda::compiler::AnyBaseType type, +static inline std::optional IsAnyTypeCanBeSubtypeOf(ark::compiler::AnyBaseType superType, + ark::compiler::AnyBaseType type, [[maybe_unused]] profiling::AnyInputType superAllowedTypes, [[maybe_unused]] profiling::AnyInputType allowedTypes) { @@ -113,92 +113,92 @@ static inline std::optional IsAnyTypeCanBeSubtypeOf(panda::compiler::AnyBa } switch (superType) { - case panda::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: switch (type) { - case panda::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_ARRAY_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_SPECIAL_INDEXED_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_ARRAY_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SPECIAL_INDEXED_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: return true; default: break; } break; - case panda::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: switch (type) { - case panda::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_ARRAY_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_SPECIAL_INDEXED_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_ARRAY_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SPECIAL_INDEXED_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: return true; default: break; } break; - case panda::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_ARRAY_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_ARRAY_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: switch (type) { - case panda::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: return std::nullopt; default: break; } break; - case panda::compiler::AnyBaseType::ECMASCRIPT_SPECIAL_INDEXED_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SPECIAL_INDEXED_TYPE: switch (type) { - case panda::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: return std::nullopt; - case panda::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_TRANSITION_HANDLER_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_PROTOTYPE_HANDLER_TYPE: return true; default: break; } break; - case panda::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: switch (type) { - case panda::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: - case panda::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: + case ark::compiler::AnyBaseType::ECMASCRIPT_FUNCTION_TYPE: return std::nullopt; default: break; } break; - case panda::compiler::AnyBaseType::UNDEFINED_TYPE: + case ark::compiler::AnyBaseType::UNDEFINED_TYPE: return true; default: break; } - if (type == panda::compiler::AnyBaseType::UNDEFINED_TYPE) { + if (type == ark::compiler::AnyBaseType::UNDEFINED_TYPE) { return std::nullopt; } - if (superType == panda::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE || - superType == panda::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE || - type == panda::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE || - type == panda::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE) { + if (superType == ark::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE || + superType == ark::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE || + type == ark::compiler::AnyBaseType::ECMASCRIPT_INT_TYPE || + type == ark::compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE) { auto possibleMaskSuper = GetPossibleTypeMask(superType, superAllowedTypes); auto possibleMask = GetPossibleTypeMask(type, allowedTypes); if ((possibleMaskSuper & possibleMask) == possibleMask) { @@ -210,6 +210,6 @@ static inline std::optional IsAnyTypeCanBeSubtypeOf(panda::compiler::AnyBa } return false; } -} // namespace panda::compiler::ecmascript +} // namespace ark::compiler::ecmascript #endif // PLUGINS_ECMASCRIPT_COMPILER_OPTIMIZER_IR_DYN_DATATYPE_H diff --git a/compiler/optimizer/ir_builder/ecmascript_inst_builder.cpp b/compiler/optimizer/ir_builder/ecmascript_inst_builder.cpp index 9184c165c..f04e68204 100644 --- a/compiler/optimizer/ir_builder/ecmascript_inst_builder.cpp +++ b/compiler/optimizer/ir_builder/ecmascript_inst_builder.cpp @@ -22,7 +22,7 @@ #include "bytecode_instruction-inl.h" #include "include/coretypes/tagged_value.h" #include "optimizer/ir_builder/pbc_iterator.h" -namespace panda::compiler { +namespace ark::compiler { void InstBuilder::FinalizeEcmaFnCall(SaveStateInst *saveState, CallInst *callInst) { @@ -218,11 +218,11 @@ void InstBuilder::BuildEcmaGetunmappedargs(const BytecodeInstruction *bcInst) UpdateDefinitionAcc(inst); } -} // namespace panda::compiler +} // namespace ark::compiler #include "ecmascript_inst_builder_gen.cpp" -namespace panda::compiler { +namespace ark::compiler { template void InstBuilder::BuildStGlobalVar(const BytecodeInstruction *bcInst, size_t typeId) @@ -315,9 +315,8 @@ void InstBuilder::BuildLdStObjByIndex(const BytecodeInstruction *bcInst, Inst *o boundsCheck->SetFlag(inst_flags::CAN_DEOPTIMIZE); auto cmpInst = graph_->CreateInstCompare( - DataType::BOOL, pc, inst, - graph_->FindOrCreateConstant(DataType::Any(panda::coretypes::TaggedValue::VALUE_HOLE)), DataType::ANY, - ConditionCode::CC_EQ); + DataType::BOOL, pc, inst, graph_->FindOrCreateConstant(DataType::Any(ark::coretypes::TaggedValue::VALUE_HOLE)), + DataType::ANY, ConditionCode::CC_EQ); auto deoptInst = graph_->CreateInstDeoptimizeIf(DataType::NO_TYPE, pc, cmpInst, saveState, DeoptimizeType::HOLE); AddInstruction(saveState, checkObj, loadObject, arrayLength, boundsCheck, inst, cmpInst, deoptInst); @@ -336,4 +335,4 @@ template void InstBuilder::BuildStGlobalVar(const BytecodeInstruction *bc template void InstBuilder::BuildLdGlobalVar(const BytecodeInstruction *bc_inst, size_t type_id); template void InstBuilder::BuildLdGlobalVar(const BytecodeInstruction *bc_inst, size_t type_id); -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/compiler/optimizer/ir_builder/ecmascript_inst_templates.yaml b/compiler/optimizer/ir_builder/ecmascript_inst_templates.yaml index b15dbbd2c..50bf0c99d 100644 --- a/compiler/optimizer/ir_builder/ecmascript_inst_templates.yaml +++ b/compiler/optimizer/ir_builder/ecmascript_inst_templates.yaml @@ -4,7 +4,7 @@ % when "RETURNUNDEFINED" auto cvat_input = FindOrCreateConstant(0); cvat_input->SetType(DataType::Type::INT64); - auto cvat = graph_->CreateInstCastValueToAnyType(0, panda::compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE, cvat_input); + auto cvat = graph_->CreateInstCastValueToAnyType(0, ark::compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE, cvat_input); auto inst = graph_->CreateInstReturn(DataType::ANY, GetPc(instruction->GetAddress()), cvat); AddInstruction(cvat); AddInstruction(inst); @@ -15,7 +15,7 @@ % cmp_imm = name == "JFALSE" ? 0 : 1 auto cvat_input = FindOrCreateConstant(<%= cmp_imm %>); cvat_input->SetType(DataType::INT64); - auto cvat = graph_->CreateInstCastValueToAnyType(0, panda::compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE, cvat_input); + auto cvat = graph_->CreateInstCastValueToAnyType(0, ark::compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE, cvat_input); auto cmp_inst = graph_->CreateInstCompare(DataType::BOOL, GetPc(instruction->GetAddress()), GetDefinitionAcc(), cvat, DataType::ANY, ConditionCode::CC_EQ); auto jmp_inst = graph_->CreateInstIfImm(DataType::NO_TYPE, GetPc(instruction->GetAddress()), cmp_inst, 0, DataType::BOOL, ConditionCode::CC_NE); AddInstruction(cvat); diff --git a/compiler/optimizer/optimizations/ecma_inlining.cpp b/compiler/optimizer/optimizations/ecma_inlining.cpp index 3ce6cfa0a..c1ba5e6e8 100644 --- a/compiler/optimizer/optimizations/ecma_inlining.cpp +++ b/compiler/optimizer/optimizations/ecma_inlining.cpp @@ -23,7 +23,7 @@ #include "optimizer/optimizations/peepholes.h" #include "runtime/profiling/profiling.h" -namespace panda::compiler::ecmascript { +namespace ark::compiler::ecmascript { EcmaInlining::EcmaInlining(Graph *graph, uint32_t instructionsCount, uint32_t inlineDepth, uint32_t methodsInlined) : Inlining(graph, instructionsCount, inlineDepth, methodsInlined), @@ -395,4 +395,4 @@ bool EcmaInlining::CheckInlinableBuiltin(CallInst *callInst, RuntimeInterface::M return false; } -} // namespace panda::compiler::ecmascript +} // namespace ark::compiler::ecmascript diff --git a/compiler/optimizer/optimizations/ecma_inlining.h b/compiler/optimizer/optimizations/ecma_inlining.h index 676323f90..871bd96a3 100644 --- a/compiler/optimizer/optimizations/ecma_inlining.h +++ b/compiler/optimizer/optimizations/ecma_inlining.h @@ -19,7 +19,7 @@ #include "compiler/optimizer/optimizations/inlining.h" #include "compiler/optimizer/ir/runtime_interface.h" -namespace panda::compiler::ecmascript { +namespace ark::compiler::ecmascript { class EcmaInlining : public Inlining { public: @@ -66,6 +66,6 @@ private: ArenaVector jsFunctions_; }; -} // namespace panda::compiler::ecmascript +} // namespace ark::compiler::ecmascript #endif // PANDA_ECMA_INLINING_H \ No newline at end of file diff --git a/compiler/optimizer/optimizations/inline_call_intrinsics.cpp b/compiler/optimizer/optimizations/inline_call_intrinsics.cpp index c7926299a..4e1ef2262 100644 --- a/compiler/optimizer/optimizations/inline_call_intrinsics.cpp +++ b/compiler/optimizer/optimizations/inline_call_intrinsics.cpp @@ -20,7 +20,7 @@ #include "optimizer/analysis/loop_analyzer.h" #include "runtime/include/coretypes/tagged_value.h" -namespace panda::compiler { +namespace ark::compiler { bool InlineCallIntrinsics::RunImpl() { @@ -175,14 +175,14 @@ bool InlineCallIntrinsics::ExpandNewObjDynRange(IntrinsicInst *inst) } auto runtime = GetGraph()->GetRuntime(); - auto kind = panda::profiling::CallKind::UNKNOWN; + auto kind = ark::profiling::CallKind::UNKNOWN; if (g_options.IsCompilerEcmaNewobjProfiling()) { functions_.clear(); kind = runtime->GetCallProfile(GetGraph()->GetMethod(), inst->GetPc(), &functions_, GetGraph()->IsAotMode()); } RuntimeInterface::NewObjDynInfo expansionInfo {RuntimeInterface::NewObjDynInfo::AllocatorType::DEFAULT, RuntimeInterface::NewObjDynInfo::ResolverType::RESOLVE}; - if (kind == panda::profiling::CallKind::MONOMORPHIC) { + if (kind == ark::profiling::CallKind::MONOMORPHIC) { expansionInfo = runtime->GetNewObjDynInfo(functions_.front()); } @@ -194,7 +194,7 @@ bool InlineCallIntrinsics::ExpandNewObjDynRange(IntrinsicInst *inst) // emit simplified fast path, but only for monomorphic call sites case RuntimeInterface::NewObjDynInfo::AllocatorType::UNDEFINED: case RuntimeInterface::NewObjDynInfo::AllocatorType::ALLOC_OBJ: - if (kind == panda::profiling::CallKind::MONOMORPHIC) { + if (kind == ark::profiling::CallKind::MONOMORPHIC) { ExpandNewObjDynFastPath(inst, expansionInfo, functions_.front()); return true; } else { @@ -260,7 +260,7 @@ void InlineCallIntrinsics::ExpandNewObjDynFastPath(Inst *inst, RuntimeInterface: appender.Append({allocObj}); } else { ASSERT(info.allocation == RuntimeInterface::NewObjDynInfo::AllocatorType::UNDEFINED); - allocObj = GetGraph()->FindOrCreateConstant(DataType::Any(panda::coretypes::TaggedValue::VALUE_UNDEFINED)); + allocObj = GetGraph()->FindOrCreateConstant(DataType::Any(ark::coretypes::TaggedValue::VALUE_UNDEFINED)); } auto ctorRes = NewObjFillCallConstructorBlock(&appender, inst, allocObj, pc); @@ -292,4 +292,4 @@ void InlineCallIntrinsics::BuildGuard(Inst *inst, uintptr_t target) inst->InsertBefore(deoptInst); } -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/compiler/optimizer/optimizations/inline_call_intrinsics.h b/compiler/optimizer/optimizations/inline_call_intrinsics.h index a7acb343a..80359e9de 100644 --- a/compiler/optimizer/optimizations/inline_call_intrinsics.h +++ b/compiler/optimizer/optimizations/inline_call_intrinsics.h @@ -21,7 +21,7 @@ #include "optimizer/pass.h" #include "utils/arena_containers.h" -namespace panda::compiler { +namespace ark::compiler { // Pass aimed to expand intrinsics into some IR involving CallDynamic, // and allow calls to be processed in EcmaInlining pass afterwards @@ -59,6 +59,6 @@ private: ArenaVector functions_; }; -} // namespace panda::compiler +} // namespace ark::compiler #endif // _COMPILER_OPTIMIZER_OPTIMIZATIONS_INLINE_CALL_INTRINSICS_H diff --git a/compiler/templates/ecmascript_inst_builder_gen.cpp.erb b/compiler/templates/ecmascript_inst_builder_gen.cpp.erb index af1ee9ebc..a23375850 100644 --- a/compiler/templates/ecmascript_inst_builder_gen.cpp.erb +++ b/compiler/templates/ecmascript_inst_builder_gen.cpp.erb @@ -23,7 +23,7 @@ #include "irtoc_builder.cpp" -namespace panda::compiler { +namespace ark::compiler { // Currently we support two strategies for building IR from ecma.* instructions: // 1) Each ecma.* instruction is translated to a corresponding intrinsic call. @@ -408,4 +408,4 @@ void InstBuilder::BuildEcmaFromIrtoc([[maybe_unused]] const BytecodeInstruction* #endif } -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/ecmascript_plugin_options.yaml b/ecmascript_plugin_options.yaml index 6d917f86a..4ccbcf8da 100644 --- a/ecmascript_plugin_options.yaml +++ b/ecmascript_plugin_options.yaml @@ -12,7 +12,7 @@ # limitations under the License. - ECMASCRIPT: - lang_context_class: panda::EcmaLanguageContext + lang_context_class: ark::EcmaLanguageContext lang_context_header_path: plugins/ecmascript/runtime/ecma_language_context.h additional_interpter_inl: plugins/ecmascript/runtime/interpreter/ecma-interpreter-inl.h lang_enum_id: 0 @@ -39,54 +39,54 @@ store_object_dynamic_codegen: GenerateStoreObjectDynamic compiler_base_types: header_path_implementation_codegen: plugins/ecmascript/compiler/optimizer/code_generator/compiler_base_types.h - func_compare_implementation_codegen: panda::compiler::ecmascript::CompareAnyTypeGen - func_get_name_implementation_codegen: panda::compiler::ecmascript::GetAnyTypeNameGen - func_cast_implementation_codegen: panda::compiler::ecmascript::CastAnyTypeValueGen - func_cast_to_any_implementation_codegen: panda::compiler::ecmascript::CastValueToAnyTypeGen - func_any_type_check_implementation_codegen: panda::compiler::ecmascript::AnyTypeCheckGen - func_hclass_check_implementation_codegen: panda::compiler::ecmascript::HclassCheckGen - func_dynamic_call_check_implementation_codegen: panda::compiler::ecmascript::DynamicCallCheckGen - func_obj_by_index_check_implementation_codegen: panda::compiler::ecmascript::ObjByIndexCheckGen - func_resolve_numeric_type: panda::compiler::ecmascript::NumericDataTypeToAnyType - func_resolve_string_type: panda::compiler::ecmascript::GetAnyStringType - func_is_any_type_can_be_subtype_of: panda::compiler::ecmascript::IsAnyTypeCanBeSubtypeOf - func_load_constant_pool: panda::compiler::ecmascript::LoadConstantPoolGen - func_load_lexical_env: panda::compiler::ecmascript::LoadLexicalEnvGen - func_is_dyn_heap_object: panda::compiler::ecmascript::IsDynHeapObject + func_compare_implementation_codegen: ark::compiler::ecmascript::CompareAnyTypeGen + func_get_name_implementation_codegen: ark::compiler::ecmascript::GetAnyTypeNameGen + func_cast_implementation_codegen: ark::compiler::ecmascript::CastAnyTypeValueGen + func_cast_to_any_implementation_codegen: ark::compiler::ecmascript::CastValueToAnyTypeGen + func_any_type_check_implementation_codegen: ark::compiler::ecmascript::AnyTypeCheckGen + func_hclass_check_implementation_codegen: ark::compiler::ecmascript::HclassCheckGen + func_dynamic_call_check_implementation_codegen: ark::compiler::ecmascript::DynamicCallCheckGen + func_obj_by_index_check_implementation_codegen: ark::compiler::ecmascript::ObjByIndexCheckGen + func_resolve_numeric_type: ark::compiler::ecmascript::NumericDataTypeToAnyType + func_resolve_string_type: ark::compiler::ecmascript::GetAnyStringType + func_is_any_type_can_be_subtype_of: ark::compiler::ecmascript::IsAnyTypeCanBeSubtypeOf + func_load_constant_pool: ark::compiler::ecmascript::LoadConstantPoolGen + func_load_lexical_env: ark::compiler::ecmascript::LoadLexicalEnvGen + func_is_dyn_heap_object: ark::compiler::ecmascript::IsDynHeapObject list_types: - HOLE_TYPE: panda::compiler::DataType::Type::ANY - NULL_TYPE: panda::compiler::DataType::Type::ANY - UNDEFINED_TYPE: panda::compiler::DataType::Type::ANY - INT_TYPE: panda::compiler::DataType::Type::INT32 - DOUBLE_TYPE: panda::compiler::DataType::Type::FLOAT64 - OBJECT_TYPE: panda::compiler::DataType::Type::REFERENCE - HEAP_OBJECT_TYPE: panda::compiler::DataType::Type::REFERENCE - STRING_TYPE: panda::compiler::DataType::Type::REFERENCE - SYMBOL_TYPE: panda::compiler::DataType::Type::REFERENCE - ARRAY_TYPE: panda::compiler::DataType::Type::REFERENCE - TRANSITION_HANDLER_TYPE: panda::compiler::DataType::Type::REFERENCE - PROTOTYPE_HANDLER_TYPE: panda::compiler::DataType::Type::REFERENCE - SPECIAL_INDEXED_TYPE: panda::compiler::DataType::Type::REFERENCE - BOOLEAN_TYPE: panda::compiler::DataType::Type::BOOL - FUNCTION_TYPE: panda::compiler::DataType::Type::REFERENCE - CALLABLE_TYPE: panda::compiler::DataType::Type::REFERENCE - BIGINT_TYPE: panda::compiler::DataType::Type::REFERENCE + HOLE_TYPE: ark::compiler::DataType::Type::ANY + NULL_TYPE: ark::compiler::DataType::Type::ANY + UNDEFINED_TYPE: ark::compiler::DataType::Type::ANY + INT_TYPE: ark::compiler::DataType::Type::INT32 + DOUBLE_TYPE: ark::compiler::DataType::Type::FLOAT64 + OBJECT_TYPE: ark::compiler::DataType::Type::REFERENCE + HEAP_OBJECT_TYPE: ark::compiler::DataType::Type::REFERENCE + STRING_TYPE: ark::compiler::DataType::Type::REFERENCE + SYMBOL_TYPE: ark::compiler::DataType::Type::REFERENCE + ARRAY_TYPE: ark::compiler::DataType::Type::REFERENCE + TRANSITION_HANDLER_TYPE: ark::compiler::DataType::Type::REFERENCE + PROTOTYPE_HANDLER_TYPE: ark::compiler::DataType::Type::REFERENCE + SPECIAL_INDEXED_TYPE: ark::compiler::DataType::Type::REFERENCE + BOOLEAN_TYPE: ark::compiler::DataType::Type::BOOL + FUNCTION_TYPE: ark::compiler::DataType::Type::REFERENCE + CALLABLE_TYPE: ark::compiler::DataType::Type::REFERENCE + BIGINT_TYPE: ark::compiler::DataType::Type::REFERENCE Intrinsics: intrinsics_inline_inl_h: plugins/ecmascript/compiler/intrinsics_inline_ecmascript.inl.h intrinsics_graph_checker_inl: plugins/ecmascript/compiler/intrinsics_graph_checker.h inlinable_native: true Metadatas: - RecordMetadata: - new_class_name: panda::pandasm::extensions::ecmascript::RecordMetadata + new_class_name: ark::pandasm::extensions::ecmascript::RecordMetadata header_path: plugins/ecmascript/assembler/extension/ecmascript_meta.h - FieldMetadata: - new_class_name: panda::pandasm::extensions::ecmascript::FieldMetadata + new_class_name: ark::pandasm::extensions::ecmascript::FieldMetadata header_path: plugins/ecmascript/assembler/extension/ecmascript_meta.h - FunctionMetadata: - new_class_name: panda::pandasm::extensions::ecmascript::FunctionMetadata + new_class_name: ark::pandasm::extensions::ecmascript::FunctionMetadata header_path: plugins/ecmascript/assembler/extension/ecmascript_meta.h - ParamMetadata: - new_class_name: panda::pandasm::extensions::ecmascript::ParamMetadata + new_class_name: ark::pandasm::extensions::ecmascript::ParamMetadata header_path: plugins/ecmascript/assembler/extension/ecmascript_meta.h runtime_defines: defines_header_path: plugins/ecmascript/runtime/asm_defines/defines.h diff --git a/ecmastdlib/ecmastdlib_inline_gen.h.erb b/ecmastdlib/ecmastdlib_inline_gen.h.erb index 00e9dfff5..14876735d 100644 --- a/ecmastdlib/ecmastdlib_inline_gen.h.erb +++ b/ecmastdlib/ecmastdlib_inline_gen.h.erb @@ -13,7 +13,7 @@ * limitations under the License. */ -namespace panda::ecmascript::ecmastdlib_inline { +namespace ark::ecmascript::ecmastdlib_inline { // NOLINTNEXTLINE(readability-function-size) inline unsigned char const* GetEcmastdlibData(size_t &fsize) { @@ -40,4 +40,4 @@ inline unsigned char const* GetEcmastdlibData(size_t &fsize) return DATA; } -} // namespace panda::ecmascript::ecmastdlib_inline +} // namespace ark::ecmascript::ecmastdlib_inline diff --git a/irtoc_scripts/common.irt b/irtoc_scripts/common.irt index 511b1ad23..80c53d3b5 100644 --- a/irtoc_scripts/common.irt +++ b/irtoc_scripts/common.irt @@ -35,8 +35,8 @@ module Constants TAGGED_HOLE = "DataType::Any(coretypes::TaggedValue::VALUE_HOLE)" TAGGED_NULL = "DataType::Any(coretypes::TaggedValue::VALUE_NULL)" TAGGED_UNDEFINED = "DataType::Any(coretypes::TaggedValue::VALUE_UNDEFINED)" - TAGGED_INFINITY = "DataType::Any(panda::coretypes::TaggedValue(coretypes::TaggedValue::VALUE_INFINITY).GetRawData())" - TAGGED_NAN_VALUE = "DataType::Any(panda::coretypes::TaggedValue(coretypes::TaggedValue::VALUE_NAN).GetRawData())" + TAGGED_INFINITY = "DataType::Any(ark::coretypes::TaggedValue(coretypes::TaggedValue::VALUE_INFINITY).GetRawData())" + TAGGED_NAN_VALUE = "DataType::Any(ark::coretypes::TaggedValue(coretypes::TaggedValue::VALUE_NAN).GetRawData())" ECMASTRING_JSTYPE_STRING = "JSTYPE_STRING" ECMASTRING_MIX_LENGTH_FIELD = "runtime->GetFieldByOffset(cross_values::GetEcmastringMixLengthOffset(graph->GetArch()))" diff --git a/irtoc_scripts/interpreter_handlers.irt b/irtoc_scripts/interpreter_handlers.irt index e4c442749..c3daec18a 100644 --- a/irtoc_scripts/interpreter_handlers.irt +++ b/irtoc_scripts/interpreter_handlers.irt @@ -80,8 +80,8 @@ end macro(:anytoheapobj) do |arg| CastAnyTypeValue(arg) .AnyType("AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE") - .SetFlag("panda::compiler::inst_flags::Flags::NO_CSE") - .SetFlag("panda::compiler::inst_flags::Flags::NO_HOIST") + .SetFlag("ark::compiler::inst_flags::Flags::NO_CSE") + .SetFlag("ark::compiler::inst_flags::Flags::NO_HOIST") .ref end @@ -441,7 +441,7 @@ end macro(:mod2dyn_smi_smi) do |l, r| il := anytoi32(l) ir := anytoi32(r) - i32toany(Mod(NegativeCheck(il).SetFlag("panda::compiler::inst_flags::Flags::CAN_DEOPTIMIZE").u32, NotPositiveCheck(ir).SetFlag("panda::compiler::inst_flags::Flags::CAN_DEOPTIMIZE").u32).u32) + i32toany(Mod(NegativeCheck(il).SetFlag("ark::compiler::inst_flags::Flags::CAN_DEOPTIMIZE").u32, NotPositiveCheck(ir).SetFlag("ark::compiler::inst_flags::Flags::CAN_DEOPTIMIZE").u32).u32) end macro(:mod2dyn_smi_double) do |l, r| diff --git a/runtime/accessor_data.h b/runtime/accessor_data.h index 3194539e4..f5cf43186 100644 --- a/runtime/accessor_data.h +++ b/runtime/accessor_data.h @@ -22,7 +22,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "plugins/ecmascript/runtime/record.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class AccessorData final : public Record { public: using InternalGetFunc = JSTaggedValue (*)(JSThread *, const JSHandle &); @@ -101,5 +101,5 @@ public: DECL_DUMP() }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_ACCESSOR_DATA_H diff --git a/runtime/asm_defines/asm_defines.def b/runtime/asm_defines/asm_defines.def index dac24aa46..1027283e0 100644 --- a/runtime/asm_defines/asm_defines.def +++ b/runtime/asm_defines/asm_defines.def @@ -14,125 +14,125 @@ */ // NOLINTBEGIN(readability-identifier-naming) -DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_SIZE, panda::ecmascript::EcmascriptEnvironment::GetSize()) -DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_CONSTANT_POOL_OFFSET, panda::ecmascript::EcmascriptEnvironment::GetConstantPoolOffset()) -DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_LEXICAL_ENV_OFFSET, panda::ecmascript::EcmascriptEnvironment::GetLexicalEnvOffset()) -DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_THIS_FUNC_OFFSET, panda::ecmascript::EcmascriptEnvironment::GetThisFuncOffset()) -DEFINE_VALUE(EXTFRAME_EXT_DATA_OFFSET, panda::ecmascript::JSExtFrame::GetExtDataOffset()) -DEFINE_VALUE(EXTFRAME_FRAME_OFFSET, panda::ecmascript::JSExtFrame::GetFrameOffset()) -DEFINE_VALUE(JSTYPE_JS_OBJECT_BEGIN, static_cast(panda::ecmascript::JSType::JS_OBJECT_BEGIN)) -DEFINE_VALUE(JSTYPE_JS_OBJECT_END, static_cast(panda::ecmascript::JSType::JS_OBJECT_END)) -DEFINE_VALUE(JSTYPE_STRING, static_cast(panda::ecmascript::JSType::STRING)) -DEFINE_VALUE(JSTYPE_SYMBOL, static_cast(panda::ecmascript::JSType::SYMBOL)) -DEFINE_VALUE(JSTYPE_BIGINT, static_cast(panda::ecmascript::JSType::BIGINT)) -DEFINE_VALUE(JSTYPE_JS_ARRAY, static_cast(panda::ecmascript::JSType::JS_ARRAY)) -DEFINE_VALUE(JSTYPE_HCLASS, static_cast(panda::ecmascript::JSType::HCLASS)) -DEFINE_VALUE(JSTYPE_PROTOTYPE_HANDLER, static_cast(panda::ecmascript::JSType::PROTOTYPE_HANDLER)) -DEFINE_VALUE(JSTYPE_TRANSITION_HANDLER, static_cast(panda::ecmascript::JSType::TRANSITION_HANDLER)) -DEFINE_VALUE(JSTYPE_JS_FUNCTION, static_cast(panda::ecmascript::JSType::JS_FUNCTION)) -DEFINE_VALUE(JSTYPE_JS_FUNCTION_BEGIN, static_cast(panda::ecmascript::JSType::JS_FUNCTION_BEGIN)) -DEFINE_VALUE(JSTYPE_JS_FUNCTION_END, static_cast(panda::ecmascript::JSType::JS_FUNCTION_END)) -DEFINE_VALUE(JSTYPE_ECMA_OBJECT_BEGIN, static_cast(panda::ecmascript::JSType::ECMA_OBJECT_BEGIN)) -DEFINE_VALUE(JSTYPE_ECMA_OBJECT_END, static_cast(panda::ecmascript::JSType::ECMA_OBJECT_END)) -DEFINE_VALUE(JSTYPE_FINALIZATION_REGISTRY, static_cast(panda::ecmascript::JSType::FINALIZATION_REGISTRY)) -DEFINE_VALUE(ECMASTRING_MIX_LENGTH_OFFSET, panda::ecmascript::EcmaString::GetMixLengthOffset()) -DEFINE_VALUE(ECMASTRING_DATA_OFFSET, panda::ecmascript::EcmaString::DATA_OFFSET) -DEFINE_VALUE(ECMASTRING_STRING_COMPRESSED_MASK, panda::ecmascript::EcmaString::GetStringCompressionMask()) -DEFINE_VALUE(JSFORINITERATOR_FAST_REMAINING_INDEX_OFFSET, panda::ecmascript::JSForInIterator::GetFastRemainingIndexOffset()) -DEFINE_VALUE(JSFORINITERATOR_REMAINING_KEYS_OFFSET, panda::ecmascript::JSForInIterator::GetRemainingKeysOffset()) -DEFINE_VALUE(TAGGEDARRAY_DATA_OFFSET, panda::ecmascript::TaggedArray::DATA_OFFSET) -DEFINE_VALUE(TAGGEDQUEUE_START_INDEX, panda::ecmascript::TaggedQueue::START_INDEX) -DEFINE_VALUE(TAGGEDQUEUE_END_INDEX, panda::ecmascript::TaggedQueue::END_INDEX) -DEFINE_VALUE(TAGGEDQUEUE_ELEMENTS_START_INDEX, panda::ecmascript::TaggedQueue::ELEMENTS_START_INDEX) -DEFINE_VALUE(JSHCLASS_BITFIELD_OFFSET, panda::ecmascript::JSHClass::BIT_FIELD_OFFSET) -DEFINE_VALUE(JSHCLASS_BITFIELD_TYPE_MASK, panda::ecmascript::JSHClass::ObjectTypeBits::MaxValue()) -DEFINE_VALUE(JSHCLASS_BITFIELD_TYPE_START_BIT, panda::ecmascript::JSHClass::ObjectTypeBits::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD_IS_DICTIONARY_START_BIT, panda::ecmascript::JSHClass::IsDictionaryBit::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD_CONSTRUCTOR_START_BIT, panda::ecmascript::JSHClass::ConstructorBit::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD_CLASS_CONSTRUCTOR_START_BIT, panda::ecmascript::JSHClass::ClassConstructorBit::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD_EXTENSIBLE_START_BIT, panda::ecmascript::JSHClass::ExtensibleBit::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD_INLINED_PROPS_START_BITS_START_BIT, panda::ecmascript::JSHClass::InlinedPropsStartBits::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD_INLINED_PROPS_START_BITS_MASK, panda::ecmascript::JSHClass::InlinedPropsStartBits::MaxValue()) -DEFINE_VALUE(JSHCLASS_OBJECT_SIZE_OFFSET, panda::ecmascript::JSHClass::OBJECT_SIZE_OFFSET) -DEFINE_VALUE(JSHCLASS_HCLASS_OFFSET, panda::ecmascript::JSHClass::GetHClassOffset()) -DEFINE_VALUE(JSHCLASS_LAYOUT_OFFSET, panda::ecmascript::JSHClass::GetLayoutOffset()) -DEFINE_VALUE(JSHCLASS_PROTO_OFFSET, panda::ecmascript::JSHClass::GetProtoOffset()) -DEFINE_VALUE(JSHCLASS_PROTO_CHANGE_MARKER_OFFSET, panda::ecmascript::JSHClass::GetProtoChangeMarkerOffset()) -DEFINE_VALUE(JSHCLASS_BITFIELD1_OFFSET, panda::ecmascript::JSHClass::BIT_FIELD1_OFFSET) -DEFINE_VALUE(JSHCLASS_BITFIELD1_NUMBER_OF_PROPS_BITS_START_BIT, panda::ecmascript::JSHClass::NumberOfPropsBits::START_BIT) -DEFINE_VALUE(JSHCLASS_BITFIELD1_NUMBER_OF_PROPS_BITS_MASK, panda::ecmascript::JSHClass::NumberOfPropsBits::MaxValue()) -DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_OFFSET, panda::ecmascript::LayoutInfo::GetPropertiesOffset()) -DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_SIZE, sizeof(panda::ecmascript::Properties)) -DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_KEY_OFFSET, panda::ecmascript::Properties::GetKeyOffset()) -DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_ATTR_OFFSET, panda::ecmascript::Properties::GetAttrOffset()) -DEFINE_VALUE(JSHCLASS_LAYOUT_INFO_NUMBER_OF_PROPERTIES_INDEX, panda::ecmascript::LayoutInfo::NUMBER_OF_PROPERTIES_INDEX) -DEFINE_VALUE(JSOBJECT_PROPERTIES_OFFSET, panda::ecmascript::JSObject::GetPropertiesOffset()) -DEFINE_VALUE(JSOBJECT_ELEMENTS_OFFSET, panda::ecmascript::JSObject::GetElementsOffset()) -DEFINE_VALUE(JSOBJECT_MAX_ELEMENT_INDEX, static_cast(panda::ecmascript::JSObject::MAX_ELEMENT_INDEX)) -DEFINE_VALUE(JSARRAY_LENGTH_OFFSET, panda::ecmascript::JSArray::GetLengthOffset()) -DEFINE_VALUE(JSFUNCTION_METHOD_OFFSET, panda::ecmascript::JSFunction::GetMethodOffset()) -DEFINE_VALUE(JSFUNCTION_PROFILE_TYPE_INFO_OFFSET, panda::ecmascript::JSFunction::GetProfileTypeInfoOffset()) -DEFINE_VALUE(JSFUNCTION_CONSTANT_POOL_OFFSET, panda::ecmascript::JSFunction::GetConstantPoolOffset()) -DEFINE_VALUE(JSFUNCTION_LEXICAL_ENV_OFFSET, panda::ecmascript::JSFunction::GetLexicalEnvOffset()) -DEFINE_VALUE(JSFUNCTION_FUNCTION_INFO_FLAG_OFFSET, panda::ecmascript::JSFunction::GetFunctionInfoFlagOffset()) -DEFINE_VALUE(JSFUNCTION_FUNCTION_INFO_FLAG_IS_STRICT_START_BIT, panda::ecmascript::JSFunction::StrictBit::START_BIT) -DEFINE_VALUE(JSFUNCTION_PROTO_OR_DYN_CLASS_OFFSET, panda::ecmascript::JSFunction::GetProtoOrDynClassOffset()) -DEFINE_VALUE(JSFUNCTION_KIND_MASK, panda::ecmascript::JSFunction::FunctionKindBit::Mask()) -DEFINE_VALUE(JSPROPERTY_BOX_VALUE_OFFSET, panda::ecmascript::PropertyBox::GetValueOffset()) -DEFINE_VALUE(JSTRANSITION_HANDLER_HANDLER_INFO_OFFSET, panda::ecmascript::TransitionHandler::GetHandlerInfoOffset()) -DEFINE_VALUE(JSTRANSITION_HANDLER_HCLASS_OFFSET, panda::ecmascript::TransitionHandler::GetTransitionHClassOffset()) -DEFINE_VALUE(JSPROTOTYPE_HANDLER_HANDLER_INFO_OFFSET, panda::ecmascript::PrototypeHandler::GetHandlerInfoOffset()) -DEFINE_VALUE(JSPROTOTYPE_HANDLER_PROTO_CELL_OFFSET, panda::ecmascript::PrototypeHandler::GetProtoCellOffset()) -DEFINE_VALUE(JSPROTOTYPE_HANDLER_HOLDER_OFFSET, panda::ecmascript::PrototypeHandler::GetHolderOffset()) -DEFINE_VALUE(JSPROTO_CHANGE_MARKER_HAS_CHANGED_OFFSET, panda::ecmascript::ProtoChangeMarker::GetHasChangedOffset()) -DEFINE_VALUE(JS_STRING_HASHCODE_OFFSET, panda::ecmascript::EcmaString::GetRawHashcodeOffset()) -DEFINE_VALUE(JS_SYMBOL_HASHFIELD_OFFSET, panda::ecmascript::JSSymbol::GetHashFieldOffset()) -DEFINE_VALUE(IC_HANDLER_KIND_BIT_START_BIT, panda::ecmascript::HandlerBase::KindBit::START_BIT) -DEFINE_VALUE(IC_HANDLER_KIND_BIT_MASK, panda::ecmascript::HandlerBase::KindBit::MaxValue()) -DEFINE_VALUE(IC_HANDLER_OFFSET_BIT_START_BIT, panda::ecmascript::HandlerBase::OffsetBit::START_BIT) -DEFINE_VALUE(IC_HANDLER_OFFSET_BIT_MASK, panda::ecmascript::HandlerBase::OffsetBit::MaxValue()) -DEFINE_VALUE(IC_HANDLER_INLINED_PROPS_BIT_START_BIT, panda::ecmascript::HandlerBase::InlinedPropsBit::START_BIT) -DEFINE_VALUE(IC_HANDLER_INLINED_PROPS_BIT_MASK, panda::ecmascript::HandlerBase::InlinedPropsBit::MaxValue()) -DEFINE_VALUE(IC_HANDLER_HANDLER_KIND_FIELD, static_cast(panda::ecmascript::HandlerBase::HandlerKind::FIELD)) +DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_SIZE, ark::ecmascript::EcmascriptEnvironment::GetSize()) +DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_CONSTANT_POOL_OFFSET, ark::ecmascript::EcmascriptEnvironment::GetConstantPoolOffset()) +DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_LEXICAL_ENV_OFFSET, ark::ecmascript::EcmascriptEnvironment::GetLexicalEnvOffset()) +DEFINE_VALUE(ECMASCRIPT_ENVIRONMENT_THIS_FUNC_OFFSET, ark::ecmascript::EcmascriptEnvironment::GetThisFuncOffset()) +DEFINE_VALUE(EXTFRAME_EXT_DATA_OFFSET, ark::ecmascript::JSExtFrame::GetExtDataOffset()) +DEFINE_VALUE(EXTFRAME_FRAME_OFFSET, ark::ecmascript::JSExtFrame::GetFrameOffset()) +DEFINE_VALUE(JSTYPE_JS_OBJECT_BEGIN, static_cast(ark::ecmascript::JSType::JS_OBJECT_BEGIN)) +DEFINE_VALUE(JSTYPE_JS_OBJECT_END, static_cast(ark::ecmascript::JSType::JS_OBJECT_END)) +DEFINE_VALUE(JSTYPE_STRING, static_cast(ark::ecmascript::JSType::STRING)) +DEFINE_VALUE(JSTYPE_SYMBOL, static_cast(ark::ecmascript::JSType::SYMBOL)) +DEFINE_VALUE(JSTYPE_BIGINT, static_cast(ark::ecmascript::JSType::BIGINT)) +DEFINE_VALUE(JSTYPE_JS_ARRAY, static_cast(ark::ecmascript::JSType::JS_ARRAY)) +DEFINE_VALUE(JSTYPE_HCLASS, static_cast(ark::ecmascript::JSType::HCLASS)) +DEFINE_VALUE(JSTYPE_PROTOTYPE_HANDLER, static_cast(ark::ecmascript::JSType::PROTOTYPE_HANDLER)) +DEFINE_VALUE(JSTYPE_TRANSITION_HANDLER, static_cast(ark::ecmascript::JSType::TRANSITION_HANDLER)) +DEFINE_VALUE(JSTYPE_JS_FUNCTION, static_cast(ark::ecmascript::JSType::JS_FUNCTION)) +DEFINE_VALUE(JSTYPE_JS_FUNCTION_BEGIN, static_cast(ark::ecmascript::JSType::JS_FUNCTION_BEGIN)) +DEFINE_VALUE(JSTYPE_JS_FUNCTION_END, static_cast(ark::ecmascript::JSType::JS_FUNCTION_END)) +DEFINE_VALUE(JSTYPE_ECMA_OBJECT_BEGIN, static_cast(ark::ecmascript::JSType::ECMA_OBJECT_BEGIN)) +DEFINE_VALUE(JSTYPE_ECMA_OBJECT_END, static_cast(ark::ecmascript::JSType::ECMA_OBJECT_END)) +DEFINE_VALUE(JSTYPE_FINALIZATION_REGISTRY, static_cast(ark::ecmascript::JSType::FINALIZATION_REGISTRY)) +DEFINE_VALUE(ECMASTRING_MIX_LENGTH_OFFSET, ark::ecmascript::EcmaString::GetMixLengthOffset()) +DEFINE_VALUE(ECMASTRING_DATA_OFFSET, ark::ecmascript::EcmaString::DATA_OFFSET) +DEFINE_VALUE(ECMASTRING_STRING_COMPRESSED_MASK, ark::ecmascript::EcmaString::GetStringCompressionMask()) +DEFINE_VALUE(JSFORINITERATOR_FAST_REMAINING_INDEX_OFFSET, ark::ecmascript::JSForInIterator::GetFastRemainingIndexOffset()) +DEFINE_VALUE(JSFORINITERATOR_REMAINING_KEYS_OFFSET, ark::ecmascript::JSForInIterator::GetRemainingKeysOffset()) +DEFINE_VALUE(TAGGEDARRAY_DATA_OFFSET, ark::ecmascript::TaggedArray::DATA_OFFSET) +DEFINE_VALUE(TAGGEDQUEUE_START_INDEX, ark::ecmascript::TaggedQueue::START_INDEX) +DEFINE_VALUE(TAGGEDQUEUE_END_INDEX, ark::ecmascript::TaggedQueue::END_INDEX) +DEFINE_VALUE(TAGGEDQUEUE_ELEMENTS_START_INDEX, ark::ecmascript::TaggedQueue::ELEMENTS_START_INDEX) +DEFINE_VALUE(JSHCLASS_BITFIELD_OFFSET, ark::ecmascript::JSHClass::BIT_FIELD_OFFSET) +DEFINE_VALUE(JSHCLASS_BITFIELD_TYPE_MASK, ark::ecmascript::JSHClass::ObjectTypeBits::MaxValue()) +DEFINE_VALUE(JSHCLASS_BITFIELD_TYPE_START_BIT, ark::ecmascript::JSHClass::ObjectTypeBits::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD_IS_DICTIONARY_START_BIT, ark::ecmascript::JSHClass::IsDictionaryBit::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD_CONSTRUCTOR_START_BIT, ark::ecmascript::JSHClass::ConstructorBit::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD_CLASS_CONSTRUCTOR_START_BIT, ark::ecmascript::JSHClass::ClassConstructorBit::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD_EXTENSIBLE_START_BIT, ark::ecmascript::JSHClass::ExtensibleBit::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD_INLINED_PROPS_START_BITS_START_BIT, ark::ecmascript::JSHClass::InlinedPropsStartBits::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD_INLINED_PROPS_START_BITS_MASK, ark::ecmascript::JSHClass::InlinedPropsStartBits::MaxValue()) +DEFINE_VALUE(JSHCLASS_OBJECT_SIZE_OFFSET, ark::ecmascript::JSHClass::OBJECT_SIZE_OFFSET) +DEFINE_VALUE(JSHCLASS_HCLASS_OFFSET, ark::ecmascript::JSHClass::GetHClassOffset()) +DEFINE_VALUE(JSHCLASS_LAYOUT_OFFSET, ark::ecmascript::JSHClass::GetLayoutOffset()) +DEFINE_VALUE(JSHCLASS_PROTO_OFFSET, ark::ecmascript::JSHClass::GetProtoOffset()) +DEFINE_VALUE(JSHCLASS_PROTO_CHANGE_MARKER_OFFSET, ark::ecmascript::JSHClass::GetProtoChangeMarkerOffset()) +DEFINE_VALUE(JSHCLASS_BITFIELD1_OFFSET, ark::ecmascript::JSHClass::BIT_FIELD1_OFFSET) +DEFINE_VALUE(JSHCLASS_BITFIELD1_NUMBER_OF_PROPS_BITS_START_BIT, ark::ecmascript::JSHClass::NumberOfPropsBits::START_BIT) +DEFINE_VALUE(JSHCLASS_BITFIELD1_NUMBER_OF_PROPS_BITS_MASK, ark::ecmascript::JSHClass::NumberOfPropsBits::MaxValue()) +DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_OFFSET, ark::ecmascript::LayoutInfo::GetPropertiesOffset()) +DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_SIZE, sizeof(ark::ecmascript::Properties)) +DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_KEY_OFFSET, ark::ecmascript::Properties::GetKeyOffset()) +DEFINE_VALUE(JSHCLASS_LAYOUT_PROPERTIES_ATTR_OFFSET, ark::ecmascript::Properties::GetAttrOffset()) +DEFINE_VALUE(JSHCLASS_LAYOUT_INFO_NUMBER_OF_PROPERTIES_INDEX, ark::ecmascript::LayoutInfo::NUMBER_OF_PROPERTIES_INDEX) +DEFINE_VALUE(JSOBJECT_PROPERTIES_OFFSET, ark::ecmascript::JSObject::GetPropertiesOffset()) +DEFINE_VALUE(JSOBJECT_ELEMENTS_OFFSET, ark::ecmascript::JSObject::GetElementsOffset()) +DEFINE_VALUE(JSOBJECT_MAX_ELEMENT_INDEX, static_cast(ark::ecmascript::JSObject::MAX_ELEMENT_INDEX)) +DEFINE_VALUE(JSARRAY_LENGTH_OFFSET, ark::ecmascript::JSArray::GetLengthOffset()) +DEFINE_VALUE(JSFUNCTION_METHOD_OFFSET, ark::ecmascript::JSFunction::GetMethodOffset()) +DEFINE_VALUE(JSFUNCTION_PROFILE_TYPE_INFO_OFFSET, ark::ecmascript::JSFunction::GetProfileTypeInfoOffset()) +DEFINE_VALUE(JSFUNCTION_CONSTANT_POOL_OFFSET, ark::ecmascript::JSFunction::GetConstantPoolOffset()) +DEFINE_VALUE(JSFUNCTION_LEXICAL_ENV_OFFSET, ark::ecmascript::JSFunction::GetLexicalEnvOffset()) +DEFINE_VALUE(JSFUNCTION_FUNCTION_INFO_FLAG_OFFSET, ark::ecmascript::JSFunction::GetFunctionInfoFlagOffset()) +DEFINE_VALUE(JSFUNCTION_FUNCTION_INFO_FLAG_IS_STRICT_START_BIT, ark::ecmascript::JSFunction::StrictBit::START_BIT) +DEFINE_VALUE(JSFUNCTION_PROTO_OR_DYN_CLASS_OFFSET, ark::ecmascript::JSFunction::GetProtoOrDynClassOffset()) +DEFINE_VALUE(JSFUNCTION_KIND_MASK, ark::ecmascript::JSFunction::FunctionKindBit::Mask()) +DEFINE_VALUE(JSPROPERTY_BOX_VALUE_OFFSET, ark::ecmascript::PropertyBox::GetValueOffset()) +DEFINE_VALUE(JSTRANSITION_HANDLER_HANDLER_INFO_OFFSET, ark::ecmascript::TransitionHandler::GetHandlerInfoOffset()) +DEFINE_VALUE(JSTRANSITION_HANDLER_HCLASS_OFFSET, ark::ecmascript::TransitionHandler::GetTransitionHClassOffset()) +DEFINE_VALUE(JSPROTOTYPE_HANDLER_HANDLER_INFO_OFFSET, ark::ecmascript::PrototypeHandler::GetHandlerInfoOffset()) +DEFINE_VALUE(JSPROTOTYPE_HANDLER_PROTO_CELL_OFFSET, ark::ecmascript::PrototypeHandler::GetProtoCellOffset()) +DEFINE_VALUE(JSPROTOTYPE_HANDLER_HOLDER_OFFSET, ark::ecmascript::PrototypeHandler::GetHolderOffset()) +DEFINE_VALUE(JSPROTO_CHANGE_MARKER_HAS_CHANGED_OFFSET, ark::ecmascript::ProtoChangeMarker::GetHasChangedOffset()) +DEFINE_VALUE(JS_STRING_HASHCODE_OFFSET, ark::ecmascript::EcmaString::GetRawHashcodeOffset()) +DEFINE_VALUE(JS_SYMBOL_HASHFIELD_OFFSET, ark::ecmascript::JSSymbol::GetHashFieldOffset()) +DEFINE_VALUE(IC_HANDLER_KIND_BIT_START_BIT, ark::ecmascript::HandlerBase::KindBit::START_BIT) +DEFINE_VALUE(IC_HANDLER_KIND_BIT_MASK, ark::ecmascript::HandlerBase::KindBit::MaxValue()) +DEFINE_VALUE(IC_HANDLER_OFFSET_BIT_START_BIT, ark::ecmascript::HandlerBase::OffsetBit::START_BIT) +DEFINE_VALUE(IC_HANDLER_OFFSET_BIT_MASK, ark::ecmascript::HandlerBase::OffsetBit::MaxValue()) +DEFINE_VALUE(IC_HANDLER_INLINED_PROPS_BIT_START_BIT, ark::ecmascript::HandlerBase::InlinedPropsBit::START_BIT) +DEFINE_VALUE(IC_HANDLER_INLINED_PROPS_BIT_MASK, ark::ecmascript::HandlerBase::InlinedPropsBit::MaxValue()) +DEFINE_VALUE(IC_HANDLER_HANDLER_KIND_FIELD, static_cast(ark::ecmascript::HandlerBase::HandlerKind::FIELD)) DEFINE_VALUE(HCLASS_DATA_OFFSET, HClass::GetDataOffset()) -DEFINE_VALUE(JSMETHOD_IC_MAPPING_OFFSET, panda::ecmascript::JSMethod::GetICMappingOffset()) +DEFINE_VALUE(JSMETHOD_IC_MAPPING_OFFSET, ark::ecmascript::JSMethod::GetICMappingOffset()) DEFINE_VALUE(HCLASS_IS_BUILTINS_CTOR_MASK, HClass::IS_BUILTINS_CTOR) -DEFINE_VALUE(JSTHREAD_GLOBAL_CONSTANTS_OFFSET, panda::ecmascript::JSThread::GetGlobalConstantsOffset()) -DEFINE_VALUE(JSTHREAD_GLOBAL_OBJECT_OFFSET, panda::ecmascript::JSThread::GetGlobalObjectOffset()) -DEFINE_VALUE(THREAD_PROPERTIES_CACHE_OFFSET, panda::ecmascript::JSThread::GetPropertiesCacheOffset()) -DEFINE_VALUE(PROPERTIES_CACHE_LENGTH, panda::ecmascript::PropertiesCache::CACHE_LENGTH) -DEFINE_VALUE(PROPERTIES_CACHE_LENGTH_MASK, panda::ecmascript::PropertiesCache::CACHE_LENGTH_MASK) -DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_SIZE, sizeof(panda::ecmascript::PropertiesCache::PropertyKey)) -DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_HCLASS_OFFSET, panda::ecmascript::PropertiesCache::PropertyKey::GetHClassOffset()) -DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_KEY_OFFSET, panda::ecmascript::PropertiesCache::PropertyKey::GetKeyOffset()) -DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_RESULTS_OFFSET, panda::ecmascript::PropertiesCache::PropertyKey::GetResultsOffset()) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_OFFSET_FIELD_START_BIT, panda::ecmascript::PropertyAttributes::OffsetField::START_BIT) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_OFFSET_FIELD_MASK, panda::ecmascript::PropertyAttributes::OffsetField::MaxValue()) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_INLINE_FIELD_START_BIT, panda::ecmascript::PropertyAttributes::IsInlinedPropsField::START_BIT) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_INLINE_FIELD_MASK, panda::ecmascript::PropertyAttributes::IsInlinedPropsField::MaxValue()) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_ACCESSOR_FIELD_START_BIT, panda::ecmascript::PropertyAttributes::IsAccessorField::START_BIT) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_ACCESSOR_FIELD_MASK, panda::ecmascript::PropertyAttributes::IsAccessorField::MaxValue()) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_WRITABLE_FIELD_START_BIT, panda::ecmascript::PropertyAttributes::WritableField::START_BIT) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_WRITABLE_FIELD_MASK, panda::ecmascript::PropertyAttributes::WritableField::MaxValue()) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_SORTED_INDEX_FIELD_START_BIT, panda::ecmascript::PropertyAttributes::SortedIndexField::START_BIT) -DEFINE_VALUE(PROPERTY_ATTRIBUTES_SORTED_INDEX_FIELD_MASK, panda::ecmascript::PropertyAttributes::SortedIndexField::MaxValue()) -DEFINE_VALUE(TAGGED_HASH_TABLE_SIZE_INDEX, panda::ecmascript::NameDictionary::SIZE_INDEX) -DEFINE_VALUE(ORDER_TAGGED_HASH_TABLE_HEADER_SIZE, panda::ecmascript::NameDictionary::TABLE_HEADER_SIZE) -DEFINE_VALUE(NAME_DICTIONARY_ENTRY_SIZE, panda::ecmascript::NameDictionary::ENTRY_SIZE) -DEFINE_VALUE(NAME_DICTIONARY_ENTRY_KEY_INDEX, panda::ecmascript::NameDictionary::ENTRY_KEY_INDEX) -DEFINE_VALUE(NAME_DICTIONARY_ENTRY_VALUE_INDEX, panda::ecmascript::NameDictionary::ENTRY_VALUE_INDEX) -DEFINE_VALUE(NAME_DICTIONARY_ENTRY_DETAILS_INDEX, panda::ecmascript::NameDictionary::ENTRY_DETAILS_INDEX) -DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_SIZE, panda::ecmascript::NumberDictionary::ENTRY_SIZE) -DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_KEY_INDEX, panda::ecmascript::NumberDictionary::ENTRY_KEY_INDEX) -DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_VALUE_INDEX, panda::ecmascript::NumberDictionary::ENTRY_VALUE_INDEX) -DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_DETAILS_INDEX, panda::ecmascript::NumberDictionary::ENTRY_DETAILS_INDEX) -DEFINE_VALUE(FUNCTION_KIND_CLASS_CTOR, panda::ecmascript::FunctionKind::CLASS_CONSTRUCTOR) -DEFINE_VALUE(FUNCTION_KIND_BUILTIN_PROXY_CTOR, panda::ecmascript::FunctionKind::BUILTIN_PROXY_CONSTRUCTOR) -DEFINE_VALUE(FUNCTION_KIND_BUILTIN_CTOR, panda::ecmascript::FunctionKind::BUILTIN_CONSTRUCTOR) -DEFINE_VALUE(FUNCTION_KIND_DERIVED_CTOR, panda::ecmascript::FunctionKind::DERIVED_CONSTRUCTOR) -DEFINE_VALUE(TAGGED_TYPE_SIZE, panda::ecmascript::JSTaggedValue::TaggedTypeSize()) -DEFINE_VALUE(ECMA_VM_GLOBAL_ENV_OFFSET, panda::ecmascript::EcmaVM::GetGlobalEnvOffset()) -DEFINE_VALUE(GLOBAL_ENV_HEADER_SIZE, panda::ecmascript::GlobalEnv::HEADER_SIZE) -DEFINE_VALUE(GLOBAL_ENV_EMPTY_ARRAY_INDEX, panda::ecmascript::GlobalEnv::EMPTY_ARRAY_OBJECT_INDEX) -DEFINE_VALUE(GLOBAL_CONST_CONSTANTS_OFFSET, panda::ecmascript::GlobalEnvConstants::GetConstantsOffset()) +DEFINE_VALUE(JSTHREAD_GLOBAL_CONSTANTS_OFFSET, ark::ecmascript::JSThread::GetGlobalConstantsOffset()) +DEFINE_VALUE(JSTHREAD_GLOBAL_OBJECT_OFFSET, ark::ecmascript::JSThread::GetGlobalObjectOffset()) +DEFINE_VALUE(THREAD_PROPERTIES_CACHE_OFFSET, ark::ecmascript::JSThread::GetPropertiesCacheOffset()) +DEFINE_VALUE(PROPERTIES_CACHE_LENGTH, ark::ecmascript::PropertiesCache::CACHE_LENGTH) +DEFINE_VALUE(PROPERTIES_CACHE_LENGTH_MASK, ark::ecmascript::PropertiesCache::CACHE_LENGTH_MASK) +DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_SIZE, sizeof(ark::ecmascript::PropertiesCache::PropertyKey)) +DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_HCLASS_OFFSET, ark::ecmascript::PropertiesCache::PropertyKey::GetHClassOffset()) +DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_KEY_OFFSET, ark::ecmascript::PropertiesCache::PropertyKey::GetKeyOffset()) +DEFINE_VALUE(PROPERTIES_CACHE_ENTRY_RESULTS_OFFSET, ark::ecmascript::PropertiesCache::PropertyKey::GetResultsOffset()) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_OFFSET_FIELD_START_BIT, ark::ecmascript::PropertyAttributes::OffsetField::START_BIT) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_OFFSET_FIELD_MASK, ark::ecmascript::PropertyAttributes::OffsetField::MaxValue()) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_INLINE_FIELD_START_BIT, ark::ecmascript::PropertyAttributes::IsInlinedPropsField::START_BIT) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_INLINE_FIELD_MASK, ark::ecmascript::PropertyAttributes::IsInlinedPropsField::MaxValue()) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_ACCESSOR_FIELD_START_BIT, ark::ecmascript::PropertyAttributes::IsAccessorField::START_BIT) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_ACCESSOR_FIELD_MASK, ark::ecmascript::PropertyAttributes::IsAccessorField::MaxValue()) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_WRITABLE_FIELD_START_BIT, ark::ecmascript::PropertyAttributes::WritableField::START_BIT) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_WRITABLE_FIELD_MASK, ark::ecmascript::PropertyAttributes::WritableField::MaxValue()) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_SORTED_INDEX_FIELD_START_BIT, ark::ecmascript::PropertyAttributes::SortedIndexField::START_BIT) +DEFINE_VALUE(PROPERTY_ATTRIBUTES_SORTED_INDEX_FIELD_MASK, ark::ecmascript::PropertyAttributes::SortedIndexField::MaxValue()) +DEFINE_VALUE(TAGGED_HASH_TABLE_SIZE_INDEX, ark::ecmascript::NameDictionary::SIZE_INDEX) +DEFINE_VALUE(ORDER_TAGGED_HASH_TABLE_HEADER_SIZE, ark::ecmascript::NameDictionary::TABLE_HEADER_SIZE) +DEFINE_VALUE(NAME_DICTIONARY_ENTRY_SIZE, ark::ecmascript::NameDictionary::ENTRY_SIZE) +DEFINE_VALUE(NAME_DICTIONARY_ENTRY_KEY_INDEX, ark::ecmascript::NameDictionary::ENTRY_KEY_INDEX) +DEFINE_VALUE(NAME_DICTIONARY_ENTRY_VALUE_INDEX, ark::ecmascript::NameDictionary::ENTRY_VALUE_INDEX) +DEFINE_VALUE(NAME_DICTIONARY_ENTRY_DETAILS_INDEX, ark::ecmascript::NameDictionary::ENTRY_DETAILS_INDEX) +DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_SIZE, ark::ecmascript::NumberDictionary::ENTRY_SIZE) +DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_KEY_INDEX, ark::ecmascript::NumberDictionary::ENTRY_KEY_INDEX) +DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_VALUE_INDEX, ark::ecmascript::NumberDictionary::ENTRY_VALUE_INDEX) +DEFINE_VALUE(NUMBER_DICTIONARY_ENTRY_DETAILS_INDEX, ark::ecmascript::NumberDictionary::ENTRY_DETAILS_INDEX) +DEFINE_VALUE(FUNCTION_KIND_CLASS_CTOR, ark::ecmascript::FunctionKind::CLASS_CONSTRUCTOR) +DEFINE_VALUE(FUNCTION_KIND_BUILTIN_PROXY_CTOR, ark::ecmascript::FunctionKind::BUILTIN_PROXY_CONSTRUCTOR) +DEFINE_VALUE(FUNCTION_KIND_BUILTIN_CTOR, ark::ecmascript::FunctionKind::BUILTIN_CONSTRUCTOR) +DEFINE_VALUE(FUNCTION_KIND_DERIVED_CTOR, ark::ecmascript::FunctionKind::DERIVED_CONSTRUCTOR) +DEFINE_VALUE(TAGGED_TYPE_SIZE, ark::ecmascript::JSTaggedValue::TaggedTypeSize()) +DEFINE_VALUE(ECMA_VM_GLOBAL_ENV_OFFSET, ark::ecmascript::EcmaVM::GetGlobalEnvOffset()) +DEFINE_VALUE(GLOBAL_ENV_HEADER_SIZE, ark::ecmascript::GlobalEnv::HEADER_SIZE) +DEFINE_VALUE(GLOBAL_ENV_EMPTY_ARRAY_INDEX, ark::ecmascript::GlobalEnv::EMPTY_ARRAY_OBJECT_INDEX) +DEFINE_VALUE(GLOBAL_CONST_CONSTANTS_OFFSET, ark::ecmascript::GlobalEnvConstants::GetConstantsOffset()) // NOLINTEND(readability-identifier-naming) diff --git a/runtime/base/array_helper.cpp b/runtime/base/array_helper.cpp index a7a795d81..640663839 100644 --- a/runtime/base/array_helper.cpp +++ b/runtime/base/array_helper.cpp @@ -25,7 +25,7 @@ #include "plugins/ecmascript/runtime/js_tagged_number.h" #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { bool ArrayHelper::IsConcatSpreadable(JSThread *thread, const JSHandle &obj) { // 1. If Type(O) is not Object, return false. @@ -141,4 +141,4 @@ double ArrayHelper::GetArrayLength(JSThread *thread, const JSHandle &obj); @@ -30,6 +30,6 @@ public: static double GetLength(JSThread *thread, const JSHandle &thisHandle); static double GetArrayLength(JSThread *thread, const JSHandle &thisHandle); }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_ARRAY_HELPER_H diff --git a/runtime/base/builtins_base.cpp b/runtime/base/builtins_base.cpp index 33405a0ab..95db6cd50 100644 --- a/runtime/base/builtins_base.cpp +++ b/runtime/base/builtins_base.cpp @@ -17,7 +17,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript { +namespace ark::ecmascript { JSHandle builtins_common::GetArgsArray(EcmaRuntimeCallInfo *msg) { JSThread *thread = msg->GetThread(); @@ -29,4 +29,4 @@ JSHandle builtins_common::GetArgsArray(EcmaRuntimeCallInfo *msg) } return array; } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/base/builtins_base.h b/runtime/base/builtins_base.h index 4e9a2b0d1..115b053d1 100644 --- a/runtime/base/builtins_base.h +++ b/runtime/base/builtins_base.h @@ -29,7 +29,7 @@ #include "plugins/ecmascript/runtime/tagged_array.h" #include "plugins/ecmascript/runtime/vmstat/runtime_stat.h" -namespace panda::ecmascript { +namespace ark::ecmascript { namespace builtins { #include "plugins/ecmascript/runtime/builtins/generated/builtins_declaration_gen.h" @@ -84,6 +84,6 @@ inline JSTaggedValue GetTaggedString(JSThread *thread, const char *str) } } // namespace builtins_common -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_BASE_BUILTINS_BASE_H diff --git a/runtime/base/config.h b/runtime/base/config.h index 267ae3d78..f9aa40947 100644 --- a/runtime/base/config.h +++ b/runtime/base/config.h @@ -16,7 +16,7 @@ #ifndef ECMASCRIPT_BASE_CONFIG_H #define ECMASCRIPT_BASE_CONFIG_H -namespace panda::ecmascript { +namespace ark::ecmascript { #define ARK_INLINE __attribute__((always_inline)) // NOLINT(cppcoreguidelines-macro-usage) #define ARK_NOINLINE __attribute__((noinline)) // NOLINT(cppcoreguidelines-macro-usage) @@ -53,6 +53,6 @@ namespace panda::ecmascript { #define ECMASCRIPT_ENABLE_HEAP_VERIFY 0 // NOLINT(cppcoreguidelines-macro-usage) #define ECMASCRIPT_ENABLE_THREAD_CHECK 1 // NOLINT(cppcoreguidelines-macro-usage) #endif -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_BASE_CONFIG_H diff --git a/runtime/base/error_helper.cpp b/runtime/base/error_helper.cpp index 696eddc7f..671467c09 100644 --- a/runtime/base/error_helper.cpp +++ b/runtime/base/error_helper.cpp @@ -26,8 +26,8 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/tooling/pt_js_extractor.h" -namespace panda::ecmascript::base { -using panda::tooling::ecmascript::PtJSExtractor; +namespace ark::ecmascript::base { +using ark::tooling::ecmascript::PtJSExtractor; JSTaggedValue ErrorHelper::ErrorCommonToString(EcmaRuntimeCallInfo *argv, const ErrorType &errorType) { @@ -218,4 +218,4 @@ PandaString ErrorHelper::BuildNativeEcmaStackTrace(JSThread *thread) return data; } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base diff --git a/runtime/base/error_helper.h b/runtime/base/error_helper.h index 2c4d2b245..bcbe06b41 100644 --- a/runtime/base/error_helper.h +++ b/runtime/base/error_helper.h @@ -21,7 +21,7 @@ #include "plugins/ecmascript/runtime/js_handle.h" #include "plugins/ecmascript/runtime/mem/ecma_string.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { constexpr char DEFAULT_EMPTY_STACK_TRACE[] = "stack is empty"; // NOLINT (modernize-avoid-c-arrays) constexpr char INTRINSIC_METHOD_NAME[] = "Intrinsic method"; // NOLINT (modernize-avoid-c-arrays) @@ -40,6 +40,6 @@ private: static JSHandle GetErrorName(JSThread *thread, const JSHandle &name, const ErrorType &errorType); }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_ERROR_HELPER_H diff --git a/runtime/base/error_type.h b/runtime/base/error_type.h index f92016abc..d27bf88b1 100644 --- a/runtime/base/error_type.h +++ b/runtime/base/error_type.h @@ -18,7 +18,7 @@ #include -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { enum class ErrorType : uint8_t { ERROR = 0, EVAL_ERROR, @@ -28,6 +28,6 @@ enum class ErrorType : uint8_t { TYPE_ERROR, URI_ERROR, }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_ERROR_TYPE_H diff --git a/runtime/base/json_parser.cpp b/runtime/base/json_parser.cpp index 914bbb82d..ff44a74ac 100644 --- a/runtime/base/json_parser.cpp +++ b/runtime/base/json_parser.cpp @@ -15,7 +15,7 @@ #include "plugins/ecmascript/runtime/base/json_parser.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { JSHandle Internalize::InternalizeJsonProperty(JSThread *thread, const JSHandle &holder, const JSHandle &name, const JSHandle &receiver) @@ -78,4 +78,4 @@ bool Internalize::RecurseAndApply(JSThread *thread, const JSHandle &ho } return changeResult; } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base diff --git a/runtime/base/json_parser.h b/runtime/base/json_parser.h index dd4fc6080..52c07dfe7 100644 --- a/runtime/base/json_parser.h +++ b/runtime/base/json_parser.h @@ -31,7 +31,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "libpandabase/utils/utf.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { constexpr unsigned int UNICODE_DIGIT_LENGTH = 4; constexpr unsigned int NUMBER_TEN = 10; constexpr unsigned int NUMBER_SIXTEEN = 16; @@ -776,6 +776,6 @@ private: static bool RecurseAndApply(JSThread *thread, const JSHandle &holder, const JSHandle &name, const JSHandle &receiver); }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_JSON_PARSE_INL_H diff --git a/runtime/base/json_stringifier.cpp b/runtime/base/json_stringifier.cpp index ade4cd4e4..39d172350 100644 --- a/runtime/base/json_stringifier.cpp +++ b/runtime/base/json_stringifier.cpp @@ -33,7 +33,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/js_tagged_value.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { constexpr unsigned char CODE_SPACE = 0x20; constexpr int GAP_MAX_LEN = 10; constexpr int FOUR_HEX = 4; @@ -724,4 +724,4 @@ bool JsonStringifier::AppendJsonString(const JSHandle &obj, const JSHa } return hasContent; } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base diff --git a/runtime/base/json_stringifier.h b/runtime/base/json_stringifier.h index d66abd7a0..ef8e59a64 100644 --- a/runtime/base/json_stringifier.h +++ b/runtime/base/json_stringifier.h @@ -21,7 +21,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/global_env.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { class JsonStringifier { public: explicit JsonStringifier(JSThread *thread) @@ -89,5 +89,5 @@ private: JSMutableHandle handleKey_; JSMutableHandle handleValue_; }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_JSON_STRINGIFY_INL_H diff --git a/runtime/base/number_helper.cpp b/runtime/base/number_helper.cpp index e367dd8bc..8093cf6cf 100644 --- a/runtime/base/number_helper.cpp +++ b/runtime/base/number_helper.cpp @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { enum class Sign { NONE, NEG, POS }; // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) @@ -833,4 +833,4 @@ int32_t NumberHelper::DoubleInRangeInt32(double d) } return base::NumberHelper::DoubleToInt(d, base::INT32_BITS); } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base diff --git a/runtime/base/number_helper.h b/runtime/base/number_helper.h index 1912bb37e..4d8d8c45f 100644 --- a/runtime/base/number_helper.h +++ b/runtime/base/number_helper.h @@ -22,7 +22,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "include/coretypes/tagged_value.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { // NOLINTNEXTLINE(modernize-avoid-c-arrays) static constexpr uint16_t SPACE_OR_LINE_TERMINAL[] = { 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x0020, 0x00A0, 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, @@ -157,5 +157,5 @@ private: } __attribute__((may_alias, packed)) u_; }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_NUMBER_HELPER_H diff --git a/runtime/base/object_helper.cpp b/runtime/base/object_helper.cpp index 1ea087a1e..9ea4ab533 100644 --- a/runtime/base/object_helper.cpp +++ b/runtime/base/object_helper.cpp @@ -9,7 +9,7 @@ #include "plugins/ecmascript/runtime/js_function.h" #include "plugins/ecmascript/runtime/js_iterator.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { // ES2021 20.1.2.7.1 JSTaggedValue ObjectHelper::CreateDataPropertyOnObject(EcmaRuntimeCallInfo *argv) { @@ -104,4 +104,4 @@ JSTaggedValue ObjectHelper::AddEntriesFromIterable(JSThread *thread, const JSHan } return target.GetTaggedValue(); } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base diff --git a/runtime/base/object_helper.h b/runtime/base/object_helper.h index f7cf6741b..0a2b8a4fa 100644 --- a/runtime/base/object_helper.h +++ b/runtime/base/object_helper.h @@ -8,7 +8,7 @@ #include "plugins/ecmascript/runtime/ecma_runtime_call_info.h" #include "plugins/ecmascript/runtime/js_tagged_value.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { class ObjectHelper { public: static JSTaggedValue CreateDataPropertyOnObject(EcmaRuntimeCallInfo *argv); @@ -16,5 +16,5 @@ public: const JSHandle &iterable, JSHandle &adder); }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // PANDA_RUNTIME_ECMASCRIPT_BASE_OBJECT_HELP_H diff --git a/runtime/base/string_helper.cpp b/runtime/base/string_helper.cpp index 9017eecaf..f9bc2f654 100644 --- a/runtime/base/string_helper.cpp +++ b/runtime/base/string_helper.cpp @@ -16,7 +16,7 @@ #include "plugins/ecmascript/runtime/base/string_helper.h" #include "plugins/ecmascript/runtime/ecma_string-inl.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { std::string StringHelper::ToStdString(EcmaString *string) { return std::string(ConvertToPandaString(string)); @@ -100,9 +100,9 @@ EcmaString *StringHelper::Trim(JSThread *thread, const std::u16string &thisStr, } // ES2021 22.1.3.15.1 StringPad ( O, max_length, fill_string, placement ) -panda::ecmascript::JSTaggedValue StringHelper::StringPad(JSThread *thread, JSHandle obj, - JSHandle maxLength, - JSHandle fillString, PadPlacement placement) +ark::ecmascript::JSTaggedValue StringHelper::StringPad(JSThread *thread, JSHandle obj, + JSHandle maxLength, + JSHandle fillString, PadPlacement placement) { [[maybe_unused]] EcmaHandleScope handleScope(thread); // 1. Assert: placement is start or end. @@ -161,4 +161,4 @@ panda::ecmascript::JSTaggedValue StringHelper::StringPad(JSThread *thread, JSHan // 12. Else, return the string-concatenation of S and truncated_string_filler. return factory->ConcatFromString(string, truncatedStringFiller).GetTaggedValue(); } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base diff --git a/runtime/base/string_helper.h b/runtime/base/string_helper.h index 7626406db..57f984864 100644 --- a/runtime/base/string_helper.h +++ b/runtime/base/string_helper.h @@ -31,7 +31,7 @@ #include "libpandabase/utils/utf.h" #include "libpandafile/file_items.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { // NOLINTNEXTLINE(modernize-avoid-c-arrays) static constexpr int UICODE_FROM_UTF8[] = { @@ -236,9 +236,9 @@ public: static EcmaString *Trim(JSThread *thread, const std::u16string &thisStr, TrimKind kind); - static panda::ecmascript::JSTaggedValue StringPad(JSThread *thread, JSHandle obj, - JSHandle maxLength, - JSHandle fillString, PadPlacement placement); + static ark::ecmascript::JSTaggedValue StringPad(JSThread *thread, JSHandle obj, + JSHandle maxLength, + JSHandle fillString, PadPlacement placement); static inline std::u16string Append(const std::u16string &str1, const std::u16string &str2) { @@ -263,5 +263,5 @@ public: return res; } }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_STRING_HELP_H diff --git a/runtime/base/typed_array_helper-inl.h b/runtime/base/typed_array_helper-inl.h index a557addfc..1e4193973 100644 --- a/runtime/base/typed_array_helper-inl.h +++ b/runtime/base/typed_array_helper-inl.h @@ -32,7 +32,7 @@ #include "plugins/ecmascript/runtime/js_typed_array.h" #include "plugins/ecmascript/runtime/base/error_type.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { DataViewType TypedArrayHelper::GetType(const JSHandle &obj) { JSType type = obj->GetJSHClass()->GetObjectType(); @@ -217,6 +217,6 @@ int32_t TypedArrayHelper::GetArrayLength(JSThread *thread, const JSHandleGetArrayLength(); return JSTaggedValue::ToLength(thread, JSHandle(thread, length)).ToInt32(); } -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_TYPED_ARRAY_HELPER_INL_H diff --git a/runtime/base/typed_array_helper.cpp b/runtime/base/typed_array_helper.cpp index 90bc7e627..edebde8a7 100644 --- a/runtime/base/typed_array_helper.cpp +++ b/runtime/base/typed_array_helper.cpp @@ -31,7 +31,7 @@ #include "plugins/ecmascript/runtime/js_typed_array.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { // es11 22.2.4 The TypedArray Constructors JSTaggedValue TypedArrayHelper::TypedArrayConstructor(EcmaRuntimeCallInfo *argv, @@ -361,7 +361,7 @@ JSHandle TypedArrayHelper::AllocateTypedArray(ObjectFactory *factory, JSTypedArray::Cast(*obj)->SetArrayLength(thread, JSTaggedValue(0)); // 9. Return obj. return obj; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base // es11 22.2.4.2.1 Runtime Semantics: AllocateTypedArray ( constructorName, new_target, defaultProto, length ) JSHandle TypedArrayHelper::AllocateTypedArray(ObjectFactory *factory, EcmaVM *ecmaVm, @@ -571,4 +571,4 @@ int32_t TypedArrayHelper::SortCompare(JSThread *thread, const JSHandle #include -namespace panda::ecmascript::base { +namespace ark::ecmascript::base { enum ElementSize : uint8_t { ONE = 1, TWO = 2, FOUR = 4, EIGHT = 8 }; class TypedArrayHelper { @@ -64,6 +64,6 @@ private: static JSHandle AllocateTypedArrayBuffer(JSThread *thread, EcmaVM *ecmaVm, const JSHandle &obj, double length); }; -} // namespace panda::ecmascript::base +} // namespace ark::ecmascript::base #endif // ECMASCRIPT_BASE_TYPED_ARRAY_HELPER_H diff --git a/runtime/bridge.h b/runtime/bridge.h index 49560ca33..a30a75fe6 100644 --- a/runtime/bridge.h +++ b/runtime/bridge.h @@ -18,11 +18,11 @@ #include "runtime/bridge/bridge.h" -namespace panda { +namespace ark { // Uses DynCall calling convention extern "C" void CompiledCodeToBuiltinBridge(); -} // namespace panda +} // namespace ark #endif // ECMASCRIPT_BRIDGE_BRIDGE_H diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_call0dyn_pref_none_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_call0dyn_pref_none_aarch64.S index 3ce199c70..1438f392d 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_call0dyn_pref_none_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_call0dyn_pref_none_aarch64.S @@ -35,7 +35,7 @@ mov x14, x0 2: - // ABI arg reg 0 (x0) <- panda::Method* + // ABI arg reg 0 (x0) <- ark::Method* mov x0, x12 // ABI arg reg 1 (x1) <- number of arguments diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_call0thisdyn_pref_v8_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_call0thisdyn_pref_v8_aarch64.S index 06ab06d72..e4954a98c 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_call0thisdyn_pref_v8_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_call0thisdyn_pref_v8_aarch64.S @@ -17,7 +17,7 @@ // regs set as follow // x9 - frame.vregs, x10 - insn_ptr, x12 - method, x15 - acc, x13, x14 - temp - // ABI arg reg 0 (x0) <- panda::Method* + // ABI arg reg 0 (x0) <- ark::Method* mov x0, x12 // ABI arg reg 1 (x1) <- number of arguments diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_calldyn_helper_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_calldyn_helper_aarch64.S index 0fecfcb22..354d464b6 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_calldyn_helper_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_calldyn_helper_aarch64.S @@ -43,7 +43,7 @@ mov x14, x0 2: - // ABI arg reg 0 (x0) <- panda::Method* + // ABI arg reg 0 (x0) <- ark::Method* mov x0, x12 // Reserve stack args diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_callirangedyn_pref_imm16_v8_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_callirangedyn_pref_imm16_v8_aarch64.S index d52dacef0..c47250eaa 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_callirangedyn_pref_imm16_v8_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_callirangedyn_pref_imm16_v8_aarch64.S @@ -37,7 +37,7 @@ mov w14, TAGGED_VALUE_UNDEFINED 1: - // ABI arg reg 0 <- panda::Method* + // ABI arg reg 0 <- ark::Method* // ABI arg reg 1 <- num_args // x14 <- resolved this mov x0, x12 diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_aarch64.S index 57b3c5174..4f4538529 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_aarch64.S @@ -25,7 +25,7 @@ ldrb w13, [x10, 2] add x9, x9, x13, lsl 3 - // ABI arg reg 0 <- panda::Method* + // ABI arg reg 0 <- ark::Method* // ABI arg reg 1 <- num_args mov x0, x12 mov w1, w15 diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_callthisdyn_helper_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_callthisdyn_helper_aarch64.S index e7b5cbba6..5ee10cdae 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_callthisdyn_helper_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_callthisdyn_helper_aarch64.S @@ -17,7 +17,7 @@ // regs set as follow // x9 - frame.vregs, x10 - insn_ptr, x12 - method, x15 - acc, x13, x14 - temp - // ABI arg reg 0 (x0) <- panda::Method* + // ABI arg reg 0 (x0) <- ark::Method* mov x0, x12 // Reserve stack args diff --git a/runtime/bridge/arch/aarch64/handle_call_ecma_newobjdynrange_pref_imm16_v8_aarch64.S b/runtime/bridge/arch/aarch64/handle_call_ecma_newobjdynrange_pref_imm16_v8_aarch64.S index 5e5977a65..036ce4b1e 100644 --- a/runtime/bridge/arch/aarch64/handle_call_ecma_newobjdynrange_pref_imm16_v8_aarch64.S +++ b/runtime/bridge/arch/aarch64/handle_call_ecma_newobjdynrange_pref_imm16_v8_aarch64.S @@ -27,7 +27,7 @@ ldrb w13, [x10, 2] add x9, x9, x13, lsl 3 - // ABI arg reg 0 <- panda::Method* + // ABI arg reg 0 <- ark::Method* // ABI arg reg 1 <- num_args mov x0, x12 mov w1, w15 diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_call0dyn_pref_none_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_call0dyn_pref_none_amd64.S index 635c76525..737873236 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_call0dyn_pref_none_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_call0dyn_pref_none_amd64.S @@ -35,7 +35,7 @@ movq %rax, %r14 2: - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* movq %r12, %rdi // ABI arg reg 1 (rsi) <- number of arguments diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_call0thisdyn_pref_v8_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_call0thisdyn_pref_v8_amd64.S index 2c315884b..8fdb3d5f8 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_call0thisdyn_pref_v8_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_call0thisdyn_pref_v8_amd64.S @@ -17,7 +17,7 @@ // regs set as follow // %rax - insn_ptr, %rbx - frame.vregs, %r12 - method, %r15 - acc, %r13, %r14 - temp - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* movq %r12, %rdi // ABI arg reg 1 (rsi) <- number of arguments diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_calldyn_helper_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_calldyn_helper_amd64.S index 5d044c468..45844cf72 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_calldyn_helper_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_calldyn_helper_amd64.S @@ -41,7 +41,7 @@ movq %r9, %rax 2: - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* movq %r12, %rdi // Reserve stack args diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_callirangedyn_pref_imm16_v8_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_callirangedyn_pref_imm16_v8_amd64.S index 1d4e7a16e..1a28b0e13 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_callirangedyn_pref_imm16_v8_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_callirangedyn_pref_imm16_v8_amd64.S @@ -39,7 +39,7 @@ movq $TAGGED_VALUE_UNDEFINED, %r14 1: - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* // ABI arg reg 1 (rsi) <- num_args movq %r12, %rdi movq %r15, %rsi diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_amd64.S index 6e6b95e5f..89577712a 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_callithisrangedyn_pref_imm16_v8_amd64.S @@ -25,7 +25,7 @@ movzbl 2(%rax), %r13d leaq (%rbx, %r13, FRAME_VREGISTER_SIZE), %rbx - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* // ABI arg reg 1 (rsi) <- num_args movq %r12, %rdi movq %r15, %rsi diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_callthisdyn_helper_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_callthisdyn_helper_amd64.S index 32f341402..719b8c0cb 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_callthisdyn_helper_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_callthisdyn_helper_amd64.S @@ -16,7 +16,7 @@ // Prepare mandatory params for ecma.call1thisdyn, ecma.call2thisdyn, ecma.call3thisdyn // regs set as follow // %rax - insn_ptr, %rbx - frame.vregs, %r12 - method, %r15 - acc, %r13, %r14 - temp - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* movq %r12, %rdi // Reserve stack args diff --git a/runtime/bridge/arch/amd64/handle_call_ecma_newobjdynrange_pref_imm16_v8_amd64.S b/runtime/bridge/arch/amd64/handle_call_ecma_newobjdynrange_pref_imm16_v8_amd64.S index 5db760947..fbdff8c4d 100644 --- a/runtime/bridge/arch/amd64/handle_call_ecma_newobjdynrange_pref_imm16_v8_amd64.S +++ b/runtime/bridge/arch/amd64/handle_call_ecma_newobjdynrange_pref_imm16_v8_amd64.S @@ -27,7 +27,7 @@ movzbl 2(%rax), %r13d leaq (%rbx, %r13, FRAME_VREGISTER_SIZE), %rbx - // ABI arg reg 0 (rdi) <- panda::Method* + // ABI arg reg 0 (rdi) <- ark::Method* // ABI arg reg 1 (rsi) <- num_args movq %r12, %rdi movq %r15, %rsi diff --git a/runtime/bridge/arch/arm/builtin_bridge_arm.S b/runtime/bridge/arch/arm/builtin_bridge_arm.S index ac89266fa..f33fdf739 100644 --- a/runtime/bridge/arch/arm/builtin_bridge_arm.S +++ b/runtime/bridge/arch/arm/builtin_bridge_arm.S @@ -14,7 +14,7 @@ */ -// CompiledCodeToBuiltinBridge(Method* method, uint32_t num_args, panda::coretypes::TaggedValue func_obj, ...); +// CompiledCodeToBuiltinBridge(Method* method, uint32_t num_args, ark::coretypes::TaggedValue func_obj, ...); .global CompiledCodeToBuiltinBridge .type CompiledCodeToBuiltinBridge, %function CompiledCodeToBuiltinBridge: diff --git a/runtime/bridge/ecma_bridge_helpers.cpp b/runtime/bridge/ecma_bridge_helpers.cpp index 2baacd622..30fda5aeb 100644 --- a/runtime/bridge/ecma_bridge_helpers.cpp +++ b/runtime/bridge/ecma_bridge_helpers.cpp @@ -5,7 +5,7 @@ #include "plugins/ecmascript/runtime/global_env.h" #include "plugins/ecmascript/compiler/ecmascript_extensions/thread_environment_api.h" -namespace panda::ecmascript { +namespace ark::ecmascript { extern "C" uint64_t EcmaResolveSecondArgument(uint64_t functionTaggedValue) { JSTaggedValue jsFunc(functionTaggedValue); @@ -14,4 +14,4 @@ extern "C" uint64_t EcmaResolveSecondArgument(uint64_t functionTaggedValue) } return JSTaggedValue::Undefined().GetRawData(); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/builtins.cpp b/runtime/builtins.cpp index 2b408c73d..d1fb07ea7 100644 --- a/runtime/builtins.cpp +++ b/runtime/builtins.cpp @@ -56,7 +56,7 @@ #include "plugins/ecmascript/runtime/mem/mem.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using ErrorType = base::ErrorType; using ContainersPrivate = containers::ContainersPrivate; @@ -837,7 +837,7 @@ void Builtins::InitializeError(const JSHandle &env, const JSHandleSetEvalErrorFunction(thread_, nativeErrorFunction); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript void Builtins::InitializeCtor(const JSHandle &env, const JSHandle &prototype, const JSHandle &ctor, const char *name, int length) const @@ -2369,4 +2369,4 @@ void Builtins::InitializeFuzzilli(const JSHandle &env, const JSHandle ->SetFunctionPrototype(thread_, fuzzilliFuncInstanceDynclass.GetTaggedValue()); } #endif -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins.h b/runtime/builtins.h index 09695ff5f..6bde94868 100644 --- a/runtime/builtins.h +++ b/runtime/builtins.h @@ -32,7 +32,7 @@ #include "plugins/ecmascript/runtime/js_set_iterator.h" #include "plugins/ecmascript/runtime/js_string_iterator.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using ErrorType = base::ErrorType; struct ErrorParameter { @@ -256,5 +256,5 @@ private: #include "plugins/ecmascript/runtime/builtins/generated/builtins_initializers_gen.h" }; -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins #endif // ECMASCRIPT_BUILTINS_H diff --git a/runtime/builtins/builtins_ark_tools.cpp b/runtime/builtins/builtins_ark_tools.cpp index b7306b768..84fe37f06 100644 --- a/runtime/builtins/builtins_ark_tools.cpp +++ b/runtime/builtins/builtins_ark_tools.cpp @@ -16,7 +16,7 @@ #include "plugins/ecmascript/runtime/base/builtins_base.h" #include "plugins/ecmascript/runtime/base/string_helper.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using StringHelper = base::StringHelper; // Make sure the ECMASCRIPT_OBJECT_DUMP in config.h has been opened before use it @@ -43,4 +43,4 @@ JSTaggedValue ark_tools::Print(EcmaRuntimeCallInfo *argv) return JSTaggedValue::Undefined(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_array.cpp b/runtime/builtins/builtins_array.cpp index 446ec3f98..eeeef1802 100644 --- a/runtime/builtins/builtins_array.cpp +++ b/runtime/builtins/builtins_array.cpp @@ -34,7 +34,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using ArrayHelper = ecmascript::base::ArrayHelper; using TypedArrayHelper = ecmascript::base::TypedArrayHelper; @@ -2895,4 +2895,4 @@ JSTaggedValue builtins::array::proto::GetUnscopables(EcmaRuntimeCallInfo *argv) return unscopableList.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_arraybuffer.cpp b/runtime/builtins/builtins_arraybuffer.cpp index f3a2168c5..0a26c2394 100644 --- a/runtime/builtins/builtins_arraybuffer.cpp +++ b/runtime/builtins/builtins_arraybuffer.cpp @@ -29,7 +29,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "securec.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { enum NumberSize : uint8_t { UINT16 = 2, INT16 = 2, @@ -639,4 +639,4 @@ JSTaggedValue builtins::array_buffer::SetValueInBuffer(JSThread *thread, JSHandl return JSTaggedValue::Undefined(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_async_from_sync_iterator.cpp b/runtime/builtins/builtins_async_from_sync_iterator.cpp index 6dba349c9..503e82b2d 100644 --- a/runtime/builtins/builtins_async_from_sync_iterator.cpp +++ b/runtime/builtins/builtins_async_from_sync_iterator.cpp @@ -10,7 +10,7 @@ #include "plugins/ecmascript/runtime/js_iterator.h" #include "plugins/ecmascript/runtime/js_async_from_sync_iterator_object.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 27.1.4.2.2 %AsyncFromSyncIteratorPrototype%.next(value) JSTaggedValue builtins::async_from_sync_iterator::proto::Next(EcmaRuntimeCallInfo *argv) { @@ -236,4 +236,4 @@ JSTaggedValue builtins::async_from_sync_iterator::proto::Throw(EcmaRuntimeCallIn // 12. Return ! AsyncFromSyncIteratorContinuation(result, promiseCapability). return JSAsyncFromSyncIteratorObject::AsyncFromSyncIteratorContinuation(thread, result, promiseCapability); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_async_function.cpp b/runtime/builtins/builtins_async_function.cpp index 4ecebdf04..eb286c864 100644 --- a/runtime/builtins/builtins_async_function.cpp +++ b/runtime/builtins/builtins_async_function.cpp @@ -17,10 +17,10 @@ #include "plugins/ecmascript/runtime/ecma_macros.h" #include "plugins/ecmascript/runtime/js_eval.h" -namespace panda::ecmascript { +namespace ark::ecmascript { // ecma2017 25.5.1.1 AsyncFunction (p1, p2, ... , pn, body) JSTaggedValue builtins::async_function::AsyncFunctionConstructor(EcmaRuntimeCallInfo *argv) { return EvalUtils::CreateDynamicFunction(argv, EvalUtils::DynamicFunctionKind::ASYNC); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/builtins/builtins_async_generator.cpp b/runtime/builtins/builtins_async_generator.cpp index a87ddcce5..e0c872d72 100644 --- a/runtime/builtins/builtins_async_generator.cpp +++ b/runtime/builtins/builtins_async_generator.cpp @@ -8,7 +8,7 @@ #include "plugins/ecmascript/runtime/js_function.h" #include "plugins/ecmascript/runtime/js_async_generator_object.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 27.4.1.1 AsyncGeneratorFunction (p1, p2, ... , pn, body) JSTaggedValue async_generator_function::AsyncGeneratorFunctionConstructor(EcmaRuntimeCallInfo *argv) { @@ -75,4 +75,4 @@ JSTaggedValue async_generator::proto::Throw(EcmaRuntimeCallInfo *argv) RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); return result.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_async_iterator.cpp b/runtime/builtins/builtins_async_iterator.cpp index 132801e36..e64b32128 100644 --- a/runtime/builtins/builtins_async_iterator.cpp +++ b/runtime/builtins/builtins_async_iterator.cpp @@ -8,10 +8,10 @@ #include "plugins/ecmascript/runtime/global_env.h" #include "plugins/ecmascript/runtime/js_iterator.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 27.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( ) JSTaggedValue async_iterator::proto::AsyncIterator(EcmaRuntimeCallInfo *argv) { return ecmascript::builtins_common::GetThis(argv).GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_bigint.cpp b/runtime/builtins/builtins_bigint.cpp index 465edc4b3..6e4c91927 100644 --- a/runtime/builtins/builtins_bigint.cpp +++ b/runtime/builtins/builtins_bigint.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_primitive_ref.h" #include "plugins/ecmascript/runtime/js_bigint.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { static JSTaggedValue ThisBigIntValue(EcmaRuntimeCallInfo *argv); @@ -175,4 +175,4 @@ JSTaggedValue big_int::proto::ValueOf(EcmaRuntimeCallInfo *argv) return ThisBigIntValue(argv); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_boolean.cpp b/runtime/builtins/builtins_boolean.cpp index 687e799e4..e74ee7a75 100644 --- a/runtime/builtins/builtins_boolean.cpp +++ b/runtime/builtins/builtins_boolean.cpp @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/global_env.h" #include "plugins/ecmascript/runtime/js_primitive_ref.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // ecma 19.3.1.1 Boolean(value) JSTaggedValue boolean::BooleanConstructor(EcmaRuntimeCallInfo *argv) { @@ -94,4 +94,4 @@ JSTaggedValue boolean::proto::ValueOf(EcmaRuntimeCallInfo *argv) // 1. Return thisBooleanValue(this value). return ThisBooleanValue(argv->GetThread(), builtins_common::GetThis(argv).GetTaggedValue()); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_collator.cpp b/runtime/builtins/builtins_collator.cpp index 978e8b68e..f5762bc8f 100644 --- a/runtime/builtins/builtins_collator.cpp +++ b/runtime/builtins/builtins_collator.cpp @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/js_collator.h" #include "plugins/ecmascript/runtime/js_intl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { constexpr uint32_t FUNCTION_LENGTH_TWO = 2; // 11.1.2 Intl.Collator ( [ locales [ , options ] ] ) @@ -150,4 +150,4 @@ JSTaggedValue collator::proto::ResolvedOptions(EcmaRuntimeCallInfo *argv) JSHandle options = JSCollator::ResolvedOptions(thread, JSHandle::Cast(thisValue)); return options.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_dataview.cpp b/runtime/builtins/builtins_dataview.cpp index 5472335c9..907da6906 100644 --- a/runtime/builtins/builtins_dataview.cpp +++ b/runtime/builtins/builtins_dataview.cpp @@ -22,7 +22,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/js_tagged_value.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 24.2.2.1 JSTaggedValue data_view::DataViewConstructor(EcmaRuntimeCallInfo *argv) { @@ -484,4 +484,4 @@ JSTaggedValue data_view::proto::SetUint32(EcmaRuntimeCallInfo *argv) return SetTypedValue(argv, DataViewType::UINT32); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_date.cpp b/runtime/builtins/builtins_date.cpp index 4d58eb5ee..15c85451c 100644 --- a/runtime/builtins/builtins_date.cpp +++ b/runtime/builtins/builtins_date.cpp @@ -25,7 +25,7 @@ #include "plugins/ecmascript/runtime/js_thread.h" #include "plugins/ecmascript/runtime/tagged_array.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // definition for set data code. static constexpr uint32_t CODE_SET_DATE = 0x32; @@ -129,7 +129,7 @@ JSTaggedValue date::UTC(EcmaRuntimeCallInfo *argv) // B.2.3.1 JSTaggedValue date::proto::GetYear(EcmaRuntimeCallInfo *argv) { - double result = GetFullYear(argv).GetNumber() - panda::ecmascript::JSDate::NINETEEN_HUNDRED_YEAR; + double result = GetFullYear(argv).GetNumber() - ark::ecmascript::JSDate::NINETEEN_HUNDRED_YEAR; return builtins_common::GetTaggedDouble(result); } @@ -547,4 +547,4 @@ JSTaggedValue date::proto::ToISOString(EcmaRuntimeCallInfo *argv) return JSDate::Cast(msg->GetTaggedObject())->ToISOString(thread); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_date_time_format.cpp b/runtime/builtins/builtins_date_time_format.cpp index a62b8348b..e815d6719 100644 --- a/runtime/builtins/builtins_date_time_format.cpp +++ b/runtime/builtins/builtins_date_time_format.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_date_time_format.h" #include "plugins/ecmascript/runtime/js_intl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 13.1.5 DateTime Format Functions JSTaggedValue AnonymousDateTimeFormat(EcmaRuntimeCallInfo *argv); @@ -325,4 +325,4 @@ JSTaggedValue date_time_format::proto::FormatRangeToParts(EcmaRuntimeCallInfo *a RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); return result.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_errors.cpp b/runtime/builtins/builtins_errors.cpp index 5af1ad712..bf7ea635d 100644 --- a/runtime/builtins/builtins_errors.cpp +++ b/runtime/builtins/builtins_errors.cpp @@ -17,7 +17,7 @@ #include "plugins/ecmascript/runtime/base/error_helper.h" #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using ErrorHelper = ecmascript::base::ErrorHelper; using ErrorType = ecmascript::base::ErrorType; @@ -110,4 +110,4 @@ JSTaggedValue eval_error::proto::ToString(EcmaRuntimeCallInfo *argv) { return ErrorHelper::ErrorCommonToString(argv, ErrorType::EVAL_ERROR); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_finalization_registry.cpp b/runtime/builtins/builtins_finalization_registry.cpp index 9199b6a94..37c517e49 100644 --- a/runtime/builtins/builtins_finalization_registry.cpp +++ b/runtime/builtins/builtins_finalization_registry.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_finalization_registry.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 26.2.3.1 JSTaggedValue finalization_registry::Constructor(EcmaRuntimeCallInfo *argv) { @@ -131,4 +131,4 @@ JSTaggedValue finalization_registry::proto::Unregister(EcmaRuntimeCallInfo *argv // 8. Return removed. return JSTaggedValue(removed); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_function.cpp b/runtime/builtins/builtins_function.cpp index 775dfd6d6..d7ab34549 100644 --- a/runtime/builtins/builtins_function.cpp +++ b/runtime/builtins/builtins_function.cpp @@ -22,7 +22,7 @@ #include "plugins/ecmascript/runtime/js_stable_array.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // ecma 19.2.1 Function (p1, p2, ... , pn, body) JSTaggedValue function::FunctionConstructor(EcmaRuntimeCallInfo *argv) { @@ -281,4 +281,4 @@ JSTaggedValue function::proto::HasInstance(EcmaRuntimeCallInfo *argv) ? builtins_common::GetTaggedBoolean(true) : builtins_common::GetTaggedBoolean(false); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_generator.cpp b/runtime/builtins/builtins_generator.cpp index 3c2e671f0..1067a3735 100644 --- a/runtime/builtins/builtins_generator.cpp +++ b/runtime/builtins/builtins_generator.cpp @@ -18,7 +18,7 @@ #include "plugins/ecmascript/runtime/js_function.h" #include "plugins/ecmascript/runtime/js_generator_object.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 26.2.1.1 GeneratorFunction(p1, p2, … , pn, body) JSTaggedValue generator_function::GeneratorFunctionConstructor(EcmaRuntimeCallInfo *argv) { @@ -92,4 +92,4 @@ JSTaggedValue generator::proto::Throw(EcmaRuntimeCallInfo *argv) RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); return result.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_global.cpp b/runtime/builtins/builtins_global.cpp index 452b49256..44a79e13d 100644 --- a/runtime/builtins/builtins_global.cpp +++ b/runtime/builtins/builtins_global.cpp @@ -31,7 +31,7 @@ #include "plugins/ecmascript/runtime/ecma_global_storage-inl.h" #include "include/thread_scopes.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { static constexpr uint8_t BIT_MASK = 0x0F; static constexpr uint8_t BIT_MASK_FF = 0xFF; @@ -1260,4 +1260,4 @@ JSTaggedValue global::StopRuntimeStat(EcmaRuntimeCallInfo *argv) return JSTaggedValue::Undefined(); } #endif -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_intl.cpp b/runtime/builtins/builtins_intl.cpp index 0ac5b772b..34013977c 100644 --- a/runtime/builtins/builtins_intl.cpp +++ b/runtime/builtins/builtins_intl.cpp @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/js_locale.h" #include "plugins/ecmascript/runtime/js_tagged_value.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 8.2.1 Intl.getCanonicalLocales ( locales ) JSTaggedValue intl::GetCanonicalLocales(EcmaRuntimeCallInfo *argv) { @@ -35,4 +35,4 @@ JSTaggedValue intl::GetCanonicalLocales(EcmaRuntimeCallInfo *argv) JSHandle result = JSArray::CreateArrayFromList(thread, elements); return result.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_iterator.cpp b/runtime/builtins/builtins_iterator.cpp index ce98e99b7..481f20db8 100644 --- a/runtime/builtins/builtins_iterator.cpp +++ b/runtime/builtins/builtins_iterator.cpp @@ -18,7 +18,7 @@ #include "plugins/ecmascript/runtime/global_env.h" #include "plugins/ecmascript/runtime/js_iterator.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { JSTaggedValue iterator::proto::Next([[maybe_unused]] EcmaRuntimeCallInfo *argv) { @@ -44,4 +44,4 @@ JSTaggedValue iterator::proto::Iterator(EcmaRuntimeCallInfo *argv) { return ecmascript::builtins_common::GetThis(argv).GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_json.cpp b/runtime/builtins/builtins_json.cpp index 868893ddc..1495c777f 100644 --- a/runtime/builtins/builtins_json.cpp +++ b/runtime/builtins/builtins_json.cpp @@ -24,7 +24,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 24.5.1 JSTaggedValue json::Parse(EcmaRuntimeCallInfo *argv) { @@ -46,10 +46,10 @@ JSTaggedValue json::Parse(EcmaRuntimeCallInfo *argv) RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); JSHandle result; if (parseString->IsUtf8()) { - panda::ecmascript::base::JsonParser parser(thread); + ark::ecmascript::base::JsonParser parser(thread); result = parser.ParseUtf8(*parseString); } else { - panda::ecmascript::base::JsonParser parser(thread); + ark::ecmascript::base::JsonParser parser(thread); result = parser.ParseUtf16(*parseString); } RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); @@ -98,9 +98,9 @@ JSTaggedValue json::Stringify(EcmaRuntimeCallInfo *argv) JSHandle handleValue(thread, value); JSHandle handleReplacer(thread, replacer); JSHandle handleGap(thread, gap); - panda::ecmascript::base::JsonStringifier stringifier(thread); + ark::ecmascript::base::JsonStringifier stringifier(thread); JSHandle result = stringifier.Stringify(handleValue, handleReplacer, handleGap); return result.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_locale.cpp b/runtime/builtins/builtins_locale.cpp index 456c73451..400fba673 100644 --- a/runtime/builtins/builtins_locale.cpp +++ b/runtime/builtins/builtins_locale.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_locale.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 10.1.3 Intl.Locale( tag [, options] ) JSTaggedValue locale::LocaleConstructor(EcmaRuntimeCallInfo *argv) { @@ -367,4 +367,4 @@ JSTaggedValue locale::proto::GetRegion(EcmaRuntimeCallInfo *argv) } return factory->NewFromString(region).GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_map.cpp b/runtime/builtins/builtins_map.cpp index 31043af57..818014632 100644 --- a/runtime/builtins/builtins_map.cpp +++ b/runtime/builtins/builtins_map.cpp @@ -24,7 +24,7 @@ #include "plugins/ecmascript/runtime/linked_hash_table.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 23.1.1.1 JSTaggedValue map::MapConstructor(EcmaRuntimeCallInfo *argv) { @@ -274,4 +274,4 @@ JSTaggedValue map::proto::Values(EcmaRuntimeCallInfo *argv) JSHandle iter = JSMapIterator::CreateMapIterator(thread, self, IterationKind::VALUE); return iter.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_math.cpp b/runtime/builtins/builtins_math.cpp index 3631f3aef..bc83c918f 100644 --- a/runtime/builtins/builtins_math.cpp +++ b/runtime/builtins/builtins_math.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_tagged_number.h" #include "utils/bit_utils.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using NumberHelper = ecmascript::base::NumberHelper; // 20.2.2.1 @@ -741,4 +741,4 @@ JSTaggedValue math::Trunc(EcmaRuntimeCallInfo *argv) } return builtins_common::GetTaggedDouble(result); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_number.cpp b/runtime/builtins/builtins_number.cpp index 00e200ebd..81f4ac08c 100644 --- a/runtime/builtins/builtins_number.cpp +++ b/runtime/builtins/builtins_number.cpp @@ -27,7 +27,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/tagged_hash_table.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using NumberHelper = ecmascript::base::NumberHelper; // 18.2.4 @@ -458,4 +458,4 @@ JSTaggedNumber ThisNumberValue(EcmaRuntimeCallInfo *argv) } THROW_TYPE_ERROR_AND_RETURN(argv->GetThread(), "not number type", JSTaggedNumber::Exception()); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_number_format.cpp b/runtime/builtins/builtins_number_format.cpp index ab0a184f6..5da008853 100644 --- a/runtime/builtins/builtins_number_format.cpp +++ b/runtime/builtins/builtins_number_format.cpp @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { static JSTaggedValue NumberFormatInternalFormatNumber(EcmaRuntimeCallInfo *argv); @@ -207,4 +207,4 @@ JSTaggedValue NumberFormatInternalFormatNumber(EcmaRuntimeCallInfo *argv) RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); return result.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_object.cpp b/runtime/builtins/builtins_object.cpp index fe36604e7..fe25ed984 100644 --- a/runtime/builtins/builtins_object.cpp +++ b/runtime/builtins/builtins_object.cpp @@ -27,7 +27,7 @@ #include "plugins/ecmascript/runtime/js_realm.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { enum class KeyType : uint8_t { STRING_TYPE = 0, @@ -1199,4 +1199,4 @@ JSTaggedValue object::Values(EcmaRuntimeCallInfo *argv) // 3. Return CreateArrayFromList(nameList). return JSArray::CreateArrayFromList(thread, nameList, length).GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_plural_rules.cpp b/runtime/builtins/builtins_plural_rules.cpp index ccd05da1c..5250d981c 100644 --- a/runtime/builtins/builtins_plural_rules.cpp +++ b/runtime/builtins/builtins_plural_rules.cpp @@ -21,7 +21,7 @@ #include "plugins/ecmascript/runtime/js_plural_rules.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 15.2.1 Intl.PluralRules ( [ locales [ , options ] ] ) JSTaggedValue plural_rules::PluralRulesConstructor(EcmaRuntimeCallInfo *argv) { @@ -131,4 +131,4 @@ JSTaggedValue plural_rules::proto::ResolvedOptions(EcmaRuntimeCallInfo *argv) // 5. Return options. return options.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_promise.cpp b/runtime/builtins/builtins_promise.cpp index d0265d238..b2828669a 100644 --- a/runtime/builtins/builtins_promise.cpp +++ b/runtime/builtins/builtins_promise.cpp @@ -29,7 +29,7 @@ #include "plugins/ecmascript/runtime/js_thread.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { static JSHandle PerformPromiseAll(JSThread *thread, const JSHandle &itRecord, const JSHandle &ctor, @@ -624,4 +624,4 @@ JSHandle PerformPromiseRace(JSThread *thread, const JSHandle

func(builtins_common::GetConstructor(argv)); return JSAsyncAwaitStatusFunction::AsyncFunctionAwaitRejected(argv->GetThread(), func, reason).GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_promise_job.cpp b/runtime/builtins/builtins_promise_job.cpp index 96e62e0ce..b4123725f 100644 --- a/runtime/builtins/builtins_promise_job.cpp +++ b/runtime/builtins/builtins_promise_job.cpp @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "libpandabase/macros.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { JSTaggedValue promise_job::PromiseReactionJob(EcmaRuntimeCallInfo *argv) { ASSERT(argv); @@ -120,4 +120,4 @@ JSTaggedValue promise_job::PromiseResolveThenableJob(EcmaRuntimeCallInfo *argv) // 4. NextJob Completion(thenCallResult). return result; } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_proxy.cpp b/runtime/builtins/builtins_proxy.cpp index 322373eee..dc468b47f 100644 --- a/runtime/builtins/builtins_proxy.cpp +++ b/runtime/builtins/builtins_proxy.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { static JSTaggedValue InvalidateProxyFunction(EcmaRuntimeCallInfo *argv); @@ -98,4 +98,4 @@ JSTaggedValue InvalidateProxyFunction(EcmaRuntimeCallInfo *argv) JSProxyRevocFunction::ProxyRevocFunctions(thread, JSHandle(desc.GetValue())); return JSTaggedValue::Undefined(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_reflect.cpp b/runtime/builtins/builtins_reflect.cpp index 375583499..0976e8718 100644 --- a/runtime/builtins/builtins_reflect.cpp +++ b/runtime/builtins/builtins_reflect.cpp @@ -18,7 +18,7 @@ #include "plugins/ecmascript/runtime/internal_call_params.h" #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // ecma 26.1.1 Reflect.apply (target, thisArgument, argumentsList) JSTaggedValue reflect::Apply(EcmaRuntimeCallInfo *argv) { @@ -312,4 +312,4 @@ JSTaggedValue reflect::SetPrototypeOf(EcmaRuntimeCallInfo *argv) // 3. Return ? target.[[SetPrototypeOf]](proto). return builtins_common::GetTaggedBoolean(JSTaggedValue::SetPrototype(thread, target, proto)); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_regexp.cpp b/runtime/builtins/builtins_regexp.cpp index 749f0b4be..6ec334e69 100644 --- a/runtime/builtins/builtins_regexp.cpp +++ b/runtime/builtins/builtins_regexp.cpp @@ -32,7 +32,7 @@ #include "plugins/ecmascript/runtime/regexp/regexp_parser_cache.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { constexpr uint32_t MIN_REPLACE_STRING_LENGTH = 1000; constexpr uint32_t MAX_SPLIT_LIMIT = 0xFFFFFFFFU; @@ -2015,4 +2015,4 @@ bool RegExpExecResultCache::Match(int entry, JSTaggedValue &pattern, JSTaggedVal return EcmaString::StringsAreEqual(patternStr, keyPatternStr) && flagsBits == keyFlagsBits && EcmaString::StringsAreEqual(inputStr, keyInputStr) && extendEqual; } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_regexp.h b/runtime/builtins/builtins_regexp.h index f2dcb60b3..1ae79d7c9 100644 --- a/runtime/builtins/builtins_regexp.h +++ b/runtime/builtins/builtins_regexp.h @@ -22,9 +22,9 @@ #include "plugins/ecmascript/runtime/regexp/regexp_executor.h" #include "runtime/regexp/ecmascript/regexp_parser.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using MatchResult = RegExpMatchResult>; -using RegExpExecutor = panda::ecmascript::RegExpExecutor; +using RegExpExecutor = ark::ecmascript::RegExpExecutor; class RegExpExecResultCache : public TaggedArray { public: @@ -143,5 +143,5 @@ private: static constexpr int EXTEND_INDEX = 8; static constexpr int ENTRY_SIZE = 9; }; -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins #endif // ECMASCRIPT_BUILTINS_BUILTINS_REGEXP_H diff --git a/runtime/builtins/builtins_relative_time_format.cpp b/runtime/builtins/builtins_relative_time_format.cpp index 4587170f4..85c6b835a 100644 --- a/runtime/builtins/builtins_relative_time_format.cpp +++ b/runtime/builtins/builtins_relative_time_format.cpp @@ -16,7 +16,7 @@ #include "plugins/ecmascript/runtime/base/builtins_base.h" #include "plugins/ecmascript/runtime/js_relative_time_format.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 14.2.1 Intl.RelativeTimeFormat ([ locales [ , options ]]) JSTaggedValue relative_time_format::RelativeTimeFormatConstructor(EcmaRuntimeCallInfo *argv) { @@ -177,4 +177,4 @@ JSTaggedValue relative_time_format::proto::ResolvedOptions(EcmaRuntimeCallInfo * // 5. Return options. return options.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins \ No newline at end of file +} // namespace ark::ecmascript::builtins \ No newline at end of file diff --git a/runtime/builtins/builtins_runtime_testing.cpp b/runtime/builtins/builtins_runtime_testing.cpp index 406b56aee..d8bf16328 100644 --- a/runtime/builtins/builtins_runtime_testing.cpp +++ b/runtime/builtins/builtins_runtime_testing.cpp @@ -16,7 +16,7 @@ #ifndef PANDA_PRODUCT_BUILD #include "plugins/ecmascript/runtime/base/builtins_base.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // A set of bits returned by GetOptimizationStatus. enum class OptimizationStatus { IS_FUNCTION = 1U << 0U, // NOLINT(readability-magic-numbers) @@ -410,6 +410,6 @@ JSTaggedValue runtime_testing::Is64Bit([[maybe_unused]] EcmaRuntimeCallInfo *arg BUILTINS_API_TRACE(thread, RuntimeTesting, Is64Bit); THROW_TYPE_ERROR_AND_RETURN(argv->GetThread(), "Builtin is not implemented", JSTaggedValue::Exception()); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins #endif // PANDA_PRODUCT_BUILD diff --git a/runtime/builtins/builtins_set.cpp b/runtime/builtins/builtins_set.cpp index 69130acfb..85076c015 100644 --- a/runtime/builtins/builtins_set.cpp +++ b/runtime/builtins/builtins_set.cpp @@ -24,7 +24,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { JSTaggedValue set::SetConstructor(EcmaRuntimeCallInfo *argv) { ASSERT(argv); @@ -266,4 +266,4 @@ JSTaggedValue set::proto::Values(EcmaRuntimeCallInfo *argv) JSHandle iter = JSSetIterator::CreateSetIterator(thread, self, IterationKind::VALUE); return iter.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_string.cpp b/runtime/builtins/builtins_string.cpp index 6182f1bfa..e3c527eff 100644 --- a/runtime/builtins/builtins_string.cpp +++ b/runtime/builtins/builtins_string.cpp @@ -41,7 +41,7 @@ #include "unicode/normlzr.h" #include "unicode/unistr.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using ObjectFactory = ecmascript::ObjectFactory; using JSArray = ecmascript::JSArray; @@ -1894,4 +1894,4 @@ int32_t ConvertDoubleToInt(double d) } return ecmascript::base::NumberHelper::DoubleToInt(d, ecmascript::base::INT32_BITS); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_string_iterator.cpp b/runtime/builtins/builtins_string_iterator.cpp index b1119df27..747cdbe8f 100644 --- a/runtime/builtins/builtins_string_iterator.cpp +++ b/runtime/builtins/builtins_string_iterator.cpp @@ -22,7 +22,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { // 21.1.5.2.1 JSTaggedValue string_iterator::proto::Next(EcmaRuntimeCallInfo *argv) { @@ -92,4 +92,4 @@ JSTaggedValue string_iterator::proto::Next(EcmaRuntimeCallInfo *argv) // 14. Return CreateIterResultObject(resultString, false). return JSIterator::CreateIterResultObject(thread, result, false).GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_symbol.cpp b/runtime/builtins/builtins_symbol.cpp index 3181efa6f..f3960375f 100644 --- a/runtime/builtins/builtins_symbol.cpp +++ b/runtime/builtins/builtins_symbol.cpp @@ -24,7 +24,7 @@ #include "plugins/ecmascript/runtime/symbol_table-inl.h" #include "utils/bit_utils.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { static JSTaggedValue ThisSymbolValue(JSThread *thread, const JSHandle &value); @@ -263,4 +263,4 @@ JSTaggedValue ThisSymbolValue(JSThread *thread, const JSHandle &v JSTaggedValue primitiveDesValue = JSSymbol::Cast(primitive.GetTaggedObject())->GetDescription(); return primitiveDesValue; } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_typedarray.cpp b/runtime/builtins/builtins_typedarray.cpp index 0d6a1cdbb..5f21eccc1 100644 --- a/runtime/builtins/builtins_typedarray.cpp +++ b/runtime/builtins/builtins_typedarray.cpp @@ -31,7 +31,7 @@ #include "plugins/ecmascript/runtime/js_typed_array.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { using TypedArrayHelper = ecmascript::base::TypedArrayHelper; // 22.2.1 @@ -1447,4 +1447,4 @@ JSTaggedValue typed_array::proto::GetToStringTag(EcmaRuntimeCallInfo *argv) // 6. Return name. return name; } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_weak_map.cpp b/runtime/builtins/builtins_weak_map.cpp index dacf622ec..7177acbf0 100644 --- a/runtime/builtins/builtins_weak_map.cpp +++ b/runtime/builtins/builtins_weak_map.cpp @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/linked_hash_table.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { JSTaggedValue weak_map::WeakMapConstructor(EcmaRuntimeCallInfo *argv) { ASSERT(argv); @@ -219,4 +219,4 @@ JSTaggedValue weak_map::proto::Set(EcmaRuntimeCallInfo *argv) JSWeakMap::Set(thread, map, key, value); return map.GetTaggedValue(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_weak_ref.cpp b/runtime/builtins/builtins_weak_ref.cpp index cc3b1313c..e9b3ab1b2 100644 --- a/runtime/builtins/builtins_weak_ref.cpp +++ b/runtime/builtins/builtins_weak_ref.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_weak_container.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { JSTaggedValue weak_ref::Constructor(EcmaRuntimeCallInfo *argv) { ASSERT(argv); @@ -67,4 +67,4 @@ JSTaggedValue weak_ref::proto::Deref(EcmaRuntimeCallInfo *argv) // 3. Return WeakRefDeref(weakRef). return weakRef->GetReferent(); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/builtins_weak_set.cpp b/runtime/builtins/builtins_weak_set.cpp index 446aac329..9e26010d5 100644 --- a/runtime/builtins/builtins_weak_set.cpp +++ b/runtime/builtins/builtins_weak_set.cpp @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/linked_hash_table-inl.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript::builtins { +namespace ark::ecmascript::builtins { JSTaggedValue weak_set::WeakSetConstructor(EcmaRuntimeCallInfo *argv) { ASSERT(argv); @@ -174,4 +174,4 @@ JSTaggedValue weak_set::proto::Has(EcmaRuntimeCallInfo *argv) int hash = LinkedHash::Hash(value.GetTaggedValue()); return builtins_common::GetTaggedBoolean(jsWeakSet->Has(value.GetTaggedValue(), hash)); } -} // namespace panda::ecmascript::builtins +} // namespace ark::ecmascript::builtins diff --git a/runtime/builtins/templates/builtins_inline_intrinsics_gen.inl.erb b/runtime/builtins/templates/builtins_inline_intrinsics_gen.inl.erb index cc7b56afd..640862b1e 100644 --- a/runtime/builtins/templates/builtins_inline_intrinsics_gen.inl.erb +++ b/runtime/builtins/templates/builtins_inline_intrinsics_gen.inl.erb @@ -15,7 +15,7 @@ #include "plugins/ecmascript/compiler/optimizer/optimizations/ecma_inlining.h" -namespace panda::compiler { +namespace ark::compiler { AnyBaseType InlineIntrinsics::FetchInputs(CallInst *callInst) { @@ -137,7 +137,7 @@ bool InlineIntrinsics::TryInlineNativeMethodGenECMASCRIPT(CallInst *callInst) switch(GetGraph()->GetRuntime()->ResolveInlinableNativeMethod(callInst->GetCallMethod())) { % Builtins.spaces.each do |space| % space.inlinable_methods.each do |method| - case panda::ecmascript::EcmaRuntimeCallerId::BUILTINS_ID_<%= space.name %>_<%= method.gen_cpp_id %>: + case ark::ecmascript::EcmaRuntimeCallerId::BUILTINS_ID_<%= space.name %>_<%= method.gen_cpp_id %>: return TryInline<%= space.name %><%= method.gen_cpp_id %>Gen(callInst); % end % end @@ -146,4 +146,4 @@ bool InlineIntrinsics::TryInlineNativeMethodGenECMASCRIPT(CallInst *callInst) } } -} // namespace panda::compiler +} // namespace ark::compiler diff --git a/runtime/class_info_extractor.cpp b/runtime/class_info_extractor.cpp index e87b7eeee..e2d5674b7 100644 --- a/runtime/class_info_extractor.cpp +++ b/runtime/class_info_extractor.cpp @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/js_function.h" #include "plugins/ecmascript/runtime/tagged_dictionary.h" -namespace panda::ecmascript { +namespace ark::ecmascript { void ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(JSThread *thread, JSHandle &extractor, const JSHandle &literal) { @@ -415,4 +415,4 @@ void ClassHelper::HandleElementsProperties(JSThread *thread, const JSHandle &object, JSHandle &elements, const JSHandle &constantpool); }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_CLASS_INFO_EXTRACTOR_H diff --git a/runtime/class_linker/panda_file_translator.cpp b/runtime/class_linker/panda_file_translator.cpp index 77090addf..b3ef35142 100644 --- a/runtime/class_linker/panda_file_translator.cpp +++ b/runtime/class_linker/panda_file_translator.cpp @@ -39,7 +39,7 @@ #include "libpandabase/os/filesystem.h" -namespace panda::ecmascript { +namespace ark::ecmascript { PandaFileTranslator::PandaFileTranslator(EcmaVM *vm) : ecmaVm_(vm), factory_(vm->GetFactory()), thread_(vm->GetJSThread()) { @@ -122,11 +122,11 @@ void PandaFileTranslator::TranslateMethod(const compiler::AotClass &aotClass, co panda_file::ProtoDataAccessor pda(pf, mda.GetProtoId()); auto *classLinker = Runtime::GetCurrent()->GetClassLinker(); - auto *extension = classLinker->GetExtension(panda::panda_file::SourceLang::ECMASCRIPT); + auto *extension = classLinker->GetExtension(ark::panda_file::SourceLang::ECMASCRIPT); auto klass = extension->GetClass(descriptor); if (klass == nullptr) { // Case for ark_aot. This is workaround. - klass = classLinker->LoadClass(&pf, descriptor, panda::panda_file::SourceLang::ECMASCRIPT); + klass = classLinker->LoadClass(&pf, descriptor, ark::panda_file::SourceLang::ECMASCRIPT); } ASSERT(klass != nullptr); // Very important assert. @@ -166,7 +166,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) JSHandle program = factory_->NewProgram(); JSHandle location = - factory_->NewFromStdStringUnCheck(pf.GetFilename(), true, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + factory_->NewFromStdStringUnCheck(pf.GetFilename(), true, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); // +1 for program JSHandle constpool = factory_->NewConstantPool(constpoolIndex_ + 1); @@ -186,7 +186,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) panda_file::File::EntityId id(it.first); auto foundStr = pf.GetStringData(id); auto string = factory_->GetRawStringFromStringTable(foundStr.data, foundStr.utf16Length, foundStr.isAscii, - panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); if (string == nullptr) { LOG(FATAL, ECMASCRIPT) << "Not enough memory"; } @@ -198,7 +198,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) ASSERT(method != nullptr); JSHandle jsFunc = factory_->NewJSFunctionByDynClass( - method, dynclass, FunctionKind::BASE_CONSTRUCTOR, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + method, dynclass, FunctionKind::BASE_CONSTRUCTOR, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); constpool->Set(thread_, value.GetConstpoolIndex(), jsFunc.GetTaggedValue()); jsFunc->SetConstantPool(thread_, constpool.GetTaggedValue()); } else if (value.GetConstpoolType() == ConstPoolType::NC_FUNCTION) { @@ -208,7 +208,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) ASSERT(method != nullptr); JSHandle jsFunc = factory_->NewJSFunctionByDynClass( - method, normalDynclass, FunctionKind::NORMAL_FUNCTION, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + method, normalDynclass, FunctionKind::NORMAL_FUNCTION, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); constpool->Set(thread_, value.GetConstpoolIndex(), jsFunc.GetTaggedValue()); jsFunc->SetConstantPool(thread_, constpool.GetTaggedValue()); } else if (value.GetConstpoolType() == ConstPoolType::GENERATOR_FUNCTION) { @@ -219,13 +219,13 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) JSHandle jsFunc = factory_->NewJSFunctionByDynClass(method, generatorDynclass, FunctionKind::GENERATOR_FUNCTION, - panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); // 26.3.4.3 prototype // Whenever a GeneratorFunction instance is created another ordinary object is also created and // is the initial value of the generator function's "prototype" property. JSHandle objFun = env->GetObjectFunction(); JSHandle initialGeneratorFuncPrototype = factory_->NewJSObjectByConstructor( - JSHandle(objFun), objFun, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + JSHandle(objFun), objFun, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); JSObject::SetPrototype(thread_, initialGeneratorFuncPrototype, env->GetGeneratorPrototype()); jsFunc->SetProtoOrDynClass(thread_, initialGeneratorFuncPrototype); @@ -238,7 +238,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) ASSERT(method != nullptr); JSHandle jsFunc = factory_->NewJSFunctionByDynClass( - method, asyncDynclass, FunctionKind::ASYNC_FUNCTION, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + method, asyncDynclass, FunctionKind::ASYNC_FUNCTION, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); constpool->Set(thread_, value.GetConstpoolIndex(), jsFunc.GetTaggedValue()); jsFunc->SetConstantPool(thread_, constpool.GetTaggedValue()); } else if (value.GetConstpoolType() == ConstPoolType::ASYNC_GENERATOR_FUNCTION) { @@ -249,7 +249,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) JSHandle jsFunc = factory_->NewJSFunctionByDynClass( method, asyncgeneratorDynclass, FunctionKind::ASYNC_GENERATOR_FUNCTION, - panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); constpool->Set(thread_, value.GetConstpoolIndex(), jsFunc.GetTaggedValue()); jsFunc->SetConstantPool(thread_, constpool.GetTaggedValue()); } else if (value.GetConstpoolType() == ConstPoolType::CLASS_FUNCTION) { @@ -266,7 +266,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) ASSERT(method != nullptr); JSHandle jsFunc = factory_->NewJSFunctionByDynClass( - method, normalDynclass, FunctionKind::NORMAL_FUNCTION, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + method, normalDynclass, FunctionKind::NORMAL_FUNCTION, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); constpool->Set(thread_, value.GetConstpoolIndex(), jsFunc.GetTaggedValue()); jsFunc->SetConstantPool(thread_, constpool.GetTaggedValue()); } else if (value.GetConstpoolType() == ConstPoolType::OBJECT_LITERAL) { @@ -275,7 +275,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) JSMutableHandle properties(thread_, JSTaggedValue::Undefined()); LiteralDataExtractor::ExtractObjectDatas(thread_, &pf, index, elements, properties, this); JSHandle obj = JSObject::CreateObjectFromProperties( - thread_, properties, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + thread_, properties, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); JSMutableHandle key(thread_, JSTaggedValue::Undefined()); JSMutableHandle valueHandle(thread_, JSTaggedValue::Undefined()); @@ -296,7 +296,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) uint32_t length = literal->GetLength(); JSHandle arr( - JSArray::ArrayCreate(thread_, JSTaggedNumber(length), panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT)); + JSArray::ArrayCreate(thread_, JSTaggedNumber(length), ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT)); arr->SetElements(thread_, literal); constpool->Set(thread_, value.GetConstpoolIndex(), arr.GetTaggedValue()); } else if (value.GetConstpoolType() == ConstPoolType::TAGGED_ARRAY) { @@ -310,7 +310,7 @@ Program *PandaFileTranslator::GenerateProgram(const panda_file::File &pf) auto method = const_cast(FindMethods(mainMethodIndex_)); ASSERT(method != nullptr); JSHandle mainFunc = factory_->NewJSFunctionByDynClass( - method, dynclass, FunctionKind::BASE_CONSTRUCTOR, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + method, dynclass, FunctionKind::BASE_CONSTRUCTOR, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); mainFunc->SetConstantPool(thread_, constpool.GetTaggedValue()); program->SetMainFunction(thread_, mainFunc.GetTaggedValue()); program->SetMethodsData(methods_.release()); @@ -589,18 +589,18 @@ JSHandle PandaFileTranslator::DefineMethodInLiteral(uint32_t methodI functionClass = JSHandle::Cast(env->GetGeneratorFunctionClass()); } JSHandle jsFunc = - factory_->NewJSFunctionByDynClass(method, functionClass, kind, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + factory_->NewJSFunctionByDynClass(method, functionClass, kind, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); if (kind == FunctionKind::GENERATOR_FUNCTION) { JSHandle objFun = env->GetObjectFunction(); JSHandle initialGeneratorFuncPrototype = factory_->NewJSObjectByConstructor( - JSHandle(objFun), objFun, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + JSHandle(objFun), objFun, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); JSObject::SetPrototype(thread_, initialGeneratorFuncPrototype, env->GetGeneratorPrototype()); jsFunc->SetProtoOrDynClass(thread_, initialGeneratorFuncPrototype); } else if (kind == FunctionKind::ASYNC_GENERATOR_FUNCTION) { JSHandle objFun = env->GetObjectFunction(); JSHandle initialAsyncGeneratorFuncPrototype = factory_->NewJSObjectByConstructor( - JSHandle(objFun), objFun, panda::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); + JSHandle(objFun), objFun, ark::SpaceType::SPACE_TYPE_NON_MOVABLE_OBJECT); JSObject::SetPrototype(thread_, initialAsyncGeneratorFuncPrototype, env->GetAsyncGeneratorPrototype()); jsFunc->SetProtoOrDynClass(thread_, initialAsyncGeneratorFuncPrototype); } @@ -632,4 +632,4 @@ void PandaFileTranslator::DefineClassInConstPool(const JSHandle &c index += 2; // 2: pair of extractor and literal } } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/class_linker/panda_file_translator.h b/runtime/class_linker/panda_file_translator.h index 0b03e128c..617bbeb2b 100644 --- a/runtime/class_linker/panda_file_translator.h +++ b/runtime/class_linker/panda_file_translator.h @@ -23,7 +23,7 @@ #include "libpandafile/file-inl.h" #include "utils/bit_field.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class JSThread; class Program; @@ -113,5 +113,5 @@ private: std::unordered_map constpoolMap_; std::set translatedCode_; }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_CLASS_LINKER_PANDA_FILE_TRANSLATOR_H diff --git a/runtime/class_linker/program_object-inl.h b/runtime/class_linker/program_object-inl.h index 213495acd..8fd33adac 100644 --- a/runtime/class_linker/program_object-inl.h +++ b/runtime/class_linker/program_object-inl.h @@ -18,7 +18,7 @@ #include "program_object.h" -namespace panda::ecmascript { +namespace ark::ecmascript { const uint8_t *LexicalFunction::GetInstructions() const { JSTaggedValue inst = GetBytecode(); @@ -36,5 +36,5 @@ void Program::FreeMethodData() mem::InternalAllocator<>::GetInternalAllocatorFromRuntime()->Delete(GetMethodsData()); SetMethodsData(nullptr); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_CLASS_LINKER_PROGRAM_INL_H diff --git a/runtime/class_linker/program_object.h b/runtime/class_linker/program_object.h index 322b8ac5c..8722dad88 100644 --- a/runtime/class_linker/program_object.h +++ b/runtime/class_linker/program_object.h @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/ecma_macros.h" #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class JSThread; class Program : public ECMAObject { @@ -82,5 +82,5 @@ public: inline JSTaggedValue GetObjectFromCache(uint32_t index) const; DECL_DUMP() }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_CLASS_LINKER_PROGRAM_H diff --git a/runtime/common.h b/runtime/common.h index cb61631e1..f98a298cf 100644 --- a/runtime/common.h +++ b/runtime/common.h @@ -19,7 +19,7 @@ #include "libpandabase/macros.h" #include "plugins/ecmascript/runtime/ecma_call_params.h" -namespace panda::ecmascript { +namespace ark::ecmascript { enum BarrierMode { SKIP_BARRIER, WRITE_BARRIER, READ_BARRIER }; // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) @@ -32,6 +32,6 @@ enum BarrierMode { SKIP_BARRIER, WRITE_BARRIER, READ_BARRIER }; // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define DUMP_API_ATTR __attribute__((visibility("default"), used)) #endif -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_COMMON_H diff --git a/runtime/compiler/ecmascript_runtime_interface.cpp b/runtime/compiler/ecmascript_runtime_interface.cpp index ddab040ad..c25e6735a 100644 --- a/runtime/compiler/ecmascript_runtime_interface.cpp +++ b/runtime/compiler/ecmascript_runtime_interface.cpp @@ -29,7 +29,7 @@ #include "plugins/ecmascript/runtime/ic/proto_change_details.h" #include "runtime/mem/refstorage/global_object_storage.h" -namespace panda::ecmascript { +namespace ark::ecmascript { EcmaRuntimeInterface::EcmaRuntimeInterface(const EcmaVM *ecmaVm, mem::InternalAllocatorPtr internalAllocator) : ecmaVm_(ecmaVm), internalAllocator_(internalAllocator) @@ -50,7 +50,7 @@ size_t EcmaRuntimeInterface::GetLanguageExtensionSize([[maybe_unused]] Arch arch std::string EcmaRuntimeInterface::GetMethodFullName(MethodPtr method, [[maybe_unused]] bool withSignature) const { - ASSERT(panda::panda_file::IsDynamicLanguage(MethodCast(method)->GetClass()->GetSourceLang())); + ASSERT(ark::panda_file::IsDynamicLanguage(MethodCast(method)->GetClass()->GetSourceLang())); return std::string(static_cast(MethodCast(method))->GetFullName()); } @@ -134,8 +134,8 @@ bool EcmaRuntimeInterface::CanInlineLdStObjByIndex(const BytecodeInstruction *bc { auto profile = GetBytecodeProfile(methodProfile, bcInst->GetAddress(), pc); auto ecmaProf = reinterpret_cast(profile); - panda::ecmascript::ObjByIndexOperationProfile p(ecmaProf); - return p.GetOperandType(0).GetType() == panda::ecmascript::ProfilingIndexedAccessBits::OBJECT_ARRAY_ACCESS; + ark::ecmascript::ObjByIndexOperationProfile p(ecmaProf); + return p.GetOperandType(0).GetType() == ark::ecmascript::ProfilingIndexedAccessBits::OBJECT_ARRAY_ACCESS; } profiling::CallKind EcmaRuntimeInterface::GetCallProfile(MethodPtr method, uint32_t pc, ArenaVector *methods, @@ -181,30 +181,30 @@ Expected EcmaRuntimeInterface::AddProfile(std::string_view f return true; } -inline compiler::AnyBaseType GetTypeOfType(panda::ecmascript::ProfilingTypeOfBits::Type type, +inline compiler::AnyBaseType GetTypeOfType(ark::ecmascript::ProfilingTypeOfBits::Type type, profiling::AnyInputType *allowedInputType, bool *isTypeProfiled) { - if (type == panda::ecmascript::ProfilingTypeOfBits::NONE) { + if (type == ark::ecmascript::ProfilingTypeOfBits::NONE) { return compiler::AnyBaseType::UNDEFINED_TYPE; } *isTypeProfiled = true; switch (type) { - case panda::ecmascript::ProfilingTypeOfBits::NUMBER: { + case ark::ecmascript::ProfilingTypeOfBits::NUMBER: { *allowedInputType = profiling::AnyInputType::INTEGER; return compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE; } - case panda::ecmascript::ProfilingTypeOfBits::SYMBOL: + case ark::ecmascript::ProfilingTypeOfBits::SYMBOL: return compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE; - case panda::ecmascript::ProfilingTypeOfBits::BOOLEAN: + case ark::ecmascript::ProfilingTypeOfBits::BOOLEAN: return compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE; - case panda::ecmascript::ProfilingTypeOfBits::STRING: + case ark::ecmascript::ProfilingTypeOfBits::STRING: return compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE; - case panda::ecmascript::ProfilingTypeOfBits::FUNCTION: + case ark::ecmascript::ProfilingTypeOfBits::FUNCTION: return compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE; - case panda::ecmascript::ProfilingTypeOfBits::UNDEFINED: + case ark::ecmascript::ProfilingTypeOfBits::UNDEFINED: return compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE; - case panda::ecmascript::ProfilingTypeOfBits::BIGINT: + case ark::ecmascript::ProfilingTypeOfBits::BIGINT: return compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE; default: return compiler::AnyBaseType::UNDEFINED_TYPE; @@ -235,7 +235,7 @@ compiler::AnyBaseType EcmaRuntimeInterface::GetProfilingAnyType(RuntimeInterface ProfilingTypeBits::Type type = ProfilingTypeBits::NONE; switch (kind) { case profiling::ProfilingKind::TYPE_OF: { - panda::ecmascript::TypeOfOperationProfile p(ecmaProf); + ark::ecmascript::TypeOfOperationProfile p(ecmaProf); return GetTypeOfType(p.GetOperandType(index).GetType(), allowedInputType, isTypeProfiled); } case profiling::ProfilingKind::UNARY_ARITH: { @@ -339,35 +339,35 @@ size_t EcmaRuntimeInterface::GetGlobalConstStringOffsetForAnyType(compiler::AnyB cross_values::GetJsthreadGlobalConstantsOffset(arch) + cross_values::GetGlobalConstConstantsOffset(arch); switch (type) { case compiler::AnyBaseType::ECMASCRIPT_UNDEFINED_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::UNDEFINED_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::UNDEFINED_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_STRING_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::STRING_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::STRING_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_INT_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_DOUBLE_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::NUMBER_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_SYMBOL_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::SYMBOL_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::SYMBOL_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_CALLABLE_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::FUNCTION_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::FUNCTION_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_BOOLEAN_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::BOOLEAN_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::BOOLEAN_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_NULL_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_BIGINT_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::BIGINT_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::BIGINT_STRING_INDEX); case compiler::AnyBaseType::ECMASCRIPT_HEAP_OBJECT_TYPE: - return globalConstArrayOffset + panda::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( - panda::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); + return globalConstArrayOffset + ark::ecmascript::GlobalEnvConstants::GetGlobalConstantOffset( + ark::ecmascript::ConstantIndex::OBJECT_STRING_INDEX); default: UNREACHABLE(); } @@ -687,8 +687,8 @@ void EcmaRuntimeInterface::AddObjectHandle(Method *method, ObjectHeader *obj) auto gos = ecmaVm_->GetGlobalObjectStorage(); // Create new Vector for the method if (it == handlesByMethodTable_.end()) { - auto vector = internalAllocator_->template New>(); - auto funcRef = gos->Add(obj, panda::mem::Reference::ObjectType::GLOBAL); + auto vector = internalAllocator_->template New>(); + auto funcRef = gos->Add(obj, ark::mem::Reference::ObjectType::GLOBAL); vector->push_back(funcRef); handlesByMethodTable_.insert({method, vector}); return; @@ -700,7 +700,7 @@ void EcmaRuntimeInterface::AddObjectHandle(Method *method, ObjectHeader *obj) return; } } - auto funcRef = gos->Add(obj, panda::mem::Reference::ObjectType::GLOBAL); + auto funcRef = gos->Add(obj, ark::mem::Reference::ObjectType::GLOBAL); vector->push_back(funcRef); } @@ -711,8 +711,8 @@ uintptr_t EcmaRuntimeInterface::AddFixedObjectHandle(Method *method, ObjectHeade auto gos = ecmaVm_->GetGlobalObjectStorage(); // Create new Vector for the method if (it == handlesByMethodTable_.end()) { - auto vector = internalAllocator_->template New>(); - auto funcRef = gos->Add(obj, panda::mem::Reference::ObjectType::GLOBAL_FIXED); + auto vector = internalAllocator_->template New>(); + auto funcRef = gos->Add(obj, ark::mem::Reference::ObjectType::GLOBAL_FIXED); if (funcRef == nullptr) { return 0; } @@ -727,7 +727,7 @@ uintptr_t EcmaRuntimeInterface::AddFixedObjectHandle(Method *method, ObjectHeade return gos->GetAddressForRef(ref); } } - auto funcRef = gos->Add(obj, panda::mem::Reference::ObjectType::GLOBAL_FIXED); + auto funcRef = gos->Add(obj, ark::mem::Reference::ObjectType::GLOBAL_FIXED); if (funcRef == nullptr) { return 0; } @@ -854,7 +854,7 @@ PandaRuntimeInterface::MethodPtr EcmaRuntimeInterface::GetMethodByIdAndSaveJsFun // Store JsFunction for recursive static inlining and futher optimizations auto gos = ecmaVm_->GetGlobalObjectStorage(); - auto funcRef = gos->Add(JSTaggedValue(target).GetHeapObject(), panda::mem::Reference::ObjectType::GLOBAL); + auto funcRef = gos->Add(JSTaggedValue(target).GetHeapObject(), ark::mem::Reference::ObjectType::GLOBAL); AddFunctionInMap(method, funcRef); return method; @@ -878,4 +878,4 @@ void *EcmaRuntimeInterface::GetConstantPool(uintptr_t funcAddress) return JSFunction::Cast(jsFunc.GetHeapObject())->GetConstantPool().GetHeapObject(); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/compiler/ecmascript_runtime_interface.h b/runtime/compiler/ecmascript_runtime_interface.h index 1ccd93608..1e827145e 100644 --- a/runtime/compiler/ecmascript_runtime_interface.h +++ b/runtime/compiler/ecmascript_runtime_interface.h @@ -25,7 +25,7 @@ #include "plugins/ecmascript/runtime/ecma_profiling.h" #include "runtime/mem/refstorage/reference.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class EcmaVM; class ProfileTypeInfo; class GlobalDictionary; @@ -58,51 +58,50 @@ public: uint32_t GetTlsGlobalObjectOffset(Arch arch) const override { - return panda::cross_values::GetJsthreadGlobalObjectOffset(arch); + return ark::cross_values::GetJsthreadGlobalObjectOffset(arch); } size_t GetPropertyBoxOffset(Arch arch) const override { - return panda::cross_values::GetJspropertyBoxValueOffset(arch); + return ark::cross_values::GetJspropertyBoxValueOffset(arch); } size_t GetElementsOffset(Arch arch) const override { - return panda::cross_values::GetJsobjectElementsOffset(arch); + return ark::cross_values::GetJsobjectElementsOffset(arch); } size_t GetPropertiesOffset(Arch arch) const override { - return panda::cross_values::GetJsobjectPropertiesOffset(arch); + return ark::cross_values::GetJsobjectPropertiesOffset(arch); } size_t GetHClassOffset(Arch arch) const override { - return -panda::cross_values::GetJshclassHclassOffset(arch) + - panda::cross_values::GetJshclassBitfieldOffset(arch); + return -ark::cross_values::GetJshclassHclassOffset(arch) + ark::cross_values::GetJshclassBitfieldOffset(arch); } size_t GetHClassBitfieldTypeStartBit(Arch arch) const override { - return panda::cross_values::GetJshclassBitfieldTypeStartBit(arch); + return ark::cross_values::GetJshclassBitfieldTypeStartBit(arch); } uint64_t GetHClassBitfieldTypeMask(Arch arch) const override { - return static_cast(panda::cross_values::GetJshclassBitfieldTypeMask(arch)) - << static_cast(panda::cross_values::GetJshclassBitfieldTypeStartBit(arch)); + return static_cast(ark::cross_values::GetJshclassBitfieldTypeMask(arch)) + << static_cast(ark::cross_values::GetJshclassBitfieldTypeStartBit(arch)); } uint64_t GetJshclassBitfieldClassConstructorStartBit(Arch arch) const override { - return static_cast(panda::cross_values::GetJshclassBitfieldClassConstructorStartBit(arch)) - << static_cast(panda::cross_values::GetJshclassBitfieldTypeStartBit(arch)); + return static_cast(ark::cross_values::GetJshclassBitfieldClassConstructorStartBit(arch)) + << static_cast(ark::cross_values::GetJshclassBitfieldTypeStartBit(arch)); } size_t GetJstypeJsFunction(Arch arch) const override { - return static_cast(panda::cross_values::GetJstypeJsFunction(arch)) - << static_cast(panda::cross_values::GetJshclassBitfieldTypeStartBit(arch)); + return static_cast(ark::cross_values::GetJstypeJsFunction(arch)) + << static_cast(ark::cross_values::GetJshclassBitfieldTypeStartBit(arch)); } size_t GetPrototypeHolderOffset(Arch arch) const override @@ -117,12 +116,12 @@ public: size_t GetIsChangeFieldOffset(Arch arch) const override { - return panda::cross_values::GetJsprotoChangeMarkerHasChangedOffset(arch); + return ark::cross_values::GetJsprotoChangeMarkerHasChangedOffset(arch); } size_t GetDynArrayLenthOffset(Arch arch) const override { - return panda::cross_values::GetJsarrayLengthOffset(arch); + return ark::cross_values::GetJsarrayLengthOffset(arch); } EntrypointId GetGlobalVarEntrypointId() override @@ -149,7 +148,7 @@ public: std::string GetClassName([[maybe_unused]] ClassPtr klass) const override { - if (static_cast(klass)->IsDynamicClass()) { + if (static_cast(klass)->IsDynamicClass()) { std::string str = std::to_string(reinterpret_cast(klass)); return "JSHClass " + str; @@ -223,7 +222,7 @@ public: void CleanFunction(Method *method); - void AddFunctionInMap(Method *method, panda::mem::Reference *func) + void AddFunctionInMap(Method *method, ark::mem::Reference *func) { os::memory::LockHolder lock(mutex_); jsFunctionTable_.insert({method, func}); @@ -281,13 +280,13 @@ private: private: const EcmaVM *ecmaVm_ {nullptr}; mem::InternalAllocatorPtr internalAllocator_; - panda::ecmascript::EcmaProfileContainer profile_; - PandaUnorderedMap jsFunctionTable_ GUARDED_BY(mutex_); - PandaUnorderedMap *> handlesByMethodTable_ GUARDED_BY(mutexH_); + ark::ecmascript::EcmaProfileContainer profile_; + PandaUnorderedMap jsFunctionTable_ GUARDED_BY(mutex_); + PandaUnorderedMap *> handlesByMethodTable_ GUARDED_BY(mutexH_); mutable os::memory::Mutex mutex_; mutable os::memory::Mutex mutexH_; }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // PANDA_RUNTIME_ECMASCRIPT_RUNTIME_INTERFACE_H diff --git a/runtime/containers/containers_arraylist.cpp b/runtime/containers/containers_arraylist.cpp index a30e766b8..294da8324 100644 --- a/runtime/containers/containers_arraylist.cpp +++ b/runtime/containers/containers_arraylist.cpp @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/object_factory.h" #include "plugins/ecmascript/runtime/tagged_array-inl.h" -namespace panda::ecmascript::containers { +namespace ark::ecmascript::containers { JSTaggedValue ContainersArrayList::ArrayListConstructor(EcmaRuntimeCallInfo *argv) { ASSERT(argv); @@ -66,4 +66,4 @@ JSTaggedValue ContainersArrayList::Iterator(EcmaRuntimeCallInfo *argv) [[maybe_unused]] EcmaHandleScope handleScope(thread); return JSTaggedValue::Undefined(); } -} // namespace panda::ecmascript::containers +} // namespace ark::ecmascript::containers diff --git a/runtime/containers/containers_arraylist.h b/runtime/containers/containers_arraylist.h index 965177147..7dc824b72 100644 --- a/runtime/containers/containers_arraylist.h +++ b/runtime/containers/containers_arraylist.h @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/base/builtins_base.h" #include "plugins/ecmascript/runtime/ecma_runtime_call_info.h" -namespace panda::ecmascript::containers { +namespace ark::ecmascript::containers { class ContainersArrayList { public: static JSTaggedValue ArrayListConstructor(EcmaRuntimeCallInfo *argv); @@ -27,5 +27,5 @@ public: static JSTaggedValue Add(EcmaRuntimeCallInfo *argv); static JSTaggedValue Iterator(EcmaRuntimeCallInfo *argv); }; -} // namespace panda::ecmascript::containers +} // namespace ark::ecmascript::containers #endif // ECMASCRIPT_CONTAINERS_CONTAINERS_ARRAYLIST_H diff --git a/runtime/containers/containers_private.cpp b/runtime/containers/containers_private.cpp index 4068bb125..3c559519e 100644 --- a/runtime/containers/containers_private.cpp +++ b/runtime/containers/containers_private.cpp @@ -21,7 +21,7 @@ #include "plugins/ecmascript/runtime/js_arraylist.h" #include "plugins/ecmascript/runtime/js_function.h" -namespace panda::ecmascript::containers { +namespace ark::ecmascript::containers { JSTaggedValue ContainersPrivate::Load(EcmaRuntimeCallInfo *msg) { ASSERT(msg); @@ -188,4 +188,4 @@ JSHandle ContainersPrivate::InitializeArrayList(JSThread *thread) return arrayListFunction; } -} // namespace panda::ecmascript::containers +} // namespace ark::ecmascript::containers diff --git a/runtime/containers/containers_private.h b/runtime/containers/containers_private.h index 429218734..a6abf2866 100644 --- a/runtime/containers/containers_private.h +++ b/runtime/containers/containers_private.h @@ -18,7 +18,7 @@ #include "plugins/ecmascript/runtime/base/builtins_base.h" -namespace panda::ecmascript::containers { +namespace ark::ecmascript::containers { enum FuncLength : uint8_t { ZERO = 0, ONE, TWO, THREE, FOUR }; enum ContainerTag : uint8_t { ARRAY_LIST = 0, @@ -63,6 +63,6 @@ private: const char *key); static JSHandle InitializeArrayList(JSThread *thread); }; -} // namespace panda::ecmascript::containers +} // namespace ark::ecmascript::containers #endif // ECMASCRIPT_CONTAINERS_CONTAINERS_PRIVATE_H diff --git a/runtime/dump.cpp b/runtime/dump.cpp index 0bcc9ee1f..9c73f48aa 100644 --- a/runtime/dump.cpp +++ b/runtime/dump.cpp @@ -77,9 +77,9 @@ #include "plugins/ecmascript/runtime/template_map.h" #include "plugins/ecmascript/runtime/transitions_dictionary.h" -namespace panda::ecmascript { -using MicroJobQueue = panda::ecmascript::job::MicroJobQueue; -using PendingJob = panda::ecmascript::job::PendingJob; +namespace ark::ecmascript { +using MicroJobQueue = ark::ecmascript::job::MicroJobQueue; +using PendingJob = ark::ecmascript::job::PendingJob; static constexpr uint32_t DUMP_TYPE_OFFSET = 12; static constexpr uint32_t DUMP_PROPERTY_OFFSET = 20; @@ -3185,4 +3185,4 @@ void ClassInfoExtractor::DumpForSnapshot([[maybe_unused]] JSThread *thread, vec.emplace_back(std::make_pair(PandaString("StaticProperties"), GetStaticProperties())); vec.emplace_back(std::make_pair(PandaString("StaticElements"), GetStaticElements())); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/ecma_call_params.h b/runtime/ecma_call_params.h index 151381fec..adc03919c 100644 --- a/runtime/ecma_call_params.h +++ b/runtime/ecma_call_params.h @@ -18,7 +18,7 @@ #include -namespace panda::ecmascript::js_method_args { +namespace ark::ecmascript::js_method_args { enum : uint8_t { FUNC_IDX = 0, NEW_TARGET_IDX = 1, @@ -28,6 +28,6 @@ enum : uint8_t { FIRST_ARG_IDX = NUM_MANDATORY_ARGS, }; -} // namespace panda::ecmascript::js_method_args +} // namespace ark::ecmascript::js_method_args #endif // PANDA_RUNTIME_ECMASCRIPT_CALL_PARAMS diff --git a/runtime/ecma_call_profiling_table.cpp b/runtime/ecma_call_profiling_table.cpp index ade57864c..d72bba7ce 100644 --- a/runtime/ecma_call_profiling_table.cpp +++ b/runtime/ecma_call_profiling_table.cpp @@ -16,7 +16,7 @@ #include "plugins/ecmascript/runtime/ecma_call_profiling_table.h" #include "plugins/ecmascript/runtime/js_object.h" -namespace panda::ecmascript { +namespace ark::ecmascript { EcmaCallProfilingTable::EcmaCallProfilingTable(uint32_t size) { @@ -96,7 +96,7 @@ void EcmaCallProfilingTable::UpdateMoved() continue; } if (object->IsForwarded()) { - ObjectHeader *fwdObject = panda::mem::GetForwardAddress(object); + ObjectHeader *fwdObject = ark::mem::GetForwardAddress(object); callProfilingTable_[i] = static_cast(fwdObject); LOG(DEBUG, GC) << "CallProfileTable: forward " << std::hex << object << " -> " << fwdObject << std::dec << " in slot " << i; @@ -116,4 +116,4 @@ void EcmaCallProfilingTable::VisitRoots(const GCRootVisitor &visitor) } } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/ecma_call_profiling_table.h b/runtime/ecma_call_profiling_table.h index ef442da35..6f6905c8f 100644 --- a/runtime/ecma_call_profiling_table.h +++ b/runtime/ecma_call_profiling_table.h @@ -19,7 +19,7 @@ #include "runtime/include/mem/panda_containers.h" #include "runtime/mem/gc/bitmap.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class EcmaVM; class ECMAObject; @@ -46,6 +46,6 @@ private: mutable os::memory::Mutex tableLock_; }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_CALL_PROFILING_TABLE_H \ No newline at end of file diff --git a/runtime/ecma_class_linker_extension.cpp b/runtime/ecma_class_linker_extension.cpp index 587be0611..90f489612 100644 --- a/runtime/ecma_class_linker_extension.cpp +++ b/runtime/ecma_class_linker_extension.cpp @@ -21,7 +21,7 @@ #include "runtime/include/class_linker-inl.h" #include "runtime/include/coretypes/class.h" -namespace panda::ecmascript { +namespace ark::ecmascript { using SourceLang = panda_file::SourceLang; bool EcmaClassLinkerExtension::InitializeImpl([[maybe_unused]] bool cmpStrEnabled) @@ -82,8 +82,8 @@ Class *EcmaClassLinkerExtension::NewClass(const uint8_t *descriptor, size_t vtab if (vm_ == nullptr) { return nullptr; } - // Create an instance of panda::Class. Since all objects in JS runtime must have a dynamic class - // wrap the instance of panda::Class into an object with a dynamic class and mark panda::Class's + // Create an instance of ark::Class. Since all objects in JS runtime must have a dynamic class + // wrap the instance of ark::Class into an object with a dynamic class and mark ark::Class's // data as native data. // // +----------+ @@ -96,7 +96,7 @@ Class *EcmaClassLinkerExtension::NewClass(const uint8_t *descriptor, size_t vtab // +--------------+ | classWord_ // +-> | ObjetcHeader | -+ // managed_object_ | +--------------+ - // +- | panda::Class | <- native data + // +- | ark::Class | <- native data // +--------------+ [[maybe_unused]] ecmascript::EcmaHandleScope scope(vm_->GetJSThread()); ObjectFactory *factory = vm_->GetFactory(); @@ -104,7 +104,7 @@ Class *EcmaClassLinkerExtension::NewClass(const uint8_t *descriptor, size_t vtab if (hclass.IsEmpty()) { return nullptr; } - // We must cover the whole panda::Class by the native_field_mask + // We must cover the whole ark::Class by the native_field_mask ASSERT(classSize < std::numeric_limits::digits * sizeof(JSTaggedType)); JSHClass *hclassPtr = reinterpret_cast(hclass.GetTaggedValue().GetTaggedObject()); hclassPtr->SetObjectSize(ObjectHeader::ObjectHeaderSize() + classSize); @@ -146,4 +146,4 @@ void EcmaClassLinkerExtension::FreeClass([[maybe_unused]] Class *klass) RemoveCreatedClass(klass); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/ecma_class_linker_extension.h b/runtime/ecma_class_linker_extension.h index 944325dfb..c9f6eab9b 100644 --- a/runtime/ecma_class_linker_extension.h +++ b/runtime/ecma_class_linker_extension.h @@ -20,11 +20,11 @@ #include "include/class_linker.h" #include "include/class_linker_extension.h" -namespace panda::coretypes { +namespace ark::coretypes { class Class; // NOLINT(bugprone-forward-declaration-namespace) -} // namespace panda::coretypes +} // namespace ark::coretypes -namespace panda::ecmascript { +namespace ark::ecmascript { class EcmaVM; class EcmaClassLinkerExtension : public ClassLinkerExtension { public: @@ -108,6 +108,6 @@ private: EcmaVM *vm_ {nullptr}; }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_ECMA_CLASS_LINKER_EXTENSION_H diff --git a/runtime/ecma_compiler.cpp b/runtime/ecma_compiler.cpp index fd82c5d19..84ef324b6 100644 --- a/runtime/ecma_compiler.cpp +++ b/runtime/ecma_compiler.cpp @@ -24,7 +24,7 @@ #include "runtime/mem/refstorage/global_object_storage.h" #include "runtime/mem/refstorage/reference.h" -namespace panda::ecmascript { +namespace ark::ecmascript { void EcmaCompiler::AddTask(CompilerTask &&task, TaggedValue func) { if (func.IsHole()) { @@ -44,10 +44,10 @@ void EcmaCompiler::AddTask(CompilerTask &&task, TaggedValue func) if (!func.IsHole()) { ASSERT(JSFunction::Cast(func.GetHeapObject())->GetCallTarget() == task.GetMethod()); auto gos = task.GetVM()->GetGlobalObjectStorage(); - auto funcRef = gos->Add(func.GetHeapObject(), panda::mem::Reference::ObjectType::GLOBAL); + auto funcRef = gos->Add(func.GetHeapObject(), ark::mem::Reference::ObjectType::GLOBAL); static_cast(GetRuntimeInterface())->AddFunctionInMap(task.GetMethod(), funcRef); } Compiler::AddTask(std::move(task), func); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/ecma_compiler.h b/runtime/ecma_compiler.h index eecb6f4bf..d292af8bf 100644 --- a/runtime/ecma_compiler.h +++ b/runtime/ecma_compiler.h @@ -18,7 +18,7 @@ #include "runtime/compiler.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class GlobalHandleCollection; class JSThread; @@ -34,6 +34,6 @@ public: void AddTask(CompilerTask &&task, TaggedValue func) override; }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_ECMA_COMPILER_H \ No newline at end of file diff --git a/runtime/ecma_entrypoints.cpp b/runtime/ecma_entrypoints.cpp index e47d293ca..9a9857233 100644 --- a/runtime/ecma_entrypoints.cpp +++ b/runtime/ecma_entrypoints.cpp @@ -20,7 +20,7 @@ #include "plugins/ecmascript/runtime/js_thread.h" #include "plugins/ecmascript/runtime/interpreter/slow_runtime_stub.h" -namespace panda::ecmascript { +namespace ark::ecmascript { extern "C" uintptr_t JSGetGlobalVarAddress(uint64_t cp, uint32_t id) { auto thread = JSThread::GetCurrent(); @@ -57,4 +57,4 @@ extern "C" uint64_t AllocDynObjectSlowPath(uint64_t ctorRaw) return thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(ctor, newTgt).GetTaggedValue().GetRawData(); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/ecma_entrypoints.h b/runtime/ecma_entrypoints.h index 1664f369d..83dc4c243 100644 --- a/runtime/ecma_entrypoints.h +++ b/runtime/ecma_entrypoints.h @@ -18,7 +18,7 @@ #include -namespace panda::ecmascript { -} // namespace panda::ecmascript +namespace ark::ecmascript { +} // namespace ark::ecmascript #endif // ECMASCRIPT_ECMA_ENTRYPOINTS_H \ No newline at end of file diff --git a/runtime/ecma_entrypoints.yaml b/runtime/ecma_entrypoints.yaml index 7bcacb617..33428838d 100644 --- a/runtime/ecma_entrypoints.yaml +++ b/runtime/ecma_entrypoints.yaml @@ -36,7 +36,7 @@ properties: [irtoc] signature: - uint64_t - - panda::ObjectHeader* + - ark::ObjectHeader* - uint64_t - uint64_t - uint64_t @@ -47,7 +47,7 @@ properties: [irtoc] signature: - uint64_t - - panda::ObjectHeader* + - ark::ObjectHeader* - uint64_t - uint64_t @@ -57,7 +57,7 @@ properties: [irtoc] signature: - uint64_t - - panda::ObjectHeader* + - ark::ObjectHeader* - uint64_t - uint64_t - uint16_t @@ -69,7 +69,7 @@ properties: [irtoc] signature: - uint64_t - - panda::ObjectHeader* + - ark::ObjectHeader* - uint64_t - uint16_t - uint64_t @@ -80,7 +80,7 @@ properties: [irtoc] signature: - uint64_t - - panda::ObjectHeader* + - ark::ObjectHeader* - uint64_t - uint64_t @@ -90,7 +90,7 @@ properties: [irtoc] signature: - uint64_t - - panda::ObjectHeader* + - ark::ObjectHeader* - uint64_t - name: AllocDynObjectStub diff --git a/runtime/ecma_exceptions.cpp b/runtime/ecma_exceptions.cpp index 0db235882..cfc621f66 100644 --- a/runtime/ecma_exceptions.cpp +++ b/runtime/ecma_exceptions.cpp @@ -21,7 +21,7 @@ #include "plugins/ecmascript/runtime/js_thread.h" #include "plugins/ecmascript/runtime/object_factory.h" -namespace panda::ecmascript { +namespace ark::ecmascript { void SetException(JSThread *thread, JSObject *error) { if (LIKELY(!thread->HasPendingException())) { @@ -50,4 +50,4 @@ void ThrowException(JSThread *thread, const char *name, const char *msg) } UNREACHABLE(); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript diff --git a/runtime/ecma_exceptions.h b/runtime/ecma_exceptions.h index 93a0bf7a7..57f7826eb 100644 --- a/runtime/ecma_exceptions.h +++ b/runtime/ecma_exceptions.h @@ -19,12 +19,12 @@ /* Do not add ecma special header's here */ #include "plugins/ecmascript/runtime/js_thread.h" -namespace panda::ecmascript { +namespace ark::ecmascript { static constexpr const char *TYPE_ERROR_STRING = "Lecma/TypedError;"; static constexpr const char *REFERENCE_ERROR_STRING = "Lecma/ReferenceError;"; static constexpr const char *RANGE_ERROR_STRING = "Lecma/RangeError;"; void ThrowException(JSThread *thread, const char *name, const char *msg); -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_ECMA_EXCEPTIONS_H diff --git a/runtime/ecma_global_storage-inl.h b/runtime/ecma_global_storage-inl.h index 249237e97..41a35f83c 100644 --- a/runtime/ecma_global_storage-inl.h +++ b/runtime/ecma_global_storage-inl.h @@ -17,7 +17,7 @@ #include "plugins/ecmascript/runtime/ecma_global_storage.h" -namespace panda::ecmascript { +namespace ark::ecmascript { inline EcmaGlobalStorage::NodeList *EcmaGlobalStorage::NodeList::NodeToNodeList(EcmaGlobalStorage::Node *node) { uintptr_t ptr = ToUintPtr(node) - node->GetIndex() * sizeof(EcmaGlobalStorage::Node); @@ -208,5 +208,5 @@ inline bool EcmaGlobalStorage::IsWeak(uintptr_t addr) const NodeList *list = NodeList::NodeToNodeList(node); return list->IsWeak(); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_ECMA_GLOABL_STORAGE_INL_H diff --git a/runtime/ecma_global_storage.h b/runtime/ecma_global_storage.h index 0d8389a37..6785e7147 100644 --- a/runtime/ecma_global_storage.h +++ b/runtime/ecma_global_storage.h @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "runtime/include/runtime.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class EcmaGlobalStorage { public: static const int32_t GLOBAL_BLOCK_SIZE = 256; @@ -263,5 +263,5 @@ private: NodeList *lastWeakGlobalNodes_ {nullptr}; NodeList *weakFreeListNodes_ {nullptr}; }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_ECMA_GLOABL_STORAGE_H diff --git a/runtime/ecma_handle_scope-inl.h b/runtime/ecma_handle_scope-inl.h index 1ee2a7268..bcd6a3829 100644 --- a/runtime/ecma_handle_scope-inl.h +++ b/runtime/ecma_handle_scope-inl.h @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/ecma_handle_scope.h" #include "plugins/ecmascript/runtime/js_thread.h" -namespace panda::ecmascript { +namespace ark::ecmascript { inline EcmaHandleScope::EcmaHandleScope(JSThread *thread) : thread_(thread), prevNext_(thread->handleScopeStorageNext_), @@ -52,5 +52,5 @@ uintptr_t EcmaHandleScope::NewHandle(JSThread *thread, JSTaggedType value) *result = value; return reinterpret_cast(result); } -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_HANDLE_SCOPE_INL_H diff --git a/runtime/ecma_handle_scope.h b/runtime/ecma_handle_scope.h index 14478f691..595f34b6f 100644 --- a/runtime/ecma_handle_scope.h +++ b/runtime/ecma_handle_scope.h @@ -18,7 +18,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value.h" -namespace panda::ecmascript { +namespace ark::ecmascript { class JSThread; /* @@ -47,5 +47,5 @@ private: NO_COPY_SEMANTIC(EcmaHandleScope); NO_MOVE_SEMANTIC(EcmaHandleScope); }; -} // namespace panda::ecmascript +} // namespace ark::ecmascript #endif // ECMASCRIPT_HANDLE_SCOPE_H diff --git a/runtime/ecma_language_context-inl.h b/runtime/ecma_language_context-inl.h index a57ab00c6..70f846c7c 100644 --- a/runtime/ecma_language_context-inl.h +++ b/runtime/ecma_language_context-inl.h @@ -10,7 +10,7 @@ #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "plugins/ecmascript/runtime/interpreter/js_frame.h" -namespace panda { +namespace ark { inline void EcmaLanguageContext::SetExceptionToVReg([[maybe_unused]] interpreter::AccVRegister &vreg, [[maybe_unused]] ObjectHeader *obj) const { @@ -25,6 +25,6 @@ inline uint32_t EcmaLanguageContext::GetFrameExtSize() const { return ecmascript::JSExtFrame::GetExtSize(); } -} // namespace panda +} // namespace ark #endif // PANDA_RUNTIME_ECMASCRIPT_LANGUAGE_CONTEXT_INL_H diff --git a/runtime/ecma_language_context.cpp b/runtime/ecma_language_context.cpp index 19b348bad..3a6841137 100644 --- a/runtime/ecma_language_context.cpp +++ b/runtime/ecma_language_context.cpp @@ -33,7 +33,7 @@ #include "runtime/core/core_itable_builder.h" #include "runtime/core/core_vtable_builder.h" -namespace panda { +namespace ark { using ecmascript::EcmaVM; using ecmascript::JSThread; @@ -104,7 +104,7 @@ size_t EcmaLanguageContext::GetStringSize(const ObjectHeader *stringObject) cons return string->ObjectSize(); } -using VRegType = panda::compiler::VRegInfo::VRegType; +using VRegType = ark::compiler::VRegInfo::VRegType; void EcmaLanguageContext::RestoreEnv(Frame *currentIframe, const StackWalker::EnvData &envData) const { auto *iframeEnv = ecmascript::JSExtFrame::FromFrame(currentIframe)->GetExtData(); @@ -139,4 +139,4 @@ uint64_t EcmaLanguageContext::GetOsrEnv(const Frame *iframe, compiler::VRegInfo } } -} // namespace panda +} // namespace ark diff --git a/runtime/ecma_language_context.h b/runtime/ecma_language_context.h index efd085e78..64790b468 100644 --- a/runtime/ecma_language_context.h +++ b/runtime/ecma_language_context.h @@ -21,7 +21,7 @@ #include "include/language_context.h" #include "plugins/ecmascript/runtime/js_hclass.h" -namespace panda { +namespace ark { class PUBLIC_API EcmaLanguageContext : public LanguageContextBase { public: EcmaLanguageContext() = default; @@ -270,7 +270,7 @@ public: return utf::CStringAsMutf8("Lpanda/IncompatibleClassChangeError;"); } - panda::panda_file::File::OpenMode GetBootPandaFilesOpenMode() const override + ark::panda_file::File::OpenMode GetBootPandaFilesOpenMode() const override { // In case of JS vm open a panda file for reading / writing because EcmaVM patches bytecode in-place return panda_file::File::READ_WRITE; @@ -298,6 +298,6 @@ public: uint64_t GetOsrEnv(const Frame *iframe, compiler::VRegInfo vregInfo) const override; }; -} // namespace panda +} // namespace ark #endif // ECMASCRIPT_LANGUAGE_CONTEXT_H diff --git a/runtime/ecma_macro_accessors.h b/runtime/ecma_macro_accessors.h index 6285ee070..bd1d3755e 100644 --- a/runtime/ecma_macro_accessors.h +++ b/runtime/ecma_macro_accessors.h @@ -23,7 +23,7 @@ #include "plugins/ecmascript/runtime/mem/barriers-inl.h" #include "utils/logger.h" -namespace panda::ecmascript { +namespace ark::ecmascript { using JSAccessorsMaskType = uint32_t; @@ -35,7 +35,7 @@ struct JSAccessorsOffs { template