11cb0ef41Sopenharmony_ci# Copyright 2013 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci# Redistribution and use in source and binary forms, with or without
31cb0ef41Sopenharmony_ci# modification, are permitted provided that the following conditions are
41cb0ef41Sopenharmony_ci# met:
51cb0ef41Sopenharmony_ci#
61cb0ef41Sopenharmony_ci#     * Redistributions of source code must retain the above copyright
71cb0ef41Sopenharmony_ci#       notice, this list of conditions and the following disclaimer.
81cb0ef41Sopenharmony_ci#     * Redistributions in binary form must reproduce the above
91cb0ef41Sopenharmony_ci#       copyright notice, this list of conditions and the following
101cb0ef41Sopenharmony_ci#       disclaimer in the documentation and/or other materials provided
111cb0ef41Sopenharmony_ci#       with the distribution.
121cb0ef41Sopenharmony_ci#     * Neither the name of Google Inc. nor the names of its
131cb0ef41Sopenharmony_ci#       contributors may be used to endorse or promote products derived
141cb0ef41Sopenharmony_ci#       from this software without specific prior written permission.
151cb0ef41Sopenharmony_ci#
161cb0ef41Sopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171cb0ef41Sopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181cb0ef41Sopenharmony_ci# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191cb0ef41Sopenharmony_ci# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201cb0ef41Sopenharmony_ci# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211cb0ef41Sopenharmony_ci# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221cb0ef41Sopenharmony_ci# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231cb0ef41Sopenharmony_ci# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241cb0ef41Sopenharmony_ci# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251cb0ef41Sopenharmony_ci# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261cb0ef41Sopenharmony_ci# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ci# Compile time controlled V8 features.
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_ci{
311cb0ef41Sopenharmony_ci  'variables': {
321cb0ef41Sopenharmony_ci    'v8_target_arch%': '<(target_arch)',
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_ci    'v8_current_cpu%': '<(target_arch)',
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci    # Emulate GN variables
371cb0ef41Sopenharmony_ci    # https://chromium.googlesource.com/chromium/src/build/+/556c524beb09c332698debe1b47b065d5d029cd0/config/BUILDCONFIG.gn#269
381cb0ef41Sopenharmony_ci    'conditions': [
391cb0ef41Sopenharmony_ci      ['OS == "win" or OS == "winuwp"', {
401cb0ef41Sopenharmony_ci        'is_win': 1,
411cb0ef41Sopenharmony_ci      }, {
421cb0ef41Sopenharmony_ci        'is_win': 0,
431cb0ef41Sopenharmony_ci      }],
441cb0ef41Sopenharmony_ci      ['OS == "fuchsia"', {
451cb0ef41Sopenharmony_ci        'is_fuchsia': 1,
461cb0ef41Sopenharmony_ci      }, {
471cb0ef41Sopenharmony_ci        'is_fuchsia': 0,
481cb0ef41Sopenharmony_ci      }],
491cb0ef41Sopenharmony_ci      ['OS=="android"', { # GYP reverts OS to linux so use `-D OS=android`
501cb0ef41Sopenharmony_ci        'is_android': 1,
511cb0ef41Sopenharmony_ci      }, {
521cb0ef41Sopenharmony_ci        'is_android': 0,
531cb0ef41Sopenharmony_ci      }],
541cb0ef41Sopenharmony_ci      # flattened (!is_win && !is_fuchsia) because of GYP evaluation order
551cb0ef41Sopenharmony_ci      ['not (OS == "win" or OS == "winuwp") and not (OS == "fuchsia")', {
561cb0ef41Sopenharmony_ci        'is_posix': 1,
571cb0ef41Sopenharmony_ci      }, {
581cb0ef41Sopenharmony_ci        'is_posix': 0,
591cb0ef41Sopenharmony_ci      }],
601cb0ef41Sopenharmony_ci      ['component and "library" in component', {
611cb0ef41Sopenharmony_ci        'is_component_build': 1,
621cb0ef41Sopenharmony_ci      }, {
631cb0ef41Sopenharmony_ci        'is_component_build': 0,
641cb0ef41Sopenharmony_ci      }],
651cb0ef41Sopenharmony_ci      ['OS == "win" or OS == "mac"', {
661cb0ef41Sopenharmony_ci        # Sets -DSYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing
671cb0ef41Sopenharmony_ci        'v8_enable_system_instrumentation': 1,
681cb0ef41Sopenharmony_ci      }, {
691cb0ef41Sopenharmony_ci        'v8_enable_system_instrumentation': 0,
701cb0ef41Sopenharmony_ci      }],
711cb0ef41Sopenharmony_ci      ['OS=="linux"', {
721cb0ef41Sopenharmony_ci        # Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
731cb0ef41Sopenharmony_ci        #
741cb0ef41Sopenharmony_ci        # This flag speeds up the performance of fork/execve on Linux systems for
751cb0ef41Sopenharmony_ci        # embedders which use it (like Node.js). It works by marking the pages that
761cb0ef41Sopenharmony_ci        # V8 allocates as MADV_DONTFORK. Without MADV_DONTFORK, the Linux kernel
771cb0ef41Sopenharmony_ci        # spends a long time manipulating page mappings on fork and exec which the
781cb0ef41Sopenharmony_ci        # child process doesn't generally need to access.
791cb0ef41Sopenharmony_ci        #
801cb0ef41Sopenharmony_ci        # See v8:7381 for more details.
811cb0ef41Sopenharmony_ci        'v8_enable_private_mapping_fork_optimization': 1,
821cb0ef41Sopenharmony_ci      }, {
831cb0ef41Sopenharmony_ci        'v8_enable_private_mapping_fork_optimization': 0,
841cb0ef41Sopenharmony_ci      }],
851cb0ef41Sopenharmony_ci    ],
861cb0ef41Sopenharmony_ci    'is_debug%': 0,
871cb0ef41Sopenharmony_ci
881cb0ef41Sopenharmony_ci    # Variables from BUILD.gn
891cb0ef41Sopenharmony_ci
901cb0ef41Sopenharmony_ci    # Set to 1 to enable DCHECKs in release builds.
911cb0ef41Sopenharmony_ci    'dcheck_always_on%': 0,
921cb0ef41Sopenharmony_ci
931cb0ef41Sopenharmony_ci    # For v18.x, disable SLOW_DCHECKs because they don't compile without
941cb0ef41Sopenharmony_ci    # the patches in https://bugs.chromium.org/p/v8/issues/detail?id=12887
951cb0ef41Sopenharmony_ci    # if used in constexpr, which can happen in other floated patches.
961cb0ef41Sopenharmony_ci    'v8_enable_slow_dchecks%': 0,
971cb0ef41Sopenharmony_ci
981cb0ef41Sopenharmony_ci    # Sets -DV8_ENABLE_FUTURE.
991cb0ef41Sopenharmony_ci    'v8_enable_future%': 0,
1001cb0ef41Sopenharmony_ci
1011cb0ef41Sopenharmony_ci    # Sets -DVERIFY_HEAP.
1021cb0ef41Sopenharmony_ci    'v8_enable_verify_heap%': 0,
1031cb0ef41Sopenharmony_ci
1041cb0ef41Sopenharmony_ci    # Sets -DVERIFY_PREDICTABLE
1051cb0ef41Sopenharmony_ci    'v8_enable_verify_predictable%': 0,
1061cb0ef41Sopenharmony_ci
1071cb0ef41Sopenharmony_ci    # Enable compiler warnings when using V8_DEPRECATED apis.
1081cb0ef41Sopenharmony_ci    'v8_deprecation_warnings%': 0,
1091cb0ef41Sopenharmony_ci
1101cb0ef41Sopenharmony_ci    # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
1111cb0ef41Sopenharmony_ci    'v8_imminent_deprecation_warnings%': 0,
1121cb0ef41Sopenharmony_ci
1131cb0ef41Sopenharmony_ci    # Allows the embedder to add a custom suffix to the version string.
1141cb0ef41Sopenharmony_ci    'v8_embedder_string%': '',
1151cb0ef41Sopenharmony_ci
1161cb0ef41Sopenharmony_ci    # Sets -dENABLE_DISASSEMBLER.
1171cb0ef41Sopenharmony_ci    'v8_enable_disassembler%': 0,
1181cb0ef41Sopenharmony_ci
1191cb0ef41Sopenharmony_ci    # Sets the number of internal fields on promise objects.
1201cb0ef41Sopenharmony_ci    'v8_promise_internal_field_count%': 0,
1211cb0ef41Sopenharmony_ci
1221cb0ef41Sopenharmony_ci    # Sets -dENABLE_GDB_JIT_INTERFACE.
1231cb0ef41Sopenharmony_ci    'v8_enable_gdbjit%': 0,
1241cb0ef41Sopenharmony_ci
1251cb0ef41Sopenharmony_ci    # Sets -dENABLE_HUGEPAGE
1261cb0ef41Sopenharmony_ci    'v8_enable_hugepage%': 0,
1271cb0ef41Sopenharmony_ci
1281cb0ef41Sopenharmony_ci    # Sets -dENABLE_VTUNE_JIT_INTERFACE.
1291cb0ef41Sopenharmony_ci    'v8_enable_vtunejit%': 0,
1301cb0ef41Sopenharmony_ci
1311cb0ef41Sopenharmony_ci    # Currently set for node by common.gypi, avoiding default because of gyp file bug.
1321cb0ef41Sopenharmony_ci    # Should be turned on only for debugging.
1331cb0ef41Sopenharmony_ci    #'v8_enable_handle_zapping%': 0,
1341cb0ef41Sopenharmony_ci
1351cb0ef41Sopenharmony_ci    # Enable fast mksnapshot runs.
1361cb0ef41Sopenharmony_ci    'v8_enable_fast_mksnapshot%': 0,
1371cb0ef41Sopenharmony_ci
1381cb0ef41Sopenharmony_ci    # Enable the registration of unwinding info for Windows/x64 and ARM64.
1391cb0ef41Sopenharmony_ci    'v8_win64_unwinding_info%': 1,
1401cb0ef41Sopenharmony_ci
1411cb0ef41Sopenharmony_ci    # Enable code comments for builtins in the snapshot (impacts performance).
1421cb0ef41Sopenharmony_ci    'v8_enable_snapshot_code_comments%': 0,
1431cb0ef41Sopenharmony_ci
1441cb0ef41Sopenharmony_ci    # Enable native counters from the snapshot (impacts performance, sets
1451cb0ef41Sopenharmony_ci    # -dV8_SNAPSHOT_NATIVE_CODE_COUNTERS).
1461cb0ef41Sopenharmony_ci    # This option will generate extra code in the snapshot to increment counters,
1471cb0ef41Sopenharmony_ci    # as per the --native-code-counters flag.
1481cb0ef41Sopenharmony_ci    'v8_enable_snapshot_native_code_counters%': 0,
1491cb0ef41Sopenharmony_ci
1501cb0ef41Sopenharmony_ci    # Enable code-generation-time checking of types in the CodeStubAssembler.
1511cb0ef41Sopenharmony_ci    'v8_enable_verify_csa%': 0,
1521cb0ef41Sopenharmony_ci
1531cb0ef41Sopenharmony_ci    # Enable pointer compression (sets -dV8_COMPRESS_POINTERS).
1541cb0ef41Sopenharmony_ci    'v8_enable_pointer_compression%': 0,
1551cb0ef41Sopenharmony_ci    'v8_enable_31bit_smis_on_64bit_arch%': 0,
1561cb0ef41Sopenharmony_ci
1571cb0ef41Sopenharmony_ci    # Sets -dV8_SHORT_BUILTIN_CALLS
1581cb0ef41Sopenharmony_ci    'v8_enable_short_builtin_calls%': 0,
1591cb0ef41Sopenharmony_ci
1601cb0ef41Sopenharmony_ci    # Sets -dOBJECT_PRINT.
1611cb0ef41Sopenharmony_ci    'v8_enable_object_print%': 0,
1621cb0ef41Sopenharmony_ci
1631cb0ef41Sopenharmony_ci    # Sets -dV8_TRACE_MAPS.
1641cb0ef41Sopenharmony_ci    'v8_enable_trace_maps%': 0,
1651cb0ef41Sopenharmony_ci
1661cb0ef41Sopenharmony_ci    # Sets -dV8_ENABLE_CHECKS.
1671cb0ef41Sopenharmony_ci    'v8_enable_v8_checks%': 0,
1681cb0ef41Sopenharmony_ci
1691cb0ef41Sopenharmony_ci    # Sets -dV8_TRACE_IGNITION.
1701cb0ef41Sopenharmony_ci    'v8_enable_trace_ignition%': 0,
1711cb0ef41Sopenharmony_ci
1721cb0ef41Sopenharmony_ci    # Sets -dV8_TRACE_FEEDBACK_UPDATES.
1731cb0ef41Sopenharmony_ci    'v8_enable_trace_feedback_updates%': 0,
1741cb0ef41Sopenharmony_ci
1751cb0ef41Sopenharmony_ci    # Sets -dV8_ATOMIC_OBJECT_FIELD_WRITES and turns all field write operations
1761cb0ef41Sopenharmony_ci    # into relaxed atomic operations.
1771cb0ef41Sopenharmony_ci    'v8_enable_atomic_object_field_writes%': 1,
1781cb0ef41Sopenharmony_ci
1791cb0ef41Sopenharmony_ci    # Has no effect in Node.js. Here for completeness with V8's config.
1801cb0ef41Sopenharmony_ci    'v8_enable_concurrent_marking%': 1,
1811cb0ef41Sopenharmony_ci
1821cb0ef41Sopenharmony_ci    # Enables various testing features.
1831cb0ef41Sopenharmony_ci    'v8_enable_test_features%': 0,
1841cb0ef41Sopenharmony_ci
1851cb0ef41Sopenharmony_ci    # Enable the Maglev compiler.
1861cb0ef41Sopenharmony_ci    # Sets -dV8_ENABLE_MAGLEV
1871cb0ef41Sopenharmony_ci    'v8_enable_maglev%': 0,
1881cb0ef41Sopenharmony_ci
1891cb0ef41Sopenharmony_ci    # With post mortem support enabled, metadata is embedded into libv8 that
1901cb0ef41Sopenharmony_ci    # describes various parameters of the VM for use by debuggers. See
1911cb0ef41Sopenharmony_ci    # tools/gen-postmortem-metadata.py for details.
1921cb0ef41Sopenharmony_ci    'v8_postmortem_support%': 0,
1931cb0ef41Sopenharmony_ci
1941cb0ef41Sopenharmony_ci    # Use Siphash as added protection against hash flooding attacks.
1951cb0ef41Sopenharmony_ci    'v8_use_siphash%': 0,
1961cb0ef41Sopenharmony_ci
1971cb0ef41Sopenharmony_ci    # Use Perfetto (https://perfetto.dev) as the default TracingController. Not
1981cb0ef41Sopenharmony_ci    # currently implemented.
1991cb0ef41Sopenharmony_ci    'v8_use_perfetto%': 0,
2001cb0ef41Sopenharmony_ci
2011cb0ef41Sopenharmony_ci    # Controls the threshold for on-heap/off-heap Typed Arrays.
2021cb0ef41Sopenharmony_ci    'v8_typed_array_max_size_in_heap%': 64,
2031cb0ef41Sopenharmony_ci
2041cb0ef41Sopenharmony_ci    # Enable sharing read-only space across isolates.
2051cb0ef41Sopenharmony_ci    # Sets -DV8_SHARED_RO_HEAP.
2061cb0ef41Sopenharmony_ci    'v8_enable_shared_ro_heap%': 0,
2071cb0ef41Sopenharmony_ci
2081cb0ef41Sopenharmony_ci    # Enable lazy source positions by default.
2091cb0ef41Sopenharmony_ci    'v8_enable_lazy_source_positions%': 1,
2101cb0ef41Sopenharmony_ci
2111cb0ef41Sopenharmony_ci    # Enable third party HEAP library
2121cb0ef41Sopenharmony_ci    'v8_enable_third_party_heap%': 0,
2131cb0ef41Sopenharmony_ci
2141cb0ef41Sopenharmony_ci    # Libaries used by third party heap
2151cb0ef41Sopenharmony_ci    'v8_third_party_heap_libs%': [],
2161cb0ef41Sopenharmony_ci
2171cb0ef41Sopenharmony_ci    # Source code used by third party heap
2181cb0ef41Sopenharmony_ci    'v8_third_party_heap_files%': [],
2191cb0ef41Sopenharmony_ci
2201cb0ef41Sopenharmony_ci    # Disable write barriers when GCs are non-incremental and
2211cb0ef41Sopenharmony_ci    # heap has single generation.
2221cb0ef41Sopenharmony_ci    'v8_disable_write_barriers%': 0,
2231cb0ef41Sopenharmony_ci
2241cb0ef41Sopenharmony_ci    # Redirect allocation in young generation so that there will be
2251cb0ef41Sopenharmony_ci    # only one single generation.
2261cb0ef41Sopenharmony_ci    'v8_enable_single_generation%': 0,
2271cb0ef41Sopenharmony_ci
2281cb0ef41Sopenharmony_ci    # Use token threaded dispatch for the regular expression interpreter.
2291cb0ef41Sopenharmony_ci    # Use switch-based dispatch if this is false.
2301cb0ef41Sopenharmony_ci    'v8_enable_regexp_interpreter_threaded_dispatch%': 1,
2311cb0ef41Sopenharmony_ci
2321cb0ef41Sopenharmony_ci    # Disable all snapshot compression.
2331cb0ef41Sopenharmony_ci    'v8_enable_snapshot_compression%': 0,
2341cb0ef41Sopenharmony_ci
2351cb0ef41Sopenharmony_ci    # Enable control-flow integrity features, such as pointer authentication
2361cb0ef41Sopenharmony_ci    # for ARM64.
2371cb0ef41Sopenharmony_ci    'v8_control_flow_integrity%': 1,
2381cb0ef41Sopenharmony_ci
2391cb0ef41Sopenharmony_ci    # Enable V8 zone compression experimental feature.
2401cb0ef41Sopenharmony_ci    # Sets -DV8_COMPRESS_ZONES.
2411cb0ef41Sopenharmony_ci    'v8_enable_zone_compression%': 0,
2421cb0ef41Sopenharmony_ci
2431cb0ef41Sopenharmony_ci    # Enable the experimental V8 sandbox.
2441cb0ef41Sopenharmony_ci    # Sets -DV8_SANDBOX.
2451cb0ef41Sopenharmony_ci    'v8_enable_sandbox%': 0,
2461cb0ef41Sopenharmony_ci
2471cb0ef41Sopenharmony_ci    # Enable external pointer sandboxing. Requires v8_enable_sandbox.
2481cb0ef41Sopenharmony_ci    # Sets -DV8_SANDBOXED_EXTERNAL_POINRTERS.
2491cb0ef41Sopenharmony_ci    'v8_enable_sandboxed_external_pointers%': 0,
2501cb0ef41Sopenharmony_ci
2511cb0ef41Sopenharmony_ci    # Enable sandboxed pointers. Requires v8_enable_sandbox.
2521cb0ef41Sopenharmony_ci    # Sets -DV8_SANDBOXED_POINTERS.
2531cb0ef41Sopenharmony_ci    'v8_enable_sandboxed_pointers%': 0,
2541cb0ef41Sopenharmony_ci
2551cb0ef41Sopenharmony_ci    # Experimental feature for collecting per-class zone memory stats.
2561cb0ef41Sopenharmony_ci    # Requires use_rtti = true
2571cb0ef41Sopenharmony_ci    'v8_enable_precise_zone_stats%': 0,
2581cb0ef41Sopenharmony_ci
2591cb0ef41Sopenharmony_ci    # Experimental feature that uses SwissNameDictionary instead of NameDictionary
2601cb0ef41Sopenharmony_ci    # as the backing store for all dictionary mode objects.
2611cb0ef41Sopenharmony_ci    'v8_enable_swiss_name_dictionary%': 0,
2621cb0ef41Sopenharmony_ci
2631cb0ef41Sopenharmony_ci    # Experimental feature for tracking constness of properties in non-global
2641cb0ef41Sopenharmony_ci    # dictionaries. Enabling this also always keeps prototypes in dict mode,
2651cb0ef41Sopenharmony_ci    # meaning that they are not switched to fast mode.
2661cb0ef41Sopenharmony_ci    # Sets -DV8_DICT_PROPERTY_CONST_TRACKING
2671cb0ef41Sopenharmony_ci    'v8_dict_property_const_tracking%': 0,
2681cb0ef41Sopenharmony_ci
2691cb0ef41Sopenharmony_ci    # Allow for JS promise hooks (instead of just C++).
2701cb0ef41Sopenharmony_ci    'v8_enable_javascript_promise_hooks%': 0,
2711cb0ef41Sopenharmony_ci
2721cb0ef41Sopenharmony_ci    # Enable allocation folding globally (sets -dV8_ALLOCATION_FOLDING).
2731cb0ef41Sopenharmony_ci    # When it's disabled, the --turbo-allocation-folding runtime flag will be ignored.
2741cb0ef41Sopenharmony_ci    'v8_enable_allocation_folding%': 1,
2751cb0ef41Sopenharmony_ci
2761cb0ef41Sopenharmony_ci    # Enable runtime verification of heap snapshots produced for devtools.
2771cb0ef41Sopenharmony_ci    'v8_enable_heap_snapshot_verify%': 0,
2781cb0ef41Sopenharmony_ci
2791cb0ef41Sopenharmony_ci    # Enable global allocation site tracking.
2801cb0ef41Sopenharmony_ci    'v8_allocation_site_tracking%': 1,
2811cb0ef41Sopenharmony_ci
2821cb0ef41Sopenharmony_ci    'v8_scriptormodule_legacy_lifetime%': 1,
2831cb0ef41Sopenharmony_ci
2841cb0ef41Sopenharmony_ci    # Change code emission and runtime features to be CET shadow-stack compliant
2851cb0ef41Sopenharmony_ci    # (incomplete and experimental).
2861cb0ef41Sopenharmony_ci    'v8_enable_cet_shadow_stack%': 0,
2871cb0ef41Sopenharmony_ci
2881cb0ef41Sopenharmony_ci    # Variables from v8.gni
2891cb0ef41Sopenharmony_ci
2901cb0ef41Sopenharmony_ci    # Enable ECMAScript Internationalization API. Enabling this feature will
2911cb0ef41Sopenharmony_ci    # add a dependency on the ICU library.
2921cb0ef41Sopenharmony_ci    'v8_enable_i18n_support%': 1,
2931cb0ef41Sopenharmony_ci
2941cb0ef41Sopenharmony_ci    # Lite mode disables a number of performance optimizations to reduce memory
2951cb0ef41Sopenharmony_ci    # at the cost of performance.
2961cb0ef41Sopenharmony_ci    # Sets --DV8_LITE_MODE.
2971cb0ef41Sopenharmony_ci    'v8_enable_lite_mode%': 0,
2981cb0ef41Sopenharmony_ci
2991cb0ef41Sopenharmony_ci    # Include support for WebAssembly. If disabled, the 'WebAssembly' global
3001cb0ef41Sopenharmony_ci    # will not be available, and embedder APIs to generate WebAssembly modules
3011cb0ef41Sopenharmony_ci    # will fail.
3021cb0ef41Sopenharmony_ci    'v8_enable_webassembly%': 1,
3031cb0ef41Sopenharmony_ci
3041cb0ef41Sopenharmony_ci    # Enable advanced BigInt algorithms, costing about 10-30 KiB binary size
3051cb0ef41Sopenharmony_ci    # depending on platform.
3061cb0ef41Sopenharmony_ci    'v8_advanced_bigint_algorithms%': 1
3071cb0ef41Sopenharmony_ci  },
3081cb0ef41Sopenharmony_ci
3091cb0ef41Sopenharmony_ci  'target_defaults': {
3101cb0ef41Sopenharmony_ci    'conditions': [
3111cb0ef41Sopenharmony_ci      ['v8_embedder_string!=""', {
3121cb0ef41Sopenharmony_ci        'defines': ['V8_EMBEDDER_STRING="<(v8_embedder_string)"',],
3131cb0ef41Sopenharmony_ci      }],
3141cb0ef41Sopenharmony_ci      ['v8_enable_disassembler==1', {
3151cb0ef41Sopenharmony_ci        'defines': ['ENABLE_DISASSEMBLER',],
3161cb0ef41Sopenharmony_ci      }],
3171cb0ef41Sopenharmony_ci      ['v8_promise_internal_field_count!=0', {
3181cb0ef41Sopenharmony_ci        'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
3191cb0ef41Sopenharmony_ci      }],
3201cb0ef41Sopenharmony_ci      ['v8_enable_future==1', {
3211cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_FUTURE',],
3221cb0ef41Sopenharmony_ci      }],
3231cb0ef41Sopenharmony_ci      ['v8_enable_lite_mode==1', {
3241cb0ef41Sopenharmony_ci        'defines': ['V8_LITE_MODE',],
3251cb0ef41Sopenharmony_ci      }],
3261cb0ef41Sopenharmony_ci      ['v8_enable_gdbjit==1', {
3271cb0ef41Sopenharmony_ci        'defines': ['ENABLE_GDB_JIT_INTERFACE',],
3281cb0ef41Sopenharmony_ci      }],
3291cb0ef41Sopenharmony_ci      ['v8_enable_hugepage==1', {
3301cb0ef41Sopenharmony_ci        'defines': ['ENABLE_HUGEPAGE',],
3311cb0ef41Sopenharmony_ci      }],
3321cb0ef41Sopenharmony_ci      ['v8_enable_private_mapping_fork_optimization==1', {
3331cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION'],
3341cb0ef41Sopenharmony_ci      }],
3351cb0ef41Sopenharmony_ci      ['v8_enable_vtunejit==1', {
3361cb0ef41Sopenharmony_ci        'defines': ['ENABLE_VTUNE_JIT_INTERFACE',],
3371cb0ef41Sopenharmony_ci      }],
3381cb0ef41Sopenharmony_ci      ['v8_enable_pointer_compression==1', {
3391cb0ef41Sopenharmony_ci        'defines': [
3401cb0ef41Sopenharmony_ci          'V8_COMPRESS_POINTERS',
3411cb0ef41Sopenharmony_ci          'V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE',
3421cb0ef41Sopenharmony_ci        ],
3431cb0ef41Sopenharmony_ci      }],
3441cb0ef41Sopenharmony_ci      ['v8_enable_pointer_compression==1 or v8_enable_31bit_smis_on_64bit_arch==1', {
3451cb0ef41Sopenharmony_ci        'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH',],
3461cb0ef41Sopenharmony_ci      }],
3471cb0ef41Sopenharmony_ci      ['v8_enable_short_builtin_calls==1', {
3481cb0ef41Sopenharmony_ci        'defines': ['V8_SHORT_BUILTIN_CALLS',],
3491cb0ef41Sopenharmony_ci      }],
3501cb0ef41Sopenharmony_ci      ['v8_enable_zone_compression==1', {
3511cb0ef41Sopenharmony_ci        'defines': ['V8_COMPRESS_ZONES',],
3521cb0ef41Sopenharmony_ci      }],
3531cb0ef41Sopenharmony_ci      ['v8_enable_sandbox==1', {
3541cb0ef41Sopenharmony_ci        'defines': ['V8_SANDBOX',],
3551cb0ef41Sopenharmony_ci      }],
3561cb0ef41Sopenharmony_ci      ['v8_enable_sandboxed_pointers==1', {
3571cb0ef41Sopenharmony_ci        'defines': ['V8_SANDBOXED_POINTERS',],
3581cb0ef41Sopenharmony_ci      }],
3591cb0ef41Sopenharmony_ci      ['v8_enable_sandboxed_external_pointers==1', {
3601cb0ef41Sopenharmony_ci        'defines': ['V8_SANDBOXED_EXTERNAL_POINTERS',],
3611cb0ef41Sopenharmony_ci      }],
3621cb0ef41Sopenharmony_ci      ['v8_enable_object_print==1', {
3631cb0ef41Sopenharmony_ci        'defines': ['OBJECT_PRINT',],
3641cb0ef41Sopenharmony_ci      }],
3651cb0ef41Sopenharmony_ci      ['v8_enable_verify_heap==1', {
3661cb0ef41Sopenharmony_ci        'defines': ['VERIFY_HEAP',],
3671cb0ef41Sopenharmony_ci      }],
3681cb0ef41Sopenharmony_ci      ['v8_enable_verify_predictable==1', {
3691cb0ef41Sopenharmony_ci        'defines': ['VERIFY_PREDICTABLE',],
3701cb0ef41Sopenharmony_ci      }],
3711cb0ef41Sopenharmony_ci      ['v8_enable_trace_maps==1', {
3721cb0ef41Sopenharmony_ci        'defines': ['V8_TRACE_MAPS',],
3731cb0ef41Sopenharmony_ci      }],
3741cb0ef41Sopenharmony_ci      ['v8_enable_trace_ignition==1', {
3751cb0ef41Sopenharmony_ci        'defines': ['V8_TRACE_IGNITION',],
3761cb0ef41Sopenharmony_ci      }],
3771cb0ef41Sopenharmony_ci      ['v8_enable_trace_feedback_updates==1', {
3781cb0ef41Sopenharmony_ci        'defines': ['V8_TRACE_FEEDBACK_UPDATES',],
3791cb0ef41Sopenharmony_ci      }],
3801cb0ef41Sopenharmony_ci      ['v8_enable_test_features==1', {
3811cb0ef41Sopenharmony_ci        'defines': [
3821cb0ef41Sopenharmony_ci          'V8_ENABLE_ALLOCATION_TIMEOUT',
3831cb0ef41Sopenharmony_ci          'V8_ENABLE_FORCE_SLOW_PATH',
3841cb0ef41Sopenharmony_ci          'V8_ENABLE_DOUBLE_CONST_STORE_CHECK',
3851cb0ef41Sopenharmony_ci        ],
3861cb0ef41Sopenharmony_ci      }],
3871cb0ef41Sopenharmony_ci      ['v8_enable_v8_checks==1', {
3881cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_CHECKS',],
3891cb0ef41Sopenharmony_ci      }],
3901cb0ef41Sopenharmony_ci      ['v8_deprecation_warnings==1', {
3911cb0ef41Sopenharmony_ci        'defines': ['V8_DEPRECATION_WARNINGS',],
3921cb0ef41Sopenharmony_ci      },{
3931cb0ef41Sopenharmony_ci        'defines!': ['V8_DEPRECATION_WARNINGS',],
3941cb0ef41Sopenharmony_ci      }],
3951cb0ef41Sopenharmony_ci      ['v8_imminent_deprecation_warnings==1', {
3961cb0ef41Sopenharmony_ci        'defines': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
3971cb0ef41Sopenharmony_ci      },{
3981cb0ef41Sopenharmony_ci        'defines!': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
3991cb0ef41Sopenharmony_ci      }],
4001cb0ef41Sopenharmony_ci      ['v8_enable_i18n_support==1', {
4011cb0ef41Sopenharmony_ci        'defines': ['V8_INTL_SUPPORT',],
4021cb0ef41Sopenharmony_ci      }],
4031cb0ef41Sopenharmony_ci      # Refs: https://github.com/nodejs/node/pull/23801
4041cb0ef41Sopenharmony_ci      # ['v8_enable_handle_zapping==1', {
4051cb0ef41Sopenharmony_ci      #  'defines': ['ENABLE_HANDLE_ZAPPING',],
4061cb0ef41Sopenharmony_ci      # }],
4071cb0ef41Sopenharmony_ci      ['v8_enable_heap_snapshot_verify==1', {
4081cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_HEAP_SNAPSHOT_VERIFY',],
4091cb0ef41Sopenharmony_ci      }],
4101cb0ef41Sopenharmony_ci      ['v8_enable_snapshot_native_code_counters==1', {
4111cb0ef41Sopenharmony_ci        'defines': ['V8_SNAPSHOT_NATIVE_CODE_COUNTERS',],
4121cb0ef41Sopenharmony_ci      }],
4131cb0ef41Sopenharmony_ci      ['v8_enable_single_generation==1', {
4141cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_SINGLE_GENERATION',],
4151cb0ef41Sopenharmony_ci      }],
4161cb0ef41Sopenharmony_ci      ['v8_disable_write_barriers==1', {
4171cb0ef41Sopenharmony_ci        'defines': ['V8_DISABLE_WRITE_BARRIERS',],
4181cb0ef41Sopenharmony_ci      }],
4191cb0ef41Sopenharmony_ci      ['v8_enable_third_party_heap==1', {
4201cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_THIRD_PARTY_HEAP',],
4211cb0ef41Sopenharmony_ci      }],
4221cb0ef41Sopenharmony_ci      ['v8_enable_atomic_object_field_writes==1', {
4231cb0ef41Sopenharmony_ci        'defines': ['V8_ATOMIC_OBJECT_FIELD_WRITES',],
4241cb0ef41Sopenharmony_ci      }],
4251cb0ef41Sopenharmony_ci      ['v8_enable_lazy_source_positions==1', {
4261cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_LAZY_SOURCE_POSITIONS',],
4271cb0ef41Sopenharmony_ci      }],
4281cb0ef41Sopenharmony_ci      ['v8_use_siphash==1', {
4291cb0ef41Sopenharmony_ci        'defines': ['V8_USE_SIPHASH',],
4301cb0ef41Sopenharmony_ci      }],
4311cb0ef41Sopenharmony_ci      ['v8_enable_shared_ro_heap==1', {
4321cb0ef41Sopenharmony_ci        'defines': ['V8_SHARED_RO_HEAP',],
4331cb0ef41Sopenharmony_ci      }],
4341cb0ef41Sopenharmony_ci      ['dcheck_always_on!=0', {
4351cb0ef41Sopenharmony_ci        'defines': ['DEBUG',],
4361cb0ef41Sopenharmony_ci      }],
4371cb0ef41Sopenharmony_ci      ['v8_enable_verify_csa==1', {
4381cb0ef41Sopenharmony_ci        'defines': ['ENABLE_VERIFY_CSA',],
4391cb0ef41Sopenharmony_ci      }],
4401cb0ef41Sopenharmony_ci      ['v8_use_perfetto==1', {
4411cb0ef41Sopenharmony_ci        'defines': ['V8_USE_PERFETTO',],
4421cb0ef41Sopenharmony_ci      }],
4431cb0ef41Sopenharmony_ci      ['v8_win64_unwinding_info==1', {
4441cb0ef41Sopenharmony_ci        'defines': ['V8_WIN64_UNWINDING_INFO',],
4451cb0ef41Sopenharmony_ci      }],
4461cb0ef41Sopenharmony_ci      ['v8_enable_regexp_interpreter_threaded_dispatch==1', {
4471cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH',],
4481cb0ef41Sopenharmony_ci      }],
4491cb0ef41Sopenharmony_ci      ['v8_enable_snapshot_compression==1', {
4501cb0ef41Sopenharmony_ci        'defines': ['V8_SNAPSHOT_COMPRESSION',],
4511cb0ef41Sopenharmony_ci      }],
4521cb0ef41Sopenharmony_ci      ['v8_control_flow_integrity==1', {
4531cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_CONTROL_FLOW_INTEGRITY',],
4541cb0ef41Sopenharmony_ci      }],
4551cb0ef41Sopenharmony_ci      ['v8_enable_cet_shadow_stack==1', {
4561cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_CET_SHADOW_STACK',],
4571cb0ef41Sopenharmony_ci      }],
4581cb0ef41Sopenharmony_ci      ['v8_enable_precise_zone_stats==1', {
4591cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_PRECISE_ZONE_STATS',],
4601cb0ef41Sopenharmony_ci      }],
4611cb0ef41Sopenharmony_ci      ['v8_enable_maglev==1', {
4621cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_MAGLEV',],
4631cb0ef41Sopenharmony_ci      }],
4641cb0ef41Sopenharmony_ci      ['v8_enable_swiss_name_dictionary==1', {
4651cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_SWISS_NAME_DICTIONARY',],
4661cb0ef41Sopenharmony_ci      }],
4671cb0ef41Sopenharmony_ci      ['v8_enable_system_instrumentation==1', {
4681cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_SYSTEM_INSTRUMENTATION',],
4691cb0ef41Sopenharmony_ci      }],
4701cb0ef41Sopenharmony_ci      ['v8_enable_webassembly==1', {
4711cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_WEBASSEMBLY',],
4721cb0ef41Sopenharmony_ci      }],
4731cb0ef41Sopenharmony_ci      ['v8_dict_property_const_tracking==1', {
4741cb0ef41Sopenharmony_ci        'defines': ['V8_DICT_PROPERTY_CONST_TRACKING',],
4751cb0ef41Sopenharmony_ci      }],
4761cb0ef41Sopenharmony_ci      ['v8_enable_javascript_promise_hooks==1', {
4771cb0ef41Sopenharmony_ci        'defines': ['V8_ENABLE_JAVASCRIPT_PROMISE_HOOKS',],
4781cb0ef41Sopenharmony_ci      }],
4791cb0ef41Sopenharmony_ci      ['v8_enable_allocation_folding==1', {
4801cb0ef41Sopenharmony_ci        'defines': ['V8_ALLOCATION_FOLDING',],
4811cb0ef41Sopenharmony_ci      }],
4821cb0ef41Sopenharmony_ci      ['v8_allocation_site_tracking==1', {
4831cb0ef41Sopenharmony_ci        'defines': ['V8_ALLOCATION_SITE_TRACKING',],
4841cb0ef41Sopenharmony_ci      }],
4851cb0ef41Sopenharmony_ci      ['v8_scriptormodule_legacy_lifetime==1', {
4861cb0ef41Sopenharmony_ci        'defines': ['V8_SCRIPTORMODULE_LEGACY_LIFETIME',],
4871cb0ef41Sopenharmony_ci      }],
4881cb0ef41Sopenharmony_ci      ['v8_advanced_bigint_algorithms==1', {
4891cb0ef41Sopenharmony_ci        'defines': ['V8_ADVANCED_BIGINT_ALGORITHMS',],
4901cb0ef41Sopenharmony_ci      }],
4911cb0ef41Sopenharmony_ci    ],  # conditions
4921cb0ef41Sopenharmony_ci    'defines': [
4931cb0ef41Sopenharmony_ci      'V8_GYP_BUILD',
4941cb0ef41Sopenharmony_ci      'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',
4951cb0ef41Sopenharmony_ci    ],  # defines
4961cb0ef41Sopenharmony_ci  },  # target_defaults
4971cb0ef41Sopenharmony_ci}
498