# Copyright 2012 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'V8_ROOT': '../../deps/v8', 'v8_code': 1, 'v8_random_seed%': 314159265, 'v8_vector_stores%': 0, 'v8_embed_script%': "", 'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)', 'v8_os_page_size%': 0, 'generate_bytecode_output_root': '<(SHARED_INTERMEDIATE_DIR)/generate-bytecode-output-root', 'generate_bytecode_builtins_list_output': '<(generate_bytecode_output_root)/builtins-generated/bytecodes-builtins-list.h', 'torque_files': [ "<(V8_ROOT)/src/builtins/array-copywithin.tq", "<(V8_ROOT)/src/builtins/array-every.tq", "<(V8_ROOT)/src/builtins/array-filter.tq", "<(V8_ROOT)/src/builtins/array-find.tq", "<(V8_ROOT)/src/builtins/array-findindex.tq", "<(V8_ROOT)/src/builtins/array-foreach.tq", "<(V8_ROOT)/src/builtins/array-from.tq", "<(V8_ROOT)/src/builtins/array-isarray.tq", "<(V8_ROOT)/src/builtins/array-join.tq", "<(V8_ROOT)/src/builtins/array-lastindexof.tq", "<(V8_ROOT)/src/builtins/array-map.tq", "<(V8_ROOT)/src/builtins/array-of.tq", "<(V8_ROOT)/src/builtins/array-reduce-right.tq", "<(V8_ROOT)/src/builtins/array-reduce.tq", "<(V8_ROOT)/src/builtins/array-reverse.tq", "<(V8_ROOT)/src/builtins/array-shift.tq", "<(V8_ROOT)/src/builtins/array-slice.tq", "<(V8_ROOT)/src/builtins/array-some.tq", "<(V8_ROOT)/src/builtins/array-splice.tq", "<(V8_ROOT)/src/builtins/array-unshift.tq", "<(V8_ROOT)/src/builtins/array.tq", "<(V8_ROOT)/src/builtins/base.tq", "<(V8_ROOT)/src/builtins/bigint.tq", "<(V8_ROOT)/src/builtins/boolean.tq", "<(V8_ROOT)/src/builtins/builtins-string.tq", "<(V8_ROOT)/src/builtins/collections.tq", "<(V8_ROOT)/src/builtins/cast.tq", "<(V8_ROOT)/src/builtins/convert.tq", "<(V8_ROOT)/src/builtins/console.tq", "<(V8_ROOT)/src/builtins/data-view.tq", "<(V8_ROOT)/src/builtins/frames.tq", "<(V8_ROOT)/src/builtins/frame-arguments.tq", "<(V8_ROOT)/src/builtins/growable-fixed-array.tq", "<(V8_ROOT)/src/builtins/internal-coverage.tq", "<(V8_ROOT)/src/builtins/iterator.tq", "<(V8_ROOT)/src/builtins/math.tq", "<(V8_ROOT)/src/builtins/number.tq", "<(V8_ROOT)/src/builtins/object-fromentries.tq", "<(V8_ROOT)/src/builtins/object.tq", "<(V8_ROOT)/src/builtins/promise-abstract-operations.tq", "<(V8_ROOT)/src/builtins/promise-all.tq", "<(V8_ROOT)/src/builtins/promise-all-element-closure.tq", "<(V8_ROOT)/src/builtins/promise-constructor.tq", "<(V8_ROOT)/src/builtins/promise-finally.tq", "<(V8_ROOT)/src/builtins/promise-misc.tq", "<(V8_ROOT)/src/builtins/promise-race.tq", "<(V8_ROOT)/src/builtins/promise-reaction-job.tq", "<(V8_ROOT)/src/builtins/promise-resolve.tq", "<(V8_ROOT)/src/builtins/promise-then.tq", "<(V8_ROOT)/src/builtins/promise-jobs.tq", "<(V8_ROOT)/src/builtins/proxy-constructor.tq", "<(V8_ROOT)/src/builtins/proxy-delete-property.tq", "<(V8_ROOT)/src/builtins/proxy-get-property.tq", "<(V8_ROOT)/src/builtins/proxy-get-prototype-of.tq", "<(V8_ROOT)/src/builtins/proxy-has-property.tq", "<(V8_ROOT)/src/builtins/proxy-is-extensible.tq", "<(V8_ROOT)/src/builtins/proxy-prevent-extensions.tq", "<(V8_ROOT)/src/builtins/proxy-revocable.tq", "<(V8_ROOT)/src/builtins/proxy-revoke.tq", "<(V8_ROOT)/src/builtins/proxy-set-property.tq", "<(V8_ROOT)/src/builtins/proxy-set-prototype-of.tq", "<(V8_ROOT)/src/builtins/proxy.tq", "<(V8_ROOT)/src/builtins/reflect.tq", "<(V8_ROOT)/src/builtins/regexp-exec.tq", "<(V8_ROOT)/src/builtins/regexp-match-all.tq", "<(V8_ROOT)/src/builtins/regexp-match.tq", "<(V8_ROOT)/src/builtins/regexp-replace.tq", "<(V8_ROOT)/src/builtins/regexp-search.tq", "<(V8_ROOT)/src/builtins/regexp-source.tq", "<(V8_ROOT)/src/builtins/regexp-split.tq", "<(V8_ROOT)/src/builtins/regexp-test.tq", "<(V8_ROOT)/src/builtins/regexp.tq", "<(V8_ROOT)/src/builtins/string-endswith.tq", "<(V8_ROOT)/src/builtins/string-html.tq", "<(V8_ROOT)/src/builtins/string-iterator.tq", "<(V8_ROOT)/src/builtins/string-pad.tq", "<(V8_ROOT)/src/builtins/string-repeat.tq", "<(V8_ROOT)/src/builtins/string-replaceall.tq", "<(V8_ROOT)/src/builtins/string-slice.tq", "<(V8_ROOT)/src/builtins/string-startswith.tq", "<(V8_ROOT)/src/builtins/string-substring.tq", "<(V8_ROOT)/src/builtins/string-substr.tq", "<(V8_ROOT)/src/builtins/symbol.tq", "<(V8_ROOT)/src/builtins/torque-internal.tq", "<(V8_ROOT)/src/builtins/typed-array-createtypedarray.tq", "<(V8_ROOT)/src/builtins/typed-array-every.tq", "<(V8_ROOT)/src/builtins/typed-array-filter.tq", "<(V8_ROOT)/src/builtins/typed-array-find.tq", "<(V8_ROOT)/src/builtins/typed-array-findindex.tq", "<(V8_ROOT)/src/builtins/typed-array-foreach.tq", "<(V8_ROOT)/src/builtins/typed-array-from.tq", "<(V8_ROOT)/src/builtins/typed-array-of.tq", "<(V8_ROOT)/src/builtins/typed-array-reduce.tq", "<(V8_ROOT)/src/builtins/typed-array-reduceright.tq", "<(V8_ROOT)/src/builtins/typed-array-set.tq", "<(V8_ROOT)/src/builtins/typed-array-slice.tq", "<(V8_ROOT)/src/builtins/typed-array-some.tq", "<(V8_ROOT)/src/builtins/typed-array-sort.tq", "<(V8_ROOT)/src/builtins/typed-array-subarray.tq", "<(V8_ROOT)/src/builtins/typed-array.tq", "<(V8_ROOT)/src/ic/handler-configuration.tq", "<(V8_ROOT)/src/objects/allocation-site.tq", "<(V8_ROOT)/src/objects/api-callbacks.tq", "<(V8_ROOT)/src/objects/arguments.tq", "<(V8_ROOT)/src/objects/cell.tq", "<(V8_ROOT)/src/objects/code.tq", "<(V8_ROOT)/src/objects/contexts.tq", "<(V8_ROOT)/src/objects/data-handler.tq", "<(V8_ROOT)/src/objects/debug-objects.tq", "<(V8_ROOT)/src/objects/descriptor-array.tq", "<(V8_ROOT)/src/objects/embedder-data-array.tq", "<(V8_ROOT)/src/objects/feedback-cell.tq", "<(V8_ROOT)/src/objects/feedback-vector.tq", "<(V8_ROOT)/src/objects/fixed-array.tq", "<(V8_ROOT)/src/objects/foreign.tq", "<(V8_ROOT)/src/objects/free-space.tq", "<(V8_ROOT)/src/objects/heap-number.tq", "<(V8_ROOT)/src/objects/heap-object.tq", "<(V8_ROOT)/src/objects/js-array-buffer.tq", "<(V8_ROOT)/src/objects/js-array.tq", "<(V8_ROOT)/src/objects/js-collection-iterator.tq", "<(V8_ROOT)/src/objects/js-collection.tq", "<(V8_ROOT)/src/objects/js-generator.tq", "<(V8_ROOT)/src/objects/js-objects.tq", "<(V8_ROOT)/src/objects/js-promise.tq", "<(V8_ROOT)/src/objects/js-proxy.tq", "<(V8_ROOT)/src/objects/js-regexp-string-iterator.tq", "<(V8_ROOT)/src/objects/js-regexp.tq", "<(V8_ROOT)/src/objects/js-weak-refs.tq", "<(V8_ROOT)/src/objects/literal-objects.tq", "<(V8_ROOT)/src/objects/map.tq", "<(V8_ROOT)/src/objects/microtask.tq", "<(V8_ROOT)/src/objects/module.tq", "<(V8_ROOT)/src/objects/name.tq", "<(V8_ROOT)/src/objects/oddball.tq", "<(V8_ROOT)/src/objects/ordered-hash-table.tq", "<(V8_ROOT)/src/objects/primitive-heap-object.tq", "<(V8_ROOT)/src/objects/promise.tq", "<(V8_ROOT)/src/objects/property-array.tq", "<(V8_ROOT)/src/objects/property-cell.tq", "<(V8_ROOT)/src/objects/property-descriptor-object.tq", "<(V8_ROOT)/src/objects/prototype-info.tq", "<(V8_ROOT)/src/objects/regexp-match-info.tq", "<(V8_ROOT)/src/objects/scope-info.tq", "<(V8_ROOT)/src/objects/script.tq", "<(V8_ROOT)/src/objects/shared-function-info.tq", "<(V8_ROOT)/src/objects/source-text-module.tq", "<(V8_ROOT)/src/objects/stack-frame-info.tq", "<(V8_ROOT)/src/objects/string.tq", "<(V8_ROOT)/src/objects/struct.tq", "<(V8_ROOT)/src/objects/synthetic-module.tq", "<(V8_ROOT)/src/objects/template-objects.tq", "<(V8_ROOT)/src/objects/template.tq", "<(V8_ROOT)/src/wasm/wasm-objects.tq", "<(V8_ROOT)/test/torque/test-torque.tq", "<(V8_ROOT)/third_party/v8/builtins/array-sort.tq", ], 'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root', 'torque_files_replaced': ['@(_outputs)', 'variables': { 'mksnapshot_flags': [ '--turbo_instruction_scheduling', # In cross builds, the snapshot may be generated for both the host and # target toolchains. The same host binary is used to generate both, so # mksnapshot needs to know which target OS to use at runtime. It's weird, # but the target OS is really <(OS). '--target_os=<(OS)', '--target_arch=<(v8_target_arch)', '--startup_src', '<(INTERMEDIATE_DIR)/snapshot.cc', '--embedded_variant', 'Default', '--embedded_src', '<(INTERMEDIATE_DIR)/embedded.S', ], }, 'inputs': [ '<(mksnapshot_exec)', ], 'outputs': [ '<(INTERMEDIATE_DIR)/snapshot.cc', '<(INTERMEDIATE_DIR)/embedded.S', ], 'process_outputs_as_sources': 1, 'conditions': [ ['v8_random_seed', { 'variables': { 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], }, }], ['v8_os_page_size', { 'variables': { 'mksnapshot_flags': ['--v8_os_page_size', '<(v8_os_page_size)'], }, }], ['v8_embed_script != ""', { 'inputs': ['<(v8_embed_script)'], 'variables': { 'mksnapshot_flags': ['<(v8_embed_script)'], }, }], ['v8_enable_snapshot_code_comments', { 'variables': { 'mksnapshot_flags': ['--code-comments'], }, }], ['v8_enable_snapshot_native_code_counters', { 'variables': { 'mksnapshot_flags': ['--native-code-counters'], }, }, { # --native-code-counters is the default in debug mode so make sure we can # unset it. 'variables': { 'mksnapshot_flags': ['--no-native-code-counters'], }, }], ], 'action': [ '>@(_inputs)', '>@(mksnapshot_flags)', ], }, ], }, # v8_snapshot { 'target_name': 'v8_version', 'type': 'none', 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], ], 'direct_dependent_settings': { 'sources': [ '<(V8_ROOT)/include/v8-value-serializer-version.h', '<(V8_ROOT)/include/v8-version-string.h', '<(V8_ROOT)/include/v8-version.h', ], }, }, # v8_version { 'target_name': 'v8_headers', 'type': 'none', 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], ], 'dependencies': [ 'v8_version', ], 'direct_dependent_settings': { 'sources': [ '<(V8_ROOT)/include/v8-internal.h', '<(V8_ROOT)/include/v8.h', '<(V8_ROOT)/include/v8config.h', # The following headers cannot be platform-specific. The include validation # of `gn gen $dir --check` requires all header files to be available on all # platforms. '<(V8_ROOT)/include/v8-wasm-trap-handler-posix.h', '<(V8_ROOT)/include/v8-wasm-trap-handler-win.h', ], }, }, # v8_headers { 'target_name': 'v8_shared_internal_headers', 'type': 'none', 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], ], 'dependencies': [ 'v8_headers', ], 'direct_dependent_settings': { 'sources': [ '<(V8_ROOT)/src/common/globals.h', ], }, }, # v8_shared_internal_headers { 'target_name': 'v8_compiler_opt', 'type': 'static_library', 'dependencies': [ 'generate_bytecode_builtins_list', 'run_torque', 'v8_maybe_icu', ], 'sources': ['<@(v8_compiler_sources)'], 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], ['OS=="win"', { 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ '<(_msvs_precompiled_header)', '<(_msvs_precompiled_source)', ], }], ], }, # v8_compiler_opt { 'target_name': 'v8_compiler', 'type': 'static_library', 'dependencies': [ 'generate_bytecode_builtins_list', 'run_torque', 'v8_maybe_icu', ], 'sources': ['<@(v8_compiler_sources)'], 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], ['OS=="win"', { 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 'sources': [ '<(_msvs_precompiled_header)', '<(_msvs_precompiled_source)', ], }], ], }, # v8_compiler { 'target_name': 'v8_compiler_for_mksnapshot', 'type': 'none', 'hard_dependency': 1, 'dependencies': [ 'generate_bytecode_builtins_list', 'run_torque', 'v8_maybe_icu', ], 'conditions': [ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], ['is_component_build and not v8_optimized_debug and v8_enable_fast_mksnapshot', { 'dependencies': [ 'v8_compiler_opt', ], 'export_dependent_settings': [ 'v8_compiler_opt', ], }, { 'dependencies': [ 'v8_compiler', ], 'export_dependent_settings': [ 'v8_compiler', ], }], ], }, # v8_compiler_for_mksnapshot { 'target_name': 'v8_base_without_compiler', 'type': 'static_library', 'dependencies': [ # Code generators that only need to be build for the host. 'torque_generated_definitions', 'v8_headers', 'v8_libbase', 'v8_libsampler', 'v8_shared_internal_headers', 'v8_version', # BUILD.gn public_deps 'generate_bytecode_builtins_list', 'run_torque', 'v8_maybe_icu', 'v8_zlib', ], 'includes': ['inspector.gypi'], 'direct_dependent_settings': { 'include_dirs': [ '<(generate_bytecode_output_root)', '<(torque_output_root)', ], }, 'sources': [ # "//base/trace_event/common/trace_event_common.h", ### gcmole(all) ### '<(generate_bytecode_builtins_list_output)', '