From 950620bd572abe777f507d9b4da1b0a74d257070 Mon Sep 17 00:00:00 2001 From: huangtianzhi Date: Tue, 5 Nov 2024 16:37:56 +0800 Subject: [PATCH] Heapdump offline metadata part 1.generate metadata.json 2.adding related ut Issue: #IAXUPR Signed-off-by: huangtianzhi --- BUILD.gn | 251 + ecmascript/dfx/hprof/tests/BUILD.gn | 48 + .../dfx/hprof/tests/js_metadata_test.cpp | 4483 +++++++++++++++++ .../js_type_metadata/accessor_data.json | 19 + .../js_type_metadata/aot_literal_info.json | 1 + .../async_generator_request.json | 19 + .../async_iterator_record.json | 19 + ecmascript/js_type_metadata/bigint.json | 1 + ecmascript/js_type_metadata/byte_array.json | 1 + ecmascript/js_type_metadata/cell_record.json | 19 + .../class_info_extractor.json | 44 + .../js_type_metadata/class_literal.json | 14 + .../js_type_metadata/completion_record.json | 14 + .../js_type_metadata/constant_pool.json | 1 + .../js_type_metadata/constant_string.json | 14 + .../cow_mutant_tagged_array.json | 1 + .../js_type_metadata/cow_tagged_array.json | 1 + .../js_type_metadata/dictionary_layout.json | 8 + ecmascript/js_type_metadata/ecma_object.json | 1 + ecmascript/js_type_metadata/ecma_string.json | 1 + .../extra_profile_type_info.json | 19 + .../js_type_metadata/function_template.json | 24 + ecmascript/js_type_metadata/global_env.json | 1 + ecmascript/js_type_metadata/hclass.json | 1 + .../js_type_metadata/importentry_record.json | 24 + .../indirect_exportentry_record.json | 24 + .../js_type_metadata/internal_accessor.json | 19 + .../js_type_metadata/js_aggregate_error.json | 17 + .../js_type_metadata/js_api_array_list.json | 14 + .../js_api_arraylist_iterator.json | 14 + .../js_type_metadata/js_api_bitvector.json | 14 + .../js_api_bitvector_iterator.json | 14 + ecmascript/js_type_metadata/js_api_deque.json | 1 + .../js_api_deque_iterator.json | 14 + .../js_type_metadata/js_api_hash_map.json | 14 + .../js_type_metadata/js_api_hash_set.json | 14 + .../js_api_hashmap_iterator.json | 24 + .../js_api_hashset_iterator.json | 24 + .../js_api_light_weight_map.json | 24 + .../js_api_light_weight_map_iterator.json | 14 + .../js_api_light_weight_set.json | 19 + .../js_api_light_weight_set_iterator.json | 14 + .../js_type_metadata/js_api_linked_list.json | 14 + .../js_api_linked_list_iterator.json | 14 + ecmascript/js_type_metadata/js_api_list.json | 14 + .../js_api_list_iterator.json | 14 + .../js_type_metadata/js_api_plain_array.json | 19 + .../js_api_plain_array_iterator.json | 14 + ecmascript/js_type_metadata/js_api_queue.json | 14 + .../js_api_queue_iterator.json | 14 + ecmascript/js_type_metadata/js_api_stack.json | 1 + .../js_api_stack_iterator.json | 14 + .../js_type_metadata/js_api_tree_map.json | 14 + .../js_type_metadata/js_api_tree_set.json | 14 + .../js_api_treemap_iterator.json | 19 + .../js_api_treeset_iterator.json | 19 + .../js_type_metadata/js_api_vector.json | 1 + .../js_api_vector_iterator.json | 14 + ecmascript/js_type_metadata/js_arguments.json | 1 + ecmascript/js_type_metadata/js_array.json | 19 + .../js_type_metadata/js_array_buffer.json | 14 + .../js_type_metadata/js_array_iterator.json | 14 + .../js_async_await_status_function.json | 14 + ..._async_from_sync_iter_unwarp_function.json | 14 + .../js_async_from_sync_iterator.json | 14 + .../js_async_func_object.json | 14 + .../js_type_metadata/js_async_function.json | 8 + .../js_async_generator_function.json | 8 + .../js_async_generator_object.json | 29 + ..._resume_next_return_processor_rst_ftn.json | 14 + .../js_async_module_fulfilled_function.json | 8 + .../js_async_module_rejected_function.json | 8 + .../js_type_metadata/js_asynciterator.json | 17 + .../js_type_metadata/js_bigint64_array.json | 19 + .../js_type_metadata/js_biguint64_array.json | 19 + .../js_type_metadata/js_bound_function.json | 24 + .../js_type_metadata/js_cjs_exports.json | 14 + .../js_type_metadata/js_cjs_module.json | 29 + .../js_type_metadata/js_cjs_require.json | 19 + ecmascript/js_type_metadata/js_collator.json | 29 + ecmascript/js_type_metadata/js_data_view.json | 19 + ecmascript/js_type_metadata/js_date.json | 19 + .../js_type_metadata/js_date_time_format.json | 49 + .../js_type_metadata/js_displaynames.json | 19 + ecmascript/js_type_metadata/js_error.json | 17 + .../js_type_metadata/js_eval_error.json | 17 + .../js_finalization_registry.json | 34 + .../js_type_metadata/js_float32_array.json | 19 + .../js_type_metadata/js_float64_array.json | 19 + .../js_type_metadata/js_forin_iterator.json | 24 + ecmascript/js_type_metadata/js_function.json | 49 + .../js_type_metadata/js_function_base.json | 14 + .../js_generator_context.json | 39 + .../js_generator_function.json | 8 + .../js_type_metadata/js_generator_object.json | 19 + .../js_type_metadata/js_global_object.json | 8 + .../js_type_metadata/js_int16_array.json | 19 + .../js_type_metadata/js_int32_array.json | 19 + .../js_type_metadata/js_int8_array.json | 19 + ecmascript/js_type_metadata/js_intl.json | 14 + .../js_intl_bound_function.json | 24 + ecmascript/js_type_metadata/js_iterator.json | 17 + .../js_type_metadata/js_list_format.json | 19 + ecmascript/js_type_metadata/js_locale.json | 14 + ecmascript/js_type_metadata/js_map.json | 14 + .../js_type_metadata/js_map_iterator.json | 14 + .../js_type_metadata/js_module_namespace.json | 24 + .../js_type_metadata/js_native_pointer.json | 14 + .../js_type_metadata/js_number_format.json | 69 + ecmascript/js_type_metadata/js_object.json | 17 + ecmascript/js_type_metadata/js_oom_error.json | 17 + .../js_type_metadata/js_plural_rules.json | 49 + .../js_type_metadata/js_primitive_ref.json | 14 + ecmascript/js_type_metadata/js_promise.json | 24 + ..._promise_all_resolve_element_function.json | 34 + ..._promise_all_settled_element_function.json | 29 + ...s_promise_any_reject_element_function.json | 29 + .../js_promise_executor_function.json | 14 + .../js_promise_finally_function.json | 19 + .../js_promise_reactions_function.json | 19 + ...omise_value_thunk_or_thrower_function.json | 14 + ecmascript/js_type_metadata/js_proxy.json | 29 + .../js_proxy_revoc_function.json | 14 + .../js_type_metadata/js_range_error.json | 17 + ecmascript/js_type_metadata/js_realm.json | 19 + .../js_type_metadata/js_reference_error.json | 17 + ecmascript/js_type_metadata/js_reg_exp.json | 29 + .../js_type_metadata/js_reg_exp_iterator.json | 19 + .../js_relative_time_format.json | 24 + .../js_type_metadata/js_segment_iterator.json | 24 + ecmascript/js_type_metadata/js_segmenter.json | 19 + ecmascript/js_type_metadata/js_segments.json | 24 + .../js_sendable_array_buffer.json | 14 + ecmascript/js_type_metadata/js_set.json | 14 + .../js_type_metadata/js_set_iterator.json | 14 + .../js_type_metadata/js_shared_array.json | 14 + .../js_shared_array_buffer.json | 14 + .../js_shared_array_iterator.json | 14 + .../js_shared_async_function.json | 8 + .../js_shared_bigint64_array.json | 8 + .../js_shared_biguint64_array.json | 8 + .../js_shared_float32_array.json | 8 + .../js_shared_float64_array.json | 8 + .../js_type_metadata/js_shared_function.json | 8 + .../js_shared_int16_array.json | 8 + .../js_shared_int32_array.json | 8 + .../js_shared_int8_array.json | 8 + .../js_type_metadata/js_shared_map.json | 14 + .../js_shared_map_iterator.json | 14 + .../js_type_metadata/js_shared_object.json | 8 + .../js_type_metadata/js_shared_set.json | 14 + .../js_shared_set_iterator.json | 14 + .../js_shared_typed_array.json | 8 + .../js_shared_uint16_array.json | 8 + .../js_shared_uint32_array.json | 8 + .../js_shared_uint8_array.json | 8 + .../js_shared_uint8_clamped_array.json | 8 + .../js_type_metadata/js_string_iterator.json | 14 + .../js_type_metadata/js_syntax_error.json | 17 + .../js_termination_error.json | 17 + .../js_type_metadata/js_type_error.json | 17 + .../js_type_metadata/js_typed_array.json | 19 + .../js_type_metadata/js_uint16_array.json | 19 + .../js_type_metadata/js_uint32_array.json | 19 + .../js_type_metadata/js_uint8_array.json | 19 + .../js_uint8_clamped_array.json | 19 + ecmascript/js_type_metadata/js_uri_error.json | 17 + ecmascript/js_type_metadata/js_weak_map.json | 14 + ecmascript/js_type_metadata/js_weak_ref.json | 14 + ecmascript/js_type_metadata/js_weak_set.json | 14 + ecmascript/js_type_metadata/lexical_env.json | 8 + ecmascript/js_type_metadata/line_string.json | 8 + ecmascript/js_type_metadata/linked_node.json | 14 + .../local_exportentry_record.json | 19 + .../js_type_metadata/machine_code_object.json | 8 + ecmascript/js_type_metadata/marker_cell.json | 8 + ecmascript/js_type_metadata/method.json | 14 + .../js_type_metadata/micro_job_queue.json | 19 + .../js_type_metadata/module_record.json | 8 + .../js_type_metadata/mutant_tagged_array.json | 8 + .../native_module_failure_info.json | 14 + ecmascript/js_type_metadata/pending_job.json | 19 + .../js_type_metadata/profile_type_info.json | 8 + .../profile_type_info_cell_0.json | 24 + .../profile_type_info_cell_1.json | 24 + .../profile_type_info_cell_n.json | 24 + ecmascript/js_type_metadata/program.json | 14 + .../js_type_metadata/promise_capability.json | 24 + .../promise_iterator_record.json | 14 + .../js_type_metadata/promise_reactions.json | 19 + .../js_type_metadata/promise_record.json | 14 + ecmascript/js_type_metadata/property_box.json | 14 + .../js_type_metadata/proto_change_marker.json | 8 + .../js_type_metadata/prototype_handler.json | 29 + .../js_type_metadata/prototype_info.json | 14 + ecmascript/js_type_metadata/rb_treenode.json | 24 + ecmascript/js_type_metadata/record.json | 8 + .../resolvedbinding_record.json | 19 + .../resolvedindexbinding_record.json | 19 + .../resolvedrecordbinding_record.json | 19 + .../resolvedrecordindexbinding_record.json | 19 + .../resolving_functions_record.json | 19 + ecmascript/js_type_metadata/sendable_env.json | 8 + .../js_type_metadata/sliced_string.json | 14 + .../source_text_module_record.json | 69 + .../star_exportentry_record.json | 14 + .../js_type_metadata/store_ts_handler.json | 24 + ecmascript/js_type_metadata/symbol.json | 14 + ecmascript/js_type_metadata/tagged_array.json | 20 + .../js_type_metadata/tagged_dictionary.json | 1 + ecmascript/js_type_metadata/tagged_node.json | 24 + .../js_type_metadata/tagged_object.json | 1 + ecmascript/js_type_metadata/template_map.json | 1 + ecmascript/js_type_metadata/track_info.json | 19 + .../trans_with_proto_handler.json | 24 + .../js_type_metadata/transition_handler.json | 19 + ecmascript/js_type_metadata/tree_string.json | 19 + ecmascript/js_type_metadata/type_enums.json | 217 + ecmascript/js_type_metadata/type_range.json | 6 + ecmascript/js_type_metadata/vtable.json | 1 + script/metadata_copy_for_test.py | 48 + script/metadata_generate.py | 86 + test/resource/js_runtime/ohos_test.xml | 222 + 223 files changed, 8870 insertions(+) create mode 100644 ecmascript/dfx/hprof/tests/js_metadata_test.cpp create mode 100644 ecmascript/js_type_metadata/accessor_data.json create mode 100644 ecmascript/js_type_metadata/aot_literal_info.json create mode 100644 ecmascript/js_type_metadata/async_generator_request.json create mode 100644 ecmascript/js_type_metadata/async_iterator_record.json create mode 100644 ecmascript/js_type_metadata/bigint.json create mode 100644 ecmascript/js_type_metadata/byte_array.json create mode 100644 ecmascript/js_type_metadata/cell_record.json create mode 100644 ecmascript/js_type_metadata/class_info_extractor.json create mode 100644 ecmascript/js_type_metadata/class_literal.json create mode 100644 ecmascript/js_type_metadata/completion_record.json create mode 100644 ecmascript/js_type_metadata/constant_pool.json create mode 100644 ecmascript/js_type_metadata/constant_string.json create mode 100644 ecmascript/js_type_metadata/cow_mutant_tagged_array.json create mode 100644 ecmascript/js_type_metadata/cow_tagged_array.json create mode 100644 ecmascript/js_type_metadata/dictionary_layout.json create mode 100644 ecmascript/js_type_metadata/ecma_object.json create mode 100644 ecmascript/js_type_metadata/ecma_string.json create mode 100644 ecmascript/js_type_metadata/extra_profile_type_info.json create mode 100644 ecmascript/js_type_metadata/function_template.json create mode 100644 ecmascript/js_type_metadata/global_env.json create mode 100644 ecmascript/js_type_metadata/hclass.json create mode 100644 ecmascript/js_type_metadata/importentry_record.json create mode 100644 ecmascript/js_type_metadata/indirect_exportentry_record.json create mode 100644 ecmascript/js_type_metadata/internal_accessor.json create mode 100644 ecmascript/js_type_metadata/js_aggregate_error.json create mode 100644 ecmascript/js_type_metadata/js_api_array_list.json create mode 100644 ecmascript/js_type_metadata/js_api_arraylist_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_bitvector.json create mode 100644 ecmascript/js_type_metadata/js_api_bitvector_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_deque.json create mode 100644 ecmascript/js_type_metadata/js_api_deque_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_hash_map.json create mode 100644 ecmascript/js_type_metadata/js_api_hash_set.json create mode 100644 ecmascript/js_type_metadata/js_api_hashmap_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_hashset_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_light_weight_map.json create mode 100644 ecmascript/js_type_metadata/js_api_light_weight_map_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_light_weight_set.json create mode 100644 ecmascript/js_type_metadata/js_api_light_weight_set_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_linked_list.json create mode 100644 ecmascript/js_type_metadata/js_api_linked_list_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_list.json create mode 100644 ecmascript/js_type_metadata/js_api_list_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_plain_array.json create mode 100644 ecmascript/js_type_metadata/js_api_plain_array_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_queue.json create mode 100644 ecmascript/js_type_metadata/js_api_queue_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_stack.json create mode 100644 ecmascript/js_type_metadata/js_api_stack_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_tree_map.json create mode 100644 ecmascript/js_type_metadata/js_api_tree_set.json create mode 100644 ecmascript/js_type_metadata/js_api_treemap_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_treeset_iterator.json create mode 100644 ecmascript/js_type_metadata/js_api_vector.json create mode 100644 ecmascript/js_type_metadata/js_api_vector_iterator.json create mode 100644 ecmascript/js_type_metadata/js_arguments.json create mode 100644 ecmascript/js_type_metadata/js_array.json create mode 100644 ecmascript/js_type_metadata/js_array_buffer.json create mode 100644 ecmascript/js_type_metadata/js_array_iterator.json create mode 100644 ecmascript/js_type_metadata/js_async_await_status_function.json create mode 100644 ecmascript/js_type_metadata/js_async_from_sync_iter_unwarp_function.json create mode 100644 ecmascript/js_type_metadata/js_async_from_sync_iterator.json create mode 100644 ecmascript/js_type_metadata/js_async_func_object.json create mode 100644 ecmascript/js_type_metadata/js_async_function.json create mode 100644 ecmascript/js_type_metadata/js_async_generator_function.json create mode 100644 ecmascript/js_type_metadata/js_async_generator_object.json create mode 100644 ecmascript/js_type_metadata/js_async_generator_resume_next_return_processor_rst_ftn.json create mode 100644 ecmascript/js_type_metadata/js_async_module_fulfilled_function.json create mode 100644 ecmascript/js_type_metadata/js_async_module_rejected_function.json create mode 100644 ecmascript/js_type_metadata/js_asynciterator.json create mode 100644 ecmascript/js_type_metadata/js_bigint64_array.json create mode 100644 ecmascript/js_type_metadata/js_biguint64_array.json create mode 100644 ecmascript/js_type_metadata/js_bound_function.json create mode 100644 ecmascript/js_type_metadata/js_cjs_exports.json create mode 100644 ecmascript/js_type_metadata/js_cjs_module.json create mode 100644 ecmascript/js_type_metadata/js_cjs_require.json create mode 100644 ecmascript/js_type_metadata/js_collator.json create mode 100644 ecmascript/js_type_metadata/js_data_view.json create mode 100644 ecmascript/js_type_metadata/js_date.json create mode 100644 ecmascript/js_type_metadata/js_date_time_format.json create mode 100644 ecmascript/js_type_metadata/js_displaynames.json create mode 100644 ecmascript/js_type_metadata/js_error.json create mode 100644 ecmascript/js_type_metadata/js_eval_error.json create mode 100644 ecmascript/js_type_metadata/js_finalization_registry.json create mode 100644 ecmascript/js_type_metadata/js_float32_array.json create mode 100644 ecmascript/js_type_metadata/js_float64_array.json create mode 100644 ecmascript/js_type_metadata/js_forin_iterator.json create mode 100644 ecmascript/js_type_metadata/js_function.json create mode 100644 ecmascript/js_type_metadata/js_function_base.json create mode 100644 ecmascript/js_type_metadata/js_generator_context.json create mode 100644 ecmascript/js_type_metadata/js_generator_function.json create mode 100644 ecmascript/js_type_metadata/js_generator_object.json create mode 100644 ecmascript/js_type_metadata/js_global_object.json create mode 100644 ecmascript/js_type_metadata/js_int16_array.json create mode 100644 ecmascript/js_type_metadata/js_int32_array.json create mode 100644 ecmascript/js_type_metadata/js_int8_array.json create mode 100644 ecmascript/js_type_metadata/js_intl.json create mode 100644 ecmascript/js_type_metadata/js_intl_bound_function.json create mode 100644 ecmascript/js_type_metadata/js_iterator.json create mode 100644 ecmascript/js_type_metadata/js_list_format.json create mode 100644 ecmascript/js_type_metadata/js_locale.json create mode 100644 ecmascript/js_type_metadata/js_map.json create mode 100644 ecmascript/js_type_metadata/js_map_iterator.json create mode 100644 ecmascript/js_type_metadata/js_module_namespace.json create mode 100644 ecmascript/js_type_metadata/js_native_pointer.json create mode 100644 ecmascript/js_type_metadata/js_number_format.json create mode 100644 ecmascript/js_type_metadata/js_object.json create mode 100644 ecmascript/js_type_metadata/js_oom_error.json create mode 100644 ecmascript/js_type_metadata/js_plural_rules.json create mode 100644 ecmascript/js_type_metadata/js_primitive_ref.json create mode 100644 ecmascript/js_type_metadata/js_promise.json create mode 100644 ecmascript/js_type_metadata/js_promise_all_resolve_element_function.json create mode 100644 ecmascript/js_type_metadata/js_promise_all_settled_element_function.json create mode 100644 ecmascript/js_type_metadata/js_promise_any_reject_element_function.json create mode 100644 ecmascript/js_type_metadata/js_promise_executor_function.json create mode 100644 ecmascript/js_type_metadata/js_promise_finally_function.json create mode 100644 ecmascript/js_type_metadata/js_promise_reactions_function.json create mode 100644 ecmascript/js_type_metadata/js_promise_value_thunk_or_thrower_function.json create mode 100644 ecmascript/js_type_metadata/js_proxy.json create mode 100644 ecmascript/js_type_metadata/js_proxy_revoc_function.json create mode 100644 ecmascript/js_type_metadata/js_range_error.json create mode 100644 ecmascript/js_type_metadata/js_realm.json create mode 100644 ecmascript/js_type_metadata/js_reference_error.json create mode 100644 ecmascript/js_type_metadata/js_reg_exp.json create mode 100644 ecmascript/js_type_metadata/js_reg_exp_iterator.json create mode 100644 ecmascript/js_type_metadata/js_relative_time_format.json create mode 100644 ecmascript/js_type_metadata/js_segment_iterator.json create mode 100644 ecmascript/js_type_metadata/js_segmenter.json create mode 100644 ecmascript/js_type_metadata/js_segments.json create mode 100644 ecmascript/js_type_metadata/js_sendable_array_buffer.json create mode 100644 ecmascript/js_type_metadata/js_set.json create mode 100644 ecmascript/js_type_metadata/js_set_iterator.json create mode 100644 ecmascript/js_type_metadata/js_shared_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_array_buffer.json create mode 100644 ecmascript/js_type_metadata/js_shared_array_iterator.json create mode 100644 ecmascript/js_type_metadata/js_shared_async_function.json create mode 100644 ecmascript/js_type_metadata/js_shared_bigint64_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_biguint64_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_float32_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_float64_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_function.json create mode 100644 ecmascript/js_type_metadata/js_shared_int16_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_int32_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_int8_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_map.json create mode 100644 ecmascript/js_type_metadata/js_shared_map_iterator.json create mode 100644 ecmascript/js_type_metadata/js_shared_object.json create mode 100644 ecmascript/js_type_metadata/js_shared_set.json create mode 100644 ecmascript/js_type_metadata/js_shared_set_iterator.json create mode 100644 ecmascript/js_type_metadata/js_shared_typed_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_uint16_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_uint32_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_uint8_array.json create mode 100644 ecmascript/js_type_metadata/js_shared_uint8_clamped_array.json create mode 100644 ecmascript/js_type_metadata/js_string_iterator.json create mode 100644 ecmascript/js_type_metadata/js_syntax_error.json create mode 100644 ecmascript/js_type_metadata/js_termination_error.json create mode 100644 ecmascript/js_type_metadata/js_type_error.json create mode 100644 ecmascript/js_type_metadata/js_typed_array.json create mode 100644 ecmascript/js_type_metadata/js_uint16_array.json create mode 100644 ecmascript/js_type_metadata/js_uint32_array.json create mode 100644 ecmascript/js_type_metadata/js_uint8_array.json create mode 100644 ecmascript/js_type_metadata/js_uint8_clamped_array.json create mode 100644 ecmascript/js_type_metadata/js_uri_error.json create mode 100644 ecmascript/js_type_metadata/js_weak_map.json create mode 100644 ecmascript/js_type_metadata/js_weak_ref.json create mode 100644 ecmascript/js_type_metadata/js_weak_set.json create mode 100644 ecmascript/js_type_metadata/lexical_env.json create mode 100644 ecmascript/js_type_metadata/line_string.json create mode 100644 ecmascript/js_type_metadata/linked_node.json create mode 100644 ecmascript/js_type_metadata/local_exportentry_record.json create mode 100644 ecmascript/js_type_metadata/machine_code_object.json create mode 100644 ecmascript/js_type_metadata/marker_cell.json create mode 100644 ecmascript/js_type_metadata/method.json create mode 100644 ecmascript/js_type_metadata/micro_job_queue.json create mode 100644 ecmascript/js_type_metadata/module_record.json create mode 100644 ecmascript/js_type_metadata/mutant_tagged_array.json create mode 100644 ecmascript/js_type_metadata/native_module_failure_info.json create mode 100644 ecmascript/js_type_metadata/pending_job.json create mode 100644 ecmascript/js_type_metadata/profile_type_info.json create mode 100644 ecmascript/js_type_metadata/profile_type_info_cell_0.json create mode 100644 ecmascript/js_type_metadata/profile_type_info_cell_1.json create mode 100644 ecmascript/js_type_metadata/profile_type_info_cell_n.json create mode 100644 ecmascript/js_type_metadata/program.json create mode 100644 ecmascript/js_type_metadata/promise_capability.json create mode 100644 ecmascript/js_type_metadata/promise_iterator_record.json create mode 100644 ecmascript/js_type_metadata/promise_reactions.json create mode 100644 ecmascript/js_type_metadata/promise_record.json create mode 100644 ecmascript/js_type_metadata/property_box.json create mode 100644 ecmascript/js_type_metadata/proto_change_marker.json create mode 100644 ecmascript/js_type_metadata/prototype_handler.json create mode 100644 ecmascript/js_type_metadata/prototype_info.json create mode 100644 ecmascript/js_type_metadata/rb_treenode.json create mode 100644 ecmascript/js_type_metadata/record.json create mode 100644 ecmascript/js_type_metadata/resolvedbinding_record.json create mode 100644 ecmascript/js_type_metadata/resolvedindexbinding_record.json create mode 100644 ecmascript/js_type_metadata/resolvedrecordbinding_record.json create mode 100644 ecmascript/js_type_metadata/resolvedrecordindexbinding_record.json create mode 100644 ecmascript/js_type_metadata/resolving_functions_record.json create mode 100644 ecmascript/js_type_metadata/sendable_env.json create mode 100644 ecmascript/js_type_metadata/sliced_string.json create mode 100644 ecmascript/js_type_metadata/source_text_module_record.json create mode 100644 ecmascript/js_type_metadata/star_exportentry_record.json create mode 100644 ecmascript/js_type_metadata/store_ts_handler.json create mode 100644 ecmascript/js_type_metadata/symbol.json create mode 100644 ecmascript/js_type_metadata/tagged_array.json create mode 100644 ecmascript/js_type_metadata/tagged_dictionary.json create mode 100644 ecmascript/js_type_metadata/tagged_node.json create mode 100644 ecmascript/js_type_metadata/tagged_object.json create mode 100644 ecmascript/js_type_metadata/template_map.json create mode 100644 ecmascript/js_type_metadata/track_info.json create mode 100644 ecmascript/js_type_metadata/trans_with_proto_handler.json create mode 100644 ecmascript/js_type_metadata/transition_handler.json create mode 100644 ecmascript/js_type_metadata/tree_string.json create mode 100644 ecmascript/js_type_metadata/type_enums.json create mode 100644 ecmascript/js_type_metadata/type_range.json create mode 100644 ecmascript/js_type_metadata/vtable.json create mode 100755 script/metadata_copy_for_test.py create mode 100755 script/metadata_generate.py diff --git a/BUILD.gn b/BUILD.gn index 7503dc8780..6eeda376a9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -19,6 +19,7 @@ group("ark_js_packages") { deps = [] deps += [ + ":js_type_metadata", ":libark_jsruntime", "ecmascript/compiler:stub.an", "ecmascript/dfx/hprof:ark_js_heap_snapshot_tool", @@ -1385,3 +1386,253 @@ ohos_prebuilt_etc("app_aot_jit_enable_list") { part_name = "ets_runtime" subsystem_name = "arkcompiler" } + +js_type_metadata_sources = [ + "ecmascript/js_type_metadata/accessor_data.json", + "ecmascript/js_type_metadata/aot_literal_info.json", + "ecmascript/js_type_metadata/async_generator_request.json", + "ecmascript/js_type_metadata/async_iterator_record.json", + "ecmascript/js_type_metadata/bigint.json", + "ecmascript/js_type_metadata/byte_array.json", + "ecmascript/js_type_metadata/cell_record.json", + "ecmascript/js_type_metadata/class_info_extractor.json", + "ecmascript/js_type_metadata/class_literal.json", + "ecmascript/js_type_metadata/completion_record.json", + "ecmascript/js_type_metadata/constant_pool.json", + "ecmascript/js_type_metadata/constant_string.json", + "ecmascript/js_type_metadata/cow_mutant_tagged_array.json", + "ecmascript/js_type_metadata/cow_tagged_array.json", + "ecmascript/js_type_metadata/dictionary_layout.json", + "ecmascript/js_type_metadata/ecma_object.json", + "ecmascript/js_type_metadata/ecma_string.json", + "ecmascript/js_type_metadata/extra_profile_type_info.json", + "ecmascript/js_type_metadata/function_template.json", + "ecmascript/js_type_metadata/global_env.json", + "ecmascript/js_type_metadata/hclass.json", + "ecmascript/js_type_metadata/importentry_record.json", + "ecmascript/js_type_metadata/indirect_exportentry_record.json", + "ecmascript/js_type_metadata/internal_accessor.json", + "ecmascript/js_type_metadata/js_aggregate_error.json", + "ecmascript/js_type_metadata/js_api_array_list.json", + "ecmascript/js_type_metadata/js_api_arraylist_iterator.json", + "ecmascript/js_type_metadata/js_api_bitvector.json", + "ecmascript/js_type_metadata/js_api_bitvector_iterator.json", + "ecmascript/js_type_metadata/js_api_deque.json", + "ecmascript/js_type_metadata/js_api_deque_iterator.json", + "ecmascript/js_type_metadata/js_api_hash_map.json", + "ecmascript/js_type_metadata/js_api_hash_set.json", + "ecmascript/js_type_metadata/js_api_hashmap_iterator.json", + "ecmascript/js_type_metadata/js_api_hashset_iterator.json", + "ecmascript/js_type_metadata/js_api_light_weight_map.json", + "ecmascript/js_type_metadata/js_api_light_weight_map_iterator.json", + "ecmascript/js_type_metadata/js_api_light_weight_set.json", + "ecmascript/js_type_metadata/js_api_light_weight_set_iterator.json", + "ecmascript/js_type_metadata/js_api_linked_list.json", + "ecmascript/js_type_metadata/js_api_linked_list_iterator.json", + "ecmascript/js_type_metadata/js_api_list.json", + "ecmascript/js_type_metadata/js_api_list_iterator.json", + "ecmascript/js_type_metadata/js_api_plain_array.json", + "ecmascript/js_type_metadata/js_api_plain_array_iterator.json", + "ecmascript/js_type_metadata/js_api_queue.json", + "ecmascript/js_type_metadata/js_api_queue_iterator.json", + "ecmascript/js_type_metadata/js_api_stack.json", + "ecmascript/js_type_metadata/js_api_stack_iterator.json", + "ecmascript/js_type_metadata/js_api_tree_map.json", + "ecmascript/js_type_metadata/js_api_tree_set.json", + "ecmascript/js_type_metadata/js_api_treemap_iterator.json", + "ecmascript/js_type_metadata/js_api_treeset_iterator.json", + "ecmascript/js_type_metadata/js_api_vector.json", + "ecmascript/js_type_metadata/js_api_vector_iterator.json", + "ecmascript/js_type_metadata/js_arguments.json", + "ecmascript/js_type_metadata/js_array.json", + "ecmascript/js_type_metadata/js_array_buffer.json", + "ecmascript/js_type_metadata/js_array_iterator.json", + "ecmascript/js_type_metadata/js_async_await_status_function.json", + "ecmascript/js_type_metadata/js_async_from_sync_iter_unwarp_function.json", + "ecmascript/js_type_metadata/js_async_from_sync_iterator.json", + "ecmascript/js_type_metadata/js_async_func_object.json", + "ecmascript/js_type_metadata/js_async_function.json", + "ecmascript/js_type_metadata/js_async_generator_function.json", + "ecmascript/js_type_metadata/js_async_generator_object.json", + "ecmascript/js_type_metadata/js_async_generator_resume_next_return_processor_rst_ftn.json", + "ecmascript/js_type_metadata/js_async_module_fulfilled_function.json", + "ecmascript/js_type_metadata/js_async_module_rejected_function.json", + "ecmascript/js_type_metadata/js_asynciterator.json", + "ecmascript/js_type_metadata/js_bigint64_array.json", + "ecmascript/js_type_metadata/js_biguint64_array.json", + "ecmascript/js_type_metadata/js_bound_function.json", + "ecmascript/js_type_metadata/js_cjs_exports.json", + "ecmascript/js_type_metadata/js_cjs_module.json", + "ecmascript/js_type_metadata/js_cjs_require.json", + "ecmascript/js_type_metadata/js_collator.json", + "ecmascript/js_type_metadata/js_data_view.json", + "ecmascript/js_type_metadata/js_date.json", + "ecmascript/js_type_metadata/js_date_time_format.json", + "ecmascript/js_type_metadata/js_displaynames.json", + "ecmascript/js_type_metadata/js_error.json", + "ecmascript/js_type_metadata/js_eval_error.json", + "ecmascript/js_type_metadata/js_finalization_registry.json", + "ecmascript/js_type_metadata/js_float32_array.json", + "ecmascript/js_type_metadata/js_float64_array.json", + "ecmascript/js_type_metadata/js_forin_iterator.json", + "ecmascript/js_type_metadata/js_function.json", + "ecmascript/js_type_metadata/js_function_base.json", + "ecmascript/js_type_metadata/js_generator_context.json", + "ecmascript/js_type_metadata/js_generator_function.json", + "ecmascript/js_type_metadata/js_generator_object.json", + "ecmascript/js_type_metadata/js_global_object.json", + "ecmascript/js_type_metadata/js_int16_array.json", + "ecmascript/js_type_metadata/js_int32_array.json", + "ecmascript/js_type_metadata/js_int8_array.json", + "ecmascript/js_type_metadata/js_intl.json", + "ecmascript/js_type_metadata/js_intl_bound_function.json", + "ecmascript/js_type_metadata/js_iterator.json", + "ecmascript/js_type_metadata/js_list_format.json", + "ecmascript/js_type_metadata/js_locale.json", + "ecmascript/js_type_metadata/js_map.json", + "ecmascript/js_type_metadata/js_map_iterator.json", + "ecmascript/js_type_metadata/js_module_namespace.json", + "ecmascript/js_type_metadata/js_native_pointer.json", + "ecmascript/js_type_metadata/js_number_format.json", + "ecmascript/js_type_metadata/js_object.json", + "ecmascript/js_type_metadata/js_oom_error.json", + "ecmascript/js_type_metadata/js_plural_rules.json", + "ecmascript/js_type_metadata/js_primitive_ref.json", + "ecmascript/js_type_metadata/js_promise.json", + "ecmascript/js_type_metadata/js_promise_all_resolve_element_function.json", + "ecmascript/js_type_metadata/js_promise_all_settled_element_function.json", + "ecmascript/js_type_metadata/js_promise_any_reject_element_function.json", + "ecmascript/js_type_metadata/js_promise_executor_function.json", + "ecmascript/js_type_metadata/js_promise_finally_function.json", + "ecmascript/js_type_metadata/js_promise_reactions_function.json", + "ecmascript/js_type_metadata/js_promise_value_thunk_or_thrower_function.json", + "ecmascript/js_type_metadata/js_proxy.json", + "ecmascript/js_type_metadata/js_proxy_revoc_function.json", + "ecmascript/js_type_metadata/js_range_error.json", + "ecmascript/js_type_metadata/js_realm.json", + "ecmascript/js_type_metadata/js_reference_error.json", + "ecmascript/js_type_metadata/js_reg_exp.json", + "ecmascript/js_type_metadata/js_reg_exp_iterator.json", + "ecmascript/js_type_metadata/js_relative_time_format.json", + "ecmascript/js_type_metadata/js_segment_iterator.json", + "ecmascript/js_type_metadata/js_segmenter.json", + "ecmascript/js_type_metadata/js_segments.json", + "ecmascript/js_type_metadata/js_sendable_array_buffer.json", + "ecmascript/js_type_metadata/js_set.json", + "ecmascript/js_type_metadata/js_set_iterator.json", + "ecmascript/js_type_metadata/js_shared_array.json", + "ecmascript/js_type_metadata/js_shared_array_buffer.json", + "ecmascript/js_type_metadata/js_shared_array_iterator.json", + "ecmascript/js_type_metadata/js_shared_async_function.json", + "ecmascript/js_type_metadata/js_shared_bigint64_array.json", + "ecmascript/js_type_metadata/js_shared_biguint64_array.json", + "ecmascript/js_type_metadata/js_shared_float32_array.json", + "ecmascript/js_type_metadata/js_shared_float64_array.json", + "ecmascript/js_type_metadata/js_shared_function.json", + "ecmascript/js_type_metadata/js_shared_int16_array.json", + "ecmascript/js_type_metadata/js_shared_int32_array.json", + "ecmascript/js_type_metadata/js_shared_int8_array.json", + "ecmascript/js_type_metadata/js_shared_map.json", + "ecmascript/js_type_metadata/js_shared_map_iterator.json", + "ecmascript/js_type_metadata/js_shared_object.json", + "ecmascript/js_type_metadata/js_shared_set.json", + "ecmascript/js_type_metadata/js_shared_set_iterator.json", + "ecmascript/js_type_metadata/js_shared_typed_array.json", + "ecmascript/js_type_metadata/js_shared_uint16_array.json", + "ecmascript/js_type_metadata/js_shared_uint32_array.json", + "ecmascript/js_type_metadata/js_shared_uint8_array.json", + "ecmascript/js_type_metadata/js_shared_uint8_clamped_array.json", + "ecmascript/js_type_metadata/js_string_iterator.json", + "ecmascript/js_type_metadata/js_syntax_error.json", + "ecmascript/js_type_metadata/js_termination_error.json", + "ecmascript/js_type_metadata/js_type_error.json", + "ecmascript/js_type_metadata/js_typed_array.json", + "ecmascript/js_type_metadata/js_uint16_array.json", + "ecmascript/js_type_metadata/js_uint32_array.json", + "ecmascript/js_type_metadata/js_uint8_array.json", + "ecmascript/js_type_metadata/js_uint8_clamped_array.json", + "ecmascript/js_type_metadata/js_uri_error.json", + "ecmascript/js_type_metadata/js_weak_map.json", + "ecmascript/js_type_metadata/js_weak_ref.json", + "ecmascript/js_type_metadata/js_weak_set.json", + "ecmascript/js_type_metadata/lexical_env.json", + "ecmascript/js_type_metadata/line_string.json", + "ecmascript/js_type_metadata/linked_node.json", + "ecmascript/js_type_metadata/local_exportentry_record.json", + "ecmascript/js_type_metadata/machine_code_object.json", + "ecmascript/js_type_metadata/marker_cell.json", + "ecmascript/js_type_metadata/method.json", + "ecmascript/js_type_metadata/micro_job_queue.json", + "ecmascript/js_type_metadata/module_record.json", + "ecmascript/js_type_metadata/mutant_tagged_array.json", + "ecmascript/js_type_metadata/native_module_failure_info.json", + "ecmascript/js_type_metadata/pending_job.json", + "ecmascript/js_type_metadata/profile_type_info.json", + "ecmascript/js_type_metadata/profile_type_info_cell_0.json", + "ecmascript/js_type_metadata/profile_type_info_cell_1.json", + "ecmascript/js_type_metadata/profile_type_info_cell_n.json", + "ecmascript/js_type_metadata/program.json", + "ecmascript/js_type_metadata/promise_capability.json", + "ecmascript/js_type_metadata/promise_iterator_record.json", + "ecmascript/js_type_metadata/promise_reactions.json", + "ecmascript/js_type_metadata/promise_record.json", + "ecmascript/js_type_metadata/property_box.json", + "ecmascript/js_type_metadata/proto_change_marker.json", + "ecmascript/js_type_metadata/prototype_handler.json", + "ecmascript/js_type_metadata/prototype_info.json", + "ecmascript/js_type_metadata/rb_treenode.json", + "ecmascript/js_type_metadata/record.json", + "ecmascript/js_type_metadata/resolvedbinding_record.json", + "ecmascript/js_type_metadata/resolvedindexbinding_record.json", + "ecmascript/js_type_metadata/resolvedrecordbinding_record.json", + "ecmascript/js_type_metadata/resolvedrecordindexbinding_record.json", + "ecmascript/js_type_metadata/resolving_functions_record.json", + "ecmascript/js_type_metadata/sendable_env.json", + "ecmascript/js_type_metadata/sliced_string.json", + "ecmascript/js_type_metadata/source_text_module_record.json", + "ecmascript/js_type_metadata/star_exportentry_record.json", + "ecmascript/js_type_metadata/store_ts_handler.json", + "ecmascript/js_type_metadata/symbol.json", + "ecmascript/js_type_metadata/tagged_array.json", + "ecmascript/js_type_metadata/tagged_dictionary.json", + "ecmascript/js_type_metadata/tagged_node.json", + "ecmascript/js_type_metadata/tagged_object.json", + "ecmascript/js_type_metadata/template_map.json", + "ecmascript/js_type_metadata/track_info.json", + "ecmascript/js_type_metadata/trans_with_proto_handler.json", + "ecmascript/js_type_metadata/transition_handler.json", + "ecmascript/js_type_metadata/tree_string.json", + "ecmascript/js_type_metadata/type_enums.json", + "ecmascript/js_type_metadata/type_range.json", + "ecmascript/js_type_metadata/vtable.json", +] + +action("gen_js_type_metadata") { + inputs = js_type_metadata_sources + + script = "$js_root/script/metadata_generate.py" + + metadata_file_gen_dir = "$root_gen_dir/arkcompiler/ets_runtime" + + args = [ + "--enum", + rebase_path("$js_root/ecmascript/js_type_metadata/type_enums.json"), + "--metadata", + rebase_path("$js_root/ecmascript/js_type_metadata"), + "--output", + rebase_path("$metadata_file_gen_dir/metadata.json"), + "--version", + "1.0.0", + ] + + outputs = [ "$metadata_file_gen_dir/metadata.json" ] +} + +ohos_prebuilt_shared_library("js_type_metadata") { + deps = [ ":gen_js_type_metadata" ] + source = "$root_gen_dir/arkcompiler/ets_runtime/metadata.json" + + relative_install_dir = arkcompiler_relative_lib_path + part_name = "ets_runtime" + subsystem_name = "arkcompiler" +} diff --git a/ecmascript/dfx/hprof/tests/BUILD.gn b/ecmascript/dfx/hprof/tests/BUILD.gn index 27b8c119c1..2e05ddd4ce 100644 --- a/ecmascript/dfx/hprof/tests/BUILD.gn +++ b/ecmascript/dfx/hprof/tests/BUILD.gn @@ -16,6 +16,8 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") module_output_path = "arkcompiler/ets_runtime" +metadata_file_path = "//arkcompiler/ets_runtime/ecmascript/js_type_metadata/" + test_js_path = "//arkcompiler/ets_runtime/ecmascript/dfx/hprof/tests/js_files/" test_js_files = [ @@ -228,6 +230,49 @@ host_unittest_action("HeapSamplingTest") { deps += hiviewdfx_deps } +action("copy_metadata_for_test") { + script = "$js_root/script/metadata_copy_for_test.py" + + target_path = rebase_path(target_out_dir) + "/metadata/" + + args = [ + "--metadata", + rebase_path("$js_root/ecmascript/js_type_metadata"), + "--outputs", + rebase_path("$target_path"), + ] + + outputs = [ "$root_gen_dir/arkcompiler/ets_runtime/metadata_copy_dummy.txt" ] +} + +host_unittest_action("JSMetadataTest") { + module_out_path = module_output_path + + sources = [ "js_metadata_test.cpp" ] + + configs = [ "../../../../:ecma_test_config" ] + + deps = [ + ":copy_metadata_for_test", + "$ark_third_party_root/icu/icu4c:shared_icui18n", + "$ark_third_party_root/icu/icu4c:shared_icuuc", + "../../../../:libark_jsruntime_test", + sdk_libc_secshared_dep, + ] + + if (is_ohos && is_standard_system) { + metadata_file_path = "/data/test/" + } + + metadata_file_path = rebase_path(metadata_file_path) + defines = [ "METADATA_SOURCE_FILE_DIR=\"${metadata_file_path}\"" ] + + # hiviewdfx libraries + external_deps = hiviewdfx_ext_deps + external_deps += [ "cJSON:cjson_static" ] + deps += hiviewdfx_deps +} + group("unittest") { testonly = true deps = [ @@ -238,6 +283,7 @@ group("unittest") { ":HeapTrackerFirstTest", ":HeapTrackerSecondTest", ":HeapTrackerThirdTest", + ":JSMetadataTest", ] } @@ -251,6 +297,7 @@ group("host_unittest") { ":HeapTrackerFirstTestAction", ":HeapTrackerSecondTestAction", ":HeapTrackerThirdTestAction", + ":JSMetadataTestAction", ] if (is_mac) { deps -= [ @@ -261,6 +308,7 @@ group("host_unittest") { ":HeapTrackerFirstTestAction", ":HeapTrackerSecondTestAction", ":HeapTrackerThirdTestAction", + ":JSMetadataTestAction", ] } } diff --git a/ecmascript/dfx/hprof/tests/js_metadata_test.cpp b/ecmascript/dfx/hprof/tests/js_metadata_test.cpp new file mode 100644 index 0000000000..5793ec8060 --- /dev/null +++ b/ecmascript/dfx/hprof/tests/js_metadata_test.cpp @@ -0,0 +1,4483 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "ecmascript/byte_array.h" +#include "ecmascript/dfx/native_module_failure_info.h" +#include "ecmascript/ic/ic_handler.h" +#include "ecmascript/ic/profile_type_info.h" +#include "ecmascript/ic/proto_change_details.h" +#include "ecmascript/jobs/micro_job_queue.h" +#include "ecmascript/jobs/pending_job.h" +#include "ecmascript/js_native_pointer.h" +#include "ecmascript/js_object.h" +#include "ecmascript/js_tagged_value.h" +#include "ecmascript/js_arraybuffer.h" +#include "ecmascript/js_array_iterator.h" +#include "ecmascript/js_async_function.h" +#include "ecmascript/js_async_from_sync_iterator.h" +#include "ecmascript/js_async_generator_object.h" +#include "ecmascript/js_iterator.h" +#include "ecmascript/js_finalization_registry.h" +#include "ecmascript/js_api/js_api_arraylist_iterator.h" +#include "ecmascript/js_api/js_api_arraylist.h" +#include "ecmascript/js_api/js_api_bitvector.h" +#include "ecmascript/js_api/js_api_bitvector_iterator.h" +#include "ecmascript/js_api/js_api_deque.h" +#include "ecmascript/js_api/js_api_deque_iterator.h" +#include "ecmascript/js_api/js_api_hashmap.h" +#include "ecmascript/js_api/js_api_hashmap_iterator.h" +#include "ecmascript/js_api/js_api_hashset.h" +#include "ecmascript/js_api/js_api_hashset_iterator.h" +#include "ecmascript/js_api/js_api_lightweightmap.h" +#include "ecmascript/js_api/js_api_lightweightmap_iterator.h" +#include "ecmascript/js_api/js_api_lightweightset.h" +#include "ecmascript/js_api/js_api_lightweightset_iterator.h" +#include "ecmascript/js_api/js_api_linked_list.h" +#include "ecmascript/js_api/js_api_linked_list_iterator.h" +#include "ecmascript/js_api/js_api_list.h" +#include "ecmascript/js_api/js_api_list_iterator.h" +#include "ecmascript/js_api/js_api_plain_array.h" +#include "ecmascript/js_api/js_api_plain_array_iterator.h" +#include "ecmascript/js_api/js_api_queue.h" +#include "ecmascript/js_api/js_api_queue_iterator.h" +#include "ecmascript/js_api/js_api_stack.h" +#include "ecmascript/js_api/js_api_stack_iterator.h" +#include "ecmascript/js_api/js_api_tree_map.h" +#include "ecmascript/js_api/js_api_tree_map_iterator.h" +#include "ecmascript/js_api/js_api_tree_set.h" +#include "ecmascript/js_api/js_api_tree_set_iterator.h" +#include "ecmascript/js_api/js_api_vector.h" +#include "ecmascript/js_api/js_api_vector_iterator.h" +#include "ecmascript/js_arguments.h" +#include "ecmascript/js_array.h" +#include "ecmascript/js_array_iterator.h" +#include "ecmascript/js_arraybuffer.h" +#include "ecmascript/js_async_function.h" +#include "ecmascript/js_async_generator_object.h" +#include "ecmascript/js_collator.h" +#include "ecmascript/js_dataview.h" +#include "ecmascript/js_date.h" +#include "ecmascript/js_date_time_format.h" +#include "ecmascript/js_for_in_iterator.h" +#include "ecmascript/js_finalization_registry.h" +#include "ecmascript/js_function.h" +#include "ecmascript/js_generator_object.h" +#include "ecmascript/js_hclass.h" +#include "ecmascript/js_intl.h" +#include "ecmascript/js_locale.h" +#include "ecmascript/js_map.h" +#include "ecmascript/js_map_iterator.h" +#include "ecmascript/js_number_format.h" +#include "ecmascript/js_object-inl.h" +#include "ecmascript/js_plural_rules.h" +#include "ecmascript/js_primitive_ref.h" +#include "ecmascript/js_promise.h" +#include "ecmascript/js_realm.h" +#include "ecmascript/js_regexp.h" +#include "ecmascript/js_regexp_iterator.h" +#include "ecmascript/js_relative_time_format.h" +#include "ecmascript/js_segmenter.h" +#include "ecmascript/js_segments.h" +#include "ecmascript/js_segment_iterator.h" +#include "ecmascript/js_set.h" +#include "ecmascript/js_displaynames.h" +#include "ecmascript/js_list_format.h" +#include "ecmascript/js_set_iterator.h" +#include "ecmascript/js_string_iterator.h" +#include "ecmascript/js_typed_array.h" +#include "ecmascript/js_weak_container.h" +#include "ecmascript/js_weak_ref.h" +#include "ecmascript/marker_cell.h" +#include "ecmascript/js_typed_array.h" +#include "ecmascript/jspandafile/class_info_extractor.h" +#include "ecmascript/jspandafile/class_literal.h" +#include "ecmascript/jspandafile/program_object.h" +#include "ecmascript/module/js_module_record.h" +#include "ecmascript/napi/include/jsnapi.h" +#include "ecmascript/object_factory.h" +#include "ecmascript/tests/test_helper.h" +#include "ecmascript/dfx/hprof/heap_profiler.h" +#include "ecmascript/global_env.h" +#include "ecmascript/require/js_cjs_module.h" +#include "ecmascript/require/js_cjs_require.h" +#include "ecmascript/require/js_cjs_exports.h" +#include "ecmascript/module/js_module_source_text.h" +#include "ecmascript/module/js_shared_module.h" +#include "ecmascript/shared_objects/js_shared_array.h" +#include "ecmascript/shared_objects/js_sendable_arraybuffer.h" +#include "ecmascript/shared_objects/js_shared_array_iterator.h" +#include "ecmascript/shared_objects/js_shared_map.h" +#include "ecmascript/shared_objects/js_shared_map_iterator.h" +#include "ecmascript/shared_objects/js_shared_set.h" +#include "ecmascript/shared_objects/js_shared_set_iterator.h" +#include "ecmascript/shared_objects/js_shared_typed_array.h" +#include "ecmascript/tagged_hash_table.h" +#include "gtest/gtest.h" +#include +#include +#include +#include +#include +#include "cJSON.h" + + +namespace panda::test { +using namespace panda::ecmascript; +using ArrayVisitor = const std::function; +class JSMetadataTest : public testing::Test { +public: + void SetUp() override + { + GTEST_LOG_(INFO) << "JSMetadataTest Setup"; + } + + void TearDown() override + { + GTEST_LOG_(INFO) << "JSMetadataTest TearDown"; + } +}; + +class JSMetadataTestHelper { +public: + explicit JSMetadataTestHelper() + { + // { typeName: [all fields' name of this type in the same order as declared in .h files + typeName] } + // typeName: Type name in JSType Enum + fieldNameTable_ = { + {JSType::HCLASS, { + "Proto", "Layout", "Transitions", "Parent", "ProtoChangeMarker", + "ProtoChangeDetails", "EnumCache", "ProfilerType", "BitField", "BitField1", "HCLASS"}}, + {JSType::ACCESSOR_DATA, {"Getter", "Setter", "ACCESSOR_DATA"}}, + {JSType::AOT_LITERAL_INFO, {"AOT_LITERAL_INFO"}}, + {JSType::ASYNC_GENERATOR_REQUEST, {"Completion", "Capability", "ASYNC_GENERATOR_REQUEST"}}, + {JSType::ASYNC_ITERATOR_RECORD, {"Iterator", "NextMethod", "ASYNC_ITERATOR_RECORD"}}, + {JSType::BIGINT, {"BIGINT"}}, + {JSType::BYTE_ARRAY, {"BYTE_ARRAY"}}, + {JSType::CELL_RECORD, {"WeakRefTarget", "HeldValue", "CELL_RECORD"}}, + {JSType::CLASS_INFO_EXTRACTOR, { + "NonStaticKeys", "NonStaticProperties", "NonStaticElements", "StaticKeys", + "StaticProperties", "StaticElements", + "ConstructorMethod", "CLASS_INFO_EXTRACTOR"}}, + {JSType::CLASS_LITERAL, {"Array", "CLASS_LITERAL"}}, + {JSType::COMPLETION_RECORD, {"Value", "COMPLETION_RECORD"}}, + {JSType::CONSTANT_POOL, {"CONSTANT_POOL"}}, + {JSType::CONSTANT_STRING, {"RelocatedData", "CONSTANT_STRING"}}, + {JSType::COW_MUTANT_TAGGED_ARRAY, {"COW_MUTANT_TAGGED_ARRAY"}}, + {JSType::COW_TAGGED_ARRAY, {"COW_TAGGED_ARRAY"}}, + {JSType::EXTRA_PROFILE_TYPE_INFO, {"ReceiverObject", "HolderObject", "EXTRA_PROFILE_TYPE_INFO"}}, + {JSType::FUNCTION_TEMPLATE, {"Method", "Module", "RawProfileTypeInfo", "FUNCTION_TEMPLATE"}}, + {JSType::GLOBAL_ENV, {"GLOBAL_ENV"}}, + {JSType::IMPORTENTRY_RECORD, {"ModuleRequest", "ImportName", "LocalName", "IMPORTENTRY_RECORD"}}, + {JSType::INDIRECT_EXPORTENTRY_RECORD, {"ExportName", "ModuleRequest", + "ImportName", "INDIRECT_EXPORTENTRY_RECORD"}}, + {JSType::INTERNAL_ACCESSOR, {"Getter", "Setter", "INTERNAL_ACCESSOR"}}, + {JSType::JS_AGGREGATE_ERROR, {"Properties", "Elements", "JS_AGGREGATE_ERROR"}}, + {JSType::JS_API_ARRAYLIST_ITERATOR, {"IteratedArrayList", "JS_API_ARRAYLIST_ITERATOR"}}, + {JSType::JS_API_ARRAY_LIST, {"Length", "JS_API_ARRAY_LIST"}}, + {JSType::JS_API_BITVECTOR, {"NativePointer", "JS_API_BITVECTOR"}}, + {JSType::JS_API_BITVECTOR_ITERATOR, {"IteratedBitVector", "JS_API_BITVECTOR_ITERATOR"}}, + {JSType::JS_API_DEQUE, {"JS_API_DEQUE"}}, + {JSType::JS_API_DEQUE_ITERATOR, {"IteratedDeque", "JS_API_DEQUE_ITERATOR"}}, + {JSType::JS_API_HASHMAP_ITERATOR, {"IteratedHashMap", "TaggedQueue", + "CurrentNodeResult", "JS_API_HASHMAP_ITERATOR"}}, + {JSType::JS_API_HASHSET_ITERATOR, {"IteratedHashSet", "TaggedQueue", + "CurrentNodeResult", "JS_API_HASHSET_ITERATOR"}}, + {JSType::JS_API_HASH_MAP, {"Table", "JS_API_HASH_MAP"}}, + {JSType::JS_API_HASH_SET, {"Table", "JS_API_HASH_SET"}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP, {"Hashes", "Keys", "Values", "JS_API_LIGHT_WEIGHT_MAP"}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP_ITERATOR, {"IteratedLightWeightMap", "JS_API_LIGHT_WEIGHT_MAP_ITERATOR"}}, + {JSType::JS_API_LIGHT_WEIGHT_SET, {"Hashes", "Values", "JS_API_LIGHT_WEIGHT_SET"}}, + {JSType::JS_API_LIGHT_WEIGHT_SET_ITERATOR, {"IteratedLightWeightSet", "JS_API_LIGHT_WEIGHT_SET_ITERATOR"}}, + {JSType::JS_API_LINKED_LIST, {"DoubleList", "JS_API_LINKED_LIST"}}, + {JSType::JS_API_LINKED_LIST_ITERATOR, {"IteratedLinkedList", "JS_API_LINKED_LIST_ITERATOR"}}, + {JSType::JS_API_LIST, {"SingleList", "JS_API_LIST"}}, + {JSType::JS_API_LIST_ITERATOR, {"IteratedList", "JS_API_LIST_ITERATOR"}}, + {JSType::JS_API_PLAIN_ARRAY, {"Keys", "Values", "JS_API_PLAIN_ARRAY"}}, + {JSType::JS_API_PLAIN_ARRAY_ITERATOR, {"IteratedPlainArray", "JS_API_PLAIN_ARRAY_ITERATOR"}}, + {JSType::JS_API_QUEUE, {"Length", "JS_API_QUEUE"}}, + {JSType::JS_API_QUEUE_ITERATOR, {"IteratedQueue", "JS_API_QUEUE_ITERATOR"}}, + {JSType::JS_API_STACK, {"JS_API_STACK"}}, + {JSType::JS_API_STACK_ITERATOR, {"IteratedStack", "JS_API_STACK_ITERATOR"}}, + {JSType::JS_API_TREEMAP_ITERATOR, {"IteratedMap", "Entries", "JS_API_TREEMAP_ITERATOR"}}, + {JSType::JS_API_TREESET_ITERATOR, {"IteratedSet", "Entries", "JS_API_TREESET_ITERATOR"}}, + {JSType::JS_API_TREE_MAP, {"TreeMap", "JS_API_TREE_MAP"}}, + {JSType::JS_API_TREE_SET, {"TreeSet", "JS_API_TREE_SET"}}, + {JSType::JS_API_VECTOR, {"JS_API_VECTOR"}}, + {JSType::JS_API_VECTOR_ITERATOR, {"IteratedVector", "JS_API_VECTOR_ITERATOR"}}, + {JSType::JS_ARGUMENTS, {"JS_ARGUMENTS"}}, + {JSType::JS_ARRAY, {"Length", "TrackInfo", "JS_ARRAY"}}, + {JSType::JS_ARRAY_BUFFER, {"ArrayBufferData", "JS_ARRAY_BUFFER"}}, + {JSType::JS_ARRAY_ITERATOR, {"IteratedArray", "JS_ARRAY_ITERATOR"}}, + {JSType::JS_ASYNCITERATOR, {"Properties", "Elements", "JS_ASYNCITERATOR"}}, + {JSType::JS_ASYNC_AWAIT_STATUS_FUNCTION, {"AsyncContext", "JS_ASYNC_AWAIT_STATUS_FUNCTION"}}, + {JSType::JS_ASYNC_FROM_SYNC_ITERATOR, {"SyncIteratorRecord", "JS_ASYNC_FROM_SYNC_ITERATOR"}}, + {JSType::JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION, {"Done", "JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION"}}, + {JSType::JS_ASYNC_FUNCTION, {"JS_ASYNC_FUNCTION"}}, + {JSType::JS_ASYNC_FUNC_OBJECT, {"Promise", "JS_ASYNC_FUNC_OBJECT"}}, + {JSType::JS_ASYNC_GENERATOR_FUNCTION, {"JS_ASYNC_GENERATOR_FUNCTION"}}, + {JSType::JS_ASYNC_GENERATOR_OBJECT, {"GeneratorContext", "AsyncGeneratorQueue", "GeneratorBrand", + "ResumeResult", "JS_ASYNC_GENERATOR_OBJECT"}}, + {JSType::JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN, { + "AsyncGeneratorObject", "JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN"}}, + {JSType::JS_ASYNC_MODULE_FULFILLED_FUNCTION, {"JS_ASYNC_MODULE_FULFILLED_FUNCTION"}}, + {JSType::JS_ASYNC_MODULE_REJECTED_FUNCTION, {"JS_ASYNC_MODULE_REJECTED_FUNCTION"}}, + {JSType::JS_BIGINT64_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_BIGINT64_ARRAY"}}, + {JSType::JS_BIGUINT64_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_BIGUINT64_ARRAY"}}, + {JSType::JS_BOUND_FUNCTION, {"BoundTarget", "BoundThis", "BoundArguments", "JS_BOUND_FUNCTION"}}, + {JSType::JS_CJS_EXPORTS, {"Exports", "JS_CJS_EXPORTS"}}, + {JSType::JS_CJS_MODULE, {"Id", "Path", "Exports", "Filename", "JS_CJS_MODULE"}}, + {JSType::JS_CJS_REQUIRE, {"Cache", "Parent", "JS_CJS_REQUIRE"}}, + {JSType::JS_COLLATOR, {"IcuFiled", "Locale", "Collation", "BoundCompare", "JS_COLLATOR"}}, + {JSType::JS_DATA_VIEW, {"DataView", "ViewedArrayBuffer", "JS_DATA_VIEW"}}, + {JSType::JS_DATE, {"TimeValue", "LocalOffset", "JS_DATE"}}, + {JSType::JS_DATE_TIME_FORMAT, {"Locale", "Calendar", "NumberingSystem", "TimeZone", "LocaleIcu", + "SimpleDateTimeFormatIcu", "Iso8601", + "BoundFormat", "JS_DATE_TIME_FORMAT"}}, + {JSType::JS_DISPLAYNAMES, {"Locale", "IcuLDN", "JS_DISPLAYNAMES"}}, + {JSType::JS_ERROR, {"Properties", "Elements", "JS_ERROR"}}, + {JSType::JS_EVAL_ERROR, {"Properties", "Elements", "JS_EVAL_ERROR"}}, + {JSType::JS_FINALIZATION_REGISTRY, {"CleanupCallback", "NoUnregister", + "MaybeUnregister", "Next", "Prev", "JS_FINALIZATION_REGISTRY"}}, + {JSType::JS_FLOAT32_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_FLOAT32_ARRAY"}}, + {JSType::JS_FLOAT64_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_FLOAT64_ARRAY"}}, + {JSType::JS_FORIN_ITERATOR, {"Object", "CachedHclass", "Keys", "JS_FORIN_ITERATOR"}}, + {JSType::JS_FUNCTION, {"ProtoOrHClass", "LexicalEnv", "MachineCode", "BaselineCode", "RawProfileTypeInfo", + "HomeObject", "Module", "ProtoTransRootHClass", "JS_FUNCTION"}}, + {JSType::JS_FUNCTION_BASE, {"Method", "JS_FUNCTION_BASE"}}, + {JSType::JS_GENERATOR_CONTEXT, {"RegsArray", "Method", "This", "Acc", + "GeneratorObject", "LexicalEnv", "JS_GENERATOR_CONTEXT"}}, + {JSType::JS_GENERATOR_FUNCTION, {"JS_GENERATOR_FUNCTION"}}, + {JSType::JS_GENERATOR_OBJECT, {"GeneratorContext", "ResumeResult", "JS_GENERATOR_OBJECT"}}, + {JSType::JS_GLOBAL_OBJECT, {"JS_GLOBAL_OBJECT"}}, + {JSType::JS_INT16_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_INT16_ARRAY"}}, + {JSType::JS_INT32_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_INT32_ARRAY"}}, + {JSType::JS_INT8_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_INT8_ARRAY"}}, + {JSType::JS_INTL, {"FallbackSymbol", "JS_INTL"}}, + {JSType::JS_INTL_BOUND_FUNCTION, {"NumberFormat", "DateTimeFormat", + "Collator", "JS_INTL_BOUND_FUNCTION"}}, + {JSType::JS_ITERATOR, {"Properties", "Elements", "JS_ITERATOR"}}, + {JSType::JS_LIST_FORMAT, {"Locale", "IcuLF", "JS_LIST_FORMAT"}}, + {JSType::JS_LOCALE, {"IcuField", "JS_LOCALE"}}, + {JSType::JS_MAP, {"LinkedMap", "JS_MAP"}}, + {JSType::JS_MAP_ITERATOR, {"IteratorMap", "JS_MAP_ITERATOR"}}, + {JSType::JS_MODULE_NAMESPACE, {"Module", "Exports", "DeregisterProcession", "JS_MODULE_NAMESPACE"}}, + {JSType::JS_NATIVE_POINTER, {"BindingSize", "JS_NATIVE_POINTER"}}, + {JSType::JS_NUMBER_FORMAT, {"Locale", "NumberingSystem", "Currency", "Unit", "MinimumIntegerDigits", + "MinimumFractionDigits", "MaximumFractionDigits", + "MinimumSignificantDigits", "MaximumSignificantDigits", + "UseGrouping", "BoundFormat", "IcuField", "JS_NUMBER_FORMAT"}}, + {JSType::JS_OBJECT, {"Properties", "Elements", "JS_OBJECT"}}, + {JSType::JS_OOM_ERROR, {"Properties", "Elements", "JS_OOM_ERROR"}}, + {JSType::JS_PLURAL_RULES, {"Locale", "MinimumIntegerDigits", + "MinimumFractionDigits", "MaximumFractionDigits", + "MinimumSignificantDigits", "MaximumSignificantDigits", + "IcuPR", "IcuNF", "JS_PLURAL_RULES"}}, + {JSType::JS_PRIMITIVE_REF, {"Value", "JS_PRIMITIVE_REF"}}, + {JSType::JS_PROMISE, {"PromiseResult", "PromiseFulfillReactions", "PromiseRejectReactions", "JS_PROMISE"}}, + {JSType::JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION, {"Index", "Values", "Capabilities", "RemainingElements", + "AlreadyCalled", + "JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION"}}, + {JSType::JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION, {"AlreadyCalled", "Values", "Capability", + "RemainingElements", + "JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION"}}, + {JSType::JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION, {"Errors", "Capability", "RemainingElements", + "AlreadyCalled", + "JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION"}}, + {JSType::JS_PROMISE_EXECUTOR_FUNCTION, {"Capability", "JS_PROMISE_EXECUTOR_FUNCTION"}}, + {JSType::JS_PROMISE_FINALLY_FUNCTION, {"Constructor", "OnFinally", "JS_PROMISE_FINALLY_FUNCTION"}}, + {JSType::JS_PROMISE_REACTIONS_FUNCTION, {"Promise", "AlreadyResolved", "JS_PROMISE_REACTIONS_FUNCTION"}}, + {JSType::JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION, {"Result", + "JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION"}}, + {JSType::JS_PROXY, {"Target", "Handler", "Method", "PrivateField", "JS_PROXY"}}, + {JSType::JS_PROXY_REVOC_FUNCTION, {"RevocableProxy", "JS_PROXY_REVOC_FUNCTION"}}, + {JSType::JS_RANGE_ERROR, {"Properties", "Elements", "JS_RANGE_ERROR"}}, + {JSType::JS_REALM, {"Value", "GlobalEnv", "JS_REALM"}}, + {JSType::JS_REFERENCE_ERROR, {"Properties", "Elements", "JS_REFERENCE_ERROR"}}, + {JSType::JS_REG_EXP, {"ByteCodeBuffer", "OriginalSource", "OriginalFlags", "GroupName", "JS_REG_EXP"}}, + {JSType::JS_REG_EXP_ITERATOR, {"IteratingRegExp", "IteratedString", "JS_REG_EXP_ITERATOR"}}, + {JSType::JS_RELATIVE_TIME_FORMAT, {"Locale", "NumberingSystem", "IcuField", "JS_RELATIVE_TIME_FORMAT"}}, + {JSType::JS_SEGMENTER, {"Locale", "IcuField", "JS_SEGMENTER"}}, + {JSType::JS_SEGMENTS, {"IcuField", "SegmentsString", "UnicodeString", "JS_SEGMENTS"}}, + {JSType::JS_SEGMENT_ITERATOR, {"IcuField", "IteratedString", "UnicodeString", "JS_SEGMENT_ITERATOR"}}, + {JSType::JS_SENDABLE_ARRAY_BUFFER, {"ArrayBufferData", "JS_SENDABLE_ARRAY_BUFFER"}}, + {JSType::JS_SET, {"LinkedSet", "JS_SET"}}, + {JSType::JS_SET_ITERATOR, {"IteratorSet", "JS_SET_ITERATOR"}}, + {JSType::JS_SHARED_ARRAY, {"TrackInfo", "JS_SHARED_ARRAY"}}, + {JSType::JS_SHARED_ARRAY_BUFFER, {"ArrayBufferData", "JS_SHARED_ARRAY_BUFFER"}}, + {JSType::JS_SHARED_ARRAY_ITERATOR, {"IteratedArray", "JS_SHARED_ARRAY_ITERATOR"}}, + {JSType::JS_SHARED_ASYNC_FUNCTION, {"JS_SHARED_ASYNC_FUNCTION"}}, + {JSType::JS_SHARED_BIGINT64_ARRAY, {"JS_SHARED_BIGINT64_ARRAY"}}, + {JSType::JS_SHARED_BIGUINT64_ARRAY, {"JS_SHARED_BIGUINT64_ARRAY"}}, + {JSType::JS_SHARED_FLOAT32_ARRAY, {"JS_SHARED_FLOAT32_ARRAY"}}, + {JSType::JS_SHARED_FLOAT64_ARRAY, {"JS_SHARED_FLOAT64_ARRAY"}}, + {JSType::JS_SHARED_FUNCTION, {"JS_SHARED_FUNCTION"}}, + {JSType::JS_SHARED_INT16_ARRAY, {"JS_SHARED_INT16_ARRAY"}}, + {JSType::JS_SHARED_INT32_ARRAY, {"JS_SHARED_INT32_ARRAY"}}, + {JSType::JS_SHARED_INT8_ARRAY, {"JS_SHARED_INT8_ARRAY"}}, + {JSType::JS_SHARED_MAP, {"LinkedMap", "JS_SHARED_MAP"}}, + {JSType::JS_SHARED_MAP_ITERATOR, {"IteratorMap", "JS_SHARED_MAP_ITERATOR"}}, + {JSType::JS_SHARED_OBJECT, {"JS_SHARED_OBJECT"}}, + {JSType::JS_SHARED_SET, {"LinkedSet", "JS_SHARED_SET"}}, + {JSType::JS_SHARED_SET_ITERATOR, {"IteratorSet", "JS_SHARED_SET_ITERATOR"}}, + {JSType::JS_SHARED_TYPED_ARRAY, {"JS_SHARED_TYPED_ARRAY"}}, + {JSType::JS_SHARED_UINT16_ARRAY, {"JS_SHARED_UINT16_ARRAY"}}, + {JSType::JS_SHARED_UINT32_ARRAY, {"JS_SHARED_UINT32_ARRAY"}}, + {JSType::JS_SHARED_UINT8_ARRAY, {"JS_SHARED_UINT8_ARRAY"}}, + {JSType::JS_SHARED_UINT8_CLAMPED_ARRAY, {"JS_SHARED_UINT8_CLAMPED_ARRAY"}}, + {JSType::JS_STRING_ITERATOR, {"IteratedString", "JS_STRING_ITERATOR"}}, + {JSType::JS_SYNTAX_ERROR, {"Properties", "Elements", "JS_SYNTAX_ERROR"}}, + {JSType::JS_TERMINATION_ERROR, {"Properties", "Elements", "JS_TERMINATION_ERROR"}}, + {JSType::JS_TYPED_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_TYPED_ARRAY"}}, + {JSType::JS_TYPE_ERROR, {"Properties", "Elements", "JS_TYPE_ERROR"}}, + {JSType::JS_UINT16_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_UINT16_ARRAY"}}, + {JSType::JS_UINT32_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_UINT32_ARRAY"}}, + {JSType::JS_UINT8_ARRAY, {"ViewedArrayBufferOrByteArray", "TypedArrayName", "JS_UINT8_ARRAY"}}, + {JSType::JS_UINT8_CLAMPED_ARRAY, {"ViewedArrayBufferOrByteArray", + "TypedArrayName", "JS_UINT8_CLAMPED_ARRAY"}}, + {JSType::JS_URI_ERROR, {"Properties", "Elements", "JS_URI_ERROR"}}, + {JSType::JS_WEAK_MAP, {"LinkedMap", "JS_WEAK_MAP"}}, + {JSType::JS_WEAK_REF, {"WeakObject", "JS_WEAK_REF"}}, + {JSType::JS_WEAK_SET, {"LinkedSet", "JS_WEAK_SET"}}, + {JSType::LEXICAL_ENV, {"LEXICAL_ENV"}}, + {JSType::LINE_STRING, {"LINE_STRING"}}, + {JSType::LINKED_NODE, {"Next", "LINKED_NODE"}}, + {JSType::LOCAL_EXPORTENTRY_RECORD, {"ExportName", "LocalName", "LOCAL_EXPORTENTRY_RECORD"}}, + {JSType::MACHINE_CODE_OBJECT, {"MACHINE_CODE_OBJECT"}}, + {JSType::MARKER_CELL, {"MARKER_CELL"}}, + {JSType::METHOD, {"ConstantPool", "METHOD"}}, + {JSType::MICRO_JOB_QUEUE, {"PromiseJobQueue", "ScriptJobQueue", "MICRO_JOB_QUEUE"}}, + {JSType::MODULE_RECORD, {"MODULE_RECORD"}}, + {JSType::MUTANT_TAGGED_ARRAY, {"MUTANT_TAGGED_ARRAY"}}, + {JSType::NATIVE_MODULE_FAILURE_INFO, {"ArkNativeModuleFailureInfo", "NATIVE_MODULE_FAILURE_INFO"}}, + {JSType::PENDING_JOB, {"Job", "Arguments", "PENDING_JOB"}}, + {JSType::PROFILE_TYPE_INFO, {"PROFILE_TYPE_INFO"}}, + {JSType::PROFILE_TYPE_INFO_CELL_0, {"Value", "MachineCode", "Handle", "PROFILE_TYPE_INFO_CELL_0"}}, + {JSType::PROFILE_TYPE_INFO_CELL_1, {"Value", "MachineCode", "Handle", "PROFILE_TYPE_INFO_CELL_1"}}, + {JSType::PROFILE_TYPE_INFO_CELL_N, {"Value", "MachineCode", "Handle", "PROFILE_TYPE_INFO_CELL_N"}}, + {JSType::PROGRAM, {"MainFunction", "PROGRAM"}}, + {JSType::PROMISE_CAPABILITY, {"Promise", "Resolve", "Reject", "PROMISE_CAPABILITY"}}, + {JSType::PROMISE_ITERATOR_RECORD, {"Iterator", "PROMISE_ITERATOR_RECORD"}}, + {JSType::PROMISE_REACTIONS, {"PromiseCapability", "Handler", "PROMISE_REACTIONS"}}, + {JSType::PROMISE_RECORD, {"Value", "PROMISE_RECORD"}}, + {JSType::PROPERTY_BOX, {"Value", "PROPERTY_BOX"}}, + {JSType::PROTOTYPE_HANDLER, {"HandlerInfo", "ProtoCell", "Holder", + "AccessorJSFunction", "PROTOTYPE_HANDLER"}}, + {JSType::PROTOTYPE_INFO, {"ChangeListener", "PROTOTYPE_INFO"}}, + {JSType::PROTO_CHANGE_MARKER, {"PROTO_CHANGE_MARKER"}}, + {JSType::RB_TREENODE, {"Left", "Right", "IsRed", "RB_TREENODE"}}, + {JSType::RESOLVEDBINDING_RECORD, {"Module", "BindingName", "RESOLVEDBINDING_RECORD"}}, + {JSType::RESOLVEDINDEXBINDING_RECORD, {"Module", "Index", "RESOLVEDINDEXBINDING_RECORD"}}, + {JSType::RESOLVEDRECORDBINDING_RECORD, {"ModuleRecord", "BindingName", "RESOLVEDRECORDBINDING_RECORD"}}, + {JSType::RESOLVEDRECORDINDEXBINDING_RECORD, {"ModuleRecord", + "AbcFileName", "RESOLVEDRECORDINDEXBINDING_RECORD"}}, + {JSType::RESOLVING_FUNCTIONS_RECORD, {"ResolveFunction", "RejectFunction", "RESOLVING_FUNCTIONS_RECORD"}}, + {JSType::SENDABLE_ENV, {"SENDABLE_ENV"}}, + {JSType::SLICED_STRING, {"Parent", "SLICED_STRING"}}, + {JSType::SOURCE_TEXT_MODULE_RECORD, {"Environment", "Namespace", "RequestedModules", + "ImportEntries", "LocalExportEntries", + "IndirectExportEntries", "StarExportEntries", + "NameDictionary", "CycleRoot", "TopLevelCapability", + "AsyncParentModules", "SendableEnv", "SOURCE_TEXT_MODULE_RECORD"}}, + {JSType::STAR_EXPORTENTRY_RECORD, {"ModuleRequest", "STAR_EXPORTENTRY_RECORD"}}, + {JSType::STORE_TS_HANDLER, {"HandlerInfo", "ProtoCell", "Holder", "STORE_TS_HANDLER"}}, + {JSType::SYMBOL, {"Description", "SYMBOL"}}, + {JSType::TAGGED_ARRAY, {"Length", "Data", "TAGGED_ARRAY"}}, + {JSType::TAGGED_DICTIONARY, {"TAGGED_DICTIONARY"}}, + {JSType::TEMPLATE_MAP, {"TEMPLATE_MAP"}}, + {JSType::TRACK_INFO, {"CachedHClass", "CachedFunc", "TRACK_INFO"}}, + {JSType::TRANSITION_HANDLER, {"HandlerInfo", "TransitionHClass", "TRANSITION_HANDLER"}}, + {JSType::TRANS_WITH_PROTO_HANDLER, {"HandlerInfo", "TransitionHClass", + "ProtoCell", "TRANS_WITH_PROTO_HANDLER"}}, + {JSType::TREE_STRING, {"First", "Second", "TREE_STRING"}}, + {JSType::VTABLE, {"VTABLE"}} + }; + // { typeName: [all fields' start offset of this type in the same order as declared in .h files + endOffset] } + // endOffset: LAST_OFFSET - (start offset of the first field of this type) + fieldOffsetTable_ = { + {JSType::HCLASS, { + JSHClass::PROTOTYPE_OFFSET, JSHClass::LAYOUT_OFFSET, JSHClass::TRANSTIONS_OFFSET, + JSHClass::PARENT_OFFSET, JSHClass::PROTO_CHANGE_MARKER_OFFSET, + JSHClass::PROTO_CHANGE_DETAILS_OFFSET, + JSHClass::ENUM_CACHE_OFFSET, JSHClass::PROFILE_TYPE, + JSHClass::BIT_FIELD_OFFSET, JSHClass::BIT_FIELD1_OFFSET, + JSHClass::LAST_OFFSET - JSHClass::PROTOTYPE_OFFSET}}, + {JSType::ACCESSOR_DATA, {AccessorData::GETTER_OFFSET, AccessorData::SETTER_OFFSET, + AccessorData::SIZE - AccessorData::GETTER_OFFSET}}, + {JSType::AOT_LITERAL_INFO, {TaggedArray::LAST_OFFSET - TaggedArray::LENGTH_OFFSET}}, + {JSType::ASYNC_GENERATOR_REQUEST, { + AsyncGeneratorRequest::COMPLETION_OFFSET, + AsyncGeneratorRequest::CAPABILITY_OFFSET, + AsyncGeneratorRequest::SIZE - AsyncGeneratorRequest::COMPLETION_OFFSET}}, + {JSType::ASYNC_ITERATOR_RECORD, {AsyncIteratorRecord::ITERATOR_OFFSET, + AsyncIteratorRecord::NEXTMETHOD_OFFSET, + AsyncIteratorRecord::SIZE - AsyncIteratorRecord::ITERATOR_OFFSET}}, + {JSType::BIGINT, {BigInt::LAST_OFFSET - BigInt::LENGTH_OFFSET}}, + {JSType::BYTE_ARRAY, {ByteArray::LAST_OFFSET - ByteArray::ARRAY_LENGTH_OFFSET}}, + {JSType::CELL_RECORD, {CellRecord::WEAKREF_TARGET_OFFSET, + CellRecord::HELD_VALUE_OFFSET, + CellRecord::SIZE - CellRecord::WEAKREF_TARGET_OFFSET}}, + {JSType::CLASS_INFO_EXTRACTOR, { + ClassInfoExtractor::PROTOTYPE_HCLASS_OFFSET, + ClassInfoExtractor::NON_STATIC_PROPERTIES_OFFSET, + ClassInfoExtractor::NON_STATIC_ELEMENTS_OFFSET, + ClassInfoExtractor::CONSTRUCTOR_HCLASS_OFFSET, + ClassInfoExtractor::STATIC_PROPERTIES_OFFSET, + ClassInfoExtractor::STATIC_ELEMENTS_OFFSET, + ClassInfoExtractor::CONSTRUCTOR_METHOD_OFFSET, + ClassInfoExtractor::LAST_OFFSET - ClassInfoExtractor::PROTOTYPE_HCLASS_OFFSET}}, + {JSType::CLASS_LITERAL, {ClassLiteral::ARRAY_OFFSET, + ClassLiteral::LAST_OFFSET - ClassLiteral::ARRAY_OFFSET}}, + {JSType::COMPLETION_RECORD, {CompletionRecord::VALUE_OFFSET, + CompletionRecord::LAST_OFFSET - CompletionRecord::VALUE_OFFSET}}, + {JSType::CONSTANT_POOL, {0}}, + {JSType::CONSTANT_STRING, {ConstantString::RELOCTAED_DATA_OFFSET, + ConstantString::LAST_OFFSET - ConstantString::RELOCTAED_DATA_OFFSET}}, + {JSType::COW_MUTANT_TAGGED_ARRAY, {0}}, + {JSType::COW_TAGGED_ARRAY, {0}}, + {JSType::EXTRA_PROFILE_TYPE_INFO, { + ExtraProfileTypeInfo::RECEIVER_OBJECT_OFFSET, + ExtraProfileTypeInfo::HOLDER_OBJECT_OFFSET, + ExtraProfileTypeInfo::LAST_OFFSET - ExtraProfileTypeInfo::RECEIVER_OBJECT_OFFSET}}, + {JSType::FUNCTION_TEMPLATE, {FunctionTemplate::METHOD_OFFSET, + FunctionTemplate::MODULE_OFFSET, + FunctionTemplate::RAW_PROFILE_TYPE_INFO_OFFSET, + FunctionTemplate::LAST_OFFSET - FunctionTemplate::METHOD_OFFSET}}, + {JSType::GLOBAL_ENV, {GlobalEnv::SIZE - GlobalEnv::HEADER_SIZE}}, + {JSType::IMPORTENTRY_RECORD, {ImportEntry::IMPORT_ENTRY_OFFSET, + ImportEntry::MODULE_REQUEST_OFFSET, + ImportEntry::IMPORT_NAME_OFFSET, + ImportEntry::SIZE - ImportEntry::IMPORT_ENTRY_OFFSET}}, + {JSType::INDIRECT_EXPORTENTRY_RECORD, { + IndirectExportEntry::INDIRECT_EXPORT_ENTRY_OFFSET, + IndirectExportEntry::MODULE_REQUEST_OFFSET, + IndirectExportEntry::IMPORT_NAME_OFFSET, + IndirectExportEntry::SIZE - IndirectExportEntry::INDIRECT_EXPORT_ENTRY_OFFSET}}, + {JSType::INTERNAL_ACCESSOR, {InternalAccessor::GETTER_OFFSET, + InternalAccessor::SETTER_OFFSET, + InternalAccessor::SIZE - InternalAccessor::GETTER_OFFSET}}, + {JSType::JS_AGGREGATE_ERROR, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_API_ARRAYLIST_ITERATOR, { + JSAPIArrayListIterator::ITERATED_ARRAYLIST_OFFSET, + JSAPIArrayListIterator::LAST_OFFSET - JSAPIArrayListIterator::ITERATED_ARRAYLIST_OFFSET}}, + {JSType::JS_API_ARRAY_LIST, {JSAPIArrayList::LENGTH_OFFSET, + JSAPIArrayList::SIZE - JSAPIArrayList::LENGTH_OFFSET}}, + {JSType::JS_API_BITVECTOR, {JSAPIBitVector::NATIVE_POINTER_OFFSET, + JSAPIBitVector::LAST_OFFSET - JSAPIBitVector::NATIVE_POINTER_OFFSET}}, + {JSType::JS_API_BITVECTOR_ITERATOR, { + JSAPIBitVectorIterator::ITERATED_BITVECTOR_OFFSET, + JSAPIBitVectorIterator::LAST_OFFSET - JSAPIBitVectorIterator::ITERATED_BITVECTOR_OFFSET}}, + {JSType::JS_API_DEQUE, {JSAPIDeque::ENDL_OFFSET - JSAPIDeque::FIRST_OFFSET}}, + {JSType::JS_API_DEQUE_ITERATOR, {JSAPIDequeIterator::ITERATED_DEQUE_OFFSET, + JSAPIDequeIterator::LAST_OFFSET - JSAPIDequeIterator::ITERATED_DEQUE_OFFSET}}, + {JSType::JS_API_HASHMAP_ITERATOR, { + JSAPIHashMapIterator::ITERATED_HASHMAP_OFFSET, + JSAPIHashMapIterator::TAGGED_QUEUE_OFFSET, + JSAPIHashMapIterator::CURRENT_NODE_RESULT, + JSAPIHashMapIterator::LAST_OFFSET - JSAPIHashMapIterator::ITERATED_HASHMAP_OFFSET}}, + {JSType::JS_API_HASHSET_ITERATOR, { + JSAPIHashSetIterator::ITERATED_HASHSET_OFFSET, + JSAPIHashSetIterator::TAGGED_QUEUE_OFFSET, + JSAPIHashSetIterator::CURRENT_NODE_RESULT, + JSAPIHashSetIterator::LAST_OFFSET - JSAPIHashSetIterator::ITERATED_HASHSET_OFFSET}}, + {JSType::JS_API_HASH_MAP, {JSAPIHashMap::HASHMAP_TABLE_INDEX, + JSAPIHashMap::LAST_OFFSET - JSAPIHashMap::HASHMAP_TABLE_INDEX}}, + {JSType::JS_API_HASH_SET, {JSAPIHashSet::HASHSET_TABLE_INDEX, + JSAPIHashSet::LAST_OFFSET - JSAPIHashSet::HASHSET_TABLE_INDEX}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP, { + JSAPILightWeightMap::LWP_HASHES_OFFSET, + JSAPILightWeightMap::LWP_KEYS_OFFSET, + JSAPILightWeightMap::LWP_VALUES_OFFSET, + JSAPILightWeightMap::LAST_OFFSET - JSAPILightWeightMap::LWP_HASHES_OFFSET}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP_ITERATOR, { + JSAPILightWeightMapIterator::ITERATED_LIGHT_WEIGHT_MAP_OFFSET, + JSAPILightWeightMapIterator::LAST_OFFSET - JSAPILightWeightMapIterator::ITERATED_LIGHT_WEIGHT_MAP_OFFSET}}, + {JSType::JS_API_LIGHT_WEIGHT_SET, { + JSAPILightWeightSet::HASHES_OFFSET, + JSAPILightWeightSet::VALUES_OFFSET, + JSAPILightWeightSet::LAST_OFFSET - JSAPILightWeightSet::HASHES_OFFSET}}, + {JSType::JS_API_LIGHT_WEIGHT_SET_ITERATOR, { + JSAPILightWeightSetIterator::ITERATED_LIGHT_WEIGHT_SET_OFFSET, + JSAPILightWeightSetIterator::LAST_OFFSET - JSAPILightWeightSetIterator::ITERATED_LIGHT_WEIGHT_SET_OFFSET}}, + {JSType::JS_API_LINKED_LIST, {JSAPILinkedList::DOUBLE_LIST_OFFSET, + JSAPILinkedList::SIZE - JSAPILinkedList::DOUBLE_LIST_OFFSET}}, + {JSType::JS_API_LINKED_LIST_ITERATOR, { + JSAPILinkedListIterator::ITERATED_LINKED_LIST_OFFSET, + JSAPILinkedListIterator::LAST_OFFSET - JSAPILinkedListIterator::ITERATED_LINKED_LIST_OFFSET}}, + {JSType::JS_API_LIST, {JSAPIList::SINGLY_LIST_OFFSET, + JSAPIList::LAST_OFFSET - JSAPIList::SINGLY_LIST_OFFSET}}, + {JSType::JS_API_LIST_ITERATOR, { + JSAPIListIterator::ITERATED_LIST_OFFSET, + JSAPIListIterator::LAST_OFFSET - JSAPIListIterator::ITERATED_LIST_OFFSET}}, + {JSType::JS_API_PLAIN_ARRAY, {JSAPIPlainArray::KEYS_OFFSET, + JSAPIPlainArray::VALUES_OFFSET, + JSAPIPlainArray::LAST_OFFSET - JSAPIPlainArray::KEYS_OFFSET}}, + {JSType::JS_API_PLAIN_ARRAY_ITERATOR, { + JSAPIPlainArrayIterator::ITERATED_PLAIN_ARRAY_OFFSET, + JSAPIPlainArrayIterator::LAST_OFFSET - JSAPIPlainArrayIterator::ITERATED_PLAIN_ARRAY_OFFSET}}, + {JSType::JS_API_QUEUE, {JSAPIQueue::LENGTH_OFFSET, + JSAPIQueue::LAST_OFFSET - JSAPIQueue::LENGTH_OFFSET}}, + {JSType::JS_API_QUEUE_ITERATOR, { + JSAPIQueueIterator::ITERATED_QUEUE_OFFSET, + JSAPIQueueIterator::LAST_OFFSET - JSAPIQueueIterator::ITERATED_QUEUE_OFFSET}}, + {JSType::JS_API_STACK, {JSAPIStack::LAST_OFFSET - JSAPIStack::TOP_OFFSET}}, + {JSType::JS_API_STACK_ITERATOR, { + JSAPIStackIterator::ITERATED_STACK_OFFSET, + JSAPIStackIterator::LAST_OFFSET - JSAPIStackIterator::ITERATED_STACK_OFFSET}}, + {JSType::JS_API_TREEMAP_ITERATOR, { + JSAPITreeMapIterator::ITERATED_MAP_OFFSET, + JSAPITreeMapIterator::ITERATED_ENTRIES_OFFSET, + JSAPITreeMapIterator::LAST_OFFSET - JSAPITreeMapIterator::ITERATED_MAP_OFFSET}}, + {JSType::JS_API_TREESET_ITERATOR, { + JSAPITreeSetIterator::ITERATED_SET_OFFSET, + JSAPITreeSetIterator::ITERATED_ENTRIES_OFFSET, + JSAPITreeSetIterator::LAST_OFFSET - JSAPITreeSetIterator::ITERATED_SET_OFFSET}}, + {JSType::JS_API_TREE_MAP, {JSAPITreeMap::TREE_MAP_OFFSET, + JSAPITreeMap::SIZE - JSAPITreeMap::TREE_MAP_OFFSET}}, + {JSType::JS_API_TREE_SET, {JSAPITreeSet::TREE_SET_OFFSET, + JSAPITreeSet::SIZE - JSAPITreeSet::TREE_SET_OFFSET}}, + {JSType::JS_API_VECTOR, {JSAPIVector::ENDL_OFFSET - JSAPIVector::ELEMENT_COUNT_OFFSET}}, + {JSType::JS_API_VECTOR_ITERATOR, { + JSAPIVectorIterator::ITERATED_VECTOR_OFFSET, + JSAPIVectorIterator::LAST_OFFSET - JSAPIVectorIterator::ITERATED_VECTOR_OFFSET}}, + {JSType::JS_ARGUMENTS, {0}}, + {JSType::JS_ARRAY, {JSArray::LENGTH_OFFSET, + JSArray::TRACK_INFO_OFFSET, + JSArray::SIZE - JSArray::LENGTH_OFFSET}}, + {JSType::JS_ARRAY_BUFFER, {JSArrayBuffer::DATA_OFFSET, + JSArrayBuffer::LAST_OFFSET - JSArrayBuffer::DATA_OFFSET}}, + {JSType::JS_ARRAY_ITERATOR, {JSArrayIterator::ITERATED_ARRAY_OFFSET, + JSArrayIterator::LAST_OFFSET - JSArrayIterator::ITERATED_ARRAY_OFFSET}}, + {JSType::JS_ASYNCITERATOR, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_ASYNC_AWAIT_STATUS_FUNCTION, { + JSAsyncAwaitStatusFunction::ASYNC_CONTEXT_OFFSET, + JSAsyncAwaitStatusFunction::SIZE - JSAsyncAwaitStatusFunction::ASYNC_CONTEXT_OFFSET}}, + {JSType::JS_ASYNC_FROM_SYNC_ITERATOR, { + JSAsyncFromSyncIterator::SYNC_ITERATOR_RECORD, + JSAsyncFromSyncIterator::SIZE - JSAsyncFromSyncIterator::SYNC_ITERATOR_RECORD}}, + {JSType::JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION, { + JSAsyncFromSyncIterUnwarpFunction::DONE_OFFSET, + JSAsyncFromSyncIterUnwarpFunction::SIZE - JSAsyncFromSyncIterUnwarpFunction::DONE_OFFSET}}, + {JSType::JS_ASYNC_FUNCTION, {JSAsyncFunction::SIZE - JSAsyncFunction::SIZE}}, + {JSType::JS_ASYNC_FUNC_OBJECT, {JSAsyncFuncObject::GENERATOR_PROMISE_OFFSET, + JSAsyncFuncObject::SIZE - JSAsyncFuncObject::GENERATOR_PROMISE_OFFSET}}, + {JSType::JS_ASYNC_GENERATOR_FUNCTION, {JSAsyncGeneratorFunction::SIZE - JSAsyncGeneratorFunction::SIZE}}, + {JSType::JS_ASYNC_GENERATOR_OBJECT, { + JSAsyncGeneratorObject::GENERATOR_CONTEXT_OFFSET, + JSAsyncGeneratorObject::ASYNC_GENERATOR_QUEUE_OFFSET, + JSAsyncGeneratorObject::GENERATOR_OFFSET, + JSAsyncGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET, + JSAsyncGeneratorObject::LAST_OFFSET - JSAsyncGeneratorObject::GENERATOR_CONTEXT_OFFSET}}, + {JSType::JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN, { + JSAsyncGeneratorResNextRetProRstFtn::ASYNC_GENERATOR_OBJECT_OFFSET, + JSAsyncGeneratorResNextRetProRstFtn::SIZE - JSAsyncGeneratorResNextRetProRstFtn::ASYNC_GENERATOR_OBJECT_OFFSET}}, + {JSType::JS_ASYNC_MODULE_FULFILLED_FUNCTION, { + JSAsyncModuleFulfilledFunction::SIZE - JSAsyncModuleFulfilledFunction::SIZE}}, + {JSType::JS_ASYNC_MODULE_REJECTED_FUNCTION, { + JSAsyncModuleRejectedFunction::SIZE - JSAsyncModuleRejectedFunction::SIZE}}, + {JSType::JS_BIGINT64_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_BIGUINT64_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_BOUND_FUNCTION, {JSBoundFunction::BOUND_TARGET_OFFSET, + JSBoundFunction::BOUND_THIS_OFFSET, + JSBoundFunction::BOUND_ARGUMENTS_OFFSET, + JSBoundFunction::SIZE - JSBoundFunction::BOUND_TARGET_OFFSET}}, + {JSType::JS_CJS_EXPORTS, {CjsExports::JS_CJS_EXPORTS_OFFSET, + CjsExports::SIZE - CjsExports::JS_CJS_EXPORTS_OFFSET}}, + {JSType::JS_CJS_MODULE, {CjsModule::JS_CJS_MODULE_OFFSET, + CjsModule::ID_OFFSET, + CjsModule::PATH_OFFSET, + CjsModule::EXPORTS_OFFSET, + CjsModule::LAST_SIZE - CjsModule::JS_CJS_MODULE_OFFSET}}, + {JSType::JS_CJS_REQUIRE, {CjsRequire::JS_CJS_REQUIRE_OFFSET, + CjsRequire::CACHE_OFFSET, + CjsRequire::SIZE - CjsRequire::JS_CJS_REQUIRE_OFFSET}}, + {JSType::JS_COLLATOR, {JSCollator::ICU_FIELD_OFFSET, + JSCollator::LOCALE_OFFSET, + JSCollator::COLLATION_OFFSET, + JSCollator::BOUND_COMPARE_OFFSET, + JSCollator::LAST_OFFSET - JSCollator::ICU_FIELD_OFFSET}}, + {JSType::JS_DATA_VIEW, {JSDataView::DATA_VIEW_OFFSET, + JSDataView::VIEW_ARRAY_BUFFER_OFFSET, + JSDataView::LAST_OFFSET - JSDataView::DATA_VIEW_OFFSET}}, + {JSType::JS_DATE, {JSDate::TIME_VALUE_OFFSET, + JSDate::LOCAL_TIME_OFFSET, + JSDate::SIZE - JSDate::TIME_VALUE_OFFSET}}, + {JSType::JS_DATE_TIME_FORMAT, {JSDateTimeFormat::LOCALE_OFFSET, + JSDateTimeFormat::CALENDAR_OFFSET, + JSDateTimeFormat::NUMBER_STRING_SYSTEM_OFFSET, + JSDateTimeFormat::TIME_ZONE_OFFSET, + JSDateTimeFormat::LOCALE_ICU_OFFSET, + JSDateTimeFormat::SIMPLE_DATE_TIME_FORMAT_ICU_OFFSET, + JSDateTimeFormat::ISO8601_OFFSET, + JSDateTimeFormat::BOUND_FORMAT_OFFSET, + JSDateTimeFormat::LAST_OFFSET - JSDateTimeFormat::LOCALE_OFFSET}}, + {JSType::JS_DISPLAYNAMES, {JSDisplayNames::LOCALE_OFFSET, + JSDisplayNames::ICU_LOCALE_DISPPLAY_NAMES, + JSDisplayNames::LAST_OFFSET - JSDisplayNames::LOCALE_OFFSET}}, + {JSType::JS_ERROR, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_EVAL_ERROR, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_FINALIZATION_REGISTRY, { + JSFinalizationRegistry::CLEANUP_CALLBACK_OFFSET, + JSFinalizationRegistry::NO_UNREGISTER_OFFSET, + JSFinalizationRegistry::MAYBE_UNREGISTER_OFFSET, + JSFinalizationRegistry::NEXT_OFFSET, + JSFinalizationRegistry::PREV_OFFSET, + JSFinalizationRegistry::SIZE - JSFinalizationRegistry::CLEANUP_CALLBACK_OFFSET}}, + {JSType::JS_FLOAT32_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_FLOAT64_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_FORIN_ITERATOR, {JSForInIterator::OBJECT_OFFSET, + JSForInIterator::CACHED_HCLASS_OFFSET, + JSForInIterator::KEYS_OFFSET, + JSForInIterator::LAST_OFFSET - JSForInIterator::OBJECT_OFFSET}}, + {JSType::JS_FUNCTION, {JSFunction::PROTO_OR_DYNCLASS_OFFSET, + JSFunction::LEXICAL_ENV_OFFSET, + JSFunction::MACHINECODE_OFFSET, + JSFunction::BASELINECODE_OFFSET, + JSFunction::RAW_PROFILE_TYPE_INFO_OFFSET, + JSFunction::HOME_OBJECT_OFFSET, + JSFunction::ECMA_MODULE_OFFSET, + JSFunction::PROTO_TRANS_ROOT_HCLASS_OFFSET, + JSFunction::LAST_OFFSET - JSFunction::PROTO_OR_DYNCLASS_OFFSET}}, + {JSType::JS_FUNCTION_BASE, {JSFunctionBase::METHOD_OFFSET, + JSFunctionBase::LAST_OFFSET - JSFunctionBase::METHOD_OFFSET}}, + {JSType::JS_GENERATOR_CONTEXT, { + GeneratorContext::GENERATOR_REGS_ARRAY_OFFSET, + GeneratorContext::GENERATOR_METHOD_OFFSET, + GeneratorContext::GENERATOR_THIS_OFFSET, + GeneratorContext::GENERATOR_ACC_OFFSET, + GeneratorContext::GENERATOR_GENERATOR_OBJECT_OFFSET, + GeneratorContext::GENERATOR_LEXICALENV_OFFSET, + GeneratorContext::LAST_OFFSET - GeneratorContext::GENERATOR_REGS_ARRAY_OFFSET}}, + {JSType::JS_GENERATOR_FUNCTION, {JSGeneratorFunction::SIZE - JSGeneratorFunction::SIZE}}, + {JSType::JS_GENERATOR_OBJECT, { + JSGeneratorObject::GENERATOR_CONTEXT_OFFSET, + JSGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET, + JSGeneratorObject::LAST_OFFSET - JSGeneratorObject::GENERATOR_CONTEXT_OFFSET}}, + {JSType::JS_GLOBAL_OBJECT, {JSGlobalObject::SIZE - JSGlobalObject::SIZE}}, + {JSType::JS_INT16_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_INT32_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_INT8_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_INTL, {JSIntl::FALLBACK_SYMBOL, + JSIntl::SIZE - JSIntl::FALLBACK_SYMBOL}}, + {JSType::JS_INTL_BOUND_FUNCTION, {JSIntlBoundFunction::NUMBER_FORMAT_OFFSET, + JSIntlBoundFunction::DATETIME_FORMAT_OFFSET, + JSIntlBoundFunction::COLLATOR_OFFSET, + JSIntlBoundFunction::SIZE - JSIntlBoundFunction::NUMBER_FORMAT_OFFSET}}, + {JSType::JS_ITERATOR, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_LIST_FORMAT, {JSListFormat::LOCALE_OFFSET, + JSListFormat::ICU_LIST_FORMAT, + JSListFormat::LAST_OFFSET - JSListFormat::LOCALE_OFFSET}}, + {JSType::JS_LOCALE, {JSLocale::ICU_FIELD_OFFSET, + JSLocale::SIZE - JSLocale::ICU_FIELD_OFFSET}}, + {JSType::JS_MAP, {JSMap::LINKED_MAP_OFFSET, + JSMap::SIZE - JSMap::LINKED_MAP_OFFSET}}, + {JSType::JS_MAP_ITERATOR, {JSMapIterator::ITERATED_MAP_OFFSET, + JSMapIterator::LAST_OFFSET - JSMapIterator::ITERATED_MAP_OFFSET}}, + {JSType::JS_MODULE_NAMESPACE, {ModuleNamespace::MODULE_OFFSET, + ModuleNamespace::EXPORTS_OFFSET, + ModuleNamespace::DEREGISTER_PROCESSION_OFFSET, + ModuleNamespace::SIZE - ModuleNamespace::MODULE_OFFSET}}, + {JSType::JS_NATIVE_POINTER, {JSNativePointer::DATA_SIZE_OFFSET, + JSNativePointer::LAST_OFFSET - JSNativePointer::POINTER_OFFSET}}, + {JSType::JS_NUMBER_FORMAT, {JSNumberFormat::LOCALE_OFFSET, + JSNumberFormat::NUMBER_STRING_SYSTEM_OFFSET, + JSNumberFormat::CURRENCY_OFFSET, + JSNumberFormat::UNIT_OFFSET, + JSNumberFormat::MINIMUM_INTEGER_DIGITS_OFFSET, + JSNumberFormat::MINIMUM_FRACTION_DIGITS_OFFSET, + JSNumberFormat::MAXIMUM_FRACTION_DIGITS_OFFSET, + JSNumberFormat::MINIMUM_SIGNIFICANT_DIGITS_OFFSET, + JSNumberFormat::MAXIMUM_SIGNIFICANT_DIGITS_OFFSET, + JSNumberFormat::USER_GROUPING_OFFSET, + JSNumberFormat::BOUND_FORMAT_OFFSET, + JSNumberFormat::ICU_FIELD_OFFSET, + JSNumberFormat::LAST_OFFSET - JSNumberFormat::LOCALE_OFFSET}}, + {JSType::JS_OBJECT, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_OOM_ERROR, {JSObject::PROPERTIES_OFFSET, + JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_PLURAL_RULES, {JSPluralRules::LOCALE_OFFSET, + JSPluralRules::MINIMUM_INTEGER_DIGITS_OFFSET, + JSPluralRules::MINIMUM_FRACTION_DIGITS_OFFSET, + JSPluralRules::MAXIMUM_FRACTION_DIGITS_OFFSET, + JSPluralRules::MININUM_SIGNIFICANT_DIGITS_OFFSET, + JSPluralRules::MAXINUM_SIGNIFICANT_DIGITS_OFFSET, + JSPluralRules::ICU_PLURAL_RULES_OFFSET, + JSPluralRules::ICU_NUMBER_FORMAT_OFFSET, + JSPluralRules::LAST_OFFSET - JSPluralRules::LOCALE_OFFSET}}, + {JSType::JS_PRIMITIVE_REF, {JSPrimitiveRef::VALUE_OFFSET, + JSPrimitiveRef::SIZE - JSPrimitiveRef::VALUE_OFFSET}}, + {JSType::JS_PROMISE, {JSPromise::PROMISE_RESULT_OFFSET, + JSPromise::PROMISE_FULFILL_REACTIONS_OFFSET, + JSPromise::PROMISE_REJECT_REACTIONS_OFFSET, + JSPromise::LAST_OFFSET - JSPromise::PROMISE_RESULT_OFFSET}}, + {JSType::JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION, { + JSPromiseAllResolveElementFunction::INDEX_OFFSET, + JSPromiseAllResolveElementFunction::VALUES_OFFSET, + JSPromiseAllResolveElementFunction::CAPABILITIES_OFFSET, + JSPromiseAllResolveElementFunction::REMAINING_ELEMENTS_OFFSET, + JSPromiseAllResolveElementFunction::ALREADY_CALLED_OFFSET, + JSPromiseAllResolveElementFunction::SIZE - JSPromiseAllResolveElementFunction::INDEX_OFFSET}}, + {JSType::JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION, { + JSPromiseAllSettledElementFunction::ALREADY_CALLED_OFFSET, + JSPromiseAllSettledElementFunction::VALUES_OFFSET, + JSPromiseAllSettledElementFunction::CAPABILITY_OFFSET, + JSPromiseAllSettledElementFunction::REMAINING_ELEMENTS_OFFSET, + JSPromiseAllSettledElementFunction::LAST_OFFSET - JSPromiseAllSettledElementFunction::ALREADY_CALLED_OFFSET}}, + {JSType::JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION, { + JSPromiseAnyRejectElementFunction::ERRORS_OFFSET, + JSPromiseAnyRejectElementFunction::CAPABILITY_OFFSET, + JSPromiseAnyRejectElementFunction::REMAINING_ELEMENTS_OFFSET, + JSPromiseAnyRejectElementFunction::ALREADY_CALLED_OFFSET, + JSPromiseAnyRejectElementFunction::LAST_OFFSET - JSPromiseAnyRejectElementFunction::ERRORS_OFFSET}}, + {JSType::JS_PROMISE_EXECUTOR_FUNCTION, { + JSPromiseExecutorFunction::CAPABILITY_OFFSET, + JSPromiseExecutorFunction::SIZE - JSPromiseExecutorFunction::CAPABILITY_OFFSET}}, + {JSType::JS_PROMISE_FINALLY_FUNCTION, { + JSPromiseFinallyFunction::CONSTRUCTOR_OFFSET, + JSPromiseFinallyFunction::ONFINALLY_OFFSET, + JSPromiseFinallyFunction::SIZE - JSPromiseFinallyFunction::CONSTRUCTOR_OFFSET}}, + {JSType::JS_PROMISE_REACTIONS_FUNCTION, { + JSPromiseReactionsFunction::PROMISE_OFFSET, + JSPromiseReactionsFunction::ALREADY_RESOLVED_OFFSET, + JSPromiseReactionsFunction::SIZE - JSPromiseReactionsFunction::PROMISE_OFFSET}}, + {JSType::JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION, { + JSPromiseValueThunkOrThrowerFunction::RESULT_OFFSET, + JSPromiseValueThunkOrThrowerFunction::SIZE - JSPromiseValueThunkOrThrowerFunction::RESULT_OFFSET}}, + {JSType::JS_PROXY, {JSProxy::TARGET_OFFSET, JSProxy::HANDLER_OFFSET, JSProxy::METHOD_OFFSET, + JSProxy::PRIVATE_FIELD_OFFSET, JSProxy::LAST_OFFSET - JSProxy::TARGET_OFFSET}}, + {JSType::JS_PROXY_REVOC_FUNCTION, { + JSProxyRevocFunction::REVOCABLE_PROXY_OFFSET, + JSProxyRevocFunction::SIZE - JSProxyRevocFunction::REVOCABLE_PROXY_OFFSET}}, + {JSType::JS_RANGE_ERROR, {JSObject::PROPERTIES_OFFSET, JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_REALM, {JSRealm::VALUE_OFFSET, JSRealm::GLOBAL_ENV_OFFSET, + JSRealm::SIZE - JSRealm::VALUE_OFFSET}}, + {JSType::JS_REFERENCE_ERROR, {JSObject::PROPERTIES_OFFSET, JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_REG_EXP, {JSRegExp::REGEXP_BYTE_CODE_OFFSET, JSRegExp::ORIGINAL_SOURCE_OFFSET, + JSRegExp::ORIGINAL_FLAGS_OFFSET, JSRegExp::GROUP_NAME_OFFSET, + JSRegExp::LAST_OFFSET - JSRegExp::REGEXP_BYTE_CODE_OFFSET}}, + {JSType::JS_REG_EXP_ITERATOR, { + JSRegExpIterator::ITERATING_REGEXP_OFFSET, + JSRegExpIterator::ITERATED_STRING_OFFSET, + JSRegExpIterator::LAST_OFFSET - JSRegExpIterator::ITERATING_REGEXP_OFFSET}}, + {JSType::JS_RELATIVE_TIME_FORMAT, { + JSRelativeTimeFormat::LOCALE_OFFSET, + JSRelativeTimeFormat::NUMBERING_SYSTEM_OFFSET, + JSRelativeTimeFormat::ICU_FIELD_OFFSET, + JSRelativeTimeFormat::LAST_OFFSET - JSRelativeTimeFormat::LOCALE_OFFSET}}, + {JSType::JS_SEGMENTER, {JSSegmenter::LOCALE_OFFSET, + JSSegmenter::ICU_FIELD_OFFSET, + JSSegmenter::LAST_OFFSET - JSSegmenter::LOCALE_OFFSET}}, + {JSType::JS_SEGMENTS, {JSSegments::ICU_FIELD_OFFSET, JSSegments::SEGMENTS_STRING_OFFSET, + JSSegments::UNICODE_STRING_OFFSET, + JSSegments::LAST_OFFSET - JSSegments::ICU_FIELD_OFFSET}}, + {JSType::JS_SEGMENT_ITERATOR, {JSSegmentIterator::ICU_FIELD_OFFSET, + JSSegmentIterator::SEGMENTS_STRING_OFFSET, + JSSegmentIterator::UNICODE_STRING_OFFSET, + JSSegmentIterator::LAST_OFFSET - JSSegmentIterator::ICU_FIELD_OFFSET}}, + {JSType::JS_SENDABLE_ARRAY_BUFFER, { + JSSendableArrayBuffer::DATA_OFFSET, + JSSendableArrayBuffer::LAST_OFFSET - JSSendableArrayBuffer::DATA_OFFSET}}, + {JSType::JS_SET, {JSSet::LINKED_SET_OFFSET, JSSet::SIZE - JSSet::LINKED_SET_OFFSET}}, + {JSType::JS_SET_ITERATOR, {JSSetIterator::ITERATED_SET_OFFSET, + JSSetIterator::LAST_OFFSET - JSSetIterator::ITERATED_SET_OFFSET}}, + {JSType::JS_SHARED_ARRAY, {JSSharedArray::TRACK_INFO_OFFSET, + JSSharedArray::LAST_OFFSET - JSSharedArray::LENGTH_OFFSET}}, + {JSType::JS_SHARED_ARRAY_BUFFER, {JSArrayBuffer::DATA_OFFSET, + JSArrayBuffer::LAST_OFFSET - JSArrayBuffer::DATA_OFFSET}}, + {JSType::JS_SHARED_ARRAY_ITERATOR, { + JSSharedArrayIterator::ITERATED_ARRAY_OFFSET, + JSSharedArrayIterator::LAST_OFFSET - JSSharedArrayIterator::ITERATED_ARRAY_OFFSET}}, + {JSType::JS_SHARED_ASYNC_FUNCTION, {JSAsyncFunction::SIZE - JSAsyncFunction::SIZE}}, + {JSType::JS_SHARED_BIGINT64_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_BIGUINT64_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_FLOAT32_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_FLOAT64_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_FUNCTION, {JSSharedFunction::SIZE - JSSharedFunction::SIZE}}, + {JSType::JS_SHARED_INT16_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_INT32_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_INT8_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_MAP, {JSSharedMap::LINKED_MAP_OFFSET, + JSSharedMap::LAST_OFFSET - JSSharedMap::LINKED_MAP_OFFSET}}, + {JSType::JS_SHARED_MAP_ITERATOR, { + JSSharedMapIterator::ITERATED_MAP_OFFSET, + JSSharedMapIterator::LAST_OFFSET - JSSharedMapIterator::ITERATED_MAP_OFFSET}}, + {JSType::JS_SHARED_OBJECT, {JSSharedObject::SIZE - JSSharedObject::SIZE}}, + {JSType::JS_SHARED_SET, {JSSharedSet::LINKED_SET_OFFSET, + JSSharedSet::LAST_OFFSET - JSSharedSet::LINKED_SET_OFFSET}}, + {JSType::JS_SHARED_SET_ITERATOR, { + JSSharedSetIterator::ITERATED_SET_OFFSET, + JSSharedSetIterator::LAST_OFFSET - JSSharedSetIterator::ITERATED_SET_OFFSET}}, + {JSType::JS_SHARED_TYPED_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_UINT16_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_UINT32_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_UINT8_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_SHARED_UINT8_CLAMPED_ARRAY, { + JSSharedTypedArray::LAST_OFFSET - JSSharedTypedArray::MOD_RECORD_OFFSET}}, + {JSType::JS_STRING_ITERATOR, { + JSStringIterator::ITERATED_STRING_OFFSET, + JSStringIterator::LAST_OFFSET - JSStringIterator::ITERATED_STRING_OFFSET}}, + {JSType::JS_SYNTAX_ERROR, {JSObject::PROPERTIES_OFFSET, JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_TERMINATION_ERROR, {JSObject::PROPERTIES_OFFSET, JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_TYPED_ARRAY, {JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_TYPE_ERROR, {JSObject::PROPERTIES_OFFSET, JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_UINT16_ARRAY, { + JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_UINT32_ARRAY, { + JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_UINT8_ARRAY, { + JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_UINT8_CLAMPED_ARRAY, { + JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::TYPED_ARRAY_NAME_OFFSET, + JSTypedArray::LAST_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_URI_ERROR, {JSObject::PROPERTIES_OFFSET, JSObject::ELEMENTS_OFFSET, + JSObject::SIZE - JSObject::PROPERTIES_OFFSET}}, + {JSType::JS_WEAK_MAP, { + JSWeakMap::LINKED_MAP_OFFSET, JSWeakMap::SIZE - JSWeakMap::LINKED_MAP_OFFSET}}, + {JSType::JS_WEAK_REF, { + JSWeakRef::WEAK_OBJECT_OFFSET, JSWeakRef::SIZE - JSWeakRef::WEAK_OBJECT_OFFSET}}, + {JSType::JS_WEAK_SET, { + JSWeakSet::LINKED_SET_OFFSET, JSWeakSet::SIZE - JSWeakSet::LINKED_SET_OFFSET}}, + {JSType::LEXICAL_ENV, {TaggedArray::SIZE - TaggedArray::SIZE}}, + {JSType::LINE_STRING, {LineEcmaString::SIZE - LineEcmaString::SIZE}}, + {JSType::LINKED_NODE, {LinkedNode::NEXT_OFFSET, LinkedNode::LAST_OFFSET - LinkedNode::NEXT_OFFSET}}, + {JSType::LOCAL_EXPORTENTRY_RECORD, { + LocalExportEntry::LOCAL_EXPORT_ENTRY_OFFSET, + LocalExportEntry::LOCAL_NAME_OFFSET, + LocalExportEntry::LAST_OFFSET - LocalExportEntry::LOCAL_EXPORT_ENTRY_OFFSET}}, + {JSType::MACHINE_CODE_OBJECT, {MachineCode::LAST_OFFSET - MachineCode::INS_SIZE_OFFSET}}, + {JSType::MARKER_CELL, {MarkerCell::SIZE - MarkerCell::BIT_FIELD_OFFSET}}, + {JSType::METHOD, {Method::CONSTANT_POOL_OFFSET, Method::LAST_OFFSET - Method::CONSTANT_POOL_OFFSET}}, + {JSType::MICRO_JOB_QUEUE, {job::MicroJobQueue::PROMISE_JOB_QUEUE_OFFSET, + job::MicroJobQueue::SCRIPT_JOB_QUEUE_OFFSET, + job::MicroJobQueue::SIZE - job::MicroJobQueue::PROMISE_JOB_QUEUE_OFFSET}}, + {JSType::MODULE_RECORD, {ModuleRecord::SIZE - ModuleRecord::SIZE}}, + {JSType::MUTANT_TAGGED_ARRAY, {MutantTaggedArray::SIZE - MutantTaggedArray::SIZE}}, + {JSType::NATIVE_MODULE_FAILURE_INFO, { + NativeModuleFailureInfo::ARK_NATIVE_MODULE_FAILURE_INFO_OFFSET, + NativeModuleFailureInfo::SIZE - NativeModuleFailureInfo::ARK_NATIVE_MODULE_FAILURE_INFO_OFFSET}}, + {JSType::PENDING_JOB, {job::PendingJob::JOB_OFFSET, + job::PendingJob::ARGUMENT_OFFSET, + job::PendingJob::SIZE - job::PendingJob::ARGUMENT_OFFSET}}, + {JSType::PROFILE_TYPE_INFO, {ProfileTypeInfo::SIZE - ProfileTypeInfo::SIZE}}, + {JSType::PROFILE_TYPE_INFO_CELL_0, { + ProfileTypeInfoCell::VALUE_OFFSET, + ProfileTypeInfoCell::MACHINE_CODE_OFFSET, + ProfileTypeInfoCell::HANDLE_OFFSET, + ProfileTypeInfoCell::LAST_OFFSET - ProfileTypeInfoCell::VALUE_OFFSET}}, + {JSType::PROFILE_TYPE_INFO_CELL_1, { + ProfileTypeInfoCell::VALUE_OFFSET, + ProfileTypeInfoCell::MACHINE_CODE_OFFSET, + ProfileTypeInfoCell::HANDLE_OFFSET, + ProfileTypeInfoCell::LAST_OFFSET - ProfileTypeInfoCell::VALUE_OFFSET}}, + {JSType::PROFILE_TYPE_INFO_CELL_N, { + ProfileTypeInfoCell::VALUE_OFFSET, + ProfileTypeInfoCell::MACHINE_CODE_OFFSET, + ProfileTypeInfoCell::HANDLE_OFFSET, + ProfileTypeInfoCell::LAST_OFFSET - ProfileTypeInfoCell::VALUE_OFFSET}}, + {JSType::PROGRAM, {Program::MAIN_FUNCTION_OFFSET, Program::SIZE - Program::MAIN_FUNCTION_OFFSET}}, + {JSType::PROMISE_CAPABILITY, {PromiseCapability::PROMISE_OFFSET, PromiseCapability::RESOLVE_OFFSET, + PromiseCapability::REJECT_OFFSET, + PromiseCapability::SIZE - PromiseCapability::PROMISE_OFFSET}}, + {JSType::PROMISE_ITERATOR_RECORD, {PromiseIteratorRecord::ITERATOR_OFFSET, + PromiseIteratorRecord::SIZE - PromiseIteratorRecord::ITERATOR_OFFSET}}, + {JSType::PROMISE_REACTIONS, {PromiseReaction::PROMISE_CAPABILITY_OFFSET, + PromiseReaction::HANDLER_OFFSET, + PromiseReaction::SIZE - PromiseReaction::PROMISE_CAPABILITY_OFFSET}}, + {JSType::PROMISE_RECORD, {PromiseRecord::VALUE_OFFSET, + PromiseRecord::SIZE - PromiseRecord::VALUE_OFFSET}}, + {JSType::PROPERTY_BOX, {PropertyBox::VALUE_OFFSET, + PropertyBox::SIZE - PropertyBox::VALUE_OFFSET}}, + {JSType::PROTOTYPE_HANDLER, {PrototypeHandler::HANDLER_INFO_OFFSET, + PrototypeHandler::PROTO_CELL_OFFSET, + PrototypeHandler::HOLDER_OFFSET, + PrototypeHandler::ACCESSOR_JSFUNCTION_OFFSET, + PrototypeHandler::LAST_OFFSET - PrototypeHandler::HANDLER_INFO_OFFSET}}, + {JSType::PROTOTYPE_INFO, {ProtoChangeDetails::CHANGE_LISTENER_OFFSET, + ProtoChangeDetails::LAST_OFFSET - ProtoChangeDetails::CHANGE_LISTENER_OFFSET}}, + {JSType::PROTO_CHANGE_MARKER, {ProtoChangeMarker::SIZE - ProtoChangeMarker::BIT_FIELD_OFFSET}}, + {JSType::RB_TREENODE, {RBTreeNode::LEFT_OFFSET, RBTreeNode::RIGHT_OFFSET, RBTreeNode::ISRED_OFFSET, + RBTreeNode::LAST_OFFSET - RBTreeNode::LEFT_OFFSET}}, + {JSType::RESOLVEDBINDING_RECORD, {ResolvedBinding::MODULE_OFFSET, ResolvedBinding::BINDING_NAME_OFFSET, + ResolvedBinding::SIZE - ResolvedBinding::MODULE_OFFSET}}, + {JSType::RESOLVEDINDEXBINDING_RECORD, { + ResolvedIndexBinding::MODULE_OFFSET, + ResolvedIndexBinding::INDEX_OFFSET, + ResolvedIndexBinding::END_OFFSET - ResolvedIndexBinding::MODULE_OFFSET}}, + {JSType::RESOLVEDRECORDBINDING_RECORD, { + ResolvedRecordBinding::MODULE_RECORD_OFFSET, + ResolvedRecordBinding::BINDING_NAME_OFFSET, + ResolvedRecordBinding::SIZE - ResolvedRecordBinding::MODULE_RECORD_OFFSET}}, + {JSType::RESOLVEDRECORDINDEXBINDING_RECORD, { + ResolvedRecordIndexBinding::MODULE_RECORD_INDEX_OFFSET, + ResolvedRecordIndexBinding::ABC_FILE_NAME, + ResolvedRecordIndexBinding::END_OFFSET - ResolvedRecordIndexBinding::MODULE_RECORD_INDEX_OFFSET}}, + {JSType::RESOLVING_FUNCTIONS_RECORD, { + ResolvingFunctionsRecord::RESOLVE_FUNCTION_OFFSET, + ResolvingFunctionsRecord::REJECT_FUNCTION_OFFSET, + ResolvingFunctionsRecord::SIZE - ResolvingFunctionsRecord::RESOLVE_FUNCTION_OFFSET}}, + {JSType::SENDABLE_ENV, {TaggedArray::SIZE - TaggedArray::SIZE}}, + {JSType::SLICED_STRING, {SlicedString::PARENT_OFFSET, SlicedString::SIZE - SlicedString::PARENT_OFFSET}}, + {JSType::SOURCE_TEXT_MODULE_RECORD, { + SourceTextModule::SOURCE_TEXT_MODULE_OFFSET, + SourceTextModule::NAMESPACE_OFFSET, + SourceTextModule::REQUESTED_MODULES_OFFSET, + SourceTextModule::IMPORT_ENTRIES_OFFSET, + SourceTextModule::LOCAL_EXPORT_ENTTRIES_OFFSET, + SourceTextModule::INDIRECT_EXPORT_ENTTRIES_OFFSET, + SourceTextModule::START_EXPORT_ENTTRIES_OFFSET, + SourceTextModule::NAME_DICTIONARY_OFFSET, + SourceTextModule::CYCLE_ROOT_OFFSET, + SourceTextModule::TOP_LEVEL_CAPABILITY_OFFSET, + SourceTextModule::ASYNC_PARENT_MODULES_OFFSET, + SourceTextModule::SENDABLE_ENV_OFFSET, + SourceTextModule::SIZE - SourceTextModule::SOURCE_TEXT_MODULE_OFFSET}}, + {JSType::STAR_EXPORTENTRY_RECORD, {StarExportEntry::STAR_EXPORT_ENTRY_OFFSET, + StarExportEntry::SIZE - StarExportEntry::STAR_EXPORT_ENTRY_OFFSET}}, + {JSType::STORE_TS_HANDLER, {StoreTSHandler::HANDLER_INFO_OFFSET, + StoreTSHandler::PROTO_CELL_OFFSET, + StoreTSHandler::HOLDER_OFFSET, + StoreTSHandler::SIZE - StoreTSHandler::HANDLER_INFO_OFFSET}}, + {JSType::SYMBOL, {JSSymbol::DESCRIPTION_OFFSET, + JSSymbol::SIZE - JSSymbol::DESCRIPTION_OFFSET}}, + {JSType::TAGGED_ARRAY, {TaggedArray::LENGTH_OFFSET, TaggedArray::DATA_OFFSET, + TaggedArray::SIZE - TaggedArray::SIZE}}, + {JSType::TAGGED_DICTIONARY, {TaggedArray::LAST_OFFSET - TaggedArray::LENGTH_OFFSET}}, + {JSType::TEMPLATE_MAP, {TaggedArray::LAST_OFFSET - TaggedArray::LENGTH_OFFSET}}, + {JSType::TRACK_INFO, {TrackInfo::CACHED_HCLASS_OFFSET, TrackInfo::CACHED_FUNC_OFFSET, + TrackInfo::LAST_OFFSET - TrackInfo::CACHED_HCLASS_OFFSET}}, + {JSType::TRANSITION_HANDLER, {TransitionHandler::HANDLER_INFO_OFFSET, + TransitionHandler::TRANSITION_HCLASS_OFFSET, + TransitionHandler::SIZE - TransitionHandler::HANDLER_INFO_OFFSET}}, + {JSType::TRANS_WITH_PROTO_HANDLER, { + TransWithProtoHandler::HANDLER_INFO_OFFSET, + TransWithProtoHandler::TRANSITION_HCLASS_OFFSET, + TransWithProtoHandler::PROTO_CELL_OFFSET, + TransWithProtoHandler::SIZE - TransWithProtoHandler::HANDLER_INFO_OFFSET}}, + {JSType::TREE_STRING, {TreeEcmaString::FIRST_OFFSET, TreeEcmaString::SECOND_OFFSET, + TreeEcmaString::SIZE - TreeEcmaString::FIRST_OFFSET}}, + {JSType::VTABLE, {TaggedArray::LAST_OFFSET - TaggedArray::LENGTH_OFFSET}} + }; + // { typeName: [all parents of this type]} + parentsTable_ = { + {JSType::HCLASS, {"TAGGED_OBJECT"}}, + {JSType::ACCESSOR_DATA, {"RECORD"}}, + {JSType::AOT_LITERAL_INFO, {"TAGGED_OBJECT"}}, + {JSType::ASYNC_GENERATOR_REQUEST, {"RECORD"}}, + {JSType::ASYNC_ITERATOR_RECORD, {"RECORD"}}, + {JSType::BIGINT, {"TAGGED_OBJECT"}}, + {JSType::BYTE_ARRAY, {"TAGGED_OBJECT"}}, + {JSType::CELL_RECORD, {"RECORD"}}, + {JSType::CLASS_INFO_EXTRACTOR, {"TAGGED_OBJECT"}}, + {JSType::CLASS_LITERAL, {"TAGGED_OBJECT"}}, + {JSType::COMPLETION_RECORD, {"RECORD"}}, + {JSType::CONSTANT_POOL, {"TAGGED_ARRAY"}}, + {JSType::CONSTANT_STRING, {"ECMA_STRING"}}, + {JSType::COW_MUTANT_TAGGED_ARRAY, {"MUTANT_TAGGED_ARRAY"}}, + {JSType::COW_TAGGED_ARRAY, {"TAGGED_ARRAY"}}, + {JSType::EXTRA_PROFILE_TYPE_INFO, {"TAGGED_OBJECT"}}, + {JSType::FUNCTION_TEMPLATE, {"TAGGED_OBJECT"}}, + {JSType::GLOBAL_ENV, {"TAGGED_OBJECT"}}, + {JSType::IMPORTENTRY_RECORD, {"RECORD"}}, + {JSType::INDIRECT_EXPORTENTRY_RECORD, {"RECORD"}}, + {JSType::INTERNAL_ACCESSOR, {"RECORD"}}, + {JSType::JS_AGGREGATE_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_API_ARRAYLIST_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_ARRAY_LIST, {"JS_OBJECT"}}, + {JSType::JS_API_BITVECTOR, {"JS_OBJECT"}}, + {JSType::JS_API_BITVECTOR_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_DEQUE, {"JS_OBJECT"}}, + {JSType::JS_API_DEQUE_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_HASHMAP_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_HASHSET_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_HASH_MAP, {"JS_OBJECT"}}, + {JSType::JS_API_HASH_SET, {"JS_OBJECT"}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP, {"JS_OBJECT"}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_LIGHT_WEIGHT_SET, {"JS_OBJECT"}}, + {JSType::JS_API_LIGHT_WEIGHT_SET_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_LINKED_LIST, {"JS_OBJECT"}}, + {JSType::JS_API_LINKED_LIST_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_LIST, {"JS_OBJECT"}}, + {JSType::JS_API_LIST_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_PLAIN_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_API_PLAIN_ARRAY_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_QUEUE, {"JS_OBJECT"}}, + {JSType::JS_API_QUEUE_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_STACK, {"JS_OBJECT"}}, + {JSType::JS_API_STACK_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_TREEMAP_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_TREESET_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_API_TREE_MAP, {"JS_OBJECT"}}, + {JSType::JS_API_TREE_SET, {"JS_OBJECT"}}, + {JSType::JS_API_VECTOR, {"JS_OBJECT"}}, + {JSType::JS_API_VECTOR_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_ARGUMENTS, {"JS_OBJECT"}}, + {JSType::JS_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_ARRAY_BUFFER, {"JS_OBJECT"}}, + {JSType::JS_ARRAY_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_ASYNCITERATOR, {"ECMA_OBJECT"}}, + {JSType::JS_ASYNC_AWAIT_STATUS_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_ASYNC_FROM_SYNC_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_ASYNC_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_ASYNC_FUNC_OBJECT, {"JS_GENERATOR_OBJECT"}}, + {JSType::JS_ASYNC_GENERATOR_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_ASYNC_GENERATOR_OBJECT, {"JS_OBJECT"}}, + {JSType::JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN, {"JS_FUNCTION"}}, + {JSType::JS_ASYNC_MODULE_FULFILLED_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_ASYNC_MODULE_REJECTED_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_BIGINT64_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_BIGUINT64_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_BOUND_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_CJS_EXPORTS, {"JS_OBJECT"}}, + {JSType::JS_CJS_MODULE, {"JS_OBJECT"}}, + {JSType::JS_CJS_REQUIRE, {"JS_OBJECT"}}, + {JSType::JS_COLLATOR, {"JS_OBJECT"}}, + {JSType::JS_DATA_VIEW, {"JS_OBJECT"}}, + {JSType::JS_DATE, {"JS_OBJECT"}}, + {JSType::JS_DATE_TIME_FORMAT, {"JS_OBJECT"}}, + {JSType::JS_DISPLAYNAMES, {"JS_OBJECT"}}, + {JSType::JS_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_EVAL_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_FINALIZATION_REGISTRY, {"JS_OBJECT"}}, + {JSType::JS_FLOAT32_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_FLOAT64_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_FORIN_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_FUNCTION, {"JS_FUNCTION_BASE"}}, + {JSType::JS_FUNCTION_BASE, {"JS_OBJECT"}}, + {JSType::JS_GENERATOR_CONTEXT, {"TAGGED_OBJECT"}}, + {JSType::JS_GENERATOR_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_GENERATOR_OBJECT, {"JS_OBJECT"}}, + {JSType::JS_GLOBAL_OBJECT, {"JS_OBJECT"}}, + {JSType::JS_INT16_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_INT32_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_INT8_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_INTL, {"JS_OBJECT"}}, + {JSType::JS_INTL_BOUND_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_ITERATOR, {"ECMA_OBJECT"}}, + {JSType::JS_LIST_FORMAT, {"JS_OBJECT"}}, + {JSType::JS_LOCALE, {"JS_OBJECT"}}, + {JSType::JS_MAP, {"JS_OBJECT"}}, + {JSType::JS_MAP_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_MODULE_NAMESPACE, {"JS_OBJECT"}}, + {JSType::JS_NATIVE_POINTER, {"TAGGED_OBJECT"}}, + {JSType::JS_NUMBER_FORMAT, {"JS_OBJECT"}}, + {JSType::JS_OBJECT, {"ECMA_OBJECT"}}, + {JSType::JS_OOM_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_PLURAL_RULES, {"JS_OBJECT"}}, + {JSType::JS_PRIMITIVE_REF, {"JS_OBJECT"}}, + {JSType::JS_PROMISE, {"JS_OBJECT"}}, + {JSType::JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROMISE_EXECUTOR_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROMISE_FINALLY_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROMISE_REACTIONS_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_PROXY, {"ECMA_OBJECT"}}, + {JSType::JS_PROXY_REVOC_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_RANGE_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_REALM, {"JS_OBJECT"}}, + {JSType::JS_REFERENCE_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_REG_EXP, {"JS_OBJECT"}}, + {JSType::JS_REG_EXP_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_RELATIVE_TIME_FORMAT, {"JS_OBJECT"}}, + {JSType::JS_SEGMENTER, {"JS_OBJECT"}}, + {JSType::JS_SEGMENTS, {"JS_OBJECT"}}, + {JSType::JS_SEGMENT_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_SENDABLE_ARRAY_BUFFER, {"JS_OBJECT"}}, + {JSType::JS_SET, {"JS_OBJECT"}}, + {JSType::JS_SET_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_SHARED_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_SHARED_ARRAY_BUFFER, {"JS_OBJECT"}}, + {JSType::JS_SHARED_ARRAY_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_SHARED_ASYNC_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_SHARED_BIGINT64_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_BIGUINT64_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_FLOAT32_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_FLOAT64_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_FUNCTION, {"JS_FUNCTION"}}, + {JSType::JS_SHARED_INT16_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_INT32_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_INT8_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_MAP, {"JS_OBJECT"}}, + {JSType::JS_SHARED_MAP_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_SHARED_OBJECT, {"JS_OBJECT"}}, + {JSType::JS_SHARED_SET, {"JS_OBJECT"}}, + {JSType::JS_SHARED_SET_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_SHARED_TYPED_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_UINT16_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_UINT32_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_UINT8_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_SHARED_UINT8_CLAMPED_ARRAY, {"JS_TYPED_ARRAY"}}, + {JSType::JS_STRING_ITERATOR, {"JS_OBJECT"}}, + {JSType::JS_SYNTAX_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_TERMINATION_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_TYPED_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_TYPE_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_UINT16_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_UINT32_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_UINT8_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_UINT8_CLAMPED_ARRAY, {"JS_OBJECT"}}, + {JSType::JS_URI_ERROR, {"ECMA_OBJECT"}}, + {JSType::JS_WEAK_MAP, {"JS_OBJECT"}}, + {JSType::JS_WEAK_REF, {"JS_OBJECT"}}, + {JSType::JS_WEAK_SET, {"JS_OBJECT"}}, + {JSType::LEXICAL_ENV, {"TAGGED_ARRAY"}}, + {JSType::LINE_STRING, {"ECMA_STRING"}}, + {JSType::LINKED_NODE, {"TAGGED_NODE"}}, + {JSType::LOCAL_EXPORTENTRY_RECORD, {"RECORD"}}, + {JSType::MACHINE_CODE_OBJECT, {"TAGGED_OBJECT"}}, + {JSType::MARKER_CELL, {"TAGGED_OBJECT"}}, + {JSType::METHOD, {"TAGGED_OBJECT"}}, + {JSType::MICRO_JOB_QUEUE, {"RECORD"}}, + {JSType::MODULE_RECORD, {"RECORD"}}, + {JSType::MUTANT_TAGGED_ARRAY, {"TAGGED_ARRAY"}}, + {JSType::NATIVE_MODULE_FAILURE_INFO, {"JS_OBJECT"}}, + {JSType::PENDING_JOB, {"RECORD"}}, + {JSType::PROFILE_TYPE_INFO, {"TAGGED_ARRAY"}}, + {JSType::PROFILE_TYPE_INFO_CELL_0, {"TAGGED_OBJECT"}}, + {JSType::PROFILE_TYPE_INFO_CELL_1, {"TAGGED_OBJECT"}}, + {JSType::PROFILE_TYPE_INFO_CELL_N, {"TAGGED_OBJECT"}}, + {JSType::PROGRAM, {"ECMA_OBJECT"}}, + {JSType::PROMISE_CAPABILITY, {"RECORD"}}, + {JSType::PROMISE_ITERATOR_RECORD, {"RECORD"}}, + {JSType::PROMISE_REACTIONS, {"RECORD"}}, + {JSType::PROMISE_RECORD, {"RECORD"}}, + {JSType::PROPERTY_BOX, {"TAGGED_OBJECT"}}, + {JSType::PROTOTYPE_HANDLER, {"TAGGED_OBJECT"}}, + {JSType::PROTOTYPE_INFO, {"TAGGED_OBJECT"}}, + {JSType::PROTO_CHANGE_MARKER, {"TAGGED_OBJECT"}}, + {JSType::RB_TREENODE, {"TAGGED_NODE"}}, + {JSType::RESOLVEDBINDING_RECORD, {"RECORD"}}, + {JSType::RESOLVEDINDEXBINDING_RECORD, {"RECORD"}}, + {JSType::RESOLVEDRECORDBINDING_RECORD, {"RECORD"}}, + {JSType::RESOLVEDRECORDINDEXBINDING_RECORD, {"RECORD"}}, + {JSType::RESOLVING_FUNCTIONS_RECORD, {"RECORD"}}, + {JSType::SENDABLE_ENV, {"TAGGED_ARRAY"}}, + {JSType::SLICED_STRING, {"ECMA_STRING"}}, + {JSType::SOURCE_TEXT_MODULE_RECORD, {"MODULE_RECORD"}}, + {JSType::STAR_EXPORTENTRY_RECORD, {"RECORD"}}, + {JSType::STORE_TS_HANDLER, {"TAGGED_OBJECT"}}, + {JSType::SYMBOL, {"TAGGED_OBJECT"}}, + {JSType::TAGGED_ARRAY, {"TAGGED_OBJECT"}}, + {JSType::TAGGED_DICTIONARY, {"TAGGED_ARRAY"}}, + {JSType::TEMPLATE_MAP, {"TAGGED_OBJECT"}}, + {JSType::TRACK_INFO, {"TAGGED_OBJECT"}}, + {JSType::TRANSITION_HANDLER, {"TAGGED_OBJECT"}}, + {JSType::TRANS_WITH_PROTO_HANDLER, {"TAGGED_OBJECT"}}, + {JSType::TREE_STRING, {"ECMA_STRING"}}, + {JSType::VTABLE, {"TAGGED_OBJECT"}} + }; + // { typeName: [size of all fields' in the same order as declared in .h files]} + fieldSizeTable_ = { + {JSType::HCLASS, {JSHClass::LAYOUT_OFFSET - JSHClass::PROTOTYPE_OFFSET, + JSHClass::TRANSTIONS_OFFSET - JSHClass::LAYOUT_OFFSET, + JSHClass::PARENT_OFFSET - JSHClass::TRANSTIONS_OFFSET, + JSHClass::PROTO_CHANGE_MARKER_OFFSET - JSHClass::PARENT_OFFSET, + JSHClass::PROTO_CHANGE_DETAILS_OFFSET - JSHClass::PROTO_CHANGE_MARKER_OFFSET, + JSHClass::ENUM_CACHE_OFFSET - JSHClass::PROTO_CHANGE_DETAILS_OFFSET, + JSHClass::PROFILE_TYPE - JSHClass::ENUM_CACHE_OFFSET, + JSHClass::BIT_FIELD_OFFSET - JSHClass::PROFILE_TYPE, + JSHClass::BIT_FIELD1_OFFSET - JSHClass::BIT_FIELD_OFFSET, + JSHClass::LAST_OFFSET - JSHClass::BIT_FIELD1_OFFSET}}, + {JSType::ACCESSOR_DATA, {AccessorData::SETTER_OFFSET - AccessorData::GETTER_OFFSET, + AccessorData::SIZE - AccessorData::SETTER_OFFSET}}, + {JSType::AOT_LITERAL_INFO, {}}, + {JSType::ASYNC_GENERATOR_REQUEST, { + AsyncGeneratorRequest::CAPABILITY_OFFSET - AsyncGeneratorRequest::COMPLETION_OFFSET, + AsyncGeneratorRequest::SIZE - AsyncGeneratorRequest::CAPABILITY_OFFSET}}, + {JSType::ASYNC_ITERATOR_RECORD, { + AsyncIteratorRecord::NEXTMETHOD_OFFSET - AsyncIteratorRecord::ITERATOR_OFFSET, + AsyncIteratorRecord::BIT_FIELD_OFFSET - AsyncIteratorRecord::NEXTMETHOD_OFFSET}}, + {JSType::BIGINT, {}}, + {JSType::BYTE_ARRAY, {}}, + {JSType::CELL_RECORD, {CellRecord::HELD_VALUE_OFFSET - CellRecord::WEAKREF_TARGET_OFFSET, + CellRecord::SIZE - CellRecord::HELD_VALUE_OFFSET}}, + {JSType::CLASS_INFO_EXTRACTOR, { + ClassInfoExtractor::NON_STATIC_PROPERTIES_OFFSET - ClassInfoExtractor::PROTOTYPE_HCLASS_OFFSET, + ClassInfoExtractor::NON_STATIC_ELEMENTS_OFFSET - ClassInfoExtractor::NON_STATIC_PROPERTIES_OFFSET, + ClassInfoExtractor::CONSTRUCTOR_HCLASS_OFFSET - ClassInfoExtractor::NON_STATIC_ELEMENTS_OFFSET, + ClassInfoExtractor::STATIC_PROPERTIES_OFFSET - ClassInfoExtractor::CONSTRUCTOR_HCLASS_OFFSET, + ClassInfoExtractor::STATIC_ELEMENTS_OFFSET - ClassInfoExtractor::STATIC_PROPERTIES_OFFSET, + ClassInfoExtractor::CONSTRUCTOR_METHOD_OFFSET - ClassInfoExtractor::STATIC_ELEMENTS_OFFSET, + ClassInfoExtractor::BIT_FIELD_OFFSET - ClassInfoExtractor::CONSTRUCTOR_METHOD_OFFSET}}, + {JSType::CLASS_LITERAL, {ClassLiteral::IS_AOT_USED_OFFSET - ClassLiteral::ARRAY_OFFSET}}, + {JSType::COMPLETION_RECORD, {CompletionRecord::BIT_FIELD_OFFSET - CompletionRecord::VALUE_OFFSET}}, + {JSType::CONSTANT_POOL, {}}, + {JSType::CONSTANT_STRING, {ConstantString::ENTITY_ID_OFFSET - ConstantString::RELOCTAED_DATA_OFFSET}}, + {JSType::COW_MUTANT_TAGGED_ARRAY, {}}, + {JSType::COW_TAGGED_ARRAY, {}}, + {JSType::EXTRA_PROFILE_TYPE_INFO, { + ExtraProfileTypeInfo::HOLDER_OBJECT_OFFSET - ExtraProfileTypeInfo::RECEIVER_OBJECT_OFFSET, + ExtraProfileTypeInfo::LAST_OFFSET - ExtraProfileTypeInfo::HOLDER_OBJECT_OFFSET}}, + {JSType::FUNCTION_TEMPLATE, { + FunctionTemplate::MODULE_OFFSET - FunctionTemplate::METHOD_OFFSET, + FunctionTemplate::RAW_PROFILE_TYPE_INFO_OFFSET - FunctionTemplate::MODULE_OFFSET, + FunctionTemplate::LENGTH_OFFSET - FunctionTemplate::RAW_PROFILE_TYPE_INFO_OFFSET}}, + {JSType::GLOBAL_ENV, {}}, + {JSType::IMPORTENTRY_RECORD, { + ImportEntry::MODULE_REQUEST_OFFSET - ImportEntry::IMPORT_ENTRY_OFFSET, + ImportEntry::IMPORT_NAME_OFFSET - ImportEntry::MODULE_REQUEST_OFFSET, + ImportEntry::SIZE - ImportEntry::IMPORT_NAME_OFFSET}}, + {JSType::INDIRECT_EXPORTENTRY_RECORD, { + IndirectExportEntry::MODULE_REQUEST_OFFSET - IndirectExportEntry::INDIRECT_EXPORT_ENTRY_OFFSET, + IndirectExportEntry::IMPORT_NAME_OFFSET - IndirectExportEntry::MODULE_REQUEST_OFFSET, + IndirectExportEntry::SIZE - IndirectExportEntry::IMPORT_NAME_OFFSET}}, + {JSType::INTERNAL_ACCESSOR, { + InternalAccessor::SETTER_OFFSET - InternalAccessor::GETTER_OFFSET, + InternalAccessor::SIZE - InternalAccessor::SETTER_OFFSET}}, + {JSType::JS_AGGREGATE_ERROR, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_API_ARRAYLIST_ITERATOR, { + JSAPIArrayListIterator::NEXT_INDEX_OFFSET - JSAPIArrayListIterator::ITERATED_ARRAYLIST_OFFSET}}, + {JSType::JS_API_ARRAY_LIST, {JSAPIArrayList::SIZE - JSAPIArrayList::LENGTH_OFFSET}}, + {JSType::JS_API_BITVECTOR, {JSAPIBitVector::LENGTH_OFFSET - JSAPIBitVector::NATIVE_POINTER_OFFSET}}, + {JSType::JS_API_BITVECTOR_ITERATOR, { + JSAPIBitVectorIterator::NEXT_INDEX_OFFSET - JSAPIBitVectorIterator::ITERATED_BITVECTOR_OFFSET}}, + {JSType::JS_API_DEQUE, {}}, + {JSType::JS_API_DEQUE_ITERATOR, { + JSAPIDequeIterator::NEXT_INDEX_OFFSET - JSAPIDequeIterator::ITERATED_DEQUE_OFFSET}}, + {JSType::JS_API_HASHMAP_ITERATOR, { + JSAPIHashMapIterator::TAGGED_QUEUE_OFFSET - JSAPIHashMapIterator::ITERATED_HASHMAP_OFFSET, + JSAPIHashMapIterator::CURRENT_NODE_RESULT - JSAPIHashMapIterator::TAGGED_QUEUE_OFFSET, + JSAPIHashMapIterator::NEXT_INDEX_OFFSET - JSAPIHashMapIterator::CURRENT_NODE_RESULT + }}, + {JSType::JS_API_HASHSET_ITERATOR, { + JSAPIHashSetIterator::TAGGED_QUEUE_OFFSET - JSAPIHashSetIterator::ITERATED_HASHSET_OFFSET, + JSAPIHashSetIterator::CURRENT_NODE_RESULT - JSAPIHashSetIterator::TAGGED_QUEUE_OFFSET, + JSAPIHashSetIterator::NEXT_INDEX_OFFSET - JSAPIHashSetIterator::CURRENT_NODE_RESULT}}, + {JSType::JS_API_HASH_MAP, {JSAPIHashMap::HASHMAP_SIZE_OFFSET- JSAPIHashMap::HASHMAP_TABLE_INDEX}}, + {JSType::JS_API_HASH_SET, {JSAPIHashSet::HASHSET_SIZE_OFFSET- JSAPIHashSet::HASHSET_TABLE_INDEX}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP, { + JSAPILightWeightMap::LWP_KEYS_OFFSET - JSAPILightWeightMap::LWP_HASHES_OFFSET, + JSAPILightWeightMap::LWP_VALUES_OFFSET - JSAPILightWeightMap::LWP_KEYS_OFFSET, + JSAPILightWeightMap::LWP_LENGTH_OFFSET - JSAPILightWeightMap::LWP_VALUES_OFFSET}}, + {JSType::JS_API_LIGHT_WEIGHT_MAP_ITERATOR, { + JSAPILightWeightMapIterator::NEXT_INDEX_OFFSET - JSAPILightWeightMapIterator::ITERATED_LIGHT_WEIGHT_MAP_OFFSET}}, + {JSType::JS_API_LIGHT_WEIGHT_SET, { + JSAPILightWeightSet::VALUES_OFFSET - JSAPILightWeightSet::HASHES_OFFSET, + JSAPILightWeightSet::LENGTH_OFFSET - JSAPILightWeightSet::VALUES_OFFSET}}, + {JSType::JS_API_LIGHT_WEIGHT_SET_ITERATOR, { + JSAPILightWeightSetIterator::NEXT_INDEX_OFFSET - JSAPILightWeightSetIterator::ITERATED_LIGHT_WEIGHT_SET_OFFSET}}, + {JSType::JS_API_LINKED_LIST, {JSAPILinkedList::SIZE - JSAPILinkedList::DOUBLE_LIST_OFFSET}}, + {JSType::JS_API_LINKED_LIST_ITERATOR, { + JSAPILinkedListIterator::DATA_INDEX_OFFSET - JSAPILinkedListIterator::ITERATED_LINKED_LIST_OFFSET}}, + {JSType::JS_API_LIST, {JSAPIList::BIT_FIELD_OFFSET - JSAPIList::SINGLY_LIST_OFFSET}}, + {JSType::JS_API_LIST_ITERATOR, { + JSAPIListIterator::DATA_INDEX_OFFSET - JSAPIListIterator::ITERATED_LIST_OFFSET}}, + {JSType::JS_API_PLAIN_ARRAY, {JSAPIPlainArray::VALUES_OFFSET - JSAPIPlainArray::KEYS_OFFSET, + JSAPIPlainArray::LENGTH_OFFSET - JSAPIPlainArray::VALUES_OFFSET}}, + {JSType::JS_API_PLAIN_ARRAY_ITERATOR, { + JSAPIPlainArrayIterator::NEXT_INDEX_OFFSET - JSAPIPlainArrayIterator::ITERATED_PLAIN_ARRAY_OFFSET}}, + {JSType::JS_API_QUEUE, {JSAPIQueue::FRONT_OFFSET - JSAPIQueue::LENGTH_OFFSET}}, + {JSType::JS_API_QUEUE_ITERATOR, { + JSAPIQueueIterator::NEXT_INDEX_OFFSET - JSAPIQueueIterator::ITERATED_QUEUE_OFFSET}}, + {JSType::JS_API_STACK, {}}, + {JSType::JS_API_STACK_ITERATOR, { + JSAPIStackIterator::NEXT_INDEX_OFFSET - JSAPIStackIterator::ITERATED_STACK_OFFSET}}, + {JSType::JS_API_TREEMAP_ITERATOR, { + JSAPITreeMapIterator::ITERATED_ENTRIES_OFFSET - JSAPITreeMapIterator::ITERATED_MAP_OFFSET, + JSAPITreeMapIterator::NEXT_INDEX_OFFSET - JSAPITreeMapIterator::ITERATED_ENTRIES_OFFSET}}, + {JSType::JS_API_TREESET_ITERATOR, { + JSAPITreeSetIterator::ITERATED_ENTRIES_OFFSET - JSAPITreeSetIterator::ITERATED_SET_OFFSET, + JSAPITreeSetIterator::NEXT_INDEX_OFFSET - JSAPITreeSetIterator::ITERATED_ENTRIES_OFFSET}}, + {JSType::JS_API_TREE_MAP, {JSAPITreeMap::SIZE - JSAPITreeMap::TREE_MAP_OFFSET}}, + {JSType::JS_API_TREE_SET, {JSAPITreeSet::SIZE - JSAPITreeSet::TREE_SET_OFFSET}}, + {JSType::JS_API_VECTOR, {}}, + {JSType::JS_API_VECTOR_ITERATOR, { + JSAPIVectorIterator::NEXT_INDEX_OFFSET - JSAPIVectorIterator::ITERATED_VECTOR_OFFSET}}, + {JSType::JS_ARGUMENTS, {}}, + {JSType::JS_ARRAY, {JSArray::TRACE_INDEX_OFFSET - JSArray::LENGTH_OFFSET, + JSArray::SIZE - JSArray::TRACK_INFO_OFFSET}}, + {JSType::JS_ARRAY_BUFFER, {JSArrayBuffer::BYTE_LENGTH_OFFSET - JSArrayBuffer::DATA_OFFSET}}, + {JSType::JS_ARRAY_ITERATOR, { + JSArrayIterator::NEXT_INDEX_OFFSET - JSArrayIterator::ITERATED_ARRAY_OFFSET}}, + {JSType::JS_ASYNCITERATOR, {JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_ASYNC_AWAIT_STATUS_FUNCTION, { + JSAsyncAwaitStatusFunction::SIZE - JSAsyncAwaitStatusFunction::ASYNC_CONTEXT_OFFSET}}, + {JSType::JS_ASYNC_FROM_SYNC_ITERATOR, { + JSAsyncFromSyncIterator::SIZE - JSAsyncFromSyncIterator::SYNC_ITERATOR_RECORD}}, + {JSType::JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION, { + JSAsyncFromSyncIterUnwarpFunction::SIZE - JSAsyncFromSyncIterUnwarpFunction::DONE_OFFSET}}, + {JSType::JS_ASYNC_FUNCTION, {}}, + {JSType::JS_ASYNC_FUNC_OBJECT, { + JSAsyncFuncObject::SIZE - JSAsyncFuncObject::GENERATOR_PROMISE_OFFSET}}, + {JSType::JS_ASYNC_GENERATOR_FUNCTION, {}}, + {JSType::JS_ASYNC_GENERATOR_OBJECT, { + JSAsyncGeneratorObject::ASYNC_GENERATOR_QUEUE_OFFSET - JSAsyncGeneratorObject::GENERATOR_CONTEXT_OFFSET, + JSAsyncGeneratorObject::GENERATOR_OFFSET - JSAsyncGeneratorObject::ASYNC_GENERATOR_QUEUE_OFFSET, + JSAsyncGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET - JSAsyncGeneratorObject::GENERATOR_OFFSET, + JSAsyncGeneratorObject::BIT_FIELD_OFFSET - JSAsyncGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET}}, + {JSType::JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN, { + JSAsyncGeneratorResNextRetProRstFtn::SIZE - JSAsyncGeneratorResNextRetProRstFtn::ASYNC_GENERATOR_OBJECT_OFFSET}}, + {JSType::JS_ASYNC_MODULE_FULFILLED_FUNCTION, {}}, + {JSType::JS_ASYNC_MODULE_REJECTED_FUNCTION, {}}, + {JSType::JS_BIGINT64_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_BIGUINT64_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_BOUND_FUNCTION, { + JSBoundFunction::BOUND_THIS_OFFSET - JSBoundFunction::BOUND_TARGET_OFFSET, + JSBoundFunction::BOUND_ARGUMENTS_OFFSET - JSBoundFunction::BOUND_THIS_OFFSET, + JSBoundFunction::SIZE - JSBoundFunction::BOUND_ARGUMENTS_OFFSET}}, + {JSType::JS_CJS_EXPORTS, {CjsExports::SIZE - CjsExports::JS_CJS_EXPORTS_OFFSET}}, + {JSType::JS_CJS_MODULE, {CjsModule::ID_OFFSET - CjsModule::JS_CJS_MODULE_OFFSET, + CjsModule::PATH_OFFSET - CjsModule::ID_OFFSET, + CjsModule::EXPORTS_OFFSET - CjsModule::PATH_OFFSET, + CjsModule::BIT_FIELD_OFFSET - CjsModule::EXPORTS_OFFSET}}, + {JSType::JS_CJS_REQUIRE, {CjsRequire::CACHE_OFFSET - CjsRequire::JS_CJS_REQUIRE_OFFSET, + CjsRequire::SIZE - CjsRequire::CACHE_OFFSET}}, + {JSType::JS_COLLATOR, {JSCollator::LOCALE_OFFSET - JSCollator::ICU_FIELD_OFFSET, + JSCollator::COLLATION_OFFSET - JSCollator::LOCALE_OFFSET, + JSCollator::BOUND_COMPARE_OFFSET - JSCollator::COLLATION_OFFSET, + JSCollator::BIT_FIELD_OFFSET - JSCollator::BOUND_COMPARE_OFFSET}}, + {JSType::JS_DATA_VIEW, {JSDataView::VIEW_ARRAY_BUFFER_OFFSET - JSDataView::DATA_VIEW_OFFSET, + JSDataView::BYTE_LENGTH_OFFSET - JSDataView::VIEW_ARRAY_BUFFER_OFFSET}}, + {JSType::JS_DATE, {JSDate::LOCAL_TIME_OFFSET - JSDate::TIME_VALUE_OFFSET, + JSDate::SIZE - JSDate::LOCAL_TIME_OFFSET}}, + {JSType::JS_DATE_TIME_FORMAT, { + JSDateTimeFormat::CALENDAR_OFFSET - JSDateTimeFormat::LOCALE_OFFSET, + JSDateTimeFormat::NUMBER_STRING_SYSTEM_OFFSET - JSDateTimeFormat::CALENDAR_OFFSET, + JSDateTimeFormat::TIME_ZONE_OFFSET - JSDateTimeFormat::NUMBER_STRING_SYSTEM_OFFSET, + JSDateTimeFormat::LOCALE_ICU_OFFSET - JSDateTimeFormat::TIME_ZONE_OFFSET, + JSDateTimeFormat::SIMPLE_DATE_TIME_FORMAT_ICU_OFFSET - JSDateTimeFormat::LOCALE_ICU_OFFSET, + JSDateTimeFormat::ISO8601_OFFSET - JSDateTimeFormat::SIMPLE_DATE_TIME_FORMAT_ICU_OFFSET, + JSDateTimeFormat::BOUND_FORMAT_OFFSET - JSDateTimeFormat::ISO8601_OFFSET, + JSDateTimeFormat::BIT_FIELD_OFFSET - JSDateTimeFormat::BOUND_FORMAT_OFFSET}}, + {JSType::JS_DISPLAYNAMES, {JSDisplayNames::ICU_LOCALE_DISPPLAY_NAMES - JSDisplayNames::LOCALE_OFFSET, + JSDisplayNames::BIT_FIELD_OFFSET - JSDisplayNames::ICU_LOCALE_DISPPLAY_NAMES}}, + {JSType::JS_ERROR, {JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_EVAL_ERROR, {JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_FINALIZATION_REGISTRY, { + JSFinalizationRegistry::NO_UNREGISTER_OFFSET - JSFinalizationRegistry::CLEANUP_CALLBACK_OFFSET, + JSFinalizationRegistry::MAYBE_UNREGISTER_OFFSET - JSFinalizationRegistry::NO_UNREGISTER_OFFSET, + JSFinalizationRegistry::NEXT_OFFSET - JSFinalizationRegistry::MAYBE_UNREGISTER_OFFSET, + JSFinalizationRegistry::PREV_OFFSET - JSFinalizationRegistry::NEXT_OFFSET, + JSFinalizationRegistry::SIZE - JSFinalizationRegistry::PREV_OFFSET}}, + {JSType::JS_FLOAT32_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_FLOAT64_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_FORIN_ITERATOR, { + JSForInIterator::CACHED_HCLASS_OFFSET - JSForInIterator::OBJECT_OFFSET, + JSForInIterator::KEYS_OFFSET - JSForInIterator::CACHED_HCLASS_OFFSET, + JSForInIterator::INDEX_OFFSET - JSForInIterator::KEYS_OFFSET}}, + {JSType::JS_FUNCTION, { + JSFunction::LEXICAL_ENV_OFFSET - JSFunction::PROTO_OR_DYNCLASS_OFFSET, + JSFunction::MACHINECODE_OFFSET - JSFunction::LEXICAL_ENV_OFFSET, + JSFunction::BASELINECODE_OFFSET - JSFunction::MACHINECODE_OFFSET, + JSFunction::RAW_PROFILE_TYPE_INFO_OFFSET - JSFunction::BASELINECODE_OFFSET, + JSFunction::HOME_OBJECT_OFFSET - JSFunction::RAW_PROFILE_TYPE_INFO_OFFSET, + JSFunction::ECMA_MODULE_OFFSET - JSFunction::HOME_OBJECT_OFFSET, + JSFunction::PROTO_TRANS_ROOT_HCLASS_OFFSET - JSFunction::ECMA_MODULE_OFFSET, + JSFunction::WORK_NODE_POINTER_OFFSET - JSFunction::PROTO_TRANS_ROOT_HCLASS_OFFSET}}, + {JSType::JS_FUNCTION_BASE, {JSFunctionBase::CODE_ENTRY_OFFSET - JSFunctionBase::METHOD_OFFSET}}, + {JSType::JS_GENERATOR_CONTEXT, { + GeneratorContext::GENERATOR_METHOD_OFFSET - GeneratorContext::GENERATOR_REGS_ARRAY_OFFSET, + GeneratorContext::GENERATOR_THIS_OFFSET - GeneratorContext::GENERATOR_METHOD_OFFSET, + GeneratorContext::GENERATOR_ACC_OFFSET - GeneratorContext::GENERATOR_THIS_OFFSET, + GeneratorContext::GENERATOR_GENERATOR_OBJECT_OFFSET - GeneratorContext::GENERATOR_ACC_OFFSET, + GeneratorContext::GENERATOR_LEXICALENV_OFFSET - GeneratorContext::GENERATOR_GENERATOR_OBJECT_OFFSET, + GeneratorContext::GENERATOR_NREGS_OFFSET - GeneratorContext::GENERATOR_LEXICALENV_OFFSET}}, + {JSType::JS_GENERATOR_FUNCTION, {}}, + {JSType::JS_GENERATOR_OBJECT, { + JSGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET - JSGeneratorObject::GENERATOR_CONTEXT_OFFSET, + JSGeneratorObject::TASK_INFO_OFFSET - JSGeneratorObject::GENERATOR_RESUME_RESULT_OFFSET}}, + {JSType::JS_GLOBAL_OBJECT, {}}, + {JSType::JS_INT16_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_INT32_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_INT8_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_INTL, {JSIntl::SIZE - JSIntl::FALLBACK_SYMBOL}}, + {JSType::JS_INTL_BOUND_FUNCTION, { + JSIntlBoundFunction::DATETIME_FORMAT_OFFSET - JSIntlBoundFunction::NUMBER_FORMAT_OFFSET, + JSIntlBoundFunction::COLLATOR_OFFSET - JSIntlBoundFunction::DATETIME_FORMAT_OFFSET, + JSIntlBoundFunction::SIZE - JSIntlBoundFunction::COLLATOR_OFFSET}}, + {JSType::JS_ITERATOR, {JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_LIST_FORMAT, {JSListFormat::ICU_LIST_FORMAT - JSListFormat::LOCALE_OFFSET, + JSListFormat::BIT_FIELD_OFFSET - JSListFormat::ICU_LIST_FORMAT}}, + {JSType::JS_LOCALE, {JSLocale::SIZE - JSLocale::ICU_FIELD_OFFSET}}, + {JSType::JS_MAP, {JSMap::SIZE - JSMap::LINKED_MAP_OFFSET}}, + {JSType::JS_MAP_ITERATOR, {JSMapIterator::NEXT_INDEX_OFFSET - JSMapIterator::ITERATED_MAP_OFFSET}}, + {JSType::JS_MODULE_NAMESPACE, { + ModuleNamespace::EXPORTS_OFFSET - ModuleNamespace::MODULE_OFFSET, + ModuleNamespace::DEREGISTER_PROCESSION_OFFSET - ModuleNamespace::EXPORTS_OFFSET, + ModuleNamespace::SIZE - ModuleNamespace::DEREGISTER_PROCESSION_OFFSET}}, + {JSType::JS_NATIVE_POINTER, { + JSNativePointer::FLAG_OFFSET- JSNativePointer::DATA_SIZE_OFFSET}}, + {JSType::JS_NUMBER_FORMAT, { + JSNumberFormat::NUMBER_STRING_SYSTEM_OFFSET - JSNumberFormat::LOCALE_OFFSET, + JSNumberFormat::CURRENCY_OFFSET - JSNumberFormat::NUMBER_STRING_SYSTEM_OFFSET, + JSNumberFormat::UNIT_OFFSET - JSNumberFormat::CURRENCY_OFFSET, + JSNumberFormat::MINIMUM_INTEGER_DIGITS_OFFSET - JSNumberFormat::UNIT_OFFSET, + JSNumberFormat::MINIMUM_FRACTION_DIGITS_OFFSET - JSNumberFormat::MINIMUM_INTEGER_DIGITS_OFFSET, + JSNumberFormat::MAXIMUM_FRACTION_DIGITS_OFFSET - JSNumberFormat::MINIMUM_FRACTION_DIGITS_OFFSET, + JSNumberFormat::MINIMUM_SIGNIFICANT_DIGITS_OFFSET - JSNumberFormat::MAXIMUM_FRACTION_DIGITS_OFFSET, + JSNumberFormat::MAXIMUM_SIGNIFICANT_DIGITS_OFFSET - JSNumberFormat::MINIMUM_SIGNIFICANT_DIGITS_OFFSET, + JSNumberFormat::USER_GROUPING_OFFSET - JSNumberFormat::MAXIMUM_SIGNIFICANT_DIGITS_OFFSET, + JSNumberFormat::BOUND_FORMAT_OFFSET - JSNumberFormat::USER_GROUPING_OFFSET, + JSNumberFormat::ICU_FIELD_OFFSET - JSNumberFormat::BOUND_FORMAT_OFFSET, + JSNumberFormat::BIT_FIELD_OFFSET - JSNumberFormat::ICU_FIELD_OFFSET}}, + {JSType::JS_OBJECT, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_OOM_ERROR, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_PLURAL_RULES, { + JSPluralRules::MINIMUM_INTEGER_DIGITS_OFFSET - JSPluralRules::LOCALE_OFFSET, + JSPluralRules::MINIMUM_FRACTION_DIGITS_OFFSET - JSPluralRules::MINIMUM_INTEGER_DIGITS_OFFSET, + JSPluralRules::MAXIMUM_FRACTION_DIGITS_OFFSET - JSPluralRules::MINIMUM_FRACTION_DIGITS_OFFSET, + JSPluralRules::MININUM_SIGNIFICANT_DIGITS_OFFSET - JSPluralRules::MAXIMUM_FRACTION_DIGITS_OFFSET, + JSPluralRules::MAXINUM_SIGNIFICANT_DIGITS_OFFSET - JSPluralRules::MININUM_SIGNIFICANT_DIGITS_OFFSET, + JSPluralRules::ICU_PLURAL_RULES_OFFSET - JSPluralRules::MAXINUM_SIGNIFICANT_DIGITS_OFFSET, + JSPluralRules::ICU_NUMBER_FORMAT_OFFSET - JSPluralRules::ICU_PLURAL_RULES_OFFSET, + JSPluralRules::BIT_FIELD_OFFSET - JSPluralRules::ICU_NUMBER_FORMAT_OFFSET}}, + {JSType::JS_PRIMITIVE_REF, {JSPrimitiveRef::SIZE - JSPrimitiveRef::VALUE_OFFSET}}, + {JSType::JS_PROMISE, { + JSPromise::PROMISE_FULFILL_REACTIONS_OFFSET - JSPromise::PROMISE_RESULT_OFFSET, + JSPromise::PROMISE_REJECT_REACTIONS_OFFSET - JSPromise::PROMISE_FULFILL_REACTIONS_OFFSET, + JSPromise::BIT_FIELD_OFFSET - JSPromise::PROMISE_REJECT_REACTIONS_OFFSET}}, + {JSType::JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION, { + JSPromiseAllResolveElementFunction::VALUES_OFFSET - JSPromiseAllResolveElementFunction::INDEX_OFFSET, + JSPromiseAllResolveElementFunction::CAPABILITIES_OFFSET - JSPromiseAllResolveElementFunction::VALUES_OFFSET, + JSPromiseAllResolveElementFunction::REMAINING_ELEMENTS_OFFSET - JSPromiseAllResolveElementFunction::CAPABILITIES_OFFSET, + JSPromiseAllResolveElementFunction::ALREADY_CALLED_OFFSET - JSPromiseAllResolveElementFunction::REMAINING_ELEMENTS_OFFSET, + JSPromiseAllResolveElementFunction::SIZE - JSPromiseAllResolveElementFunction::ALREADY_CALLED_OFFSET}}, + {JSType::JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION, { + JSPromiseAllSettledElementFunction::VALUES_OFFSET - JSPromiseAllSettledElementFunction::ALREADY_CALLED_OFFSET, + JSPromiseAllSettledElementFunction::CAPABILITY_OFFSET - JSPromiseAllSettledElementFunction::VALUES_OFFSET, + JSPromiseAllSettledElementFunction::REMAINING_ELEMENTS_OFFSET - JSPromiseAllSettledElementFunction::CAPABILITY_OFFSET, + JSPromiseAllSettledElementFunction::INDEX_OFFSET - JSPromiseAllSettledElementFunction::REMAINING_ELEMENTS_OFFSET}}, + {JSType::JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION, { + JSPromiseAnyRejectElementFunction::CAPABILITY_OFFSET - JSPromiseAnyRejectElementFunction::ERRORS_OFFSET, + JSPromiseAnyRejectElementFunction::REMAINING_ELEMENTS_OFFSET - JSPromiseAnyRejectElementFunction::CAPABILITY_OFFSET, + JSPromiseAnyRejectElementFunction::ALREADY_CALLED_OFFSET - JSPromiseAnyRejectElementFunction::REMAINING_ELEMENTS_OFFSET, + JSPromiseAnyRejectElementFunction::INDEX_OFFSET - JSPromiseAnyRejectElementFunction::ALREADY_CALLED_OFFSET}}, + {JSType::JS_PROMISE_EXECUTOR_FUNCTION, { + JSPromiseExecutorFunction::SIZE - JSPromiseExecutorFunction::CAPABILITY_OFFSET}}, + {JSType::JS_PROMISE_FINALLY_FUNCTION, { + JSPromiseFinallyFunction::ONFINALLY_OFFSET - JSPromiseFinallyFunction::CONSTRUCTOR_OFFSET, + JSPromiseFinallyFunction::SIZE - JSPromiseFinallyFunction::ONFINALLY_OFFSET}}, + {JSType::JS_PROMISE_REACTIONS_FUNCTION, { + JSPromiseReactionsFunction::ALREADY_RESOLVED_OFFSET - JSPromiseReactionsFunction::PROMISE_OFFSET, + JSPromiseReactionsFunction::SIZE - JSPromiseReactionsFunction::ALREADY_RESOLVED_OFFSET}}, + {JSType::JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION, { + JSPromiseValueThunkOrThrowerFunction::SIZE - JSPromiseValueThunkOrThrowerFunction::RESULT_OFFSET}}, + {JSType::JS_PROXY, {JSProxy::HANDLER_OFFSET - JSProxy::TARGET_OFFSET, + JSProxy::METHOD_OFFSET - JSProxy::HANDLER_OFFSET, + JSProxy::PRIVATE_FIELD_OFFSET - JSProxy::METHOD_OFFSET, + JSProxy::BIT_FIELD_OFFSET - JSProxy::PRIVATE_FIELD_OFFSET}}, + {JSType::JS_PROXY_REVOC_FUNCTION, { + JSProxyRevocFunction::SIZE - JSProxyRevocFunction::REVOCABLE_PROXY_OFFSET}}, + {JSType::JS_RANGE_ERROR, {JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_REALM, {JSRealm::GLOBAL_ENV_OFFSET - JSRealm::VALUE_OFFSET, + JSRealm::SIZE - JSRealm::GLOBAL_ENV_OFFSET}}, + {JSType::JS_REFERENCE_ERROR, {JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_REG_EXP, {JSRegExp::ORIGINAL_SOURCE_OFFSET - JSRegExp::REGEXP_BYTE_CODE_OFFSET, + JSRegExp::ORIGINAL_FLAGS_OFFSET - JSRegExp::ORIGINAL_SOURCE_OFFSET, + JSRegExp::GROUP_NAME_OFFSET - JSRegExp::ORIGINAL_FLAGS_OFFSET, + JSRegExp::LENGTH_OFFSET - JSRegExp::GROUP_NAME_OFFSET}}, + {JSType::JS_REG_EXP_ITERATOR, { + JSRegExpIterator::ITERATED_STRING_OFFSET - JSRegExpIterator::ITERATING_REGEXP_OFFSET, + JSRegExpIterator::BIT_FIELD_OFFSET - JSRegExpIterator::ITERATED_STRING_OFFSET}}, + {JSType::JS_RELATIVE_TIME_FORMAT, { + JSRelativeTimeFormat::NUMBERING_SYSTEM_OFFSET - JSRelativeTimeFormat::LOCALE_OFFSET, + JSRelativeTimeFormat::ICU_FIELD_OFFSET - JSRelativeTimeFormat::NUMBERING_SYSTEM_OFFSET, + JSRelativeTimeFormat::BIT_FIELD_OFFSET - JSRelativeTimeFormat::ICU_FIELD_OFFSET}}, + {JSType::JS_SEGMENTER, {JSSegmenter::ICU_FIELD_OFFSET - JSSegmenter::LOCALE_OFFSET, + JSSegmenter::BIT_FIELD_OFFSET - JSSegmenter::ICU_FIELD_OFFSET}}, + {JSType::JS_SEGMENTS, {JSSegments::SEGMENTS_STRING_OFFSET - JSSegments::ICU_FIELD_OFFSET, + JSSegments::UNICODE_STRING_OFFSET - JSSegments::SEGMENTS_STRING_OFFSET, + JSSegments::BIT_FIELD_OFFSET - JSSegments::UNICODE_STRING_OFFSET}}, + {JSType::JS_SEGMENT_ITERATOR, { + JSSegmentIterator::SEGMENTS_STRING_OFFSET - JSSegmentIterator::ICU_FIELD_OFFSET, + JSSegmentIterator::UNICODE_STRING_OFFSET - JSSegmentIterator::SEGMENTS_STRING_OFFSET, + JSSegmentIterator::BIT_FIELD_OFFSET - JSSegmentIterator::UNICODE_STRING_OFFSET}}, + {JSType::JS_SENDABLE_ARRAY_BUFFER, { + JSSendableArrayBuffer::BYTE_LENGTH_OFFSET- JSSendableArrayBuffer::DATA_OFFSET}}, + {JSType::JS_SET, {JSSet::SIZE - JSSet::LINKED_SET_OFFSET}}, + {JSType::JS_SET_ITERATOR, { + JSSetIterator::NEXT_INDEX_OFFSET - JSSetIterator::ITERATED_SET_OFFSET}}, + {JSType::JS_SHARED_ARRAY, { + JSSharedArray::MOD_RECORD_OFFSET - JSSharedArray::TRACK_INFO_OFFSET}}, + {JSType::JS_SHARED_ARRAY_BUFFER, { + JSArrayBuffer::BYTE_LENGTH_OFFSET - JSArrayBuffer::DATA_OFFSET}}, + {JSType::JS_SHARED_ARRAY_ITERATOR, { + JSSharedArrayIterator::NEXT_INDEX_OFFSET - JSSharedArrayIterator::ITERATED_ARRAY_OFFSET}}, + {JSType::JS_SHARED_ASYNC_FUNCTION, {}}, + {JSType::JS_SHARED_BIGINT64_ARRAY, {}}, + {JSType::JS_SHARED_BIGUINT64_ARRAY, {}}, + {JSType::JS_SHARED_FLOAT32_ARRAY, {}}, + {JSType::JS_SHARED_FLOAT64_ARRAY, {}}, + {JSType::JS_SHARED_FUNCTION, {}}, + {JSType::JS_SHARED_INT16_ARRAY, {}}, + {JSType::JS_SHARED_INT32_ARRAY, {}}, + {JSType::JS_SHARED_INT8_ARRAY, {}}, + {JSType::JS_SHARED_MAP, { + JSSharedMap::MOD_RECORD_OFFSET - JSSharedMap::LINKED_MAP_OFFSET}}, + {JSType::JS_SHARED_MAP_ITERATOR, { + JSSharedMapIterator::NEXT_INDEX_OFFSET - JSSharedMapIterator::ITERATED_MAP_OFFSET}}, + {JSType::JS_SHARED_OBJECT, {}}, + {JSType::JS_SHARED_SET, { + JSSharedSet::MOD_RECORD_OFFSET - JSSharedSet::LINKED_SET_OFFSET}}, + {JSType::JS_SHARED_SET_ITERATOR, { + JSSharedSetIterator::NEXT_INDEX_OFFSET - JSSharedSetIterator::ITERATED_SET_OFFSET}}, + {JSType::JS_SHARED_TYPED_ARRAY, {}}, + {JSType::JS_SHARED_UINT16_ARRAY, {}}, + {JSType::JS_SHARED_UINT32_ARRAY, {}}, + {JSType::JS_SHARED_UINT8_ARRAY, {}}, + {JSType::JS_SHARED_UINT8_CLAMPED_ARRAY, {}}, + {JSType::JS_STRING_ITERATOR, { + JSStringIterator::STRING_ITERATOR_NEXT_INDEX_OFFSET - JSStringIterator::ITERATED_STRING_OFFSET}}, + {JSType::JS_SYNTAX_ERROR, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_TERMINATION_ERROR, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_TYPED_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_TYPE_ERROR, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_UINT16_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_UINT32_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_UINT8_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_UINT8_CLAMPED_ARRAY, { + JSTypedArray::TYPED_ARRAY_NAME_OFFSET - JSTypedArray::VIEWED_ARRAY_BUFFER_OFFSET, + JSTypedArray::BYTE_LENGTH_OFFSET - JSTypedArray::TYPED_ARRAY_NAME_OFFSET}}, + {JSType::JS_URI_ERROR, { + JSObject::ELEMENTS_OFFSET - JSObject::PROPERTIES_OFFSET, + JSObject::SIZE - JSObject::ELEMENTS_OFFSET}}, + {JSType::JS_WEAK_MAP, {JSWeakMap::SIZE - JSWeakMap::LINKED_MAP_OFFSET}}, + {JSType::JS_WEAK_REF, {JSWeakRef::SIZE - JSWeakRef::WEAK_OBJECT_OFFSET}}, + {JSType::JS_WEAK_SET, {JSWeakSet::SIZE - JSWeakSet::LINKED_SET_OFFSET}}, + {JSType::LEXICAL_ENV, {}}, + {JSType::LINE_STRING, {}}, + {JSType::LINKED_NODE, {LinkedNode::SIZE - LinkedNode::NEXT_OFFSET}}, + {JSType::LOCAL_EXPORTENTRY_RECORD, { + LocalExportEntry::LOCAL_NAME_OFFSET - LocalExportEntry::LOCAL_EXPORT_ENTRY_OFFSET, + LocalExportEntry::LOCAL_INDEX_OFFSET - LocalExportEntry::LOCAL_NAME_OFFSET}}, + {JSType::MACHINE_CODE_OBJECT, {}}, + {JSType::MARKER_CELL, {}}, + {JSType::METHOD, {Method::CALL_FIELD_OFFSET - Method::CONSTANT_POOL_OFFSET}}, + {JSType::MICRO_JOB_QUEUE, { + job::MicroJobQueue::SCRIPT_JOB_QUEUE_OFFSET - job::MicroJobQueue::PROMISE_JOB_QUEUE_OFFSET, + job::MicroJobQueue::SIZE - job::MicroJobQueue::SCRIPT_JOB_QUEUE_OFFSET}}, + {JSType::MODULE_RECORD, {}}, + {JSType::MUTANT_TAGGED_ARRAY, {}}, + {JSType::NATIVE_MODULE_FAILURE_INFO, { + NativeModuleFailureInfo::SIZE - NativeModuleFailureInfo::ARK_NATIVE_MODULE_FAILURE_INFO_OFFSET}}, + {JSType::PENDING_JOB, {job::PendingJob::ARGUMENT_OFFSET - job::PendingJob::JOB_OFFSET, + job::PendingJob::SIZE - job::PendingJob::ARGUMENT_OFFSET}}, + {JSType::PROFILE_TYPE_INFO, {}}, + {JSType::PROFILE_TYPE_INFO_CELL_0, { + ProfileTypeInfoCell::MACHINE_CODE_OFFSET - ProfileTypeInfoCell::VALUE_OFFSET, + ProfileTypeInfoCell::HANDLE_OFFSET - ProfileTypeInfoCell::MACHINE_CODE_OFFSET, + ProfileTypeInfoCell::LAST_OFFSET - ProfileTypeInfoCell::HANDLE_OFFSET}}, + {JSType::PROFILE_TYPE_INFO_CELL_1, { + ProfileTypeInfoCell::MACHINE_CODE_OFFSET - ProfileTypeInfoCell::VALUE_OFFSET, + ProfileTypeInfoCell::HANDLE_OFFSET - ProfileTypeInfoCell::MACHINE_CODE_OFFSET, + ProfileTypeInfoCell::LAST_OFFSET - ProfileTypeInfoCell::HANDLE_OFFSET}}, + {JSType::PROFILE_TYPE_INFO_CELL_N, { + ProfileTypeInfoCell::MACHINE_CODE_OFFSET - ProfileTypeInfoCell::VALUE_OFFSET, + ProfileTypeInfoCell::HANDLE_OFFSET - ProfileTypeInfoCell::MACHINE_CODE_OFFSET, + ProfileTypeInfoCell::LAST_OFFSET - ProfileTypeInfoCell::HANDLE_OFFSET}}, + {JSType::PROGRAM, {Program::SIZE - Program::MAIN_FUNCTION_OFFSET}}, + {JSType::PROMISE_CAPABILITY, { + PromiseCapability::RESOLVE_OFFSET - PromiseCapability::PROMISE_OFFSET, + PromiseCapability::REJECT_OFFSET - PromiseCapability::RESOLVE_OFFSET, + PromiseCapability::SIZE - PromiseCapability::REJECT_OFFSET}}, + {JSType::PROMISE_ITERATOR_RECORD, { + PromiseIteratorRecord::BIT_FIELD_OFFSET - PromiseIteratorRecord::ITERATOR_OFFSET}}, + {JSType::PROMISE_REACTIONS, { + PromiseReaction::HANDLER_OFFSET - PromiseReaction::PROMISE_CAPABILITY_OFFSET, + PromiseReaction::BIT_FIELD_OFFSET - PromiseReaction::HANDLER_OFFSET}}, + {JSType::PROMISE_RECORD, {PromiseRecord::SIZE - PromiseRecord::VALUE_OFFSET}}, + {JSType::PROPERTY_BOX, {PropertyBox::SIZE - PropertyBox::VALUE_OFFSET}}, + {JSType::PROTOTYPE_HANDLER, { + PrototypeHandler::PROTO_CELL_OFFSET - PrototypeHandler::HANDLER_INFO_OFFSET, + PrototypeHandler::HOLDER_OFFSET - PrototypeHandler::PROTO_CELL_OFFSET, + PrototypeHandler::ACCESSOR_JSFUNCTION_OFFSET - PrototypeHandler::HOLDER_OFFSET, + PrototypeHandler::ACCESSOR_METHOD_ID_OFFSET - PrototypeHandler::PrototypeHandler::ACCESSOR_JSFUNCTION_OFFSET}}, + {JSType::PROTOTYPE_INFO, { + ProtoChangeDetails::REGISTER_INDEX_OFFSET - ProtoChangeDetails::CHANGE_LISTENER_OFFSET}}, + {JSType::PROTO_CHANGE_MARKER, {}}, + {JSType::RB_TREENODE, { + RBTreeNode::RIGHT_OFFSET - RBTreeNode::LEFT_OFFSET, + RBTreeNode::ISRED_OFFSET - RBTreeNode::RIGHT_OFFSET, + RBTreeNode::COUNT_OFFSET - RBTreeNode::ISRED_OFFSET}}, + {JSType::RESOLVEDBINDING_RECORD, { + ResolvedBinding::BINDING_NAME_OFFSET - ResolvedBinding::MODULE_OFFSET, + ResolvedBinding::SIZE - ResolvedBinding::BINDING_NAME_OFFSET}}, + {JSType::RESOLVEDINDEXBINDING_RECORD, { + ResolvedIndexBinding::INDEX_OFFSET - ResolvedIndexBinding::MODULE_OFFSET, + ResolvedIndexBinding::END_OFFSET - ResolvedIndexBinding::INDEX_OFFSET}}, + {JSType::RESOLVEDRECORDBINDING_RECORD, { + ResolvedRecordBinding::BINDING_NAME_OFFSET - ResolvedRecordBinding::MODULE_RECORD_OFFSET, + ResolvedRecordBinding::SIZE - ResolvedRecordBinding::BINDING_NAME_OFFSET}}, + {JSType::RESOLVEDRECORDINDEXBINDING_RECORD, { + ResolvedRecordIndexBinding::ABC_FILE_NAME - ResolvedRecordIndexBinding::MODULE_RECORD_INDEX_OFFSET, + ResolvedRecordIndexBinding::INDEX_OFFSET - ResolvedRecordIndexBinding::ABC_FILE_NAME}}, + {JSType::RESOLVING_FUNCTIONS_RECORD, { + ResolvingFunctionsRecord::REJECT_FUNCTION_OFFSET - ResolvingFunctionsRecord::RESOLVE_FUNCTION_OFFSET, + ResolvingFunctionsRecord::SIZE - ResolvingFunctionsRecord::REJECT_FUNCTION_OFFSET}}, + {JSType::SENDABLE_ENV, {}}, + {JSType::SLICED_STRING, {SlicedString::STARTINDEX_OFFSET - SlicedString::PARENT_OFFSET}}, + {JSType::SOURCE_TEXT_MODULE_RECORD, { + SourceTextModule::NAMESPACE_OFFSET - SourceTextModule::SOURCE_TEXT_MODULE_OFFSET, + SourceTextModule::REQUESTED_MODULES_OFFSET - SourceTextModule::NAMESPACE_OFFSET, + SourceTextModule::IMPORT_ENTRIES_OFFSET - SourceTextModule::REQUESTED_MODULES_OFFSET, + SourceTextModule::LOCAL_EXPORT_ENTTRIES_OFFSET - SourceTextModule::IMPORT_ENTRIES_OFFSET, + SourceTextModule::INDIRECT_EXPORT_ENTTRIES_OFFSET - SourceTextModule::LOCAL_EXPORT_ENTTRIES_OFFSET, + SourceTextModule::START_EXPORT_ENTTRIES_OFFSET - SourceTextModule::INDIRECT_EXPORT_ENTTRIES_OFFSET, + SourceTextModule::NAME_DICTIONARY_OFFSET - SourceTextModule::START_EXPORT_ENTTRIES_OFFSET, + SourceTextModule::CYCLE_ROOT_OFFSET - SourceTextModule::NAME_DICTIONARY_OFFSET, + SourceTextModule::TOP_LEVEL_CAPABILITY_OFFSET - SourceTextModule::CYCLE_ROOT_OFFSET, + SourceTextModule::ASYNC_PARENT_MODULES_OFFSET - SourceTextModule::TOP_LEVEL_CAPABILITY_OFFSET, + SourceTextModule::SENDABLE_ENV_OFFSET - SourceTextModule::ASYNC_PARENT_MODULES_OFFSET, + SourceTextModule::EVALUATION_ERROR_OFFSET - SourceTextModule::SENDABLE_ENV_OFFSET}}, + {JSType::STAR_EXPORTENTRY_RECORD, {StarExportEntry::SIZE - StarExportEntry::STAR_EXPORT_ENTRY_OFFSET}}, + {JSType::STORE_TS_HANDLER, {StoreTSHandler::PROTO_CELL_OFFSET - StoreTSHandler::HANDLER_INFO_OFFSET, + StoreTSHandler::HOLDER_OFFSET - StoreTSHandler::PROTO_CELL_OFFSET, + StoreTSHandler::SIZE - StoreTSHandler::HOLDER_OFFSET}}, + {JSType::SYMBOL, {JSSymbol::HASHFIELD_OFFSET - JSSymbol::DESCRIPTION_OFFSET}}, + {JSType::TAGGED_ARRAY, { + TaggedArray::EXTRA_LENGTH_OFFSET - TaggedArray::LENGTH_OFFSET, TaggedArray::LENGTH_OFFSET}}, + {JSType::TAGGED_DICTIONARY, {}}, + {JSType::TEMPLATE_MAP, {}}, + {JSType::TRACK_INFO, { + TrackInfo::CACHED_FUNC_OFFSET - TrackInfo::CACHED_HCLASS_OFFSET, + TrackInfo::BIT_FIELD_OFFSET - TrackInfo::CACHED_FUNC_OFFSET}}, + {JSType::TRANSITION_HANDLER, { + TransitionHandler::TRANSITION_HCLASS_OFFSET - TransitionHandler::HANDLER_INFO_OFFSET, + TransitionHandler::SIZE - TransitionHandler::TRANSITION_HCLASS_OFFSET}}, + {JSType::TRANS_WITH_PROTO_HANDLER, { + TransWithProtoHandler::TRANSITION_HCLASS_OFFSET - TransWithProtoHandler::HANDLER_INFO_OFFSET, + TransWithProtoHandler::PROTO_CELL_OFFSET - TransWithProtoHandler::TRANSITION_HCLASS_OFFSET, + TransWithProtoHandler::SIZE - TransWithProtoHandler::PROTO_CELL_OFFSET}}, + {JSType::TREE_STRING, {TreeEcmaString::SECOND_OFFSET - TreeEcmaString::FIRST_OFFSET, + TreeEcmaString::SIZE - TreeEcmaString::SECOND_OFFSET}}, + {JSType::VTABLE, {}} + }; + } + + ~JSMetadataTestHelper() = default; + + enum MetadataStatus { + UNINITIALIZED = 0, + INITIALIZED + }; + + struct Metadata { + std::string name {}; + std::unordered_map> offsets {}; + int endOffset {}; + std::vector parents {}; + int status {MetadataStatus::UNINITIALIZED}; + }; + + void ReadAndParseMetadataJson(std::string &filePath, Metadata &metadata) + { + // Open specific metadata json file and using cJSON to parse + std::ifstream jsonFile(filePath); + if (!jsonFile.is_open()) { + std::cout << "Fail to open metadata file: " << filePath << std::endl; + return; + } + std::stringstream buffer; + buffer << jsonFile.rdbuf(); + auto json = cJSON_ParseWithOpts(buffer.str().c_str(), nullptr, true); + if (!json) { + std::cout << "Fail to read metadata file: " << filePath << std::endl; + jsonFile.close(); + return; + } + jsonFile.close(); + // Get "name" from json and set it to metadata.name + if (!GetStringFromJson(json, "name", metadata.name)) { + std::cout << "Fail to read name: " << filePath << std::endl; + return; + } + // Get "end_offset" from json and set it to metadata.endoffset + if (!GetIntFromJson(json, "end_offset", metadata.endOffset)) { + std::cout << "Fail to read endOffset: " << filePath << std::endl; + return; + } + // Get "offsets" and "parents" arrays from json + cJSON *offsets {}; + cJSON *parents {}; + if (!GetArrayFromJson(json, "offsets", &offsets)) { + std::cout << "Fail to read offsets array: " << filePath << std::endl; + return; + } + if (!GetArrayFromJson(json, "parents", &parents)) { + std::cout << "Fail to read parents array: " << filePath << std::endl; + return; + } + // Iterate over those two arrays and set items to metadata + auto parentVisitor = [&filePath, &metadata](const cJSON *item, int index) -> bool { + if (!cJSON_IsString(item)) { + std::cout << "Fail to visit parent: " << filePath << ", parents index: " << index << std::endl; + return false; + } + metadata.parents.emplace_back(item->valuestring); + return true; + }; + auto offsetVisitor = [&filePath, &metadata, this](const cJSON *item, int index) -> bool { + std::string key {}; + int offset {}; + int size {}; + if (!GetStringFromJson(item, "name", key)) { + std::cout << "Fail to visit name: " << filePath << ", offsets index " << index << std::endl; + return false; + } + if (!GetIntFromJson(item, "offset", offset)) { + std::cout << "Fail to visit offset: " << filePath << ", offsets index " << index << std::endl; + return false; + } + if (!GetIntFromJson(item, "size", size)) { + std::cout << "Fail to visit size: " << filePath << ", offsets index " << index << std::endl; + return false; + } + metadata.offsets[key] = std::make_pair(offset, size); + return true; + }; + if (!VisitArrayItems(offsets, offsetVisitor)) { + std::cout << "Fail to get offsets: " << filePath << std::endl; + return; + } + if (!VisitArrayItems(parents, parentVisitor)) { + std::cout << "Fail to get parents: " << filePath << std::endl; + return; + } + // Set metadata status to INITIALIZED + metadata.status = MetadataStatus::INITIALIZED; + } + + bool Test(JSType type, Metadata &metadata) + { + auto fieldNames = GetFieldNamesByType(type); + auto fieldOffsets = GetFieldOffsetsByType(type); + auto sizeTable = GetFieldSizesByType(type); + // Fields count should be the same as offsets' + if (fieldNames.size() != fieldOffsets.size()) { + std::cout << "Type fields' number inconsistent with offsets' number" << std::endl; + return false; + } + // check each [name, offset] pair + int index = 0; + for (; index < fieldNames.size(); index++) { + if (index == fieldNames.size() - 1) { + // Check typename and endOffset, stored at the last index of each array + if (!CheckTypeNameAndEndOffset(metadata.name, fieldNames[index], + metadata.endOffset, fieldOffsets[index])) { + return false; + } + } else { + // Check individual fields + if (!CheckField(fieldNames[index], fieldOffsets[index], metadata, fieldOffsets[0], sizeTable[index])) { + return false; + } + } + } + // If any field left in metadata that has not been checked, return false + if (!CheckLeftoverFieldInMetadata(metadata)) { + return false; + } + // Check if parent array is the same + if (!CheckParents(type, metadata)) { + return false; + } + + return true; + } + + bool TestForDictionaryLayout(std::string &filePath) + { + std::ifstream jsonFile(filePath); + if (!jsonFile.is_open()) { + std::cout << "Fail to open metadata file: " << filePath << std::endl; + return false; + } + std::stringstream buffer; + buffer << jsonFile.rdbuf(); + auto json = cJSON_ParseWithOpts(buffer.str().c_str(), nullptr, true); + if (!json) { + std::cout << "Fail to read metadata file: " << filePath << std::endl; + jsonFile.close(); + return false; + } + jsonFile.close(); + + int value; + if (!GetIntFromJson(json, "key_index", value)) { + std::cout << "Fail to get key_index: " << filePath << std::endl; + return false; + } + if (value != NameDictionary::ENTRY_KEY_INDEX) { + std::cout << "Dictionary layout key_index inconsistent: " << value << " "; + std::cout << NameDictionary::ENTRY_KEY_INDEX << std::endl; + return false; + } + if (!GetIntFromJson(json, "value_index", value)) { + std::cout << "Fail to get value_index: " << filePath << std::endl; + return false; + } + if (value != NameDictionary::ENTRY_VALUE_INDEX) { + std::cout << "Dictionary layout value_index inconsistent: " << value << " "; + std::cout << NameDictionary::ENTRY_VALUE_INDEX << std::endl; + return false; + } + if (!GetIntFromJson(json, "detail_index", value)) { + std::cout << "Fail to get detail_index: " << filePath << std::endl; + return false; + } + if (value != NameDictionary::ENTRY_DETAILS_INDEX) { + std::cout << "Dictionary layout detail_index inconsistent: " << value << " "; + std::cout << NameDictionary::ENTRY_DETAILS_INDEX << std::endl; + return false; + } + if (!GetIntFromJson(json, "entry_size", value)) { + std::cout << "Fail to get entry_size: " << filePath << std::endl; + return false; + } + if (value != NameDictionary::ENTRY_SIZE) { + std::cout << "Dictionary layout entry_size inconsistent: " << value << " "; + std::cout << NameDictionary::ENTRY_SIZE << std::endl; + return false; + } + if (!GetIntFromJson(json, "header_size", value)) { + std::cout << "Fail to get header_size: " << filePath << std::endl; + return false; + } + if (value != NameDictionary::TABLE_HEADER_SIZE) { + std::cout << "Dictionary layout header_size inconsistent: " << value << " "; + std::cout << NameDictionary::TABLE_HEADER_SIZE << std::endl; + return false; + } + return true; + } + + bool TestForTypeRange(std::string &filePath) + { + std::ifstream jsonFile(filePath); + if (!jsonFile.is_open()) { + std::cout << "Fail to open metadata file: " << filePath << std::endl; + return false; + } + std::stringstream buffer; + buffer << jsonFile.rdbuf(); + auto json = cJSON_ParseWithOpts(buffer.str().c_str(), nullptr, true); + if (!json) { + std::cout << "Fail to read metadata file: " << filePath << std::endl; + jsonFile.close(); + return false; + } + jsonFile.close(); + + std::string value; + if (!GetStringFromJson(json, "string_first", value)) { + std::cout << "Fail to read string_first: " << filePath << std::endl; + return false; + } + if (value != "LINE_STRING") { + std::cout << "string_first inconsistent" << std::endl; + return false; + } + if (!GetStringFromJson(json, "string_last", value)) { + std::cout << "Fail to read string_last: " << filePath << std::endl; + return false; + } + if (value != "TREE_STRING") { + std::cout << "string_last inconsistent" << std::endl; + return false; + } + if (!GetStringFromJson(json, "js_object_first", value)) { + std::cout << "Fail to read js_object_first: " << filePath << std::endl; + return false; + } + if (value != "JS_OBJECT") { + std::cout << "js_object_first inconsistent" << std::endl; + return false; + } + if (!GetStringFromJson(json, "js_object_last", value)) { + std::cout << "Fail to read js_object_last: " << filePath << std::endl; + return false; + } + if (value != "JS_GLOBAL_OBJECT") { + std::cout << "js_object_last inconsistent" << std::endl; + return false; + } + return true; + } + + static std::unordered_map> fieldNameTable_; + static std::unordered_map> fieldOffsetTable_; + static std::unordered_map> parentsTable_; + static std::unordered_map> fieldSizeTable_; +private: + std::vector GetFieldNamesByType(JSType type) + { + return HasTypeInFieldNameTable(type) ? fieldNameTable_.at(type) : std::vector(); + } + + std::vector GetFieldOffsetsByType(JSType type) + { + return HasTypeInFieldOffsetTable(type) ? fieldOffsetTable_.at(type) : std::vector(); + } + + std::vector GetParentsByType(JSType type) + { + return HasTypeInParentsTable(type) ? parentsTable_.at(type) : std::vector(); + } + + std::vector GetFieldSizesByType(JSType type) + { + return HasTypeInFieldSizesTable(type) ? fieldSizeTable_.at(type) : std::vector(); + } + + bool HasTypeInFieldNameTable(JSType type) + { + return !fieldNameTable_.empty() && fieldNameTable_.find(type) != fieldNameTable_.end(); + } + + bool HasTypeInFieldOffsetTable(JSType type) + { + return !fieldOffsetTable_.empty() && fieldOffsetTable_.find(type) != fieldOffsetTable_.end(); + } + + bool HasTypeInFieldSizesTable(JSType type) + { + return !fieldSizeTable_.empty() && fieldSizeTable_.find(type) != fieldSizeTable_.end(); + } + + bool HasTypeInParentsTable(JSType type) + { + return !parentsTable_.empty() && parentsTable_.find(type) != parentsTable_.end(); + } + + bool CheckTypeNameAndEndOffset(std::string &metaName, std::string &typeName, int metaEndOffset, int endOffset) + { + if (metaName != typeName || metaEndOffset != endOffset) { + std::cout << "Type name or endOffset inconsistent" << std::endl; + std::cout << "[" << metaName << " " << metaEndOffset << "] ["; + std::cout << typeName << " " << endOffset << "]" << std::endl; + return false; + } + return true; + } + + bool CheckField(std::string &fieldName, int fieldOffset, Metadata &metadata, int offsetAlign, int size) + { + if (metadata.offsets.find(fieldName) == metadata.offsets.end()) { + // a field is defined in the code but not in metadata, ignored for now + std::cout << "Type " << metadata.name << " Field " << fieldName; + std::cout << " is not defined in metadata" << std::endl; + return true; + } + offsetAlign = metadata.name == "JS_NATIVE_POINTER" ? JSNativePointer::POINTER_OFFSET : + metadata.name == "JS_SHARED_ARRAY" ? JSSharedArray::LENGTH_OFFSET : offsetAlign; + if ((fieldOffset - offsetAlign) != metadata.offsets[fieldName].first) { + std::cout << "Type " << metadata.name << " Field " << fieldName << " offset inconsistent" << std::endl; + std::cout << "Metadata: " << metadata.offsets[fieldName].first; + std::cout << ", Class definition: " << fieldOffset << std::endl; + return false; + } + if (size != metadata.offsets[fieldName].second) { + std::cout << "Type " << metadata.name << " Field " << fieldName << " size inconsistent" << std::endl; + std::cout << "Metadata: " << metadata.offsets[fieldName].second; + std::cout << ", Class definition: " << size << std::endl; + return false; + } + // remove fieldName in metadata that has been checked + metadata.offsets.erase(fieldName); + return true; + } + + bool CheckLeftoverFieldInMetadata(Metadata &metadata) + { + if (!metadata.offsets.empty()) { + std::cout << "Following fields of Type " << metadata.name; + std::cout << ", defined in metadata has not been checked: " << std::endl; + DumpFieldsInMetadata(metadata); + return false; + } + return true; + } + + bool CheckParents(JSType type, Metadata &metadata) + { + auto parents = GetParentsByType(type); + if (parents.size() != metadata.parents.size()) { + std::cout << "Type " << metadata.name << " parents inconsistent" << std::endl; + return false; + } + int index = 0; + for (; index < parents.size(); index++) { + if (parents.at(index) != metadata.parents.at(index)) { + std::cout << "Type " << metadata.name << " parents inconsistent" << std::endl; + return false; + } + } + return true; + } + + void DumpFieldsInMetadata(Metadata &metadata) + { + for (const auto &field : metadata.offsets) { + std::cout << "Field: " << field.first << " Offset: "; + std::cout << field.second.first << " Size: " << field.second.second << std::endl; + } + } + + bool GetStringFromJson(const cJSON *json, const char *key, std::string &value) + { + auto item = cJSON_GetObjectItem(json, key); + if (!item || !cJSON_IsString(item)) { + return false; + } + value = item->valuestring; + return true; + } + + bool GetIntFromJson(const cJSON *json, const char *key, int &value) + { + auto item = cJSON_GetObjectItem(json, key); + if (!item || !cJSON_IsNumber(item)) { + return false; + } + value = static_cast(item->valuedouble); + return true; + } + + bool GetArrayFromJson(const cJSON *json, const char *key, cJSON **value) + { + auto item = cJSON_GetObjectItem(json, key); + if (!item || !cJSON_IsArray(item)) { + return false; + } + *value = item; + return true; + } + + bool VisitArrayItems(const cJSON *json, ArrayVisitor &visitor) + { + int size = cJSON_GetArraySize(json); + if (size < 0) { + return false; + } + for (int index = 0; index < size; index++) { + cJSON *item = cJSON_GetArrayItem(json, index); + if (!visitor(item, index)) { + return false; + } + } + return true; + } +}; + +std::unordered_map> JSMetadataTestHelper::fieldNameTable_ {}; +std::unordered_map> JSMetadataTestHelper::fieldOffsetTable_ {}; +std::unordered_map> JSMetadataTestHelper::parentsTable_ {}; +std::unordered_map> JSMetadataTestHelper::fieldSizeTable_ {}; + +HWTEST_F_L0(JSMetadataTest, TestHClassMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"hclass.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::HCLASS, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestAccessorDataMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"accessor_data.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::ACCESSOR_DATA, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestAotLiteralInfoMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"aot_literal_info.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::AOT_LITERAL_INFO, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestAsyncGeneratorRequestMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"async_generator_request.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::ASYNC_GENERATOR_REQUEST, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestAsyncIteratorRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"async_iterator_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::ASYNC_ITERATOR_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestBigintMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"bigint.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::BIGINT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestByteArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"byte_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::BYTE_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestCellRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"cell_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::CELL_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestClassInfoExtractorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"class_info_extractor.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::CLASS_INFO_EXTRACTOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestClassLiteralMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"class_literal.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::CLASS_LITERAL, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestCompletionRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"completion_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::COMPLETION_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestConstantPoolMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"constant_pool.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::CONSTANT_POOL, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestConstantStringMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"constant_string.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::CONSTANT_STRING, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestCowMutantTaggedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"cow_mutant_tagged_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::COW_MUTANT_TAGGED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestCowTaggedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"cow_tagged_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::COW_TAGGED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestExtraProfileTypeInfoMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"extra_profile_type_info.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::EXTRA_PROFILE_TYPE_INFO, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestFunctionTemplateMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"function_template.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::FUNCTION_TEMPLATE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestGlobalEnvMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"global_env.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::GLOBAL_ENV, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestImportentryRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"importentry_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::IMPORTENTRY_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestIndirectExportentryRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"indirect_exportentry_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::INDIRECT_EXPORTENTRY_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestInternalAccessorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"internal_accessor.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::INTERNAL_ACCESSOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAggregateErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_aggregate_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_AGGREGATE_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiArraylistIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_arraylist_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_ARRAYLIST_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiArrayListMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_array_list.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_ARRAY_LIST, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiBitvectorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_bitvector.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_BITVECTOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiBitvectorIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_bitvector_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_BITVECTOR_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiDequeMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_deque.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_DEQUE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiDequeIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_deque_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_DEQUE_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiHashmapIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_hashmap_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_HASHMAP_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiHashsetIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_hashset_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_HASHSET_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiHashMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_hash_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_HASH_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiHashSetMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_hash_set.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_HASH_SET, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiLightWeightMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_light_weight_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LIGHT_WEIGHT_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiLightWeightMapIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_light_weight_map_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LIGHT_WEIGHT_MAP_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiLightWeightSetMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_light_weight_set.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LIGHT_WEIGHT_SET, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiLightWeightSetIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_light_weight_set_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LIGHT_WEIGHT_SET_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiLinkedListMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_linked_list.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LINKED_LIST, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiLinkedListIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_linked_list_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LINKED_LIST_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiListMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_list.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LIST, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiListIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_list_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_LIST_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiPlainArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_plain_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_PLAIN_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiPlainArrayIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_plain_array_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_PLAIN_ARRAY_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiQueueMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_queue.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_QUEUE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiQueueIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_queue_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_QUEUE_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiStackMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_stack.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_STACK, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiStackIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_stack_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_STACK_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiTreemapIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_treemap_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_TREEMAP_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiTreesetIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_treeset_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_TREESET_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiTreeMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_tree_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_TREE_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiTreeSetMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_tree_set.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_TREE_SET, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiVectorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_vector.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_VECTOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsApiVectorIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_api_vector_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_API_VECTOR_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsArgumentsMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_arguments.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ARGUMENTS, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsArrayBufferMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_array_buffer.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ARRAY_BUFFER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsArrayIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_array_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ARRAY_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsynciteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_asynciterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNCITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncAwaitStatusFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_await_status_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_AWAIT_STATUS_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncFromSyncIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_from_sync_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_FROM_SYNC_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncFromSyncIterUnwarpFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_from_sync_iter_unwarp_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncFuncObjectMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_func_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_FUNC_OBJECT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncGeneratorFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_generator_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_GENERATOR_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncGeneratorObjectMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_generator_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_GENERATOR_OBJECT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncGeneratorResumeNextReturnProcessorRstFtnMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = + METADATA_SOURCE_FILE_DIR"js_async_generator_resume_next_return_processor_rst_ftn.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncModuleFulfilledFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_module_fulfilled_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_MODULE_FULFILLED_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsAsyncModuleRejectedFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_async_module_rejected_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ASYNC_MODULE_REJECTED_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsBigint64ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_bigint64_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_BIGINT64_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsBiguint64ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_biguint64_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_BIGUINT64_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsBoundFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_bound_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_BOUND_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsCjsExportsMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_cjs_exports.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_CJS_EXPORTS, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsCjsModuleMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_cjs_module.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_CJS_MODULE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsCjsRequireMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_cjs_require.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_CJS_REQUIRE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsCollatorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_collator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_COLLATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsDataViewMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_data_view.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_DATA_VIEW, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsDateMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_date.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_DATE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsDateTimeFormatMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_date_time_format.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_DATE_TIME_FORMAT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsDisplaynamesMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_displaynames.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_DISPLAYNAMES, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsEvalErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_eval_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_EVAL_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsFinalizationRegistryMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_finalization_registry.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_FINALIZATION_REGISTRY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsFloat32ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_float32_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_FLOAT32_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsFloat64ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_float64_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_FLOAT64_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsForinIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_forin_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_FORIN_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsFunctionMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_FUNCTION, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestJsFunctionBaseMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_function_base.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_FUNCTION_BASE, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestJsGeneratorContextMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_generator_context.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_GENERATOR_CONTEXT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsGeneratorFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_generator_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_GENERATOR_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsGeneratorObjectMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_generator_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_GENERATOR_OBJECT, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestJsGlobalObjectMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_global_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_GLOBAL_OBJECT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsInt16ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_int16_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_INT16_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsInt32ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_int32_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_INT32_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsInt8ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_int8_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_INT8_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsIntlMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_intl.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_INTL, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsIntlBoundFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_intl_bound_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_INTL_BOUND_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsListFormatMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_list_format.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_LIST_FORMAT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsLocaleMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_locale.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_LOCALE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsMapIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_map_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_MAP_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsModuleNamespaceMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_module_namespace.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_MODULE_NAMESPACE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsNativePointerMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_native_pointer.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_NATIVE_POINTER, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestJsNumberFormatMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_number_format.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_NUMBER_FORMAT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsObjectMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_OBJECT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsOomErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_oom_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_OOM_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPluralRulesMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_plural_rules.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PLURAL_RULES, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPrimitiveRefMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_primitive_ref.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PRIMITIVE_REF, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseAllResolveElementFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_all_resolve_element_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseAllSettledElementFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_all_settled_element_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseAnyRejectElementFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_any_reject_element_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseExecutorFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_executor_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_EXECUTOR_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseFinallyFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_finally_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_FINALLY_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseReactionsFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_reactions_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_REACTIONS_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsPromiseValueThunkOrThrowerFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_promise_value_thunk_or_thrower_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsProxyMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_proxy.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROXY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsProxyRevocFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_proxy_revoc_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_PROXY_REVOC_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsRangeErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_range_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_RANGE_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsRealmMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_realm.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_REALM, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsReferenceErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_reference_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_REFERENCE_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsRegExpMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_reg_exp.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_REG_EXP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsRegExpIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_reg_exp_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_REG_EXP_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsRelativeTimeFormatMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_relative_time_format.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_RELATIVE_TIME_FORMAT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSegmenterMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_segmenter.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SEGMENTER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSegmentsMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_segments.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SEGMENTS, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSegmentIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_segment_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SEGMENT_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSendableArrayBufferMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_sendable_array_buffer.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SENDABLE_ARRAY_BUFFER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSetMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_set.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SET, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSetIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_set_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SET_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedArrayBufferMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_array_buffer.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_ARRAY_BUFFER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedArrayIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_array_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_ARRAY_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedAsyncFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_async_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_ASYNC_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedBigint64ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_bigint64_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_BIGINT64_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedBiguint64ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_biguint64_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_BIGUINT64_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedFloat32ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_float32_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_FLOAT32_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedFloat64ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_float64_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_FLOAT64_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedFunctionMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_function.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_FUNCTION, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedInt16ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_int16_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_INT16_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedInt32ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_int32_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_INT32_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedInt8ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_int8_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_INT8_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedMapIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_map_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_MAP_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedObjectMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_OBJECT, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedSetMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_set.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_SET, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedSetIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_set_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_SET_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedTypedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_typed_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_TYPED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedUint16ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_uint16_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_UINT16_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedUint32ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_uint32_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_UINT32_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedUint8ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_uint8_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_UINT8_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSharedUint8ClampedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_shared_uint8_clamped_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SHARED_UINT8_CLAMPED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsStringIteratorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_string_iterator.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_STRING_ITERATOR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsSyntaxErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_syntax_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_SYNTAX_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsTerminationErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_termination_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_TERMINATION_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsTypedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_typed_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_TYPED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsTypeErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_type_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_TYPE_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsUint16ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_uint16_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_UINT16_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsUint32ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_uint32_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_UINT32_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsUint8ArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_uint8_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_UINT8_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsUint8ClampedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_uint8_clamped_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_UINT8_CLAMPED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsUriErrorMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_uri_error.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_URI_ERROR, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsWeakMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_weak_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_WEAK_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsWeakRefMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_weak_ref.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_WEAK_REF, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestJsWeakSetMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"js_weak_set.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::JS_WEAK_SET, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestLexicalEnvMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"lexical_env.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::LEXICAL_ENV, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestLineStringMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"line_string.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::LINE_STRING, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestLinkedNodeMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"linked_node.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::LINKED_NODE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestLocalExportentryRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"local_exportentry_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::LOCAL_EXPORTENTRY_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestMachineCodeObjectMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"machine_code_object.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::MACHINE_CODE_OBJECT, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestMarkerCellMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"marker_cell.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::MARKER_CELL, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestMethodMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"method.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::METHOD, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestMicroJobQueueMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"micro_job_queue.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::MICRO_JOB_QUEUE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestModuleRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"module_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::MODULE_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestMutantTaggedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"mutant_tagged_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::MUTANT_TAGGED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestNativeModuleFailureInfoMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"native_module_failure_info.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::NATIVE_MODULE_FAILURE_INFO, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestProfileTypeInfoMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"profile_type_info.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROFILE_TYPE_INFO, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestProfileTypeInfoCell0Metadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"profile_type_info_cell_0.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROFILE_TYPE_INFO_CELL_0, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestProfileTypeInfoCell1Metadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"profile_type_info_cell_1.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROFILE_TYPE_INFO_CELL_1, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestProfileTypeInfoCellNMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"profile_type_info_cell_n.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROFILE_TYPE_INFO_CELL_N, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestProgramMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"program.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROGRAM, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPromiseCapabilityMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"promise_capability.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROMISE_CAPABILITY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPromiseIteratorRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"promise_iterator_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROMISE_ITERATOR_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPromiseReactionsMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"promise_reactions.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROMISE_REACTIONS, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPromiseRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"promise_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROMISE_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPropertyBoxMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"property_box.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROPERTY_BOX, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPrototypeHandlerMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"prototype_handler.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROTOTYPE_HANDLER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestPrototypeInfoMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"prototype_info.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROTOTYPE_INFO, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestProtoChangeMarkerMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"proto_change_marker.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::PROTO_CHANGE_MARKER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestRbTreenodeMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"rb_treenode.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::RB_TREENODE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestResolvedbindingRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"resolvedbinding_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::RESOLVEDBINDING_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestResolvedindexbindingRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"resolvedindexbinding_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::RESOLVEDINDEXBINDING_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestResolvedrecordbindingRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"resolvedrecordbinding_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::RESOLVEDRECORDBINDING_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestResolvedrecordindexbindingRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"resolvedrecordindexbinding_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::RESOLVEDRECORDINDEXBINDING_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestResolvingFunctionsRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"resolving_functions_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::RESOLVING_FUNCTIONS_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestSendableEnvMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"sendable_env.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::SENDABLE_ENV, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestSlicedStringMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"sliced_string.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::SLICED_STRING, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestSourceTextModuleRecordMetadata) +{ +#if defined(PANDA_TARGET_AMD64) || defined(PANDA_TARGET_ARM64) + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"source_text_module_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::SOURCE_TEXT_MODULE_RECORD, metadata)); +#endif +} + +HWTEST_F_L0(JSMetadataTest, TestStarExportentryRecordMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"star_exportentry_record.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::STAR_EXPORTENTRY_RECORD, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestStoreTsHandlerMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"store_ts_handler.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::STORE_TS_HANDLER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestSymbolMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"symbol.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::SYMBOL, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTaggedArrayMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"tagged_array.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TAGGED_ARRAY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTaggedDictionaryMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"tagged_dictionary.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TAGGED_DICTIONARY, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTemplateMapMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"template_map.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TEMPLATE_MAP, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTrackInfoMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"track_info.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TRACK_INFO, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTransitionHandlerMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"transition_handler.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TRANSITION_HANDLER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTransWithProtoHandlerMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"trans_with_proto_handler.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TRANS_WITH_PROTO_HANDLER, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestTreeStringMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"tree_string.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::TREE_STRING, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestVtableMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"vtable.json"; + JSMetadataTestHelper::Metadata metadata {}; + + tester.ReadAndParseMetadataJson(metadataFilePath, metadata); + ASSERT_TRUE(metadata.status == JSMetadataTestHelper::INITIALIZED); + ASSERT_TRUE(tester.Test(JSType::VTABLE, metadata)); +} + +HWTEST_F_L0(JSMetadataTest, TestDictionaryLayoutMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"dictionary_layout.json"; + ASSERT_TRUE(tester.TestForDictionaryLayout(metadataFilePath)); +} + +HWTEST_F_L0(JSMetadataTest, TestTypeRangeMetadata) +{ + JSMetadataTestHelper tester {}; + std::string metadataFilePath = METADATA_SOURCE_FILE_DIR"type_range.json"; + ASSERT_TRUE(tester.TestForTypeRange(metadataFilePath)); +} +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/accessor_data.json b/ecmascript/js_type_metadata/accessor_data.json new file mode 100644 index 0000000000..a9016195de --- /dev/null +++ b/ecmascript/js_type_metadata/accessor_data.json @@ -0,0 +1,19 @@ +{ + "name": "ACCESSOR_DATA", + "offsets": [ + { + "name": "Getter", + "offset": 0, + "size": 8 + }, + { + "name": "Setter", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/aot_literal_info.json b/ecmascript/js_type_metadata/aot_literal_info.json new file mode 100644 index 0000000000..20b0f43f31 --- /dev/null +++ b/ecmascript/js_type_metadata/aot_literal_info.json @@ -0,0 +1 @@ +{"name": "AOT_LITERAL_INFO", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/async_generator_request.json b/ecmascript/js_type_metadata/async_generator_request.json new file mode 100644 index 0000000000..6eab7aaafe --- /dev/null +++ b/ecmascript/js_type_metadata/async_generator_request.json @@ -0,0 +1,19 @@ +{ + "name": "ASYNC_GENERATOR_REQUEST", + "offsets": [ + { + "name": "Completion", + "offset": 0, + "size": 8 + }, + { + "name": "Capability", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/async_iterator_record.json b/ecmascript/js_type_metadata/async_iterator_record.json new file mode 100644 index 0000000000..314f67bbe7 --- /dev/null +++ b/ecmascript/js_type_metadata/async_iterator_record.json @@ -0,0 +1,19 @@ +{ + "name": "ASYNC_ITERATOR_RECORD", + "offsets": [ + { + "name": "Iterator", + "offset": 0, + "size": 8 + }, + { + "name": "NextMethod", + "offset": 8, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/bigint.json b/ecmascript/js_type_metadata/bigint.json new file mode 100644 index 0000000000..1aa9b52502 --- /dev/null +++ b/ecmascript/js_type_metadata/bigint.json @@ -0,0 +1 @@ +{"name": "BIGINT", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/byte_array.json b/ecmascript/js_type_metadata/byte_array.json new file mode 100644 index 0000000000..384f11df17 --- /dev/null +++ b/ecmascript/js_type_metadata/byte_array.json @@ -0,0 +1 @@ +{"name": "BYTE_ARRAY", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/cell_record.json b/ecmascript/js_type_metadata/cell_record.json new file mode 100644 index 0000000000..5da40c0d35 --- /dev/null +++ b/ecmascript/js_type_metadata/cell_record.json @@ -0,0 +1,19 @@ +{ + "name": "CELL_RECORD", + "offsets": [ + { + "name": "WeakRefTarget", + "offset": 0, + "size": 8 + }, + { + "name": "HeldValue", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/class_info_extractor.json b/ecmascript/js_type_metadata/class_info_extractor.json new file mode 100644 index 0000000000..af30e7a89e --- /dev/null +++ b/ecmascript/js_type_metadata/class_info_extractor.json @@ -0,0 +1,44 @@ +{ + "name": "CLASS_INFO_EXTRACTOR", + "offsets": [ + { + "name": "NonStaticKeys", + "offset": 0, + "size": 8 + }, + { + "name": "NonStaticProperties", + "offset": 8, + "size": 8 + }, + { + "name": "NonStaticElements", + "offset": 16, + "size": 8 + }, + { + "name": "StaticKeys", + "offset": 24, + "size": 8 + }, + { + "name": "StaticProperties", + "offset": 32, + "size": 8 + }, + { + "name": "StaticElements", + "offset": 40, + "size": 8 + }, + { + "name": "ConstructorMethod", + "offset": 48, + "size": 8 + } + ], + "end_offset": 60, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/class_literal.json b/ecmascript/js_type_metadata/class_literal.json new file mode 100644 index 0000000000..30d799287c --- /dev/null +++ b/ecmascript/js_type_metadata/class_literal.json @@ -0,0 +1,14 @@ +{ + "name": "CLASS_LITERAL", + "offsets": [ + { + "name": "Array", + "offset": 0, + "size": 8 + } + ], + "end_offset": 9, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/completion_record.json b/ecmascript/js_type_metadata/completion_record.json new file mode 100644 index 0000000000..f9b7eb03b1 --- /dev/null +++ b/ecmascript/js_type_metadata/completion_record.json @@ -0,0 +1,14 @@ +{ + "name": "COMPLETION_RECORD", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/constant_pool.json b/ecmascript/js_type_metadata/constant_pool.json new file mode 100644 index 0000000000..41ecdfe22c --- /dev/null +++ b/ecmascript/js_type_metadata/constant_pool.json @@ -0,0 +1 @@ +{"name": "CONSTANT_POOL", "offsets": [], "end_offset": 0, "parents": ["TAGGED_ARRAY"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/constant_string.json b/ecmascript/js_type_metadata/constant_string.json new file mode 100644 index 0000000000..dd3bcd9140 --- /dev/null +++ b/ecmascript/js_type_metadata/constant_string.json @@ -0,0 +1,14 @@ +{ + "name": "CONSTANT_STRING", + "offsets": [ + { + "name": "RelocatedData", + "offset": 0, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "ECMA_STRING" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/cow_mutant_tagged_array.json b/ecmascript/js_type_metadata/cow_mutant_tagged_array.json new file mode 100644 index 0000000000..744c232cb3 --- /dev/null +++ b/ecmascript/js_type_metadata/cow_mutant_tagged_array.json @@ -0,0 +1 @@ +{"name": "COW_MUTANT_TAGGED_ARRAY", "offsets": [], "end_offset": 0, "parents": ["MUTANT_TAGGED_ARRAY"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/cow_tagged_array.json b/ecmascript/js_type_metadata/cow_tagged_array.json new file mode 100644 index 0000000000..5e56f353d5 --- /dev/null +++ b/ecmascript/js_type_metadata/cow_tagged_array.json @@ -0,0 +1 @@ +{"name": "COW_TAGGED_ARRAY", "offsets": [], "end_offset": 0, "parents": ["TAGGED_ARRAY"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/dictionary_layout.json b/ecmascript/js_type_metadata/dictionary_layout.json new file mode 100644 index 0000000000..0057605084 --- /dev/null +++ b/ecmascript/js_type_metadata/dictionary_layout.json @@ -0,0 +1,8 @@ +{ + "name": "Dictionary", + "key_index": 0, + "value_index": 1, + "detail_index": 2, + "entry_size": 3, + "header_size": 4 +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/ecma_object.json b/ecmascript/js_type_metadata/ecma_object.json new file mode 100644 index 0000000000..324f696a49 --- /dev/null +++ b/ecmascript/js_type_metadata/ecma_object.json @@ -0,0 +1 @@ +{"name": "ECMA_OBJECT", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/ecma_string.json b/ecmascript/js_type_metadata/ecma_string.json new file mode 100644 index 0000000000..8f282d89b5 --- /dev/null +++ b/ecmascript/js_type_metadata/ecma_string.json @@ -0,0 +1 @@ +{"name": "ECMA_STRING", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/extra_profile_type_info.json b/ecmascript/js_type_metadata/extra_profile_type_info.json new file mode 100644 index 0000000000..84fa356d05 --- /dev/null +++ b/ecmascript/js_type_metadata/extra_profile_type_info.json @@ -0,0 +1,19 @@ +{ + "name": "EXTRA_PROFILE_TYPE_INFO", + "offsets": [ + { + "name": "ReceiverObject", + "offset": 0, + "size": 8 + }, + { + "name": "HolderObject", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/function_template.json b/ecmascript/js_type_metadata/function_template.json new file mode 100644 index 0000000000..ab77eb5cbd --- /dev/null +++ b/ecmascript/js_type_metadata/function_template.json @@ -0,0 +1,24 @@ +{ + "name": "FUNCTION_TEMPLATE", + "offsets": [ + { + "name": "Method", + "offset": 0, + "size": 8 + }, + { + "name": "Module", + "offset": 8, + "size": 8 + }, + { + "name": "RawProfileTypeInfo", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/global_env.json b/ecmascript/js_type_metadata/global_env.json new file mode 100644 index 0000000000..8e5ee9bdd9 --- /dev/null +++ b/ecmascript/js_type_metadata/global_env.json @@ -0,0 +1 @@ +{"name": "GLOBAL_ENV", "offsets": [], "end_offset": 2360, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/hclass.json b/ecmascript/js_type_metadata/hclass.json new file mode 100644 index 0000000000..65962f7da0 --- /dev/null +++ b/ecmascript/js_type_metadata/hclass.json @@ -0,0 +1 @@ +{"name": "HCLASS", "offsets": [{"name": "Proto", "offset": 0, "size": 8}, {"name": "Layout", "offset": 8, "size": 8}, {"name": "Transitions", "offset": 16, "size": 8}, {"name": "Parent", "offset": 24, "size": 8}, {"name": "ProtoChangeMarker", "offset": 32, "size": 8}, {"name": "ProtoChangeDetails", "offset": 40, "size": 8}, {"name": "EnumCache", "offset": 48, "size": 8}, {"name": "ProfilerType", "offset": 56, "size": 8}, {"name": "BitField", "offset": 64, "size": 4}, {"name": "BitField1", "offset": 68, "size": 4}], "end_offset": 72, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/importentry_record.json b/ecmascript/js_type_metadata/importentry_record.json new file mode 100644 index 0000000000..15dea4d4f8 --- /dev/null +++ b/ecmascript/js_type_metadata/importentry_record.json @@ -0,0 +1,24 @@ +{ + "name": "IMPORTENTRY_RECORD", + "offsets": [ + { + "name": "ModuleRequest", + "offset": 0, + "size": 8 + }, + { + "name": "ImportName", + "offset": 8, + "size": 8 + }, + { + "name": "LocalName", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/indirect_exportentry_record.json b/ecmascript/js_type_metadata/indirect_exportentry_record.json new file mode 100644 index 0000000000..bc947d2815 --- /dev/null +++ b/ecmascript/js_type_metadata/indirect_exportentry_record.json @@ -0,0 +1,24 @@ +{ + "name": "INDIRECT_EXPORTENTRY_RECORD", + "offsets": [ + { + "name": "ExportName", + "offset": 0, + "size": 8 + }, + { + "name": "ModuleRequest", + "offset": 8, + "size": 8 + }, + { + "name": "ImportName", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/internal_accessor.json b/ecmascript/js_type_metadata/internal_accessor.json new file mode 100644 index 0000000000..94c0ea9dae --- /dev/null +++ b/ecmascript/js_type_metadata/internal_accessor.json @@ -0,0 +1,19 @@ +{ + "name": "INTERNAL_ACCESSOR", + "offsets": [ + { + "name": "Getter", + "offset": 0, + "size": 8 + }, + { + "name": "Setter", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_aggregate_error.json b/ecmascript/js_type_metadata/js_aggregate_error.json new file mode 100644 index 0000000000..61c99883cb --- /dev/null +++ b/ecmascript/js_type_metadata/js_aggregate_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_AGGREGATE_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_array_list.json b/ecmascript/js_type_metadata/js_api_array_list.json new file mode 100644 index 0000000000..15fa465650 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_array_list.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_ARRAY_LIST", + "offsets": [ + { + "name": "Length", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_arraylist_iterator.json b/ecmascript/js_type_metadata/js_api_arraylist_iterator.json new file mode 100644 index 0000000000..d5ce2e7234 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_arraylist_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_ARRAYLIST_ITERATOR", + "offsets": [ + { + "name": "IteratedArrayList", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_bitvector.json b/ecmascript/js_type_metadata/js_api_bitvector.json new file mode 100644 index 0000000000..23feac4835 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_bitvector.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_BITVECTOR", + "offsets": [ + { + "name": "NativePointer", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_bitvector_iterator.json b/ecmascript/js_type_metadata/js_api_bitvector_iterator.json new file mode 100644 index 0000000000..09a3867738 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_bitvector_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_BITVECTOR_ITERATOR", + "offsets": [ + { + "name": "IteratedBitVector", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_deque.json b/ecmascript/js_type_metadata/js_api_deque.json new file mode 100644 index 0000000000..4c0c0e0e04 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_deque.json @@ -0,0 +1 @@ +{"name": "JS_API_DEQUE", "offsets": [], "end_offset": 8, "parents": ["JS_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_deque_iterator.json b/ecmascript/js_type_metadata/js_api_deque_iterator.json new file mode 100644 index 0000000000..3555f2fb2f --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_deque_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_DEQUE_ITERATOR", + "offsets": [ + { + "name": "IteratedDeque", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_hash_map.json b/ecmascript/js_type_metadata/js_api_hash_map.json new file mode 100644 index 0000000000..c708457974 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_hash_map.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_HASH_MAP", + "offsets": [ + { + "name": "Table", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_hash_set.json b/ecmascript/js_type_metadata/js_api_hash_set.json new file mode 100644 index 0000000000..149dd830d3 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_hash_set.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_HASH_SET", + "offsets": [ + { + "name": "Table", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_hashmap_iterator.json b/ecmascript/js_type_metadata/js_api_hashmap_iterator.json new file mode 100644 index 0000000000..d1be38b054 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_hashmap_iterator.json @@ -0,0 +1,24 @@ +{ + "name": "JS_API_HASHMAP_ITERATOR", + "offsets": [ + { + "name": "IteratedHashMap", + "offset": 0, + "size": 8 + }, + { + "name": "TaggedQueue", + "offset": 8, + "size": 8 + }, + { + "name": "CurrentNodeResult", + "offset": 16, + "size": 8 + } + ], + "end_offset": 32, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_hashset_iterator.json b/ecmascript/js_type_metadata/js_api_hashset_iterator.json new file mode 100644 index 0000000000..7236f90bbc --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_hashset_iterator.json @@ -0,0 +1,24 @@ +{ + "name": "JS_API_HASHSET_ITERATOR", + "offsets": [ + { + "name": "IteratedHashSet", + "offset": 0, + "size": 8 + }, + { + "name": "TaggedQueue", + "offset": 8, + "size": 8 + }, + { + "name": "CurrentNodeResult", + "offset": 16, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_light_weight_map.json b/ecmascript/js_type_metadata/js_api_light_weight_map.json new file mode 100644 index 0000000000..51eb9b7260 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_light_weight_map.json @@ -0,0 +1,24 @@ +{ + "name": "JS_API_LIGHT_WEIGHT_MAP", + "offsets": [ + { + "name": "Hashes", + "offset": 0, + "size": 8 + }, + { + "name": "Keys", + "offset": 8, + "size": 8 + }, + { + "name": "Values", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_light_weight_map_iterator.json b/ecmascript/js_type_metadata/js_api_light_weight_map_iterator.json new file mode 100644 index 0000000000..0cb5c018ba --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_light_weight_map_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_LIGHT_WEIGHT_MAP_ITERATOR", + "offsets": [ + { + "name": "IteratedLightWeightMap", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_light_weight_set.json b/ecmascript/js_type_metadata/js_api_light_weight_set.json new file mode 100644 index 0000000000..c2650f63f5 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_light_weight_set.json @@ -0,0 +1,19 @@ +{ + "name": "JS_API_LIGHT_WEIGHT_SET", + "offsets": [ + { + "name": "Hashes", + "offset": 0, + "size": 8 + }, + { + "name": "Values", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_light_weight_set_iterator.json b/ecmascript/js_type_metadata/js_api_light_weight_set_iterator.json new file mode 100644 index 0000000000..0d47cbc47f --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_light_weight_set_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_LIGHT_WEIGHT_SET_ITERATOR", + "offsets": [ + { + "name": "IteratedLightWeightSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_linked_list.json b/ecmascript/js_type_metadata/js_api_linked_list.json new file mode 100644 index 0000000000..f976b88b9c --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_linked_list.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_LINKED_LIST", + "offsets": [ + { + "name": "DoubleList", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_linked_list_iterator.json b/ecmascript/js_type_metadata/js_api_linked_list_iterator.json new file mode 100644 index 0000000000..6ee305c4d2 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_linked_list_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_LINKED_LIST_ITERATOR", + "offsets": [ + { + "name": "IteratedLinkedList", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_list.json b/ecmascript/js_type_metadata/js_api_list.json new file mode 100644 index 0000000000..708a246d90 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_list.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_LIST", + "offsets": [ + { + "name": "SingleList", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_list_iterator.json b/ecmascript/js_type_metadata/js_api_list_iterator.json new file mode 100644 index 0000000000..c9fde387b6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_list_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_LIST_ITERATOR", + "offsets": [ + { + "name": "IteratedList", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_plain_array.json b/ecmascript/js_type_metadata/js_api_plain_array.json new file mode 100644 index 0000000000..ada79ae605 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_plain_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_API_PLAIN_ARRAY", + "offsets": [ + { + "name": "Keys", + "offset": 0, + "size": 8 + }, + { + "name": "Values", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_plain_array_iterator.json b/ecmascript/js_type_metadata/js_api_plain_array_iterator.json new file mode 100644 index 0000000000..00169ece5d --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_plain_array_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_PLAIN_ARRAY_ITERATOR", + "offsets": [ + { + "name": "IteratedPlainArray", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_queue.json b/ecmascript/js_type_metadata/js_api_queue.json new file mode 100644 index 0000000000..d0ecc6e6cb --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_queue.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_QUEUE", + "offsets": [ + { + "name": "Length", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_queue_iterator.json b/ecmascript/js_type_metadata/js_api_queue_iterator.json new file mode 100644 index 0000000000..44cd5ed2c6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_queue_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_QUEUE_ITERATOR", + "offsets": [ + { + "name": "IteratedQueue", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_stack.json b/ecmascript/js_type_metadata/js_api_stack.json new file mode 100644 index 0000000000..6f52c30889 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_stack.json @@ -0,0 +1 @@ +{"name": "JS_API_STACK", "offsets": [], "end_offset": 4, "parents": ["JS_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_stack_iterator.json b/ecmascript/js_type_metadata/js_api_stack_iterator.json new file mode 100644 index 0000000000..ff341ba1fc --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_stack_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_STACK_ITERATOR", + "offsets": [ + { + "name": "IteratedStack", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_tree_map.json b/ecmascript/js_type_metadata/js_api_tree_map.json new file mode 100644 index 0000000000..73e2b7c8db --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_tree_map.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_TREE_MAP", + "offsets": [ + { + "name": "TreeMap", + "offset": 0, + "size":8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_tree_set.json b/ecmascript/js_type_metadata/js_api_tree_set.json new file mode 100644 index 0000000000..2d7d768ce8 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_tree_set.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_TREE_SET", + "offsets": [ + { + "name": "TreeSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_treemap_iterator.json b/ecmascript/js_type_metadata/js_api_treemap_iterator.json new file mode 100644 index 0000000000..7fa52ef200 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_treemap_iterator.json @@ -0,0 +1,19 @@ +{ + "name": "JS_API_TREEMAP_ITERATOR", + "offsets": [ + { + "name": "IteratedMap", + "offset": 0, + "size": 8 + }, + { + "name": "Entries", + "offset": 8, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_treeset_iterator.json b/ecmascript/js_type_metadata/js_api_treeset_iterator.json new file mode 100644 index 0000000000..d941ccaf6f --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_treeset_iterator.json @@ -0,0 +1,19 @@ +{ + "name": "JS_API_TREESET_ITERATOR", + "offsets": [ + { + "name": "IteratedSet", + "offset": 0, + "size": 8 + }, + { + "name": "Entries", + "offset": 8, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_vector.json b/ecmascript/js_type_metadata/js_api_vector.json new file mode 100644 index 0000000000..4b7cec3750 --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_vector.json @@ -0,0 +1 @@ +{"name": "JS_API_VECTOR", "offsets": [], "end_offset": 4, "parents": ["JS_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_api_vector_iterator.json b/ecmascript/js_type_metadata/js_api_vector_iterator.json new file mode 100644 index 0000000000..4725cce22e --- /dev/null +++ b/ecmascript/js_type_metadata/js_api_vector_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_API_VECTOR_ITERATOR", + "offsets": [ + { + "name": "IteratedVector", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_arguments.json b/ecmascript/js_type_metadata/js_arguments.json new file mode 100644 index 0000000000..3fa62e7ec8 --- /dev/null +++ b/ecmascript/js_type_metadata/js_arguments.json @@ -0,0 +1 @@ +{"name": "JS_ARGUMENTS", "offsets": [], "end_offset": 0, "parents": ["JS_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_array.json b/ecmascript/js_type_metadata/js_array.json new file mode 100644 index 0000000000..5da87b7085 --- /dev/null +++ b/ecmascript/js_type_metadata/js_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_ARRAY", + "offsets": [ + { + "name": "Length", + "offset": 0, + "size": 4 + }, + { + "name": "TrackInfo", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_array_buffer.json b/ecmascript/js_type_metadata/js_array_buffer.json new file mode 100644 index 0000000000..8af4a4a75b --- /dev/null +++ b/ecmascript/js_type_metadata/js_array_buffer.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ARRAY_BUFFER", + "offsets": [ + { + "name": "ArrayBufferData", + "offset": 0, + "size":8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_array_iterator.json b/ecmascript/js_type_metadata/js_array_iterator.json new file mode 100644 index 0000000000..cbf374c233 --- /dev/null +++ b/ecmascript/js_type_metadata/js_array_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ARRAY_ITERATOR", + "offsets": [ + { + "name": "IteratedArray", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_await_status_function.json b/ecmascript/js_type_metadata/js_async_await_status_function.json new file mode 100644 index 0000000000..b4a7d78eab --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_await_status_function.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ASYNC_AWAIT_STATUS_FUNCTION", + "offsets": [ + { + "name": "AsyncContext", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_from_sync_iter_unwarp_function.json b/ecmascript/js_type_metadata/js_async_from_sync_iter_unwarp_function.json new file mode 100644 index 0000000000..5cf08c4225 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_from_sync_iter_unwarp_function.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION", + "offsets": [ + { + "name": "Done", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_from_sync_iterator.json b/ecmascript/js_type_metadata/js_async_from_sync_iterator.json new file mode 100644 index 0000000000..011c6c9e72 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_from_sync_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ASYNC_FROM_SYNC_ITERATOR", + "offsets": [ + { + "name": "SyncIteratorRecord", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_func_object.json b/ecmascript/js_type_metadata/js_async_func_object.json new file mode 100644 index 0000000000..c23a174273 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_func_object.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ASYNC_FUNC_OBJECT", + "offsets": [ + { + "name": "Promise", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_GENERATOR_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_function.json b/ecmascript/js_type_metadata/js_async_function.json new file mode 100644 index 0000000000..f6c2473e61 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_ASYNC_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_generator_function.json b/ecmascript/js_type_metadata/js_async_generator_function.json new file mode 100644 index 0000000000..fd1f56cf61 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_generator_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_ASYNC_GENERATOR_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_generator_object.json b/ecmascript/js_type_metadata/js_async_generator_object.json new file mode 100644 index 0000000000..9f120a8735 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_generator_object.json @@ -0,0 +1,29 @@ +{ + "name": "JS_ASYNC_GENERATOR_OBJECT", + "offsets": [ + { + "name": "GeneratorContext", + "offset": 0, + "size": 8 + }, + { + "name": "AsyncGeneratorQueue", + "offset": 8, + "size": 8 + }, + { + "name": "GeneratorBrand", + "offset": 16, + "size": 8 + }, + { + "name": "ResumeResult", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_generator_resume_next_return_processor_rst_ftn.json b/ecmascript/js_type_metadata/js_async_generator_resume_next_return_processor_rst_ftn.json new file mode 100644 index 0000000000..94ae4472c4 --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_generator_resume_next_return_processor_rst_ftn.json @@ -0,0 +1,14 @@ +{ + "name": "JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN", + "offsets": [ + { + "name": "AsyncGeneratorObject", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_module_fulfilled_function.json b/ecmascript/js_type_metadata/js_async_module_fulfilled_function.json new file mode 100644 index 0000000000..85c2c72d3d --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_module_fulfilled_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_ASYNC_MODULE_FULFILLED_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_async_module_rejected_function.json b/ecmascript/js_type_metadata/js_async_module_rejected_function.json new file mode 100644 index 0000000000..e4a92f0ece --- /dev/null +++ b/ecmascript/js_type_metadata/js_async_module_rejected_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_ASYNC_MODULE_REJECTED_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_asynciterator.json b/ecmascript/js_type_metadata/js_asynciterator.json new file mode 100644 index 0000000000..5eace6e921 --- /dev/null +++ b/ecmascript/js_type_metadata/js_asynciterator.json @@ -0,0 +1,17 @@ +{ + "name": "JS_ASYNCITERATOR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_bigint64_array.json b/ecmascript/js_type_metadata/js_bigint64_array.json new file mode 100644 index 0000000000..1e53798aac --- /dev/null +++ b/ecmascript/js_type_metadata/js_bigint64_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_BIGINT64_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_biguint64_array.json b/ecmascript/js_type_metadata/js_biguint64_array.json new file mode 100644 index 0000000000..06fc07f9c7 --- /dev/null +++ b/ecmascript/js_type_metadata/js_biguint64_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_BIGUINT64_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_bound_function.json b/ecmascript/js_type_metadata/js_bound_function.json new file mode 100644 index 0000000000..86815c7766 --- /dev/null +++ b/ecmascript/js_type_metadata/js_bound_function.json @@ -0,0 +1,24 @@ +{ + "name": "JS_BOUND_FUNCTION", + "offsets": [ + { + "name": "BoundTarget", + "offset": 0, + "size": 8 + }, + { + "name": "BoundThis", + "offset": 8, + "size": 8 + }, + { + "name": "BoundArguments", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_cjs_exports.json b/ecmascript/js_type_metadata/js_cjs_exports.json new file mode 100644 index 0000000000..f588b5d886 --- /dev/null +++ b/ecmascript/js_type_metadata/js_cjs_exports.json @@ -0,0 +1,14 @@ +{ + "name": "JS_CJS_EXPORTS", + "offsets": [ + { + "name": "Exports", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_cjs_module.json b/ecmascript/js_type_metadata/js_cjs_module.json new file mode 100644 index 0000000000..87c0eb63bd --- /dev/null +++ b/ecmascript/js_type_metadata/js_cjs_module.json @@ -0,0 +1,29 @@ +{ + "name": "JS_CJS_MODULE", + "offsets": [ + { + "name": "Id", + "offset": 0, + "size": 8 + }, + { + "name": "Path", + "offset": 8, + "size": 8 + }, + { + "name": "Exports", + "offset": 16, + "size": 8 + }, + { + "name": "Filename", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_cjs_require.json b/ecmascript/js_type_metadata/js_cjs_require.json new file mode 100644 index 0000000000..4c60e32e4d --- /dev/null +++ b/ecmascript/js_type_metadata/js_cjs_require.json @@ -0,0 +1,19 @@ +{ + "name": "JS_CJS_REQUIRE", + "offsets": [ + { + "name": "Cache", + "offset": 0, + "size": 8 + }, + { + "name": "Parent", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_collator.json b/ecmascript/js_type_metadata/js_collator.json new file mode 100644 index 0000000000..9b17b1122f --- /dev/null +++ b/ecmascript/js_type_metadata/js_collator.json @@ -0,0 +1,29 @@ +{ + "name": "JS_COLLATOR", + "offsets": [ + { + "name": "IcuFiled", + "offset": 0, + "size": 8 + }, + { + "name": "Locale", + "offset": 8, + "size": 8 + }, + { + "name": "Collation", + "offset": 16, + "size": 8 + }, + { + "name": "BoundCompare", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_data_view.json b/ecmascript/js_type_metadata/js_data_view.json new file mode 100644 index 0000000000..ca3eeede1d --- /dev/null +++ b/ecmascript/js_type_metadata/js_data_view.json @@ -0,0 +1,19 @@ +{ + "name": "JS_DATA_VIEW", + "offsets": [ + { + "name": "DataView", + "offset": 0, + "size": 8 + }, + { + "name": "ViewedArrayBuffer", + "offset": 8, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_date.json b/ecmascript/js_type_metadata/js_date.json new file mode 100644 index 0000000000..e4517a476d --- /dev/null +++ b/ecmascript/js_type_metadata/js_date.json @@ -0,0 +1,19 @@ +{ + "name": "JS_DATE", + "offsets": [ + { + "name": "TimeValue", + "offset": 0, + "size": 8 + }, + { + "name": "LocalOffset", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_date_time_format.json b/ecmascript/js_type_metadata/js_date_time_format.json new file mode 100644 index 0000000000..be3f88abf2 --- /dev/null +++ b/ecmascript/js_type_metadata/js_date_time_format.json @@ -0,0 +1,49 @@ +{ + "name": "JS_DATE_TIME_FORMAT", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "Calendar", + "offset": 8, + "size": 8 + }, + { + "name": "NumberingSystem", + "offset": 16, + "size": 8 + }, + { + "name": "TimeZone", + "offset": 24, + "size": 8 + }, + { + "name": "LocaleIcu", + "offset": 32, + "size": 8 + }, + { + "name": "SimpleDateTimeFormatIcu", + "offset": 40, + "size": 8 + }, + { + "name": "Iso8601", + "offset": 48, + "size": 8 + }, + { + "name": "BoundFormat", + "offset": 56, + "size": 8 + } + ], + "end_offset": 68, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_displaynames.json b/ecmascript/js_type_metadata/js_displaynames.json new file mode 100644 index 0000000000..6daf1ad6ec --- /dev/null +++ b/ecmascript/js_type_metadata/js_displaynames.json @@ -0,0 +1,19 @@ +{ + "name": "JS_DISPLAYNAMES", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "IcuLDN", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_error.json b/ecmascript/js_type_metadata/js_error.json new file mode 100644 index 0000000000..bcdfd6b144 --- /dev/null +++ b/ecmascript/js_type_metadata/js_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_eval_error.json b/ecmascript/js_type_metadata/js_eval_error.json new file mode 100644 index 0000000000..31e43f923c --- /dev/null +++ b/ecmascript/js_type_metadata/js_eval_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_EVAL_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_finalization_registry.json b/ecmascript/js_type_metadata/js_finalization_registry.json new file mode 100644 index 0000000000..6e69bf67bb --- /dev/null +++ b/ecmascript/js_type_metadata/js_finalization_registry.json @@ -0,0 +1,34 @@ +{ + "name": "JS_FINALIZATION_REGISTRY", + "offsets": [ + { + "name": "CleanupCallback", + "offset": 0, + "size": 8 + }, + { + "name": "NoUnregister", + "offset": 8, + "size": 8 + }, + { + "name": "MaybeUnregister", + "offset": 16, + "size": 8 + }, + { + "name": "Next", + "offset": 24, + "size": 8 + }, + { + "name": "Prev", + "offset": 32, + "size": 8 + } + ], + "end_offset": 40, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_float32_array.json b/ecmascript/js_type_metadata/js_float32_array.json new file mode 100644 index 0000000000..c8948ef9e6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_float32_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_FLOAT32_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_float64_array.json b/ecmascript/js_type_metadata/js_float64_array.json new file mode 100644 index 0000000000..ea3d52c76c --- /dev/null +++ b/ecmascript/js_type_metadata/js_float64_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_FLOAT64_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_forin_iterator.json b/ecmascript/js_type_metadata/js_forin_iterator.json new file mode 100644 index 0000000000..74cf1ea8c0 --- /dev/null +++ b/ecmascript/js_type_metadata/js_forin_iterator.json @@ -0,0 +1,24 @@ +{ + "name": "JS_FORIN_ITERATOR", + "offsets": [ + { + "name": "Object", + "offset": 0, + "size": 8 + }, + { + "name": "CachedHclass", + "offset": 8, + "size": 8 + }, + { + "name": "Keys", + "offset": 16, + "size": 8 + } + ], + "end_offset": 32, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_function.json b/ecmascript/js_type_metadata/js_function.json new file mode 100644 index 0000000000..1e4d8b7bba --- /dev/null +++ b/ecmascript/js_type_metadata/js_function.json @@ -0,0 +1,49 @@ +{ + "name": "JS_FUNCTION", + "offsets": [ + { + "name": "ProtoOrHClass", + "offset": 0, + "size": 8 + }, + { + "name": "LexicalEnv", + "offset": 8, + "size": 8 + }, + { + "name": "MachineCode", + "offset": 16, + "size": 8 + }, + { + "name": "BaselineCode", + "offset": 24, + "size": 8 + }, + { + "name": "RawProfileTypeInfo", + "offset": 32, + "size": 8 + }, + { + "name": "HomeObject", + "offset": 40, + "size": 8 + }, + { + "name": "Module", + "offset": 48, + "size": 8 + }, + { + "name": "ProtoTransRootHClass", + "offset": 56, + "size": 8 + } + ], + "end_offset": 72, + "parents": [ + "JS_FUNCTION_BASE" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_function_base.json b/ecmascript/js_type_metadata/js_function_base.json new file mode 100644 index 0000000000..16e6ab4630 --- /dev/null +++ b/ecmascript/js_type_metadata/js_function_base.json @@ -0,0 +1,14 @@ +{ + "name": "JS_FUNCTION_BASE", + "offsets": [ + { + "name": "Method", + "offset": 0, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_generator_context.json b/ecmascript/js_type_metadata/js_generator_context.json new file mode 100644 index 0000000000..182beeffcd --- /dev/null +++ b/ecmascript/js_type_metadata/js_generator_context.json @@ -0,0 +1,39 @@ +{ + "name": "JS_GENERATOR_CONTEXT", + "offsets": [ + { + "name": "RegsArray", + "offset": 0, + "size": 8 + }, + { + "name": "Method", + "offset": 8, + "size": 8 + }, + { + "name": "This", + "offset": 16, + "size": 8 + }, + { + "name": "Acc", + "offset": 24, + "size": 8 + }, + { + "name": "GeneratorObject", + "offset": 32, + "size": 8 + }, + { + "name": "LexicalEnv", + "offset": 40, + "size": 8 + } + ], + "end_offset": 56, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_generator_function.json b/ecmascript/js_type_metadata/js_generator_function.json new file mode 100644 index 0000000000..ac9a19a782 --- /dev/null +++ b/ecmascript/js_type_metadata/js_generator_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_GENERATOR_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_generator_object.json b/ecmascript/js_type_metadata/js_generator_object.json new file mode 100644 index 0000000000..5bf788aca5 --- /dev/null +++ b/ecmascript/js_type_metadata/js_generator_object.json @@ -0,0 +1,19 @@ +{ + "name": "JS_GENERATOR_OBJECT", + "offsets": [ + { + "name": "GeneratorContext", + "offset": 0, + "size": 8 + }, + { + "name": "ResumeResult", + "offset": 8, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_global_object.json b/ecmascript/js_type_metadata/js_global_object.json new file mode 100644 index 0000000000..4bd4fdde78 --- /dev/null +++ b/ecmascript/js_type_metadata/js_global_object.json @@ -0,0 +1,8 @@ +{ + "name": "JS_GLOBAL_OBJECT", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_int16_array.json b/ecmascript/js_type_metadata/js_int16_array.json new file mode 100644 index 0000000000..a5d140d3bc --- /dev/null +++ b/ecmascript/js_type_metadata/js_int16_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_INT16_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_int32_array.json b/ecmascript/js_type_metadata/js_int32_array.json new file mode 100644 index 0000000000..aae70a14b2 --- /dev/null +++ b/ecmascript/js_type_metadata/js_int32_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_INT32_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_int8_array.json b/ecmascript/js_type_metadata/js_int8_array.json new file mode 100644 index 0000000000..11e42f967c --- /dev/null +++ b/ecmascript/js_type_metadata/js_int8_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_INT8_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_intl.json b/ecmascript/js_type_metadata/js_intl.json new file mode 100644 index 0000000000..ecce318e7c --- /dev/null +++ b/ecmascript/js_type_metadata/js_intl.json @@ -0,0 +1,14 @@ +{ + "name": "JS_INTL", + "offsets": [ + { + "name": "FallbackSymbol", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_intl_bound_function.json b/ecmascript/js_type_metadata/js_intl_bound_function.json new file mode 100644 index 0000000000..28b60dedca --- /dev/null +++ b/ecmascript/js_type_metadata/js_intl_bound_function.json @@ -0,0 +1,24 @@ +{ + "name": "JS_INTL_BOUND_FUNCTION", + "offsets": [ + { + "name": "NumberFormat", + "offset": 0, + "size": 8 + }, + { + "name": "DateTimeFormat", + "offset": 8, + "size": 8 + }, + { + "name": "Collator", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_iterator.json b/ecmascript/js_type_metadata/js_iterator.json new file mode 100644 index 0000000000..305d8b5dd6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_iterator.json @@ -0,0 +1,17 @@ +{ + "name": "JS_ITERATOR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_list_format.json b/ecmascript/js_type_metadata/js_list_format.json new file mode 100644 index 0000000000..99c81b3663 --- /dev/null +++ b/ecmascript/js_type_metadata/js_list_format.json @@ -0,0 +1,19 @@ +{ + "name": "JS_LIST_FORMAT", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "IcuLF", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_locale.json b/ecmascript/js_type_metadata/js_locale.json new file mode 100644 index 0000000000..4fefecec96 --- /dev/null +++ b/ecmascript/js_type_metadata/js_locale.json @@ -0,0 +1,14 @@ +{ + "name": "JS_LOCALE", + "offsets": [ + { + "name": "IcuField", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_map.json b/ecmascript/js_type_metadata/js_map.json new file mode 100644 index 0000000000..b94439055c --- /dev/null +++ b/ecmascript/js_type_metadata/js_map.json @@ -0,0 +1,14 @@ +{ + "name": "JS_MAP", + "offsets": [ + { + "name": "LinkedMap", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_map_iterator.json b/ecmascript/js_type_metadata/js_map_iterator.json new file mode 100644 index 0000000000..d0071cb6b3 --- /dev/null +++ b/ecmascript/js_type_metadata/js_map_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_MAP_ITERATOR", + "offsets": [ + { + "name": "IteratorMap", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_module_namespace.json b/ecmascript/js_type_metadata/js_module_namespace.json new file mode 100644 index 0000000000..f2b4439458 --- /dev/null +++ b/ecmascript/js_type_metadata/js_module_namespace.json @@ -0,0 +1,24 @@ +{ + "name": "JS_MODULE_NAMESPACE", + "offsets": [ + { + "name": "Module", + "offset": 0, + "size": 8 + }, + { + "name": "Exports", + "offset": 8, + "size": 8 + }, + { + "name": "DeregisterProcession", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_native_pointer.json b/ecmascript/js_type_metadata/js_native_pointer.json new file mode 100644 index 0000000000..4a48827b6e --- /dev/null +++ b/ecmascript/js_type_metadata/js_native_pointer.json @@ -0,0 +1,14 @@ +{ + "name": "JS_NATIVE_POINTER", + "offsets": [ + { + "name": "BindingSize", + "offset": 24, + "size": 4 + } + ], + "end_offset": 32, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_number_format.json b/ecmascript/js_type_metadata/js_number_format.json new file mode 100644 index 0000000000..a73a0decd4 --- /dev/null +++ b/ecmascript/js_type_metadata/js_number_format.json @@ -0,0 +1,69 @@ +{ + "name": "JS_NUMBER_FORMAT", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "NumberingSystem", + "offset": 8, + "size": 8 + }, + { + "name": "Currency", + "offset": 16, + "size": 8 + }, + { + "name": "Unit", + "offset": 24, + "size": 8 + }, + { + "name": "MinimumIntegerDigits", + "offset": 32, + "size": 8 + }, + { + "name": "MinimumFractionDigits", + "offset": 40, + "size": 8 + }, + { + "name": "MaximumFractionDigits", + "offset": 48, + "size": 8 + }, + { + "name": "MinimumSignificantDigits", + "offset": 56, + "size": 8 + }, + { + "name": "MaximumSignificantDigits", + "offset": 64, + "size": 8 + }, + { + "name": "UseGrouping", + "offset": 72, + "size": 8 + }, + { + "name": "BoundFormat", + "offset": 80, + "size": 8 + }, + { + "name": "IcuField", + "offset": 88, + "size": 8 + } + ], + "end_offset": 100, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_object.json b/ecmascript/js_type_metadata/js_object.json new file mode 100644 index 0000000000..964141263d --- /dev/null +++ b/ecmascript/js_type_metadata/js_object.json @@ -0,0 +1,17 @@ +{ + "name": "JS_OBJECT", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_oom_error.json b/ecmascript/js_type_metadata/js_oom_error.json new file mode 100644 index 0000000000..7ef8a46d99 --- /dev/null +++ b/ecmascript/js_type_metadata/js_oom_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_OOM_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_plural_rules.json b/ecmascript/js_type_metadata/js_plural_rules.json new file mode 100644 index 0000000000..ae337e3e60 --- /dev/null +++ b/ecmascript/js_type_metadata/js_plural_rules.json @@ -0,0 +1,49 @@ +{ + "name": "JS_PLURAL_RULES", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "MinimumIntegerDigits", + "offset": 8, + "size": 8 + }, + { + "name": "MinimumFractionDigits", + "offset": 16, + "size": 8 + }, + { + "name": "MaximumFractionDigits", + "offset": 24, + "size": 8 + }, + { + "name": "MinimumSignificantDigits", + "offset": 32, + "size": 8 + }, + { + "name": "MaximumSignificantDigits", + "offset": 40, + "size": 8 + }, + { + "name": "IcuPR", + "offset": 48, + "size": 8 + }, + { + "name": "IcuNF", + "offset": 56, + "size": 8 + } + ], + "end_offset": 68, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_primitive_ref.json b/ecmascript/js_type_metadata/js_primitive_ref.json new file mode 100644 index 0000000000..32b41ffe49 --- /dev/null +++ b/ecmascript/js_type_metadata/js_primitive_ref.json @@ -0,0 +1,14 @@ +{ + "name": "JS_PRIMITIVE_REF", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise.json b/ecmascript/js_type_metadata/js_promise.json new file mode 100644 index 0000000000..57073cdd1b --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise.json @@ -0,0 +1,24 @@ +{ + "name": "JS_PROMISE", + "offsets": [ + { + "name": "PromiseResult", + "offset": 0, + "size": 8 + }, + { + "name": "PromiseFulfillReactions", + "offset": 8, + "size": 8 + }, + { + "name": "PromiseRejectReactions", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_all_resolve_element_function.json b/ecmascript/js_type_metadata/js_promise_all_resolve_element_function.json new file mode 100644 index 0000000000..77cfb3099a --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_all_resolve_element_function.json @@ -0,0 +1,34 @@ +{ + "name": "JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION", + "offsets": [ + { + "name": "Index", + "offset": 0, + "size": 8 + }, + { + "name": "Values", + "offset": 8, + "size": 8 + }, + { + "name": "Capabilities", + "offset": 16, + "size": 8 + }, + { + "name": "RemainingElements", + "offset": 24, + "size": 8 + }, + { + "name": "AlreadyCalled", + "offset": 32, + "size": 8 + } + ], + "end_offset": 40, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_all_settled_element_function.json b/ecmascript/js_type_metadata/js_promise_all_settled_element_function.json new file mode 100644 index 0000000000..50377e666e --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_all_settled_element_function.json @@ -0,0 +1,29 @@ +{ + "name": "JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION", + "offsets": [ + { + "name": "AlreadyCalled", + "offset": 0, + "size": 8 + }, + { + "name": "Values", + "offset": 8, + "size": 8 + }, + { + "name": "Capability", + "offset": 16, + "size": 8 + }, + { + "name": "RemainingElements", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_any_reject_element_function.json b/ecmascript/js_type_metadata/js_promise_any_reject_element_function.json new file mode 100644 index 0000000000..5f8d9d7f04 --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_any_reject_element_function.json @@ -0,0 +1,29 @@ +{ + "name": "JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION", + "offsets": [ + { + "name": "Errors", + "offset": 0, + "size": 8 + }, + { + "name": "Capability", + "offset": 8, + "size": 8 + }, + { + "name": "RemainingElements", + "offset": 16, + "size": 8 + }, + { + "name": "AlreadyCalled", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_executor_function.json b/ecmascript/js_type_metadata/js_promise_executor_function.json new file mode 100644 index 0000000000..88a77c9d31 --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_executor_function.json @@ -0,0 +1,14 @@ +{ + "name": "JS_PROMISE_EXECUTOR_FUNCTION", + "offsets": [ + { + "name": "Capability", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_finally_function.json b/ecmascript/js_type_metadata/js_promise_finally_function.json new file mode 100644 index 0000000000..2a0c3475d2 --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_finally_function.json @@ -0,0 +1,19 @@ +{ + "name": "JS_PROMISE_FINALLY_FUNCTION", + "offsets": [ + { + "name": "Constructor", + "offset": 0, + "size": 8 + }, + { + "name": "OnFinally", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_reactions_function.json b/ecmascript/js_type_metadata/js_promise_reactions_function.json new file mode 100644 index 0000000000..824ed40d23 --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_reactions_function.json @@ -0,0 +1,19 @@ +{ + "name": "JS_PROMISE_REACTIONS_FUNCTION", + "offsets": [ + { + "name": "Promise", + "offset": 0, + "size": 8 + }, + { + "name": "AlreadyResolved", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_promise_value_thunk_or_thrower_function.json b/ecmascript/js_type_metadata/js_promise_value_thunk_or_thrower_function.json new file mode 100644 index 0000000000..ff9c0781f5 --- /dev/null +++ b/ecmascript/js_type_metadata/js_promise_value_thunk_or_thrower_function.json @@ -0,0 +1,14 @@ +{ + "name": "JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION", + "offsets": [ + { + "name": "Result", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_proxy.json b/ecmascript/js_type_metadata/js_proxy.json new file mode 100644 index 0000000000..5a0bb93cf6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_proxy.json @@ -0,0 +1,29 @@ +{ + "name": "JS_PROXY", + "offsets": [ + { + "name": "Target", + "offset": 0, + "size": 8 + }, + { + "name": "Handler", + "offset": 8, + "size": 8 + }, + { + "name": "Method", + "offset": 16, + "size": 8 + }, + { + "name": "PrivateField", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "ECMA_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_proxy_revoc_function.json b/ecmascript/js_type_metadata/js_proxy_revoc_function.json new file mode 100644 index 0000000000..4f12ba2f4f --- /dev/null +++ b/ecmascript/js_type_metadata/js_proxy_revoc_function.json @@ -0,0 +1,14 @@ +{ + "name": "JS_PROXY_REVOC_FUNCTION", + "offsets": [ + { + "name": "RevocableProxy", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_range_error.json b/ecmascript/js_type_metadata/js_range_error.json new file mode 100644 index 0000000000..91a1bd8fde --- /dev/null +++ b/ecmascript/js_type_metadata/js_range_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_RANGE_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_realm.json b/ecmascript/js_type_metadata/js_realm.json new file mode 100644 index 0000000000..24b2e560c3 --- /dev/null +++ b/ecmascript/js_type_metadata/js_realm.json @@ -0,0 +1,19 @@ +{ + "name": "JS_REALM", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + }, + { + "name": "GlobalEnv", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_reference_error.json b/ecmascript/js_type_metadata/js_reference_error.json new file mode 100644 index 0000000000..ea378f1385 --- /dev/null +++ b/ecmascript/js_type_metadata/js_reference_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_REFERENCE_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_reg_exp.json b/ecmascript/js_type_metadata/js_reg_exp.json new file mode 100644 index 0000000000..f8d233c775 --- /dev/null +++ b/ecmascript/js_type_metadata/js_reg_exp.json @@ -0,0 +1,29 @@ +{ + "name": "JS_REG_EXP", + "offsets": [ + { + "name": "ByteCodeBuffer", + "offset": 0, + "size": 8 + }, + { + "name": "OriginalSource", + "offset": 8, + "size": 8 + }, + { + "name": "OriginalFlags", + "offset": 16, + "size": 8 + }, + { + "name": "GroupName", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_reg_exp_iterator.json b/ecmascript/js_type_metadata/js_reg_exp_iterator.json new file mode 100644 index 0000000000..afbea536ad --- /dev/null +++ b/ecmascript/js_type_metadata/js_reg_exp_iterator.json @@ -0,0 +1,19 @@ +{ + "name": "JS_REG_EXP_ITERATOR", + "offsets": [ + { + "name": "IteratingRegExp", + "offset": 0, + "size": 8 + }, + { + "name": "IteratedString", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_relative_time_format.json b/ecmascript/js_type_metadata/js_relative_time_format.json new file mode 100644 index 0000000000..99d2d0be0e --- /dev/null +++ b/ecmascript/js_type_metadata/js_relative_time_format.json @@ -0,0 +1,24 @@ +{ + "name": "JS_RELATIVE_TIME_FORMAT", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "NumberingSystem", + "offset": 8, + "size": 8 + }, + { + "name": "IcuField", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_segment_iterator.json b/ecmascript/js_type_metadata/js_segment_iterator.json new file mode 100644 index 0000000000..2b675c9bce --- /dev/null +++ b/ecmascript/js_type_metadata/js_segment_iterator.json @@ -0,0 +1,24 @@ +{ + "name": "JS_SEGMENT_ITERATOR", + "offsets": [ + { + "name": "IcuField", + "offset": 0, + "size": 8 + }, + { + "name": "IteratedString", + "offset": 8, + "size": 8 + }, + { + "name": "UnicodeString", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_segmenter.json b/ecmascript/js_type_metadata/js_segmenter.json new file mode 100644 index 0000000000..8780f1d91e --- /dev/null +++ b/ecmascript/js_type_metadata/js_segmenter.json @@ -0,0 +1,19 @@ +{ + "name": "JS_SEGMENTER", + "offsets": [ + { + "name": "Locale", + "offset": 0, + "size": 8 + }, + { + "name": "IcuField", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_segments.json b/ecmascript/js_type_metadata/js_segments.json new file mode 100644 index 0000000000..88427238bc --- /dev/null +++ b/ecmascript/js_type_metadata/js_segments.json @@ -0,0 +1,24 @@ +{ + "name": "JS_SEGMENTS", + "offsets": [ + { + "name": "IcuField", + "offset": 0, + "size": 8 + }, + { + "name": "SegmentsString", + "offset": 8, + "size": 8 + }, + { + "name": "UnicodeString", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_sendable_array_buffer.json b/ecmascript/js_type_metadata/js_sendable_array_buffer.json new file mode 100644 index 0000000000..28ca47b89f --- /dev/null +++ b/ecmascript/js_type_metadata/js_sendable_array_buffer.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SENDABLE_ARRAY_BUFFER", + "offsets": [ + { + "name": "ArrayBufferData", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_set.json b/ecmascript/js_type_metadata/js_set.json new file mode 100644 index 0000000000..40f75a35d1 --- /dev/null +++ b/ecmascript/js_type_metadata/js_set.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SET", + "offsets": [ + { + "name": "LinkedSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_set_iterator.json b/ecmascript/js_type_metadata/js_set_iterator.json new file mode 100644 index 0000000000..28313c03c5 --- /dev/null +++ b/ecmascript/js_type_metadata/js_set_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SET_ITERATOR", + "offsets": [ + { + "name": "IteratorSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_array.json b/ecmascript/js_type_metadata/js_shared_array.json new file mode 100644 index 0000000000..4e7347d3ed --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_array.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_ARRAY", + "offsets": [ + { + "name": "TrackInfo", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_array_buffer.json b/ecmascript/js_type_metadata/js_shared_array_buffer.json new file mode 100644 index 0000000000..d373cb3de9 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_array_buffer.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_ARRAY_BUFFER", + "offsets": [ + { + "name": "ArrayBufferData", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_array_iterator.json b/ecmascript/js_type_metadata/js_shared_array_iterator.json new file mode 100644 index 0000000000..e56ae165d2 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_array_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_ARRAY_ITERATOR", + "offsets": [ + { + "name": "IteratedArray", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_async_function.json b/ecmascript/js_type_metadata/js_shared_async_function.json new file mode 100644 index 0000000000..c5d04a464e --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_async_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_ASYNC_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_bigint64_array.json b/ecmascript/js_type_metadata/js_shared_bigint64_array.json new file mode 100644 index 0000000000..9b8e69ab43 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_bigint64_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_BIGINT64_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_biguint64_array.json b/ecmascript/js_type_metadata/js_shared_biguint64_array.json new file mode 100644 index 0000000000..23649a82b8 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_biguint64_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_BIGUINT64_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_float32_array.json b/ecmascript/js_type_metadata/js_shared_float32_array.json new file mode 100644 index 0000000000..029cdc35bd --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_float32_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_FLOAT32_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_float64_array.json b/ecmascript/js_type_metadata/js_shared_float64_array.json new file mode 100644 index 0000000000..e7ad779f78 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_float64_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_FLOAT64_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_function.json b/ecmascript/js_type_metadata/js_shared_function.json new file mode 100644 index 0000000000..433ca5b5b4 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_function.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_FUNCTION", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_FUNCTION" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_int16_array.json b/ecmascript/js_type_metadata/js_shared_int16_array.json new file mode 100644 index 0000000000..d6ea8238c6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_int16_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_INT16_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_int32_array.json b/ecmascript/js_type_metadata/js_shared_int32_array.json new file mode 100644 index 0000000000..61919f5ce4 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_int32_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_INT32_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_int8_array.json b/ecmascript/js_type_metadata/js_shared_int8_array.json new file mode 100644 index 0000000000..467d835457 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_int8_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_INT8_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_map.json b/ecmascript/js_type_metadata/js_shared_map.json new file mode 100644 index 0000000000..4652f08a38 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_map.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_MAP", + "offsets": [ + { + "name": "LinkedMap", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_map_iterator.json b/ecmascript/js_type_metadata/js_shared_map_iterator.json new file mode 100644 index 0000000000..98f77ff3ef --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_map_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_MAP_ITERATOR", + "offsets": [ + { + "name": "IteratorMap", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_object.json b/ecmascript/js_type_metadata/js_shared_object.json new file mode 100644 index 0000000000..5e6102abb8 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_object.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_OBJECT", + "offsets": [], + "end_offset": 0, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_set.json b/ecmascript/js_type_metadata/js_shared_set.json new file mode 100644 index 0000000000..bdc912b1c1 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_set.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_SET", + "offsets": [ + { + "name": "LinkedSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_set_iterator.json b/ecmascript/js_type_metadata/js_shared_set_iterator.json new file mode 100644 index 0000000000..baae11a57e --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_set_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_SHARED_SET_ITERATOR", + "offsets": [ + { + "name": "IteratorSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_typed_array.json b/ecmascript/js_type_metadata/js_shared_typed_array.json new file mode 100644 index 0000000000..54b109b835 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_typed_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_TYPED_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_uint16_array.json b/ecmascript/js_type_metadata/js_shared_uint16_array.json new file mode 100644 index 0000000000..a72d488ca6 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_uint16_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_UINT16_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_uint32_array.json b/ecmascript/js_type_metadata/js_shared_uint32_array.json new file mode 100644 index 0000000000..a5a88e86e2 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_uint32_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_UINT32_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_uint8_array.json b/ecmascript/js_type_metadata/js_shared_uint8_array.json new file mode 100644 index 0000000000..5cda865803 --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_uint8_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_UINT8_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_shared_uint8_clamped_array.json b/ecmascript/js_type_metadata/js_shared_uint8_clamped_array.json new file mode 100644 index 0000000000..39f6f7aa4f --- /dev/null +++ b/ecmascript/js_type_metadata/js_shared_uint8_clamped_array.json @@ -0,0 +1,8 @@ +{ + "name": "JS_SHARED_UINT8_CLAMPED_ARRAY", + "offsets": [], + "end_offset": 4, + "parents": [ + "JS_TYPED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_string_iterator.json b/ecmascript/js_type_metadata/js_string_iterator.json new file mode 100644 index 0000000000..2fcdf98bb9 --- /dev/null +++ b/ecmascript/js_type_metadata/js_string_iterator.json @@ -0,0 +1,14 @@ +{ + "name": "JS_STRING_ITERATOR", + "offsets": [ + { + "name": "IteratedString", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_syntax_error.json b/ecmascript/js_type_metadata/js_syntax_error.json new file mode 100644 index 0000000000..f229230394 --- /dev/null +++ b/ecmascript/js_type_metadata/js_syntax_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_SYNTAX_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_termination_error.json b/ecmascript/js_type_metadata/js_termination_error.json new file mode 100644 index 0000000000..3cb60ba5c3 --- /dev/null +++ b/ecmascript/js_type_metadata/js_termination_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_TERMINATION_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_type_error.json b/ecmascript/js_type_metadata/js_type_error.json new file mode 100644 index 0000000000..296d69208b --- /dev/null +++ b/ecmascript/js_type_metadata/js_type_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_TYPE_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_typed_array.json b/ecmascript/js_type_metadata/js_typed_array.json new file mode 100644 index 0000000000..4be1b7beb1 --- /dev/null +++ b/ecmascript/js_type_metadata/js_typed_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_TYPED_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_uint16_array.json b/ecmascript/js_type_metadata/js_uint16_array.json new file mode 100644 index 0000000000..c82cbae207 --- /dev/null +++ b/ecmascript/js_type_metadata/js_uint16_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_UINT16_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_uint32_array.json b/ecmascript/js_type_metadata/js_uint32_array.json new file mode 100644 index 0000000000..f11e3bf173 --- /dev/null +++ b/ecmascript/js_type_metadata/js_uint32_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_UINT32_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_uint8_array.json b/ecmascript/js_type_metadata/js_uint8_array.json new file mode 100644 index 0000000000..7651b8fd4c --- /dev/null +++ b/ecmascript/js_type_metadata/js_uint8_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_UINT8_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_uint8_clamped_array.json b/ecmascript/js_type_metadata/js_uint8_clamped_array.json new file mode 100644 index 0000000000..31e9508a44 --- /dev/null +++ b/ecmascript/js_type_metadata/js_uint8_clamped_array.json @@ -0,0 +1,19 @@ +{ + "name": "JS_UINT8_CLAMPED_ARRAY", + "offsets": [ + { + "name": "ViewedArrayBufferOrByteArray", + "offset": 0, + "size": 8 + }, + { + "name": "TypedArrayName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 29, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_uri_error.json b/ecmascript/js_type_metadata/js_uri_error.json new file mode 100644 index 0000000000..58b3824b03 --- /dev/null +++ b/ecmascript/js_type_metadata/js_uri_error.json @@ -0,0 +1,17 @@ +{ + "name": "JS_URI_ERROR", + "offsets": [ + { + "name": "Properties", + "offset": 0, + "size": 8 + }, + { + "name": "Elements", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": ["ECMA_OBJECT"] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_weak_map.json b/ecmascript/js_type_metadata/js_weak_map.json new file mode 100644 index 0000000000..c455773fe9 --- /dev/null +++ b/ecmascript/js_type_metadata/js_weak_map.json @@ -0,0 +1,14 @@ +{ + "name": "JS_WEAK_MAP", + "offsets": [ + { + "name": "LinkedMap", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_weak_ref.json b/ecmascript/js_type_metadata/js_weak_ref.json new file mode 100644 index 0000000000..e14f2b1b4c --- /dev/null +++ b/ecmascript/js_type_metadata/js_weak_ref.json @@ -0,0 +1,14 @@ +{ + "name": "JS_WEAK_REF", + "offsets": [ + { + "name": "WeakObject", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/js_weak_set.json b/ecmascript/js_type_metadata/js_weak_set.json new file mode 100644 index 0000000000..7f9485762b --- /dev/null +++ b/ecmascript/js_type_metadata/js_weak_set.json @@ -0,0 +1,14 @@ +{ + "name": "JS_WEAK_SET", + "offsets": [ + { + "name": "LinkedSet", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/lexical_env.json b/ecmascript/js_type_metadata/lexical_env.json new file mode 100644 index 0000000000..0877f1b4f0 --- /dev/null +++ b/ecmascript/js_type_metadata/lexical_env.json @@ -0,0 +1,8 @@ +{ + "name": "LEXICAL_ENV", + "offsets": [], + "end_offset": 0, + "parents": [ + "TAGGED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/line_string.json b/ecmascript/js_type_metadata/line_string.json new file mode 100644 index 0000000000..d7cf3cc38d --- /dev/null +++ b/ecmascript/js_type_metadata/line_string.json @@ -0,0 +1,8 @@ +{ + "name": "LINE_STRING", + "offsets": [], + "end_offset": 0, + "parents": [ + "ECMA_STRING" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/linked_node.json b/ecmascript/js_type_metadata/linked_node.json new file mode 100644 index 0000000000..365920106f --- /dev/null +++ b/ecmascript/js_type_metadata/linked_node.json @@ -0,0 +1,14 @@ +{ + "name": "LINKED_NODE", + "offsets": [ + { + "name": "Next", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "TAGGED_NODE" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/local_exportentry_record.json b/ecmascript/js_type_metadata/local_exportentry_record.json new file mode 100644 index 0000000000..837af0b0b8 --- /dev/null +++ b/ecmascript/js_type_metadata/local_exportentry_record.json @@ -0,0 +1,19 @@ +{ + "name": "LOCAL_EXPORTENTRY_RECORD", + "offsets": [ + { + "name": "ExportName", + "offset": 0, + "size": 8 + }, + { + "name": "LocalName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/machine_code_object.json b/ecmascript/js_type_metadata/machine_code_object.json new file mode 100644 index 0000000000..70afbcc103 --- /dev/null +++ b/ecmascript/js_type_metadata/machine_code_object.json @@ -0,0 +1,8 @@ +{ + "name": "MACHINE_CODE_OBJECT", + "offsets": [], + "end_offset": 312, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/marker_cell.json b/ecmascript/js_type_metadata/marker_cell.json new file mode 100644 index 0000000000..f9d5a5f2c6 --- /dev/null +++ b/ecmascript/js_type_metadata/marker_cell.json @@ -0,0 +1,8 @@ +{ + "name": "MARKER_CELL", + "offsets": [], + "end_offset": 8, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/method.json b/ecmascript/js_type_metadata/method.json new file mode 100644 index 0000000000..4195866a41 --- /dev/null +++ b/ecmascript/js_type_metadata/method.json @@ -0,0 +1,14 @@ +{ + "name": "METHOD", + "offsets": [ + { + "name": "ConstantPool", + "offset": 0, + "size": 8 + } + ], + "end_offset": 48, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/micro_job_queue.json b/ecmascript/js_type_metadata/micro_job_queue.json new file mode 100644 index 0000000000..aca34378a8 --- /dev/null +++ b/ecmascript/js_type_metadata/micro_job_queue.json @@ -0,0 +1,19 @@ +{ + "name": "MICRO_JOB_QUEUE", + "offsets": [ + { + "name": "PromiseJobQueue", + "offset": 0, + "size": 8 + }, + { + "name": "ScriptJobQueue", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/module_record.json b/ecmascript/js_type_metadata/module_record.json new file mode 100644 index 0000000000..6c1d82caa8 --- /dev/null +++ b/ecmascript/js_type_metadata/module_record.json @@ -0,0 +1,8 @@ +{ + "name": "MODULE_RECORD", + "offsets": [], + "end_offset": 0, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/mutant_tagged_array.json b/ecmascript/js_type_metadata/mutant_tagged_array.json new file mode 100644 index 0000000000..e118144210 --- /dev/null +++ b/ecmascript/js_type_metadata/mutant_tagged_array.json @@ -0,0 +1,8 @@ +{ + "name": "MUTANT_TAGGED_ARRAY", + "offsets": [], + "end_offset": 0, + "parents": [ + "TAGGED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/native_module_failure_info.json b/ecmascript/js_type_metadata/native_module_failure_info.json new file mode 100644 index 0000000000..3a77dabc9d --- /dev/null +++ b/ecmascript/js_type_metadata/native_module_failure_info.json @@ -0,0 +1,14 @@ +{ + "name": "NATIVE_MODULE_FAILURE_INFO", + "offsets": [ + { + "name": "ArkNativeModuleFailureInfo", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "JS_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/pending_job.json b/ecmascript/js_type_metadata/pending_job.json new file mode 100644 index 0000000000..e62d742c76 --- /dev/null +++ b/ecmascript/js_type_metadata/pending_job.json @@ -0,0 +1,19 @@ +{ + "name": "PENDING_JOB", + "offsets": [ + { + "name": "Job", + "offset": 0, + "size": 8 + }, + { + "name": "Arguments", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/profile_type_info.json b/ecmascript/js_type_metadata/profile_type_info.json new file mode 100644 index 0000000000..a9b8f37728 --- /dev/null +++ b/ecmascript/js_type_metadata/profile_type_info.json @@ -0,0 +1,8 @@ +{ + "name": "PROFILE_TYPE_INFO", + "offsets": [], + "end_offset": 0, + "parents": [ + "TAGGED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/profile_type_info_cell_0.json b/ecmascript/js_type_metadata/profile_type_info_cell_0.json new file mode 100644 index 0000000000..0dc65df6c6 --- /dev/null +++ b/ecmascript/js_type_metadata/profile_type_info_cell_0.json @@ -0,0 +1,24 @@ +{ + "name": "PROFILE_TYPE_INFO_CELL_0", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + }, + { + "name": "MachineCode", + "offset": 8, + "size": 8 + }, + { + "name": "Handle", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/profile_type_info_cell_1.json b/ecmascript/js_type_metadata/profile_type_info_cell_1.json new file mode 100644 index 0000000000..63d04f3254 --- /dev/null +++ b/ecmascript/js_type_metadata/profile_type_info_cell_1.json @@ -0,0 +1,24 @@ +{ + "name": "PROFILE_TYPE_INFO_CELL_1", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + }, + { + "name": "MachineCode", + "offset": 8, + "size": 8 + }, + { + "name": "Handle", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/profile_type_info_cell_n.json b/ecmascript/js_type_metadata/profile_type_info_cell_n.json new file mode 100644 index 0000000000..cc6ae0dee3 --- /dev/null +++ b/ecmascript/js_type_metadata/profile_type_info_cell_n.json @@ -0,0 +1,24 @@ +{ + "name": "PROFILE_TYPE_INFO_CELL_N", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + }, + { + "name": "MachineCode", + "offset": 8, + "size": 8 + }, + { + "name": "Handle", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/program.json b/ecmascript/js_type_metadata/program.json new file mode 100644 index 0000000000..a0b1897edf --- /dev/null +++ b/ecmascript/js_type_metadata/program.json @@ -0,0 +1,14 @@ +{ + "name": "PROGRAM", + "offsets": [ + { + "name": "MainFunction", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "ECMA_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/promise_capability.json b/ecmascript/js_type_metadata/promise_capability.json new file mode 100644 index 0000000000..b72c600ce6 --- /dev/null +++ b/ecmascript/js_type_metadata/promise_capability.json @@ -0,0 +1,24 @@ +{ + "name": "PROMISE_CAPABILITY", + "offsets": [ + { + "name": "Promise", + "offset": 0, + "size": 8 + }, + { + "name": "Resolve", + "offset": 8, + "size": 8 + }, + { + "name": "Reject", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/promise_iterator_record.json b/ecmascript/js_type_metadata/promise_iterator_record.json new file mode 100644 index 0000000000..b1d84971ca --- /dev/null +++ b/ecmascript/js_type_metadata/promise_iterator_record.json @@ -0,0 +1,14 @@ +{ + "name": "PROMISE_ITERATOR_RECORD", + "offsets": [ + { + "name": "Iterator", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/promise_reactions.json b/ecmascript/js_type_metadata/promise_reactions.json new file mode 100644 index 0000000000..030bdc7921 --- /dev/null +++ b/ecmascript/js_type_metadata/promise_reactions.json @@ -0,0 +1,19 @@ +{ + "name": "PROMISE_REACTIONS", + "offsets": [ + { + "name": "PromiseCapability", + "offset": 0, + "size": 8 + }, + { + "name": "Handler", + "offset": 8, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/promise_record.json b/ecmascript/js_type_metadata/promise_record.json new file mode 100644 index 0000000000..38249d6253 --- /dev/null +++ b/ecmascript/js_type_metadata/promise_record.json @@ -0,0 +1,14 @@ +{ + "name": "PROMISE_RECORD", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/property_box.json b/ecmascript/js_type_metadata/property_box.json new file mode 100644 index 0000000000..d4fdeaf90c --- /dev/null +++ b/ecmascript/js_type_metadata/property_box.json @@ -0,0 +1,14 @@ +{ + "name": "PROPERTY_BOX", + "offsets": [ + { + "name": "Value", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/proto_change_marker.json b/ecmascript/js_type_metadata/proto_change_marker.json new file mode 100644 index 0000000000..2e2da67077 --- /dev/null +++ b/ecmascript/js_type_metadata/proto_change_marker.json @@ -0,0 +1,8 @@ +{ + "name": "PROTO_CHANGE_MARKER", + "offsets": [], + "end_offset": 8, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/prototype_handler.json b/ecmascript/js_type_metadata/prototype_handler.json new file mode 100644 index 0000000000..ae667cc184 --- /dev/null +++ b/ecmascript/js_type_metadata/prototype_handler.json @@ -0,0 +1,29 @@ +{ + "name": "PROTOTYPE_HANDLER", + "offsets": [ + { + "name": "HandlerInfo", + "offset": 0, + "size": 8 + }, + { + "name": "ProtoCell", + "offset": 8, + "size": 8 + }, + { + "name": "Holder", + "offset": 16, + "size": 8 + }, + { + "name": "AccessorJSFunction", + "offset": 24, + "size": 8 + } + ], + "end_offset": 36, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/prototype_info.json b/ecmascript/js_type_metadata/prototype_info.json new file mode 100644 index 0000000000..3d0aaeac1f --- /dev/null +++ b/ecmascript/js_type_metadata/prototype_info.json @@ -0,0 +1,14 @@ +{ + "name": "PROTOTYPE_INFO", + "offsets": [ + { + "name": "ChangeListener", + "offset": 0, + "size": 8 + } + ], + "end_offset": 12, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/rb_treenode.json b/ecmascript/js_type_metadata/rb_treenode.json new file mode 100644 index 0000000000..bec3aed9ae --- /dev/null +++ b/ecmascript/js_type_metadata/rb_treenode.json @@ -0,0 +1,24 @@ +{ + "name": "RB_TREENODE", + "offsets": [ + { + "name": "Left", + "offset": 0, + "size": 8 + }, + { + "name": "Right", + "offset": 8, + "size": 8 + }, + { + "name": "IsRed", + "offset": 16, + "size": 8 + } + ], + "end_offset": 28, + "parents": [ + "TAGGED_NODE" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/record.json b/ecmascript/js_type_metadata/record.json new file mode 100644 index 0000000000..3bcf47d325 --- /dev/null +++ b/ecmascript/js_type_metadata/record.json @@ -0,0 +1,8 @@ +{ + "name": "RECORD", + "offsets": [], + "end_offset": 0, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/resolvedbinding_record.json b/ecmascript/js_type_metadata/resolvedbinding_record.json new file mode 100644 index 0000000000..89155f112b --- /dev/null +++ b/ecmascript/js_type_metadata/resolvedbinding_record.json @@ -0,0 +1,19 @@ +{ + "name": "RESOLVEDBINDING_RECORD", + "offsets": [ + { + "name": "Module", + "offset": 0, + "size": 8 + }, + { + "name": "BindingName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/resolvedindexbinding_record.json b/ecmascript/js_type_metadata/resolvedindexbinding_record.json new file mode 100644 index 0000000000..8ce98e347a --- /dev/null +++ b/ecmascript/js_type_metadata/resolvedindexbinding_record.json @@ -0,0 +1,19 @@ +{ + "name": "RESOLVEDINDEXBINDING_RECORD", + "offsets": [ + { + "name": "Module", + "offset": 0, + "size": 8 + }, + { + "name": "Index", + "offset": 8, + "size": 4 + } + ], + "end_offset": 12, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/resolvedrecordbinding_record.json b/ecmascript/js_type_metadata/resolvedrecordbinding_record.json new file mode 100644 index 0000000000..efeae4e21d --- /dev/null +++ b/ecmascript/js_type_metadata/resolvedrecordbinding_record.json @@ -0,0 +1,19 @@ +{ + "name": "RESOLVEDRECORDBINDING_RECORD", + "offsets": [ + { + "name": "ModuleRecord", + "offset": 0, + "size": 8 + }, + { + "name": "BindingName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/resolvedrecordindexbinding_record.json b/ecmascript/js_type_metadata/resolvedrecordindexbinding_record.json new file mode 100644 index 0000000000..8cb4d1cd3e --- /dev/null +++ b/ecmascript/js_type_metadata/resolvedrecordindexbinding_record.json @@ -0,0 +1,19 @@ +{ + "name": "RESOLVEDRECORDINDEXBINDING_RECORD", + "offsets": [ + { + "name": "ModuleRecord", + "offset": 0, + "size": 8 + }, + { + "name": "AbcFileName", + "offset": 8, + "size": 8 + } + ], + "end_offset": 20, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/resolving_functions_record.json b/ecmascript/js_type_metadata/resolving_functions_record.json new file mode 100644 index 0000000000..51a76e4ffd --- /dev/null +++ b/ecmascript/js_type_metadata/resolving_functions_record.json @@ -0,0 +1,19 @@ +{ + "name": "RESOLVING_FUNCTIONS_RECORD", + "offsets": [ + { + "name": "ResolveFunction", + "offset": 0, + "size": 8 + }, + { + "name": "RejectFunction", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/sendable_env.json b/ecmascript/js_type_metadata/sendable_env.json new file mode 100644 index 0000000000..c9f9790773 --- /dev/null +++ b/ecmascript/js_type_metadata/sendable_env.json @@ -0,0 +1,8 @@ +{ + "name": "SENDABLE_ENV", + "offsets": [], + "end_offset": 0, + "parents": [ + "TAGGED_ARRAY" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/sliced_string.json b/ecmascript/js_type_metadata/sliced_string.json new file mode 100644 index 0000000000..a62b8cf9f7 --- /dev/null +++ b/ecmascript/js_type_metadata/sliced_string.json @@ -0,0 +1,14 @@ +{ + "name": "SLICED_STRING", + "offsets": [ + { + "name": "Parent", + "offset": 0, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "ECMA_STRING" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/source_text_module_record.json b/ecmascript/js_type_metadata/source_text_module_record.json new file mode 100644 index 0000000000..d892e22b80 --- /dev/null +++ b/ecmascript/js_type_metadata/source_text_module_record.json @@ -0,0 +1,69 @@ +{ + "name": "SOURCE_TEXT_MODULE_RECORD", + "offsets": [ + { + "name": "Environment", + "offset": 0, + "size": 8 + }, + { + "name": "Namespace", + "offset": 8, + "size": 8 + }, + { + "name": "RequestedModules", + "offset": 16, + "size": 8 + }, + { + "name": "ImportEntries", + "offset": 24, + "size": 8 + }, + { + "name": "LocalExportEntries", + "offset": 32, + "size": 8 + }, + { + "name": "IndirectExportEntries", + "offset": 40, + "size": 8 + }, + { + "name": "StarExportEntries", + "offset": 48, + "size": 8 + }, + { + "name": "NameDictionary", + "offset": 56, + "size": 8 + }, + { + "name": "CycleRoot", + "offset": 64, + "size": 8 + }, + { + "name": "TopLevelCapability", + "offset": 72, + "size": 8 + }, + { + "name": "AsyncParentModules", + "offset": 80, + "size": 8 + }, + { + "name": "SendableEnv", + "offset": 88, + "size": 8 + } + ], + "end_offset": 144, + "parents": [ + "MODULE_RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/star_exportentry_record.json b/ecmascript/js_type_metadata/star_exportentry_record.json new file mode 100644 index 0000000000..1418ca7a04 --- /dev/null +++ b/ecmascript/js_type_metadata/star_exportentry_record.json @@ -0,0 +1,14 @@ +{ + "name": "STAR_EXPORTENTRY_RECORD", + "offsets": [ + { + "name": "ModuleRequest", + "offset": 0, + "size": 8 + } + ], + "end_offset": 8, + "parents": [ + "RECORD" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/store_ts_handler.json b/ecmascript/js_type_metadata/store_ts_handler.json new file mode 100644 index 0000000000..35f5109d77 --- /dev/null +++ b/ecmascript/js_type_metadata/store_ts_handler.json @@ -0,0 +1,24 @@ +{ + "name": "STORE_TS_HANDLER", + "offsets": [ + { + "name": "HandlerInfo", + "offset": 0, + "size": 8 + }, + { + "name": "ProtoCell", + "offset": 8, + "size": 8 + }, + { + "name": "Holder", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/symbol.json b/ecmascript/js_type_metadata/symbol.json new file mode 100644 index 0000000000..b67aaf13f7 --- /dev/null +++ b/ecmascript/js_type_metadata/symbol.json @@ -0,0 +1,14 @@ +{ + "name": "SYMBOL", + "offsets": [ + { + "name": "Description", + "offset": 0, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/tagged_array.json b/ecmascript/js_type_metadata/tagged_array.json new file mode 100644 index 0000000000..519b8992d9 --- /dev/null +++ b/ecmascript/js_type_metadata/tagged_array.json @@ -0,0 +1,20 @@ +{ + "name": "TAGGED_ARRAY", + "offsets": [ + { + "name": "Length", + "offset": 0, + "size": 4 + }, + { + "name": "Data", + "offset": 8, + "size": 8 + } + ], + "end_offset": 0, + "parents": [ + "TAGGED_OBJECT" + ], + "visit_type": "Array" +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/tagged_dictionary.json b/ecmascript/js_type_metadata/tagged_dictionary.json new file mode 100644 index 0000000000..756db47c30 --- /dev/null +++ b/ecmascript/js_type_metadata/tagged_dictionary.json @@ -0,0 +1 @@ +{"name": "TAGGED_DICTIONARY", "offsets": [], "end_offset": 8, "parents": ["TAGGED_ARRAY"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/tagged_node.json b/ecmascript/js_type_metadata/tagged_node.json new file mode 100644 index 0000000000..4edf6efca6 --- /dev/null +++ b/ecmascript/js_type_metadata/tagged_node.json @@ -0,0 +1,24 @@ +{ + "name": "TAGGED_NODE", + "offsets": [ + { + "name": "Hash", + "offset": 0, + "size": 8 + }, + { + "name": "Key", + "offset": 8, + "size": 8 + }, + { + "name": "Value", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/tagged_object.json b/ecmascript/js_type_metadata/tagged_object.json new file mode 100644 index 0000000000..b3ff6ecb1e --- /dev/null +++ b/ecmascript/js_type_metadata/tagged_object.json @@ -0,0 +1 @@ +{"name": "TAGGED_OBJECT", "offsets": [], "end_offset": 8, "parents": []} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/template_map.json b/ecmascript/js_type_metadata/template_map.json new file mode 100644 index 0000000000..591f518674 --- /dev/null +++ b/ecmascript/js_type_metadata/template_map.json @@ -0,0 +1 @@ +{"name": "TEMPLATE_MAP", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/track_info.json b/ecmascript/js_type_metadata/track_info.json new file mode 100644 index 0000000000..4398ea12d1 --- /dev/null +++ b/ecmascript/js_type_metadata/track_info.json @@ -0,0 +1,19 @@ +{ + "name": "TRACK_INFO", + "offsets": [ + { + "name": "CachedHClass", + "offset": 0, + "size": 8 + }, + { + "name": "CachedFunc", + "offset": 8, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/trans_with_proto_handler.json b/ecmascript/js_type_metadata/trans_with_proto_handler.json new file mode 100644 index 0000000000..88742c8400 --- /dev/null +++ b/ecmascript/js_type_metadata/trans_with_proto_handler.json @@ -0,0 +1,24 @@ +{ + "name": "TRANS_WITH_PROTO_HANDLER", + "offsets": [ + { + "name": "HandlerInfo", + "offset": 0, + "size": 8 + }, + { + "name": "TransitionHClass", + "offset": 8, + "size": 8 + }, + { + "name": "ProtoCell", + "offset": 16, + "size": 8 + } + ], + "end_offset": 24, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/transition_handler.json b/ecmascript/js_type_metadata/transition_handler.json new file mode 100644 index 0000000000..e9a7dc3bc5 --- /dev/null +++ b/ecmascript/js_type_metadata/transition_handler.json @@ -0,0 +1,19 @@ +{ + "name": "TRANSITION_HANDLER", + "offsets": [ + { + "name": "HandlerInfo", + "offset": 0, + "size": 8 + }, + { + "name": "TransitionHClass", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "TAGGED_OBJECT" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/tree_string.json b/ecmascript/js_type_metadata/tree_string.json new file mode 100644 index 0000000000..7464813554 --- /dev/null +++ b/ecmascript/js_type_metadata/tree_string.json @@ -0,0 +1,19 @@ +{ + "name": "TREE_STRING", + "offsets": [ + { + "name": "First", + "offset": 0, + "size": 8 + }, + { + "name": "Second", + "offset": 8, + "size": 8 + } + ], + "end_offset": 16, + "parents": [ + "ECMA_STRING" + ] +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/type_enums.json b/ecmascript/js_type_metadata/type_enums.json new file mode 100644 index 0000000000..c8ad11d1a6 --- /dev/null +++ b/ecmascript/js_type_metadata/type_enums.json @@ -0,0 +1,217 @@ +{ + "type_enum": { + "INVALID":8, + "JS_OBJECT":3, + "JS_SHARED_OBJECT":3, + "JS_REALM":8, + "JS_FUNCTION_BASE":8, + "JS_FUNCTION":5, + "JS_SHARED_FUNCTION":5, + "JS_PROXY_REVOC_FUNCTION":5, + "JS_PROMISE_REACTIONS_FUNCTION":5, + "JS_PROMISE_EXECUTOR_FUNCTION":5, + "JS_ASYNC_MODULE_FULFILLED_FUNCTION":5, + "JS_ASYNC_MODULE_REJECTED_FUNCTION":5, + "JS_ASYNC_FROM_SYNC_ITER_UNWARP_FUNCTION":5, + "JS_PROMISE_ALL_RESOLVE_ELEMENT_FUNCTION":5, + "JS_ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN":5, + "JS_PROMISE_ANY_REJECT_ELEMENT_FUNCTION":5, + "JS_PROMISE_ALL_SETTLED_ELEMENT_FUNCTION":5, + "JS_PROMISE_FINALLY_FUNCTION":5, + "JS_PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION":5, + "JS_GENERATOR_FUNCTION":5, + "JS_ASYNC_GENERATOR_FUNCTION":5, + "JS_ASYNC_FUNCTION":5, + "JS_SHARED_ASYNC_FUNCTION":5, + "JS_INTL_BOUND_FUNCTION":5, + "JS_ASYNC_AWAIT_STATUS_FUNCTION":5, + "JS_BOUND_FUNCTION":8, + "JS_ERROR":8, + "JS_EVAL_ERROR":8, + "JS_RANGE_ERROR":8, + "JS_REFERENCE_ERROR":8, + "JS_TYPE_ERROR":8, + "JS_AGGREGATE_ERROR":8, + "JS_URI_ERROR":8, + "JS_SYNTAX_ERROR":8, + "JS_OOM_ERROR":8, + "JS_TERMINATION_ERROR":8, + "JS_REG_EXP":6, + "JS_SET":8, + "JS_SHARED_SET":8, + "JS_MAP":8, + "JS_SHARED_MAP":8, + "JS_WEAK_MAP":8, + "JS_WEAK_SET":8, + "JS_WEAK_REF":8, + "JS_FINALIZATION_REGISTRY":8, + "JS_DATE":8, + "JS_ITERATOR":8, + "JS_ASYNCITERATOR":8, + "JS_ASYNC_FROM_SYNC_ITERATOR":8, + "JS_FORIN_ITERATOR":8, + "JS_MAP_ITERATOR":8, + "JS_SHARED_MAP_ITERATOR":8, + "JS_SET_ITERATOR":8, + "JS_SHARED_SET_ITERATOR":8, + "JS_REG_EXP_ITERATOR":8, + "JS_API_ARRAYLIST_ITERATOR":8, + "JS_API_DEQUE_ITERATOR":8, + "JS_API_HASHMAP_ITERATOR":8, + "JS_API_HASHSET_ITERATOR":8, + "JS_API_LIGHT_WEIGHT_MAP_ITERATOR":8, + "JS_API_LIGHT_WEIGHT_SET_ITERATOR":8, + "JS_API_PLAIN_ARRAY_ITERATOR":8, + "JS_API_QUEUE_ITERATOR":8, + "JS_API_STACK_ITERATOR":8, + "JS_API_TREEMAP_ITERATOR":8, + "JS_API_TREESET_ITERATOR":8, + "JS_API_VECTOR_ITERATOR":8, + "JS_API_BITVECTOR_ITERATOR":8, + "JS_API_LINKED_LIST_ITERATOR":8, + "JS_API_LIST_ITERATOR":8, + "JS_ARRAY_ITERATOR":8, + "JS_SHARED_ARRAY_ITERATOR":8, + "JS_SEGMENT_ITERATOR":8, + "JS_STRING_ITERATOR":8, + "JS_INTL":8, + "JS_LOCALE":8, + "JS_DATE_TIME_FORMAT":8, + "JS_RELATIVE_TIME_FORMAT":8, + "JS_NUMBER_FORMAT":8, + "JS_COLLATOR":8, + "JS_PLURAL_RULES":8, + "JS_DISPLAYNAMES":8, + "JS_LIST_FORMAT":8, + "JS_SEGMENTER":8, + "JS_SEGMENTS":8, + "JS_ARRAY_BUFFER":8, + "JS_SHARED_ARRAY_BUFFER":8, + "JS_SENDABLE_ARRAY_BUFFER":8, + "JS_PROMISE":8, + "JS_DATA_VIEW":8, + "JS_ARGUMENTS":8, + "JS_GENERATOR_OBJECT":8, + "JS_ASYNC_GENERATOR_OBJECT":8, + "JS_ASYNC_FUNC_OBJECT":8, + "JS_ARRAY":3, + "JS_SHARED_ARRAY":8, + "JS_API_ARRAY_LIST":8, + "JS_API_LIGHT_WEIGHT_MAP":8, + "JS_API_LIGHT_WEIGHT_SET":8, + "JS_API_VECTOR":8, + "JS_API_BITVECTOR":8, + "JS_API_LINKED_LIST":8, + "JS_API_LIST":8, + "JS_API_HASH_MAP":8, + "JS_API_HASH_SET":8, + "JS_API_TREE_MAP":8, + "JS_API_TREE_SET":8, + "JS_API_DEQUE":8, + "JS_API_STACK":8, + "JS_API_PLAIN_ARRAY":8, + "JS_API_QUEUE":8, + "JS_TYPED_ARRAY":3, + "JS_INT8_ARRAY":8, + "JS_UINT8_ARRAY":8, + "JS_UINT8_CLAMPED_ARRAY":8, + "JS_INT16_ARRAY":8, + "JS_UINT16_ARRAY":8, + "JS_INT32_ARRAY":8, + "JS_UINT32_ARRAY":8, + "JS_FLOAT32_ARRAY":8, + "JS_FLOAT64_ARRAY":8, + "JS_BIGINT64_ARRAY":8, + "JS_BIGUINT64_ARRAY":8, + "JS_SHARED_TYPED_ARRAY":8, + "JS_SHARED_INT8_ARRAY":8, + "JS_SHARED_UINT8_ARRAY":8, + "JS_SHARED_UINT8_CLAMPED_ARRAY":8, + "JS_SHARED_INT16_ARRAY":8, + "JS_SHARED_UINT16_ARRAY":8, + "JS_SHARED_INT32_ARRAY":8, + "JS_SHARED_UINT32_ARRAY":8, + "JS_SHARED_FLOAT32_ARRAY":8, + "JS_SHARED_FLOAT64_ARRAY":8, + "JS_SHARED_BIGINT64_ARRAY":8, + "JS_SHARED_BIGUINT64_ARRAY":8, + "JS_PRIMITIVE_REF":7, + "JS_MODULE_NAMESPACE":8, + "JS_CJS_MODULE":8, + "JS_CJS_EXPORTS":8, + "JS_CJS_REQUIRE":8, + "NATIVE_MODULE_FAILURE_INFO":8, + "JS_GLOBAL_OBJECT":8, + "JS_PROXY":8, + "HCLASS":8, + "LINE_STRING":2, + "CONSTANT_STRING":2, + "SLICED_STRING":2, + "TREE_STRING":2, + "BIGINT":13, + "TAGGED_ARRAY":1, + "MUTANT_TAGGED_ARRAY":1, + "BYTE_ARRAY":8, + "LEXICAL_ENV":1, + "SENDABLE_ENV":1, + "TAGGED_DICTIONARY":1, + "CONSTANT_POOL":1, + "PROFILE_TYPE_INFO":1, + "COW_MUTANT_TAGGED_ARRAY":1, + "COW_TAGGED_ARRAY":1, + "LINKED_NODE":8, + "RB_TREENODE":8, + "FREE_OBJECT_WITH_ONE_FIELD":8, + "FREE_OBJECT_WITH_NONE_FIELD":8, + "FREE_OBJECT_WITH_TWO_FIELD":8, + "JS_NATIVE_POINTER":8, + "GLOBAL_ENV":8, + "ACCESSOR_DATA":8, + "INTERNAL_ACCESSOR":8, + "SYMBOL":12, + "JS_GENERATOR_CONTEXT":8, + "PROTOTYPE_HANDLER":8, + "TRANSITION_HANDLER":8, + "TRANS_WITH_PROTO_HANDLER":8, + "STORE_TS_HANDLER":8, + "PROPERTY_BOX":8, + "PROTO_CHANGE_MARKER":8, + "MARKER_CELL":8, + "TRACK_INFO":8, + "PROTOTYPE_INFO":8, + "TEMPLATE_MAP":8, + "PROGRAM":8, + "METHOD":8, + "CLASS_LITERAL":8, + "PROMISE_CAPABILITY":8, + "PROMISE_RECORD":8, + "RESOLVING_FUNCTIONS_RECORD":8, + "PROMISE_REACTIONS":8, + "ASYNC_GENERATOR_REQUEST":8, + "ASYNC_ITERATOR_RECORD":8, + "PROMISE_ITERATOR_RECORD":8, + "MICRO_JOB_QUEUE":8, + "PENDING_JOB":8, + "MODULE_RECORD":8, + "SOURCE_TEXT_MODULE_RECORD":8, + "IMPORTENTRY_RECORD":8, + "LOCAL_EXPORTENTRY_RECORD":8, + "INDIRECT_EXPORTENTRY_RECORD":8, + "STAR_EXPORTENTRY_RECORD":8, + "RESOLVEDBINDING_RECORD":8, + "RESOLVEDINDEXBINDING_RECORD":8, + "RESOLVEDRECORDINDEXBINDING_RECORD":8, + "RESOLVEDRECORDBINDING_RECORD":8, + "CELL_RECORD":8, + "COMPLETION_RECORD":8, + "MACHINE_CODE_OBJECT":8, + "CLASS_INFO_EXTRACTOR":8, + "PROFILE_TYPE_INFO_CELL_0":8, + "PROFILE_TYPE_INFO_CELL_1":8, + "PROFILE_TYPE_INFO_CELL_N":8, + "EXTRA_PROFILE_TYPE_INFO":8, + "FUNCTION_TEMPLATE":8, + "VTABLE":1, + "AOT_LITERAL_INFO":1 + } +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/type_range.json b/ecmascript/js_type_metadata/type_range.json new file mode 100644 index 0000000000..5a5984747f --- /dev/null +++ b/ecmascript/js_type_metadata/type_range.json @@ -0,0 +1,6 @@ +{ + "string_first": "LINE_STRING", + "string_last": "TREE_STRING", + "js_object_first": "JS_OBJECT", + "js_object_last": "JS_GLOBAL_OBJECT" +} \ No newline at end of file diff --git a/ecmascript/js_type_metadata/vtable.json b/ecmascript/js_type_metadata/vtable.json new file mode 100644 index 0000000000..01a78d5265 --- /dev/null +++ b/ecmascript/js_type_metadata/vtable.json @@ -0,0 +1 @@ +{"name": "VTABLE", "offsets": [], "end_offset": 8, "parents": ["TAGGED_OBJECT"]} \ No newline at end of file diff --git a/script/metadata_copy_for_test.py b/script/metadata_copy_for_test.py new file mode 100755 index 0000000000..c82303a92c --- /dev/null +++ b/script/metadata_copy_for_test.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Copyright (c) 2024 Huawei Device Co., Ltd. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Description: metadata.json generate +""" +import argparse +import os +from shutil import copyfile + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--metadata', + type=str, + required=True, + help='metadata folder path') + parser.add_argument('--outputs', + type=str, + required=True, + help='copy destination') + args = parser.parse_args() + return args + + +def copy_metadata(input_path, output_path): + if not os.path.exists(output_path): + os.makedirs(output_path, 0o777, True) + for file_name in os.listdir(input_path): + if os.path.isfile(os.path.join(input_path, file_name)) and file_name.endswith('.json'): + copyfile(os.path.join(input_path, file_name), os.path.join(output_path, file_name)) + + +if __name__ == '__main__': + arguments = parse_args() + copy_metadata(arguments.metadata, arguments.outputs) diff --git a/script/metadata_generate.py b/script/metadata_generate.py new file mode 100755 index 0000000000..e6b1291222 --- /dev/null +++ b/script/metadata_generate.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Copyright (c) 2024 Huawei Device Co., Ltd. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Description: metadata.json generate +""" + +import argparse +import os +import json + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--enum', + type=str, + required=True, + help='type_enum.json file path') + parser.add_argument('--metadata', + type=str, + required=True, + help='metadata folder path') + parser.add_argument('--output', + type=str, + required=True, + help='generated metadata.json file path') + parser.add_argument('--version', + type=str, + required=True, + help='version number') + args = parser.parse_args() + return args + + +def parse_type_enums(file_path): + with open(file_path, 'r') as f: + type_enums = json.load(f) + return type_enums["type_enum"] + + +def parse_type_list(dir_path): + type_list, type_layout = [], {} + for file_name in os.listdir(dir_path): + if not os.path.isfile(os.path.join(dir_path, file_name)) or not _is_metadata_file(file_name): + continue + with open(os.path.join(dir_path, file_name), 'r') as f: + metadata = json.load(f) + if file_name.endswith("_layout.json"): + type_layout["Dictionary_layout"] = metadata + elif file_name == "type_range.json": + type_layout["Type_range"] = metadata + else: + type_list.append(metadata) + return type_list, type_layout + + +def _is_metadata_file(file_name): + return file_name.endswith(".json") and file_name != "type_enums.json" + + +def generate_metadata_json(enum_list, metadata_list, type_layout, file_path, version): + metadata_dict = {"type_enum": enum_list, "type_list": [], "type_layout": type_layout, "version": version} + for metadata in metadata_list: + metadata_dict["type_list"].append(metadata) + with os.fdopen(os.open(file_path, os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o777), 'w+') as f: + json_str = json.dumps(metadata_dict) + f.write(json_str) + + +if __name__ == '__main__': + arguments = parse_args() + type_enum_list = parse_type_enums(arguments.enum) + type_metadata_list, type_layout_list = parse_type_list(arguments.metadata) + generate_metadata_json(type_enum_list, type_metadata_list, type_layout_list, arguments.output, arguments.version) diff --git a/test/resource/js_runtime/ohos_test.xml b/test/resource/js_runtime/ohos_test.xml index cb1b486bf9..3531a8d069 100755 --- a/test/resource/js_runtime/ohos_test.xml +++ b/test/resource/js_runtime/ohos_test.xml @@ -798,6 +798,228 @@