Fix RiscV support - Rendering issue for armv7l
[platform/framework/web/chromium-efl.git] / v8 / BUILD.gn
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/android/config.gni")
6 import("//build/config/arm.gni")
7 import("//build/config/coverage/coverage.gni")
8 import("//build/config/dcheck_always_on.gni")
9 import("//build/config/host_byteorder.gni")
10 import("//build/config/mips.gni")
11 import("//build/config/riscv.gni")
12 import("//build/config/sanitizers/sanitizers.gni")
13 import("//build_overrides/build.gni")
14 import("//tizen_src/build/config/tizen_features.gni")
15
16 import("gni/snapshot_toolchain.gni")
17 import("gni/v8.gni")
18
19 # Specifies if the target build is a simulator build. Comparing target cpu
20 # with v8 target cpu to not affect simulator builds for making cross-compile
21 # snapshots.
22 target_is_simulator = (target_cpu != v8_target_cpu && !v8_multi_arch_build) ||
23                       (current_cpu != v8_current_cpu && v8_multi_arch_build)
24
25 # For faster Windows builds. See https://crbug.com/v8/8475.
26 emit_builtins_as_inline_asm = is_win && is_clang
27
28 declare_args() {
29   # Print to stdout on Android.
30   v8_android_log_stdout = false
31
32   # Dynamically set an additional dependency from v8/custom_deps.
33   v8_custom_deps = ""
34
35   # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode
36   # within a release Chrome.
37   v8_enable_debugging_features = is_debug
38
39   # Sets -DV8_ENABLE_FUTURE.
40   v8_enable_future = false
41
42   # Sets -DENABLE_SYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing
43   v8_enable_system_instrumentation = (is_win || is_mac) && !v8_use_perfetto
44
45   # Sets -DV8_ENABLE_ETW_STACK_WALKING. Enables ETW Stack Walking
46   v8_enable_etw_stack_walking = is_win
47
48   # Sets the GUID for the ETW provider
49   v8_etw_guid = ""
50
51   # Sets -DVERIFY_HEAP.
52   v8_enable_verify_heap = ""
53
54   # Sets -DVERIFY_PREDICTABLE
55   v8_enable_verify_predictable = false
56
57   # Enable compiler warnings when using V8_DEPRECATED apis.
58   v8_deprecation_warnings = true
59
60   # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
61   v8_imminent_deprecation_warnings = true
62
63   # Embeds the given script into the snapshot.
64   v8_embed_script = ""
65
66   # Allows the embedder to add a custom suffix to the version string.
67   v8_embedder_string = ""
68
69   # Sets -dENABLE_DISASSEMBLER.
70   v8_enable_disassembler = ""
71
72   # Sets the number of internal fields on promise objects.
73   v8_promise_internal_field_count = 0
74
75   # Sets -dENABLE_GDB_JIT_INTERFACE.
76   v8_enable_gdbjit = ""
77
78   # Sets -dENABLE_VTUNE_JIT_INTERFACE.
79   v8_enable_vtunejit = false
80
81   # Sets -dENABLE_VTUNE_TRACEMARK.
82   v8_enable_vtunetracemark = false
83
84   # Sets -dENABLE_HUGEPAGE
85   v8_enable_hugepage = false
86
87   # Sets -dV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION.
88   #
89   # This flag speeds up the performance of fork/execve on Linux systems for
90   # embedders which use it (like Node.js). It works by marking the pages that
91   # V8 allocates as MADV_DONTFORK. Without MADV_DONTFORK, the Linux kernel
92   # spends a long time manipulating page mappings on fork and exec which the
93   # child process doesn't generally need to access.
94   #
95   # See v8:7381 for more details.
96   v8_enable_private_mapping_fork_optimization = false
97
98   # Sets -dENABLE_HANDLE_ZAPPING.
99   v8_enable_handle_zapping = is_asan || is_debug
100
101   # Enable slow dchecks.
102   v8_enable_slow_dchecks = false
103
104   # Enable fast mksnapshot runs.
105   v8_enable_fast_mksnapshot = false
106
107   # Optimize code for Torque executable, even during a debug build.
108   v8_enable_fast_torque = ""
109
110   # Enable the registration of unwinding info for Windows x64 and ARM64.
111   v8_win64_unwinding_info = true
112
113   # Enable code comments for builtins in the snapshot (impacts performance).
114   # This also enables v8_code_comments.
115   v8_enable_snapshot_code_comments = false
116
117   # Allow runtime-enabled code comments (with --code-comments). Enabled by
118   # default in debug builds.
119   # Sets -dV8_CODE_COMMENTS
120   v8_code_comments = ""
121
122   # Allow runtime-enabled debug code (with --debug-code). Enabled by default in
123   # debug builds.
124   # Sets -dV8_ENABLE_DEBUG_CODE
125   v8_enable_debug_code = ""
126
127   # Enable native counters from the snapshot (impacts performance, sets
128   # -dV8_SNAPSHOT_NATIVE_CODE_COUNTERS).
129   # This option will generate extra code in the snapshot to increment counters,
130   # as per the --native-code-counters flag.
131   v8_enable_snapshot_native_code_counters = ""
132
133   # Use pre-generated static root pointer values from static-roots.h.
134   v8_enable_static_roots = ""
135
136   # Mode used by gen-static-roots.py to have a heap layout which is identical
137   # to when v8_enable_static_roots is enabled.
138   v8_enable_static_roots_generation = false
139
140   # Enable code-generation-time checking of types in the CodeStubAssembler.
141   v8_enable_verify_csa = false
142
143   # Enable pointer compression (sets -dV8_COMPRESS_POINTERS).
144   v8_enable_pointer_compression = ""
145   v8_enable_pointer_compression_shared_cage = ""
146   v8_enable_31bit_smis_on_64bit_arch = false
147
148   # Sets -dOBJECT_PRINT.
149   v8_enable_object_print = ""
150
151   # Sets -dV8_TRACE_MAPS.
152   v8_enable_trace_maps = ""
153
154   # Sets -dV8_ENABLE_CHECKS.
155   v8_enable_v8_checks = ""
156
157   # Sets -dV8_TRACE_UNOPTIMIZED.
158   v8_enable_trace_unoptimized = ""
159   v8_enable_trace_ignition = false
160   v8_enable_trace_baseline_exec = false
161
162   # Sets -dV8_TRACE_FEEDBACK_UPDATES.
163   v8_enable_trace_feedback_updates = false
164
165   # Sets -dV8_ATOMIC_OBJECT_FIELD_WRITES and turns all field write operations
166   # into relaxed atomic operations.
167   v8_enable_atomic_object_field_writes = ""
168
169   # Controls the default value of v8_enable_concurrent_marking_state. See the
170   # default setting code below.
171   v8_enable_concurrent_marking = true
172
173   # Sets -dV8_IGNITION_DISPATCH_COUNTING.
174   # Enables counting frequencies of bytecode dispatches. After building in this
175   # configuration, subsequent runs of d8 can output frequencies for each pair
176   # of (current, next) bytecode instructions executed if you specify
177   # --trace-ignition-dispatches-output-file, or can generate a JS object with
178   # those frequencies if you run with --expose-ignition-statistics and call the
179   # extension function getIgnitionDispatchCounters().
180   v8_enable_ignition_dispatch_counting = false
181
182   # Runs mksnapshot with --turbo-profiling. After building in this
183   # configuration, any subsequent run of d8 will output information about usage
184   # of basic blocks in builtins.
185   v8_enable_builtins_profiling = false
186
187   # Runs mksnapshot with --turbo-profiling-verbose. After building in this
188   # configuration, any subsequent run of d8 will output information about usage
189   # of basic blocks in builtins, including the schedule and disassembly of all
190   # used builtins.
191   v8_enable_builtins_profiling_verbose = false
192
193   # This build flag is used to input a builtin pgo file containing raw
194   # execution counts (as opposed to branch hints), which are embedded into
195   # the `--trace-turbo` .json file from `mksnapshot`.
196   v8_log_builtins_block_count_input = ""
197
198   # This build flag is used to control whether reorder builtins acoording to
199   # the call graph with C3 algorithm based builtin PGO profiling.
200   v8_enable_builtins_reordering = false
201
202   # Provides the given V8 log file as an input to mksnapshot, where it can be
203   # used for profile-guided optimization of builtins.
204   #
205   # To do profile-guided optimizations of builtins:
206   # 1. Build with v8_enable_builtins_profiling = true
207   # 2. Run your chosen workload with the --turbo-profiling-output flag.
208   #    For Chrome, the invocation might look like this:
209   #      chrome --no-sandbox --disable-extensions
210   #        --js-flags="--turbo-profiling-output=v8.builtins.pgo"
211   #        "http://localhost/test-suite"
212   # 3. Run tools/builtins-pgo/get_hints.py to produce the branch hints,
213   #    selecting min_count and threshold_ratio as you wish.
214   # 4. Optionally repeat steps 2-3 for additional workloads, and use
215   #    tools/builtins-pgo/combine_hints.py to combine the hints produced in
216   #    step 3 into a single file.
217   # 5. Build again with v8_builtins_profiling_log_file set to the file created
218   #    in step 3 or 4.
219   v8_builtins_profiling_log_file = "default"
220
221   # Enables various testing features.
222   v8_enable_test_features = ""
223
224   # Enable short builtins call instruction sequences by un-embedding builtins.
225   # Sets -dV8_SHORT_BUILTIN_CALLS
226   v8_enable_short_builtin_calls = ""
227
228   # Enable support for external code range relative to the pointer compression
229   # cage.
230   # Sets -dV8_EXTERNAL_CODE_SPACE
231   v8_enable_external_code_space = ""
232
233   # With post mortem support enabled, metadata is embedded into libv8 that
234   # describes various parameters of the VM for use by debuggers. See
235   # tools/gen-postmortem-metadata.py for details.
236   v8_postmortem_support = false
237
238   # Use Siphash as added protection against hash flooding attacks.
239   v8_use_siphash = false
240
241   # Switches off inlining in V8.
242   v8_no_inline = false
243
244   # Override OS page size when generating snapshot
245   v8_os_page_size = "0"
246
247   # Similar to vfp but on MIPS.
248   v8_can_use_fpu_instructions = true
249
250   # Similar to the ARM hard float ABI but on MIPS.
251   v8_use_mips_abi_hardfloat = true
252
253   # Controls the threshold for on-heap/off-heap Typed Arrays.
254   v8_typed_array_max_size_in_heap = 64
255
256   v8_enable_gdbjit = ((v8_current_cpu == "x86" || v8_current_cpu == "x64") &&
257                       (is_linux || is_chromeos || is_mac)) ||
258                      (v8_current_cpu == "ppc64" && (is_linux || is_chromeos))
259
260   # Check that each header can be included in isolation (requires also
261   # setting the "check_v8_header_includes" gclient variable to run a
262   # specific hook).
263   v8_check_header_includes = false
264
265   # Enable sharing read-only space across isolates.
266   # Sets -DV8_SHARED_RO_HEAP.
267   v8_enable_shared_ro_heap = ""
268
269   # Enable lazy source positions by default.
270   v8_enable_lazy_source_positions = true
271
272   # Enable third party HEAP library
273   v8_enable_third_party_heap = false
274
275   # Libaries used by third party heap
276   v8_third_party_heap_libs = []
277
278   # Source code used by third party heap
279   v8_third_party_heap_files = []
280
281   # Disable write barriers when GCs are non-incremental and
282   # heap has single generation.
283   v8_disable_write_barriers = false
284
285   # Ensure that write barriers are always used.
286   # Useful for debugging purposes.
287   v8_enable_unconditional_write_barriers = false
288
289   # Redirect allocation in young generation so that there will be
290   # only one single generation.
291   v8_enable_single_generation = ""
292
293   # Use token threaded dispatch for the regular expression interpreter.
294   # Use switch-based dispatch if this is false
295   v8_enable_regexp_interpreter_threaded_dispatch = true
296
297   # Enforce equality of builtins hashes from compatible architectures.
298   v8_verify_builtins_compatibility = false
299
300   # Check mksnapshot determinism by running it multiple times.
301   v8_verify_deterministic_mksnapshot = false
302
303   # Enable additional targets necessary for verification of torque
304   # file generation
305   v8_verify_torque_generation_invariance = false
306
307   # Generate comments describing the Torque intermediate representation.
308   v8_annotate_torque_ir = false
309
310   # Enable snapshot compression (enabled by default for desktop) devices.
311   v8_enable_snapshot_compression =
312       target_os == "android" || target_os == "chromeos" ||
313       target_os == "fuchsia"
314
315   # Enable control-flow integrity features, such as pointer authentication for
316   # ARM64. Enable it by default for simulator builds and when native code
317   # supports it as well.
318   v8_control_flow_integrity =
319       v8_current_cpu == "arm64" &&
320       (target_is_simulator || arm_control_flow_integrity != "none")
321
322   # Enable heap reservation of size 4GB. Only possible for 64bit archs.
323   cppgc_enable_caged_heap =
324       v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
325       v8_current_cpu == "loong64" || v8_current_cpu == "riscv64"
326
327   # Enables additional heap verification phases and checks.
328   cppgc_enable_verify_heap = ""
329
330   # Enable allocations during prefinalizer invocations.
331   cppgc_allow_allocations_in_prefinalizers = false
332
333   # Enable V8 zone compression experimental feature.
334   # Sets -DV8_COMPRESS_ZONES.
335   v8_enable_zone_compression = ""
336
337   # Enable the experimental V8 sandbox.
338   # Sets -DV8_ENABLE_SANDBOX.
339   v8_enable_sandbox = ""
340
341   # Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
342   # WARNING This will expose builtins that (by design) cause memory corruption.
343   # Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API
344   v8_expose_memory_corruption_api = false
345
346   # Experimental feature for collecting per-class zone memory stats.
347   # Requires use_rtti = true
348   v8_enable_precise_zone_stats = false
349
350   # Experimental feature that uses SwissNameDictionary instead of NameDictionary
351   # as the backing store for all dictionary mode objects.
352   v8_enable_swiss_name_dictionary = false
353
354   # If enabled then macro definitions that are used in externally visible
355   # header files are placed in a separate header file v8-gn.h.
356   v8_generate_external_defines_header = false
357
358   # Experimental feature for tracking constness of properties in non-global
359   # dictionaries. Enabling this also always keeps prototypes in dict mode,
360   # meaning that they are not switched to fast mode.
361   # Sets -DV8_DICT_PROPERTY_CONST_TRACKING
362   v8_dict_property_const_tracking = false
363
364   # Enable map packing & unpacking (sets -dV8_MAP_PACKING).
365   v8_enable_map_packing = false
366
367   # Allow for JS promise hooks (instead of just C++).
368   v8_enable_javascript_promise_hooks = false
369
370   # Enable allocation folding globally (sets -dV8_ALLOCATION_FOLDING).
371   # When it's disabled, the --turbo-allocation-folding runtime flag will be ignored.
372   v8_enable_allocation_folding = true
373
374   # Enable runtime verification of heap snapshots produced for devtools.
375   v8_enable_heap_snapshot_verify = ""
376
377   # Enable global allocation site tracking.
378   v8_allocation_site_tracking = true
379
380   # TODO(cbruni, v8:12302): Remove once API is migrated
381   # Enable legacy mode for ScriptOrModule's lifetime. By default it's a
382   # temporary object, if enabled it will be kept alive by the parent Script.
383   # This is only used by nodejs.
384   v8_scriptormodule_legacy_lifetime = false
385
386   # Enables pointer compression for 8GB heaps.
387   # Sets -DV8_COMPRESS_POINTERS_8GB.
388   v8_enable_pointer_compression_8gb = ""
389
390   # Compile V8 using zlib as dependency.
391   # Sets -DV8_USE_ZLIB
392   v8_use_zlib = true
393
394   # Make ValueDeserializer crash if the data to deserialize is invalid.
395   v8_value_deserializer_hard_fail = false
396
397   # Enable jitless mode, including compile-time optimizations. Note that even
398   # when this is set to 'false', one can run V8 in jitless mode at runtime by
399   # passing the `--jitless` flag; but then you miss out on compile-time
400   # optimizations.
401   # iOS (non-simulator) does not have executable pages for 3rd party
402   # applications yet so disable jit.
403   v8_jitless = v8_enable_lite_mode || target_is_ios_device
404
405   # Enable Sparkplug
406   # Sets -DV8_ENABLE_SPARKPLUG.
407   v8_enable_sparkplug = ""
408
409   # Enable Maglev's graph printer.
410   # Sets -DV8_ENABLE_MAGLEV_GRAPH_PRINTER.
411   v8_enable_maglev_graph_printer = !build_with_chromium
412
413   # Enable slow tracing, e.g., tracing on every instruction or Turbofan node.
414   # Sets -DV8_ENABLE_SLOW_TRACING.
415   v8_enable_slow_tracing = is_debug
416
417   # Enable jump table switch for built-in.
418   v8_enable_builtin_jump_table_switch = v8_current_cpu == "x64"
419
420   v8_shortcut_strings_in_minor_ms = false
421
422   # Whether custom embedder snapshots may extend (= allocate new objects in)
423   # ReadOnlySpace.
424   v8_enable_extensible_ro_snapshot = true
425 }
426
427 # Derived defaults.
428 if (cppgc_enable_verify_heap == "") {
429   cppgc_enable_verify_heap = v8_enable_debugging_features || dcheck_always_on
430 }
431 if (v8_enable_verify_heap == "") {
432   v8_enable_verify_heap = v8_enable_debugging_features
433 }
434 if (v8_enable_object_print == "") {
435   v8_enable_object_print = v8_enable_debugging_features
436 }
437 if (v8_enable_disassembler == "") {
438   v8_enable_disassembler = v8_enable_debugging_features
439 }
440 if (v8_enable_trace_maps == "") {
441   v8_enable_trace_maps = v8_enable_debugging_features
442 }
443 if (v8_enable_test_features == "") {
444   v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
445 }
446 if (v8_enable_v8_checks == "") {
447   v8_enable_v8_checks = v8_enable_debugging_features
448 }
449 if (v8_enable_heap_snapshot_verify == "") {
450   v8_enable_heap_snapshot_verify =
451       v8_enable_debugging_features || dcheck_always_on
452 }
453 if (v8_enable_snapshot_code_comments) {
454   assert(v8_code_comments == true || v8_code_comments == "",
455          "v8_enable_snapshot_code_comments conflicts with v8_code_comments.")
456   v8_code_comments = true
457 } else if (v8_code_comments == "") {
458   v8_code_comments = v8_enable_debugging_features
459 }
460 if (v8_enable_debug_code == "") {
461   v8_enable_debug_code = v8_enable_debugging_features
462 }
463 if (v8_enable_snapshot_native_code_counters == "") {
464   v8_enable_snapshot_native_code_counters = v8_enable_debugging_features
465 }
466 if (v8_enable_pointer_compression == "") {
467   v8_enable_pointer_compression =
468       v8_current_cpu == "arm64" || v8_current_cpu == "x64"
469 }
470
471 # Toggle pointer compression for correctness fuzzing when building the
472 # clang_x64_pointer_compression toolchain. We'll correctness-compare the
473 # default build with the clang_x64_pointer_compression build.
474 if (v8_multi_arch_build &&
475     rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) ==
476     "clang_x64_pointer_compression") {
477   v8_enable_pointer_compression = !v8_enable_pointer_compression
478 }
479
480 # Ensure the sandbox is on/off in the same way as pointer compression for
481 # correctness fuzzing builds.
482 if (v8_multi_arch_build) {
483   v8_enable_sandbox = v8_enable_pointer_compression
484 }
485 if (v8_enable_pointer_compression_shared_cage == "") {
486   v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression
487 }
488 if (v8_enable_pointer_compression_8gb == "") {
489   v8_enable_pointer_compression_8gb = false
490 }
491 if (v8_enable_fast_torque == "") {
492   v8_enable_fast_torque = v8_enable_fast_mksnapshot
493 }
494 if (v8_enable_zone_compression == "") {
495   v8_enable_zone_compression = false
496 }
497 if (v8_enable_short_builtin_calls == "") {
498   v8_enable_short_builtin_calls =
499       v8_current_cpu == "x64" || v8_current_cpu == "arm64"
500 }
501 if (v8_enable_external_code_space == "") {
502   v8_enable_external_code_space =
503       v8_enable_pointer_compression &&
504       v8_enable_pointer_compression_shared_cage &&
505       (v8_current_cpu == "x64" || v8_current_cpu == "arm64")
506 }
507 if (v8_enable_sparkplug == "") {
508   v8_enable_sparkplug = !v8_jitless
509 }
510 if (v8_enable_maglev == "") {
511   v8_enable_maglev = v8_enable_turbofan &&
512                      (v8_current_cpu == "arm" || v8_current_cpu == "x64" ||
513                       v8_current_cpu == "arm64")
514 }
515 assert(v8_enable_turbofan || !v8_enable_maglev,
516        "Maglev is not available when Turbofan is disabled.")
517
518 assert(!v8_jitless || (!v8_enable_sparkplug && !v8_enable_maglev &&
519                            !v8_enable_turbofan && !v8_enable_webassembly),
520        "Sparkplug, Maglev, Turbofan and Wasm are not available in jitless mode")
521
522 if (v8_enable_single_generation == "") {
523   v8_enable_single_generation = v8_disable_write_barriers
524 }
525 if (v8_enable_atomic_object_field_writes == "") {
526   v8_enable_atomic_object_field_writes = v8_enable_concurrent_marking
527 }
528 if (v8_enable_third_party_heap) {
529   v8_disable_write_barriers = true
530   v8_enable_single_generation = true
531   v8_enable_shared_ro_heap = false
532   v8_enable_pointer_compression = false
533   v8_enable_pointer_compression_shared_cage = false
534   v8_enable_allocation_folding = false
535 }
536 if (v8_enable_single_generation) {
537   v8_allocation_site_tracking = false
538 }
539 assert(!v8_enable_concurrent_marking || v8_enable_atomic_object_field_writes,
540        "Concurrent marking requires atomic object field writes.")
541 if (v8_enable_trace_unoptimized == "") {
542   v8_enable_trace_unoptimized =
543       v8_enable_trace_ignition || v8_enable_trace_baseline_exec
544 }
545 assert(!v8_enable_trace_ignition || v8_enable_trace_unoptimized,
546        "Ignition tracing requires unoptimized tracing to be enabled.")
547 assert(!v8_enable_trace_baseline_exec || v8_enable_trace_unoptimized,
548        "Baseline tracing requires unoptimized tracing to be enabled.")
549 assert(
550     v8_enable_debugging_features == true || dcheck_always_on ||
551         !v8_enable_slow_dchecks,
552     "v8_enable_slow_dchecks requires v8_enable_debugging_features or dcheck_always_on.")
553
554 if (v8_enable_short_builtin_calls &&
555     (!v8_enable_pointer_compression && v8_current_cpu != "x64")) {
556   # Disable short calls when pointer compression is not enabled, except x64,
557   # where short builtin calls can still be enabled if the code range is
558   # guaranteed to be close enough to embedded builtins.
559   v8_enable_short_builtin_calls = false
560 }
561 if (v8_enable_shared_ro_heap == "") {
562   v8_enable_shared_ro_heap = !v8_enable_pointer_compression ||
563                              v8_enable_pointer_compression_shared_cage
564 }
565
566 if (v8_enable_sandbox == "") {
567   # TODO(saelo, v8:11880) remove dependency on v8_enable_external_code_space
568   # once that is enabled everywhere by default.
569   # TODO(chromium:1325784) the sandbox is not currently supported in Chromium
570   # on Fuchsia.
571   v8_enable_sandbox = v8_enable_pointer_compression_shared_cage &&
572                       v8_enable_external_code_space && target_os != "fuchsia"
573 }
574
575 if (v8_enable_static_roots == "") {
576   # Static roots are only valid for builds with pointer compression and a
577   # shared read-only heap.
578   # TODO(olivf, v8:13466) Some configurations could be supported if we
579   # introduce different static root files for different build configurations:
580   # Non-wasm and non-i18n builds have fewer read only roots. Configurations
581   # without external code space allocate read only roots at a further
582   # location relative to the cage base.
583   v8_enable_static_roots =
584       v8_enable_pointer_compression && v8_enable_shared_ro_heap &&
585       v8_enable_pointer_compression_shared_cage &&
586       v8_enable_external_code_space && v8_enable_webassembly &&
587       v8_enable_i18n_support
588 }
589
590 assert(!v8_enable_static_roots ||
591            (v8_enable_pointer_compression && v8_enable_shared_ro_heap &&
592                 v8_enable_pointer_compression_shared_cage &&
593                 v8_enable_external_code_space && v8_enable_webassembly &&
594                 v8_enable_i18n_support),
595        "Trying to enable static roots in a configuration that is not supported")
596
597 assert(
598     !(v8_enable_static_roots && v8_enable_static_roots_generation),
599     "Static root values must be generated in a build that does not rely on static roots itself")
600
601 if (v8_builtins_profiling_log_file == "default") {
602   v8_builtins_profiling_log_file = ""
603
604   # Don't use existing profile when
605   # * v8_enable_builtins_optimization is disabled,
606   # * generating a new one (i.e. v8_enable_builtins_profiling),
607   # * is_debug or dcheck_always_on because they add more checks to the
608   #   builtins control flow which we don't want to generate,
609   # * !v8_enable_sandbox because it affects the way how external pointer values
610   #   are accessed,
611   # * v8_enable_webassembly because it changes the set of opcodes which affects
612   #   graphs hashes,
613   if (v8_enable_builtins_optimization && !v8_enable_builtins_profiling &&
614       !is_debug && !dcheck_always_on && v8_enable_webassembly) {
615     # This is about function arguments evaluation order, which makes node IDs
616     # not predictable for subgraphs like Op1(Op2(), Op3()) and as a result
617     # different graph hashes.
618     # Clang uses left-to-right order everywhere except Windows, otherwise the
619     # order is right-to-left.
620     # TODO(crbug.com/v8/13647): Remove once this issue is fixed in CSA.
621     if (!is_clang || is_win) {
622       pgo_profile_suffix = "-rl"
623     } else {
624       pgo_profile_suffix = ""
625     }
626     if ((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
627         v8_enable_pointer_compression && v8_enable_external_code_space &&
628         v8_enable_sandbox) {
629       # Note, currently x64 profile can be applied to arm64 but not the other
630       # way round.
631       v8_builtins_profiling_log_file =
632           "tools/builtins-pgo/profiles/x64" + pgo_profile_suffix + ".profile"
633     } else if (v8_current_cpu == "x86" || v8_current_cpu == "arm") {
634       # Note, x86 profile can be applied to arm but not the other way round.
635       v8_builtins_profiling_log_file =
636           "tools/builtins-pgo/profiles/x86" + pgo_profile_suffix + ".profile"
637     }
638   }
639 }
640
641 if (v8_enable_webassembly && !target_is_simulator && v8_current_cpu == "x64") {
642   v8_enable_wasm_simd256_revec = true
643 }
644
645 assert(!v8_disable_write_barriers || v8_enable_single_generation,
646        "Disabling write barriers works only with single generation")
647
648 assert(v8_current_cpu == "arm64" || !v8_control_flow_integrity,
649        "Control-flow integrity is only supported on arm64")
650
651 if (v8_enable_shared_ro_heap && v8_enable_pointer_compression &&
652     !v8_enable_pointer_compression_shared_cage) {
653   assert(
654       is_linux || is_chromeos || is_android,
655       "Sharing read-only heap with pointer compression is only supported on Linux or Android")
656 }
657
658 assert(!v8_enable_map_packing || !v8_enable_pointer_compression,
659        "Map packing does not support pointer compression")
660
661 assert(!v8_enable_map_packing || v8_current_cpu == "x64",
662        "Map packing is only supported on x64")
663
664 assert(!v8_enable_external_code_space || v8_enable_pointer_compression,
665        "External code space feature requires pointer compression")
666
667 assert(!v8_enable_pointer_compression_8gb || v8_enable_pointer_compression,
668        "Pointer compression for 8GB cages requires pointer compression")
669
670 assert(!v8_enable_sandbox || v8_enable_pointer_compression_shared_cage,
671        "The sandbox requires the shared pointer compression cage")
672
673 assert(!v8_enable_sandbox || v8_enable_external_code_space,
674        "The sandbox requires the external code space")
675
676 assert(!v8_enable_sandbox || !v8_enable_third_party_heap,
677        "The sandbox is incompatible with the third-party heap")
678
679 assert(!v8_expose_memory_corruption_api || v8_enable_sandbox,
680        "The Memory Corruption API requires the sandbox")
681
682 assert(
683     !v8_enable_pointer_compression_shared_cage || v8_enable_pointer_compression,
684     "Can't share a pointer compression cage if pointers aren't compressed")
685
686 assert(
687     !v8_enable_pointer_compression ||
688         v8_enable_pointer_compression_shared_cage ||
689         !v8_enable_external_code_space,
690     "Multi-cage pointer compression mode is not compatible with external code space")
691
692 assert(
693     !v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
694         v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
695         v8_current_cpu == "ppc64" || v8_current_cpu == "s390x" ||
696         v8_current_cpu == "loong64",
697     "Sharing a pointer compression cage is only supported on x64, arm64, ppc64, s390x, riscv64 and loong64")
698
699 assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
700        "Write barriers can't be both enabled and disabled")
701
702 assert(!cppgc_enable_caged_heap || v8_current_cpu == "x64" ||
703            v8_current_cpu == "arm64" || v8_current_cpu == "loong64" ||
704            v8_current_cpu == "riscv64",
705        "CppGC caged heap requires 64bit platforms")
706
707 assert(!cppgc_enable_young_generation || cppgc_enable_caged_heap,
708        "Young generation in CppGC requires caged heap")
709
710 assert(!cppgc_enable_pointer_compression || cppgc_enable_caged_heap,
711        "Pointer compression in CppGC requires caged heap")
712
713 if (v8_enable_single_generation == true) {
714   assert(
715       v8_enable_unconditional_write_barriers || v8_disable_write_barriers,
716       "Requires unconditional write barriers or none (which disables incremental marking)")
717 }
718
719 assert(!v8_enable_snapshot_compression || v8_use_zlib,
720        "Snapshot compression requires zlib")
721
722 v8_random_seed = "314159265"
723 v8_toolset_for_shell = "host"
724
725 ###############################################################################
726 # Configurations
727 #
728
729 config("internal_config_base") {
730   # Only targets in this file and its subdirs can depend on this.
731   visibility = [ "./*" ]
732
733   configs = [ ":v8_tracing_config" ]
734
735   include_dirs = [
736     ".",
737     "include",
738     "$target_gen_dir",
739     "$target_gen_dir/include",
740   ]
741 }
742
743 config("internal_config") {
744   defines = []
745
746   # Only targets in this file and its subdirs can depend on this.
747   visibility = [ "./*" ]
748
749   configs = [
750     "//build/config/compiler:wexit_time_destructors",
751     ":internal_config_base",
752     ":v8_header_features",
753     ":cppgc_header_features",
754   ]
755
756   if (is_component_build) {
757     defines += [ "BUILDING_V8_SHARED" ]
758   }
759
760   if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
761     if (!is_clang) {
762       libs = [ "atomic" ]
763     }
764   }
765 }
766
767 # Should be applied to all targets that write trace events.
768 config("v8_tracing_config") {
769   if (v8_use_perfetto) {
770     include_dirs = [
771       "//third_party/perfetto/include",
772       "$root_gen_dir/third_party/perfetto",
773       "$root_gen_dir/third_party/perfetto/build_config",
774     ]
775   }
776 }
777
778 # This config should be applied to code using the libplatform.
779 config("libplatform_config") {
780   include_dirs = [ "include" ]
781   if (is_component_build) {
782     defines = [ "USING_V8_PLATFORM_SHARED" ]
783   }
784 }
785
786 # This config should be applied to code using the libbase.
787 config("libbase_config") {
788   if (is_component_build) {
789     defines = [ "USING_V8_BASE_SHARED" ]
790   }
791   libs = []
792   if (is_android && current_toolchain != host_toolchain) {
793     libs += [ "log" ]
794   }
795   include_dirs = [ "$target_gen_dir/include" ]
796 }
797
798 # Standalone cppgc cannot be built within chrome or with perfetto.
799 assert(!cppgc_is_standalone || !build_with_chromium)
800 assert(!cppgc_is_standalone || !v8_use_perfetto)
801
802 # This config should be applied to code using the cppgc_base.
803 config("cppgc_base_config") {
804   defines = []
805   if (cppgc_is_standalone) {
806     defines += [ "CPPGC_IS_STANDALONE" ]
807   }
808 }
809
810 # This config is only applied to v8_headers and is the basis for external_config
811 # but without setting the USING_V8_SHARED define, which means v8_headers can be
812 # used inside v8 itself.
813 config("headers_config") {
814   defines = []
815   configs = [
816     ":v8_header_features",
817     ":cppgc_header_features",
818   ]
819   include_dirs = [
820     "include",
821     "$target_gen_dir/include",
822   ]
823 }
824
825 # This config should only be applied to code using V8 and not any V8 code
826 # itself.
827 config("external_config") {
828   configs = [ ":headers_config" ]
829   defines = []
830   if (is_component_build) {
831     defines += [ "USING_V8_SHARED" ]
832   }
833
834   if (current_cpu == "riscv64" || current_cpu == "riscv32") {
835     if (!is_clang) {
836       libs = [ "atomic" ]
837     }
838   }
839 }
840
841 # This config should only be applied to code that needs to be explicitly
842 # aware of whether we are using startup data or not.
843 config("external_startup_data") {
844   if (v8_use_external_startup_data) {
845     defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
846   }
847 }
848
849 # List of defines that can appear in externally visible header files and that
850 # are controlled by args.gn.
851 external_v8_defines = [
852   "V8_ENABLE_CHECKS",
853   "V8_COMPRESS_POINTERS",
854   "V8_COMPRESS_POINTERS_IN_SHARED_CAGE",
855   "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE",
856   "V8_31BIT_SMIS_ON_64BIT_ARCH",
857   "V8_COMPRESS_ZONES",
858   "V8_ENABLE_SANDBOX",
859   "V8_DEPRECATION_WARNINGS",
860   "V8_IMMINENT_DEPRECATION_WARNINGS",
861   "V8_NO_ARGUMENTS_ADAPTOR",
862   "V8_USE_PERFETTO",
863   "V8_MAP_PACKING",
864   "V8_IS_TSAN",
865   "V8_ENABLE_CONSERVATIVE_STACK_SCANNING",
866   "V8_ENABLE_DIRECT_LOCAL",
867 ]
868
869 enabled_external_v8_defines = []
870
871 if (v8_enable_v8_checks) {
872   enabled_external_v8_defines += [ "V8_ENABLE_CHECKS" ]
873 }
874 if (v8_enable_pointer_compression) {
875   enabled_external_v8_defines += [ "V8_COMPRESS_POINTERS" ]
876   if (v8_enable_pointer_compression_shared_cage) {
877     enabled_external_v8_defines += [ "V8_COMPRESS_POINTERS_IN_SHARED_CAGE" ]
878   } else {
879     enabled_external_v8_defines += [ "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE" ]
880   }
881 }
882 if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
883   enabled_external_v8_defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
884 }
885 if (v8_enable_zone_compression) {
886   enabled_external_v8_defines += [ "V8_COMPRESS_ZONES" ]
887 }
888 if (v8_enable_sandbox) {
889   enabled_external_v8_defines += [ "V8_ENABLE_SANDBOX" ]
890 }
891 if (v8_deprecation_warnings) {
892   enabled_external_v8_defines += [ "V8_DEPRECATION_WARNINGS" ]
893 }
894 if (v8_imminent_deprecation_warnings) {
895   enabled_external_v8_defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
896 }
897 if (v8_use_perfetto) {
898   enabled_external_v8_defines += [ "V8_USE_PERFETTO" ]
899 }
900 if (v8_enable_map_packing) {
901   enabled_external_v8_defines += [ "V8_MAP_PACKING" ]
902 }
903 if (is_tsan) {
904   enabled_external_v8_defines += [ "V8_IS_TSAN" ]
905 }
906 if (v8_enable_conservative_stack_scanning) {
907   enabled_external_v8_defines += [ "V8_ENABLE_CONSERVATIVE_STACK_SCANNING" ]
908 }
909 if (v8_enable_direct_local) {
910   enabled_external_v8_defines += [ "V8_ENABLE_DIRECT_LOCAL" ]
911 }
912 if (v8_shortcut_strings_in_minor_ms) {
913   enabled_external_v8_defines += [ "V8_MINORMS_STRING_SHORTCUTTING" ]
914 }
915 disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
916
917 # Put defines that are used in public headers here; public headers are
918 # defined in "v8_headers" and are included by embedders of V8.
919 config("v8_header_features") {
920   visibility = [ ":*" ]
921
922   if (v8_generate_external_defines_header) {
923     defines = [ "V8_GN_HEADER" ]
924   } else {
925     defines = enabled_external_v8_defines
926   }
927 }
928
929 # List of defines that can appear in externally visible cppgc header files and
930 # that are controlled by args.gn.
931 external_cppgc_defines = [
932   "CPPGC_SUPPORTS_OBJECT_NAMES",
933   "CPPGC_CAGED_HEAP",
934   "CPPGC_SLIM_WRITE_BARRIER",
935   "CPPGC_YOUNG_GENERATION",
936   "CPPGC_POINTER_COMPRESSION",
937   "CPPGC_ENABLE_LARGER_CAGE",
938 ]
939
940 enabled_external_cppgc_defines = []
941
942 if (cppgc_enable_object_names) {
943   enabled_external_cppgc_defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ]
944 }
945 if (cppgc_enable_caged_heap) {
946   enabled_external_cppgc_defines += [ "CPPGC_CAGED_HEAP" ]
947
948   # Always enable young generation compile time flag if caged heap is enabled.
949   cppgc_enable_young_generation = true
950
951   # Pointer compression regresses binary size on Fuchsia by about 300K.
952   # However, the change improves Oilpan memory by 15-20% (2-4% of PMF),
953   # which is beneficial for memory-impoverished platforms.
954   cppgc_enable_pointer_compression = true
955 }
956 if (cppgc_enable_young_generation) {
957   enabled_external_cppgc_defines += [ "CPPGC_YOUNG_GENERATION" ]
958 }
959 if (cppgc_enable_pointer_compression) {
960   enabled_external_cppgc_defines += [ "CPPGC_POINTER_COMPRESSION" ]
961 }
962 if (cppgc_enable_2gb_cage) {
963   enabled_external_cppgc_defines += [ "CPPGC_2GB_CAGE" ]
964 }
965 if (cppgc_enable_larger_cage) {
966   enabled_external_cppgc_defines += [ "CPPGC_ENABLE_LARGER_CAGE" ]
967 }
968 if (cppgc_enable_slim_write_barrier) {
969   enabled_external_cppgc_defines += [ "CPPGC_SLIM_WRITE_BARRIER" ]
970 }
971
972 disabled_external_cppgc_defines =
973     external_cppgc_defines - enabled_external_cppgc_defines
974
975 config("cppgc_header_features") {
976   visibility = [ ":*" ]
977
978   if (v8_generate_external_defines_header) {
979     defines = [ "V8_GN_HEADER" ]
980   } else {
981     defines = enabled_external_cppgc_defines
982   }
983 }
984
985 enabled_external_defines =
986     enabled_external_v8_defines + enabled_external_cppgc_defines
987 disabled_external_defines =
988     disabled_external_v8_defines + disabled_external_cppgc_defines
989
990 # Put defines here that are only used in our internal files and NEVER in
991 # external headers that embedders (such as chromium and node) might include.
992 config("features") {
993   # Only targets in this file and its subdirs can depend on this.
994   visibility = [ "./*" ]
995
996   defines = []
997
998   configs = [
999     ":v8_header_features",
1000     ":cppgc_header_features",
1001   ]
1002
1003   if (cppgc_enable_verify_heap) {
1004     defines += [ "CPPGC_VERIFY_HEAP" ]
1005   }
1006
1007   if (cppgc_allow_allocations_in_prefinalizers) {
1008     defines += [ "CPPGC_ALLOW_ALLOCATIONS_IN_PREFINALIZERS" ]
1009   }
1010
1011   if (v8_embedder_string != "") {
1012     defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
1013   }
1014   if (v8_enable_disassembler || v8_log_builtins_block_count_input != "") {
1015     defines += [ "ENABLE_DISASSEMBLER" ]
1016   }
1017   if (enable_wrt_js) {
1018     v8_promise_internal_field_count = 1
1019     v8_enable_javascript_promise_hooks = true
1020   }
1021   if (v8_log_builtins_block_count_input != "") {
1022     defines += [ "LOG_BUILTIN_BLOCK_COUNT" ]
1023   }
1024   if (v8_promise_internal_field_count != 0) {
1025     defines +=
1026         [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
1027   }
1028   defines +=
1029       [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
1030
1031   if (v8_enable_future) {
1032     defines += [ "V8_ENABLE_FUTURE" ]
1033   }
1034   if (v8_enable_lite_mode) {
1035     defines += [ "V8_LITE_MODE" ]
1036   }
1037   if (v8_enable_gdbjit) {
1038     defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
1039   }
1040   if (v8_enable_vtunejit) {
1041     defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
1042   }
1043   if (v8_enable_vtunetracemark) {
1044     defines += [ "ENABLE_VTUNE_TRACEMARK" ]
1045   }
1046   if (v8_enable_hugepage) {
1047     defines += [ "ENABLE_HUGEPAGE" ]
1048   }
1049   if (v8_enable_private_mapping_fork_optimization) {
1050     defines += [ "V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION" ]
1051   }
1052   if (v8_enable_object_print) {
1053     defines += [ "OBJECT_PRINT" ]
1054   }
1055   if (v8_enable_verify_heap) {
1056     defines += [ "VERIFY_HEAP" ]
1057   }
1058   if (v8_enable_verify_predictable) {
1059     defines += [ "VERIFY_PREDICTABLE" ]
1060   }
1061   if (v8_enable_trace_maps) {
1062     defines += [ "V8_TRACE_MAPS" ]
1063   }
1064   if (v8_enable_trace_unoptimized) {
1065     defines += [ "V8_TRACE_UNOPTIMIZED" ]
1066   }
1067   if (v8_enable_trace_feedback_updates) {
1068     defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
1069   }
1070   if (v8_enable_test_features) {
1071     defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
1072     defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
1073     defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
1074   }
1075   if (v8_enable_i18n_support) {
1076     defines += [ "V8_INTL_SUPPORT" ]
1077   }
1078   if (v8_enable_handle_zapping) {
1079     defines += [ "ENABLE_HANDLE_ZAPPING" ]
1080   }
1081   if (v8_code_comments == true) {
1082     defines += [ "V8_CODE_COMMENTS" ]
1083   }
1084   if (v8_enable_debug_code) {
1085     defines += [ "V8_ENABLE_DEBUG_CODE" ]
1086   }
1087   if (v8_enable_heap_snapshot_verify) {
1088     defines += [ "V8_ENABLE_HEAP_SNAPSHOT_VERIFY" ]
1089   }
1090   if (v8_enable_snapshot_native_code_counters) {
1091     defines += [ "V8_SNAPSHOT_NATIVE_CODE_COUNTERS" ]
1092   }
1093   if (v8_enable_single_generation) {
1094     defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
1095   }
1096   if (v8_disable_write_barriers) {
1097     defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
1098   }
1099   if (v8_enable_third_party_heap) {
1100     defines += [ "V8_ENABLE_THIRD_PARTY_HEAP" ]
1101   }
1102   if (v8_use_external_startup_data) {
1103     defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
1104   }
1105   if (v8_enable_atomic_object_field_writes) {
1106     defines += [ "V8_ATOMIC_OBJECT_FIELD_WRITES" ]
1107   }
1108   if (v8_enable_ignition_dispatch_counting) {
1109     defines += [ "V8_IGNITION_DISPATCH_COUNTING" ]
1110   }
1111   if (v8_enable_lazy_source_positions) {
1112     defines += [ "V8_ENABLE_LAZY_SOURCE_POSITIONS" ]
1113   }
1114   if (v8_use_siphash) {
1115     defines += [ "V8_USE_SIPHASH" ]
1116   }
1117   if (v8_enable_shared_ro_heap) {
1118     defines += [ "V8_SHARED_RO_HEAP" ]
1119   }
1120   if (v8_win64_unwinding_info) {
1121     defines += [ "V8_WIN64_UNWINDING_INFO" ]
1122   }
1123   if (v8_enable_regexp_interpreter_threaded_dispatch) {
1124     defines += [ "V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH" ]
1125   }
1126   if (v8_enable_snapshot_compression) {
1127     defines += [ "V8_SNAPSHOT_COMPRESSION" ]
1128   }
1129   if (v8_control_flow_integrity) {
1130     defines += [ "V8_ENABLE_CONTROL_FLOW_INTEGRITY" ]
1131   }
1132   if (v8_enable_cet_shadow_stack) {
1133     defines += [ "V8_ENABLE_CET_SHADOW_STACK" ]
1134   }
1135   if (v8_enable_wasm_gdb_remote_debugging) {
1136     defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ]
1137   }
1138   if (v8_enable_precise_zone_stats) {
1139     defines += [ "V8_ENABLE_PRECISE_ZONE_STATS" ]
1140   }
1141   if (v8_fuzzilli) {
1142     defines += [ "V8_FUZZILLI" ]
1143   }
1144   if (v8_enable_short_builtin_calls) {
1145     defines += [ "V8_SHORT_BUILTIN_CALLS" ]
1146   }
1147   if (v8_enable_external_code_space) {
1148     defines += [ "V8_EXTERNAL_CODE_SPACE" ]
1149   }
1150   if (v8_enable_sparkplug) {
1151     defines += [ "V8_ENABLE_SPARKPLUG" ]
1152   }
1153   if (v8_enable_maglev) {
1154     defines += [ "V8_ENABLE_MAGLEV" ]
1155   }
1156   if (v8_enable_turbofan) {
1157     defines += [ "V8_ENABLE_TURBOFAN" ]
1158   }
1159   if (v8_jitless) {
1160     defines += [ "V8_JITLESS" ]
1161   }
1162   if (v8_enable_swiss_name_dictionary) {
1163     defines += [ "V8_ENABLE_SWISS_NAME_DICTIONARY" ]
1164   }
1165   if (v8_enable_system_instrumentation) {
1166     defines += [ "V8_ENABLE_SYSTEM_INSTRUMENTATION" ]
1167   }
1168   if (v8_enable_etw_stack_walking) {
1169     defines += [ "V8_ENABLE_ETW_STACK_WALKING" ]
1170   }
1171   if (v8_etw_guid != "") {
1172     defines += [ "V8_ETW_GUID=\"$v8_etw_guid\"" ]
1173   }
1174   if (v8_enable_webassembly) {
1175     defines += [ "V8_ENABLE_WEBASSEMBLY" ]
1176   }
1177   if (v8_dict_property_const_tracking) {
1178     defines += [ "V8_DICT_PROPERTY_CONST_TRACKING" ]
1179   }
1180   if (v8_enable_javascript_promise_hooks) {
1181     defines += [ "V8_ENABLE_JAVASCRIPT_PROMISE_HOOKS" ]
1182   }
1183   if (v8_enable_allocation_folding) {
1184     defines += [ "V8_ALLOCATION_FOLDING" ]
1185   }
1186   if (v8_allocation_site_tracking) {
1187     defines += [ "V8_ALLOCATION_SITE_TRACKING" ]
1188   }
1189   if (v8_scriptormodule_legacy_lifetime) {
1190     defines += [ "V8_SCRIPTORMODULE_LEGACY_LIFETIME" ]
1191   }
1192   if (v8_advanced_bigint_algorithms) {
1193     defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ]
1194   }
1195   if (v8_expose_memory_corruption_api) {
1196     defines += [ "V8_EXPOSE_MEMORY_CORRUPTION_API" ]
1197   }
1198   if (v8_enable_pointer_compression_8gb) {
1199     defines += [ "V8_COMPRESS_POINTERS_8GB" ]
1200   }
1201   if (v8_enable_static_roots) {
1202     defines += [ "V8_STATIC_ROOTS" ]
1203   }
1204   if (v8_enable_static_roots_generation) {
1205     defines += [ "V8_STATIC_ROOTS_GENERATION" ]
1206   }
1207   if (v8_use_zlib) {
1208     defines += [ "V8_USE_ZLIB" ]
1209   }
1210   if (v8_use_libm_trig_functions) {
1211     defines += [ "V8_USE_LIBM_TRIG_FUNCTIONS" ]
1212   }
1213   if (v8_value_deserializer_hard_fail) {
1214     defines += [ "V8_VALUE_DESERIALIZER_HARD_FAIL" ]
1215   }
1216   if (v8_enable_wasm_simd256_revec) {
1217     defines += [ "V8_ENABLE_WASM_SIMD256_REVEC" ]
1218   }
1219   if (v8_enable_maglev_graph_printer) {
1220     defines += [ "V8_ENABLE_MAGLEV_GRAPH_PRINTER" ]
1221   }
1222   if (v8_enable_slow_tracing) {
1223     defines += [ "V8_ENABLE_SLOW_TRACING" ]
1224   }
1225   if (v8_enable_builtin_jump_table_switch) {
1226     defines += [ "V8_ENABLE_BUILTIN_JUMP_TABLE_SWITCH" ]
1227   }
1228   if (v8_enable_direct_handle) {
1229     defines += [ "V8_ENABLE_DIRECT_HANDLE" ]
1230   }
1231   if (v8_enable_extensible_ro_snapshot) {
1232     defines += [ "V8_ENABLE_EXTENSIBLE_RO_SNAPSHOT" ]
1233   }
1234   if (v8_enable_local_off_stack_check) {
1235     defines += [ "V8_ENABLE_LOCAL_OFF_STACK_CHECK" ]
1236   }
1237 }
1238
1239 config("toolchain") {
1240   # Only targets in this file and its subdirs can depend on this.
1241   visibility = [ "./*" ]
1242
1243   defines = []
1244   cflags = []
1245   ldflags = []
1246
1247   if (v8_current_cpu == "arm") {
1248     defines += [ "V8_TARGET_ARCH_ARM" ]
1249     if (arm_version >= 7) {
1250       defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
1251     }
1252     if (arm_fpu == "vfpv3-d16") {
1253       defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
1254     } else if (arm_fpu == "vfpv3") {
1255       defines += [
1256         "CAN_USE_VFP3_INSTRUCTIONS",
1257         "CAN_USE_VFP32DREGS",
1258       ]
1259     } else if (arm_fpu == "neon") {
1260       defines += [
1261         "CAN_USE_VFP3_INSTRUCTIONS",
1262         "CAN_USE_VFP32DREGS",
1263         "CAN_USE_NEON",
1264       ]
1265     }
1266
1267     # TODO(infra): Add support for arm_test_noprobe.
1268
1269     if (current_cpu != "arm") {
1270       # These defines ares used for the ARM simulator.
1271       if (arm_float_abi == "hard") {
1272         defines += [ "USE_EABI_HARDFLOAT=1" ]
1273       } else if (arm_float_abi == "softfp") {
1274         defines += [ "USE_EABI_HARDFLOAT=0" ]
1275       }
1276     }
1277   }
1278   if (v8_current_cpu == "arm64") {
1279     defines += [ "V8_TARGET_ARCH_ARM64" ]
1280     if (current_cpu == "arm64" && v8_control_flow_integrity && is_clang) {
1281       # Mark assembly code as BTI-compatible.
1282       asmflags = [ "-mmark-bti-property" ]
1283     }
1284   }
1285
1286   # Mips64el simulators.
1287   if (target_is_simulator && v8_current_cpu == "mips64el") {
1288     defines += [ "_MIPS_TARGET_SIMULATOR" ]
1289   }
1290
1291   if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
1292     defines += [ "V8_TARGET_ARCH_MIPS64" ]
1293     if (v8_can_use_fpu_instructions) {
1294       defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
1295     }
1296     if (mips_use_msa) {
1297       defines += [ "_MIPS_MSA" ]
1298     }
1299     if (host_byteorder == "little") {
1300       defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
1301     } else if (host_byteorder == "big") {
1302       defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
1303     }
1304     if (v8_use_mips_abi_hardfloat) {
1305       defines += [
1306         "__mips_hard_float=1",
1307         "CAN_USE_FPU_INSTRUCTIONS",
1308       ]
1309     } else {
1310       defines += [ "__mips_soft_float=1" ]
1311     }
1312     if (mips_arch_variant == "r6") {
1313       defines += [ "_MIPS_ARCH_MIPS64R6" ]
1314     } else if (mips_arch_variant == "r2") {
1315       defines += [ "_MIPS_ARCH_MIPS64R2" ]
1316     }
1317   }
1318
1319   # loong64 simulators.
1320   if (target_is_simulator && v8_current_cpu == "loong64") {
1321     defines += [ "_LOONG64_TARGET_SIMULATOR" ]
1322   }
1323   if (v8_current_cpu == "loong64") {
1324     defines += [ "V8_TARGET_ARCH_LOONG64" ]
1325   }
1326
1327   if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
1328     defines += [ "V8_TARGET_ARCH_S390" ]
1329     cflags += [ "-ffp-contract=off" ]
1330     if (v8_current_cpu == "s390x") {
1331       defines += [ "V8_TARGET_ARCH_S390X" ]
1332     }
1333     if (host_byteorder == "little") {
1334       defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
1335     } else {
1336       cflags += [ "-march=z196" ]
1337     }
1338   }
1339   if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
1340     if (v8_current_cpu == "ppc") {
1341       defines += [ "V8_TARGET_ARCH_PPC" ]
1342     } else if (v8_current_cpu == "ppc64") {
1343       defines += [ "V8_TARGET_ARCH_PPC64" ]
1344       cflags += [ "-ffp-contract=off" ]
1345     }
1346     if (host_byteorder == "little") {
1347       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
1348     } else if (host_byteorder == "big") {
1349       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
1350       if (current_os == "aix") {
1351         cflags += [
1352           # Work around AIX ceil, trunc and round oddities.
1353           "-mcpu=power5+",
1354           "-mfprnd",
1355
1356           # Work around AIX assembler popcntb bug.
1357           "-mno-popcntb",
1358         ]
1359       }
1360     }
1361   }
1362
1363   # Under simulator build, compiler will not provide __riscv_xlen. Define here
1364   if (v8_current_cpu == "riscv64") {
1365     defines += [ "V8_TARGET_ARCH_RISCV64" ]
1366     defines += [ "__riscv_xlen=64" ]
1367     defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
1368     if (!is_clang) {
1369       cflags += [ "-ffp-contract=off" ]
1370     }
1371     if (riscv_use_rvv || target_is_simulator) {
1372       defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
1373       defines += [ "RVV_VLEN=${riscv_rvv_vlen}" ]
1374     }
1375   }
1376
1377   if (v8_current_cpu == "riscv32") {
1378     defines += [ "V8_TARGET_ARCH_RISCV32" ]
1379     defines += [ "__riscv_xlen=32" ]
1380     defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
1381
1382     if (riscv_use_rvv || target_is_simulator) {
1383       defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
1384       defines += [ "RVV_VLEN=${riscv_rvv_vlen}" ]
1385     }
1386   }
1387
1388   if (v8_current_cpu == "x86") {
1389     defines += [ "V8_TARGET_ARCH_IA32" ]
1390     if (is_win) {
1391       # Ensure no surprising artifacts from 80bit double math with x86.
1392       cflags += [ "/arch:SSE2" ]
1393     }
1394   }
1395   if (v8_current_cpu == "x64") {
1396     defines += [ "V8_TARGET_ARCH_X64" ]
1397     if (is_win) {
1398       # Increase the initial stack size. The default is 1MB, this is 2MB. This
1399       # applies only to executables and shared libraries produced by V8 since
1400       # ldflags are not pushed to dependants.
1401       ldflags += [ "/STACK:2097152" ]
1402     }
1403   }
1404   if (is_android && v8_android_log_stdout) {
1405     defines += [ "V8_ANDROID_LOG_STDOUT" ]
1406   }
1407
1408   # V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
1409   # mksnapshot. We additionally set V8_HAVE_TARGET_OS to determine that a
1410   # target OS has in fact been set; otherwise we internally assume that target
1411   # OS == host OS (see v8config.h).
1412   if (target_os == "android") {
1413     defines += [ "V8_HAVE_TARGET_OS" ]
1414     defines += [ "V8_TARGET_OS_ANDROID" ]
1415   } else if (target_os == "fuchsia") {
1416     defines += [ "V8_HAVE_TARGET_OS" ]
1417     defines += [ "V8_TARGET_OS_FUCHSIA" ]
1418   } else if (target_os == "ios") {
1419     defines += [ "V8_HAVE_TARGET_OS" ]
1420     defines += [ "V8_TARGET_OS_IOS" ]
1421   } else if (target_os == "linux") {
1422     defines += [ "V8_HAVE_TARGET_OS" ]
1423     defines += [ "V8_TARGET_OS_LINUX" ]
1424   } else if (target_os == "mac") {
1425     defines += [ "V8_HAVE_TARGET_OS" ]
1426     defines += [ "V8_TARGET_OS_MACOS" ]
1427   } else if (target_os == "win") {
1428     defines += [ "V8_HAVE_TARGET_OS" ]
1429     defines += [ "V8_TARGET_OS_WIN" ]
1430   } else if (target_os == "chromeos") {
1431     defines += [ "V8_HAVE_TARGET_OS" ]
1432     defines += [ "V8_TARGET_OS_CHROMEOS" ]
1433   }
1434
1435   # TODO(infra): Support v8_enable_prof on Windows.
1436   # TODO(infra): Add support for compiling with simulators.
1437
1438   if (v8_enable_debugging_features) {
1439     if ((is_linux || is_chromeos) && v8_enable_backtrace) {
1440       ldflags += [ "-rdynamic" ]
1441     }
1442   }
1443   if (v8_enable_debugging_features || dcheck_always_on) {
1444     defines += [ "DEBUG" ]
1445     if (v8_enable_slow_dchecks) {
1446       defines += [ "ENABLE_SLOW_DCHECKS" ]
1447     }
1448   }
1449
1450   if (v8_enable_verify_csa) {
1451     defines += [ "ENABLE_VERIFY_CSA" ]
1452   }
1453
1454   if (v8_enable_runtime_call_stats) {
1455     defines += [ "V8_RUNTIME_CALL_STATS" ]
1456   }
1457
1458   if (v8_no_inline) {
1459     if (is_win) {
1460       cflags += [ "/Ob0" ]
1461     } else {
1462       cflags += [
1463         "-fno-inline-functions",
1464         "-fno-inline",
1465       ]
1466     }
1467   }
1468
1469   if (is_clang) {
1470     cflags += [
1471       "-Wmissing-field-initializers",
1472       "-Wunreachable-code",
1473
1474       # TODO(v8:12245): Fix shadowing instances and remove.
1475       "-Wno-shadow",
1476     ]
1477
1478     # TODO(fuchsia:127411): Re-enable once FIDL bindings are compatible.
1479     if (!is_fuchsia) {
1480       # Google3 enables this warning, so we should also enable it to find issue
1481       # earlier. See https://reviews.llvm.org/D56731 for details about this
1482       # warning.
1483       cflags += [ "-Wctad-maybe-unsupported" ]
1484     }
1485
1486     if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
1487         v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") {
1488       cflags += [ "-Wshorten-64-to-32" ]
1489     }
1490   }
1491
1492   if (is_clang || !is_win) {
1493     cflags += [
1494       # On clang and gcc, disable warnings about offsetof being used on
1495       # non-standard-layout types. offsetof is only specified for
1496       # standard-layout types, but its behaviour on non-standard-layout types is
1497       # implementation defined (rather than UB), and our supported compilers
1498       # have the expected reasonable behaviour.
1499       "-Wno-invalid-offsetof",
1500     ]
1501   }
1502
1503   if (is_win) {
1504     cflags += [
1505       "/wd4245",  # Conversion with signed/unsigned mismatch.
1506       "/wd4267",  # Conversion with possible loss of data.
1507       "/wd4324",  # Padding structure due to alignment.
1508       "/wd4701",  # Potentially uninitialized local variable.
1509       "/wd4702",  # Unreachable code.
1510       "/wd4703",  # Potentially uninitialized local pointer variable.
1511       "/wd4709",  # Comma operator within array index expr (bugged).
1512       "/wd4714",  # Function marked forceinline not inlined.
1513
1514       # MSVC assumes that control can get past an exhaustive switch and then
1515       # warns if there's no return there (see https://crbug.com/v8/7658)
1516       "/wd4715",  # Not all control paths return a value.
1517
1518       "/wd4718",  # Recursive call has no side-effect.
1519       "/wd4723",  # https://crbug.com/v8/7771
1520       "/wd4724",  # https://crbug.com/v8/7771
1521       "/wd4800",  # Forcing value to bool.
1522     ]
1523   }
1524
1525   if (!is_clang && is_win) {
1526     cflags += [
1527       "/wd4506",  # Benign "no definition for inline function"
1528
1529       # Warnings permanently disabled:
1530
1531       # C4091: 'typedef ': ignored on left of 'X' when no variable is
1532       #                    declared.
1533       # This happens in a number of Windows headers. Dumb.
1534       "/wd4091",
1535
1536       # C4127: conditional expression is constant
1537       # This warning can in theory catch dead code and other problems, but
1538       # triggers in far too many desirable cases where the conditional
1539       # expression is either set by macros or corresponds some legitimate
1540       # compile-time constant expression (due to constant template args,
1541       # conditionals comparing the sizes of different types, etc.).  Some of
1542       # these can be worked around, but it's not worth it.
1543       "/wd4127",
1544
1545       # C4251: 'identifier' : class 'type' needs to have dll-interface to be
1546       #        used by clients of class 'type2'
1547       # This is necessary for the shared library build.
1548       "/wd4251",
1549
1550       # C4275:  non dll-interface class used as base for dll-interface class
1551       # This points out a potential (but rare) problem with referencing static
1552       # fields of a non-exported base, through the base's non-exported inline
1553       # functions, or directly. The warning is subtle enough that people just
1554       # suppressed it when they saw it, so it's not worth it.
1555       "/wd4275",
1556
1557       # C4312 is a VS 2015 64-bit warning for integer to larger pointer.
1558       # TODO(brucedawson): fix warnings, crbug.com/554200
1559       "/wd4312",
1560
1561       # C4324 warns when padding is added to fulfill alignas requirements,
1562       # but can trigger in benign cases that are difficult to individually
1563       # suppress.
1564       "/wd4324",
1565
1566       # C4351: new behavior: elements of array 'array' will be default
1567       #        initialized
1568       # This is a silly "warning" that basically just alerts you that the
1569       # compiler is going to actually follow the language spec like it's
1570       # supposed to, instead of not following it like old buggy versions did.
1571       # There's absolutely no reason to turn this on.
1572       "/wd4351",
1573
1574       # C4355: 'this': used in base member initializer list
1575       # It's commonly useful to pass |this| to objects in a class' initializer
1576       # list.  While this warning can catch real bugs, most of the time the
1577       # constructors in question don't attempt to call methods on the passed-in
1578       # pointer (until later), and annotating every legit usage of this is
1579       # simply more hassle than the warning is worth.
1580       "/wd4355",
1581
1582       # C4503: 'identifier': decorated name length exceeded, name was
1583       #        truncated
1584       # This only means that some long error messages might have truncated
1585       # identifiers in the presence of lots of templates.  It has no effect on
1586       # program correctness and there's no real reason to waste time trying to
1587       # prevent it.
1588       "/wd4503",
1589
1590       # Warning C4589 says: "Constructor of abstract class ignores
1591       # initializer for virtual base class." Disable this warning because it
1592       # is flaky in VS 2015 RTM. It triggers on compiler generated
1593       # copy-constructors in some cases.
1594       "/wd4589",
1595
1596       # C4611: interaction between 'function' and C++ object destruction is
1597       #        non-portable
1598       # This warning is unavoidable when using e.g. setjmp/longjmp.  MSDN
1599       # suggests using exceptions instead of setjmp/longjmp for C++, but
1600       # Chromium code compiles without exception support.  We therefore have to
1601       # use setjmp/longjmp for e.g. JPEG decode error handling, which means we
1602       # have to turn off this warning (and be careful about how object
1603       # destruction happens in such cases).
1604       "/wd4611",
1605
1606       # Warnings to evaluate and possibly fix/reenable later:
1607
1608       "/wd4100",  # Unreferenced formal function parameter.
1609       "/wd4121",  # Alignment of a member was sensitive to packing.
1610       "/wd4244",  # Conversion: possible loss of data.
1611       "/wd4505",  # Unreferenced local function has been removed.
1612       "/wd4510",  # Default constructor could not be generated.
1613       "/wd4512",  # Assignment operator could not be generated.
1614       "/wd4610",  # Class can never be instantiated, constructor required.
1615       "/wd4838",  # Narrowing conversion. Doesn't seem to be very useful.
1616       "/wd4995",  # 'X': name was marked as #pragma deprecated
1617       "/wd4996",  # Deprecated function warning.
1618
1619       # These are variable shadowing warnings that are new in VS2015. We
1620       # should work through these at some point -- they may be removed from
1621       # the RTM release in the /W4 set.
1622       "/wd4456",
1623       "/wd4457",
1624       "/wd4458",
1625       "/wd4459",
1626
1627       # All of our compilers support the extensions below.
1628       "/wd4200",  # nonstandard extension used: zero-sized array in struct/union
1629       "/wd4201",  # nonstandard extension used: nameless struct/union
1630       "/wd4204",  # nonstandard extension used : non-constant aggregate
1631                   # initializer
1632
1633       "/wd4221",  # nonstandard extension used : 'identifier' : cannot be
1634                   # initialized using address of automatic variable
1635
1636       # http://crbug.com/588506 - Conversion suppressions waiting on Clang
1637       # -Wconversion.
1638       "/wd4245",  # 'conversion' : conversion from 'type1' to 'type2',
1639                   # signed/unsigned mismatch
1640
1641       "/wd4267",  # 'var' : conversion from 'size_t' to 'type', possible loss of
1642                   # data
1643
1644       "/wd4305",  # 'identifier' : truncation from 'type1' to 'type2'
1645       "/wd4389",  # 'operator' : signed/unsigned mismatch
1646
1647       "/wd4702",  # unreachable code
1648
1649       # http://crbug.com/848979 - MSVC is more conservative than Clang with
1650       # regards to variables initialized and consumed in different branches.
1651       "/wd4701",  # Potentially uninitialized local variable 'name' used
1652       "/wd4703",  # Potentially uninitialized local pointer variable 'name' used
1653
1654       # http://crbug.com/848979 - Remaining Clang permitted warnings.
1655       "/wd4661",  # 'identifier' : no suitable definition provided for explicit
1656                   # template instantiation request
1657
1658       "/wd4706",  # assignment within conditional expression
1659                   # MSVC is stricter and requires a boolean expression.
1660
1661       "/wd4715",  # 'function' : not all control paths return a value'
1662                   # MSVC does not analyze switch (enum) for completeness.
1663     ]
1664   }
1665
1666   if (!is_clang && !is_win) {
1667     cflags += [
1668       # Disable gcc warnings for optimizations based on the assumption that
1669       # signed overflow does not occur. Generates false positives (see
1670       # http://crbug.com/v8/6341).
1671       "-Wno-strict-overflow",
1672
1673       # GCC assumes that control can get past an exhaustive switch and then
1674       # warns if there's no return there (see https://crbug.com/v8/7658).
1675       "-Wno-return-type",
1676
1677       # Disable gcc warnings for using enum constant in boolean context.
1678       # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97266
1679       "-Wno-int-in-bool-context",
1680
1681       # Disable gcc deprecation warnings, which are firing on implicit capture
1682       # of `this` in capture-by-value lambdas and preventing a build roll which
1683       # enables C++20 (see https://crbug.com/1374227).
1684       "-Wno-deprecated",
1685     ]
1686   }
1687
1688   # Chromium uses a hand-picked subset of UBSan coverage. We want everything.
1689   if (is_ubsan) {
1690     cflags += [ "-fsanitize=undefined" ]
1691   }
1692 }
1693
1694 # For code that is hot during mksnapshot. In fast-mksnapshot builds, we
1695 # optimize some files even in debug builds to speed up mksnapshot times.
1696 config("always_turbofanimize") {
1697   configs = [ ":internal_config" ]
1698
1699   # TODO(crbug.com/621335) Rework this so that we don't have the confusion
1700   # between "optimize_speed" and "optimize_max".
1701   if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
1702     configs += [ "//build/config/compiler:optimize_speed" ]
1703   } else {
1704     configs += [ "//build/config/compiler:optimize_max" ]
1705   }
1706 }
1707
1708 ###############################################################################
1709 # Actions
1710 #
1711
1712 # Only for Windows clang builds. Converts the embedded.S file produced by
1713 # mksnapshot into an embedded.cc file with corresponding inline assembly.
1714 template("asm_to_inline_asm") {
1715   name = target_name
1716   if (name == "default") {
1717     suffix = ""
1718   } else {
1719     suffix = "_$name"
1720   }
1721
1722   action("asm_to_inline_asm_" + name) {
1723     visibility = [ ":*" ]  # Only targets in this file can depend on this.
1724
1725     assert(emit_builtins_as_inline_asm)
1726
1727     script = "tools/snapshot/asm_to_inline_asm.py"
1728     deps = [ ":run_mksnapshot_" + name ]
1729     sources = [ "$target_gen_dir/embedded${suffix}.S" ]
1730     outputs = [ "$target_gen_dir/embedded${suffix}.cc" ]
1731     args = invoker.args
1732     args += [
1733       rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1734       rebase_path("$target_gen_dir/embedded${suffix}.cc", root_build_dir),
1735     ]
1736   }
1737 }
1738
1739 if (v8_postmortem_support) {
1740   action("postmortem-metadata") {
1741     # Only targets in this file can depend on this.
1742     visibility = [ ":*" ]
1743
1744     script = "tools/gen-postmortem-metadata.py"
1745
1746     # NOSORT
1747     sources = [
1748       "$target_gen_dir/torque-generated/instance-types.h",
1749       "src/objects/allocation-site.h",
1750       "src/objects/allocation-site-inl.h",
1751       "src/objects/cell.h",
1752       "src/objects/cell-inl.h",
1753       "src/objects/dependent-code.h",
1754       "src/objects/dependent-code-inl.h",
1755       "src/objects/bytecode-array.h",
1756       "src/objects/bytecode-array-inl.h",
1757       "src/objects/abstract-code.h",
1758       "src/objects/abstract-code-inl.h",
1759       "src/objects/instruction-stream.h",
1760       "src/objects/instruction-stream-inl.h",
1761       "src/objects/code.h",
1762       "src/objects/code-inl.h",
1763       "src/objects/data-handler.h",
1764       "src/objects/data-handler-inl.h",
1765       "src/objects/deoptimization-data.h",
1766       "src/objects/deoptimization-data-inl.h",
1767       "src/objects/descriptor-array.h",
1768       "src/objects/descriptor-array-inl.h",
1769       "src/objects/feedback-cell.h",
1770       "src/objects/feedback-cell-inl.h",
1771       "src/objects/fixed-array.h",
1772       "src/objects/fixed-array-inl.h",
1773       "src/objects/heap-number.h",
1774       "src/objects/heap-number-inl.h",
1775       "src/objects/heap-object.h",
1776       "src/objects/heap-object-inl.h",
1777       "src/objects/instance-type.h",
1778       "src/objects/instance-type-checker.h",
1779       "src/objects/instance-type-inl.h",
1780       "src/objects/js-array-buffer.h",
1781       "src/objects/js-array-buffer-inl.h",
1782       "src/objects/js-array.h",
1783       "src/objects/js-array-inl.h",
1784       "src/objects/js-function-inl.h",
1785       "src/objects/js-function.cc",
1786       "src/objects/js-function.h",
1787       "src/objects/js-objects.cc",
1788       "src/objects/js-objects.h",
1789       "src/objects/js-objects-inl.h",
1790       "src/objects/js-promise.h",
1791       "src/objects/js-promise-inl.h",
1792       "src/objects/js-raw-json.cc",
1793       "src/objects/js-raw-json.h",
1794       "src/objects/js-raw-json-inl.h",
1795       "src/objects/js-regexp.cc",
1796       "src/objects/js-regexp.h",
1797       "src/objects/js-regexp-inl.h",
1798       "src/objects/js-regexp-string-iterator.h",
1799       "src/objects/js-regexp-string-iterator-inl.h",
1800       "src/objects/map.cc",
1801       "src/objects/map.h",
1802       "src/objects/map-inl.h",
1803       "src/objects/megadom-handler.h",
1804       "src/objects/megadom-handler-inl.h",
1805       "src/objects/name.h",
1806       "src/objects/name-inl.h",
1807       "src/objects/objects.h",
1808       "src/objects/objects-inl.h",
1809       "src/objects/oddball.h",
1810       "src/objects/oddball-inl.h",
1811       "src/objects/primitive-heap-object.h",
1812       "src/objects/primitive-heap-object-inl.h",
1813       "src/objects/scope-info.h",
1814       "src/objects/scope-info-inl.h",
1815       "src/objects/script.h",
1816       "src/objects/script-inl.h",
1817       "src/objects/shared-function-info.cc",
1818       "src/objects/shared-function-info.h",
1819       "src/objects/shared-function-info-inl.h",
1820       "src/objects/string.cc",
1821       "src/objects/string-comparator.cc",
1822       "src/objects/string-comparator.h",
1823       "src/objects/string.h",
1824       "src/objects/string-inl.h",
1825       "src/objects/struct.h",
1826       "src/objects/struct-inl.h",
1827       "src/objects/tagged.h",
1828     ]
1829
1830     outputs = [ "$target_gen_dir/debug-support.cc" ]
1831
1832     args = rebase_path(outputs, root_build_dir) +
1833            rebase_path(sources, root_build_dir)
1834
1835     deps = [ ":run_torque" ]
1836   }
1837 }
1838
1839 torque_files = [
1840   "src/builtins/aggregate-error.tq",
1841   "src/builtins/array-at.tq",
1842   "src/builtins/array-concat.tq",
1843   "src/builtins/array-copywithin.tq",
1844   "src/builtins/array-every.tq",
1845   "src/builtins/array-filter.tq",
1846   "src/builtins/array-find.tq",
1847   "src/builtins/array-findindex.tq",
1848   "src/builtins/array-findlast.tq",
1849   "src/builtins/array-findlastindex.tq",
1850   "src/builtins/array-foreach.tq",
1851   "src/builtins/array-from-async.tq",
1852   "src/builtins/array-from.tq",
1853   "src/builtins/array-isarray.tq",
1854   "src/builtins/array-join.tq",
1855   "src/builtins/array-lastindexof.tq",
1856   "src/builtins/array-map.tq",
1857   "src/builtins/array-of.tq",
1858   "src/builtins/array-reduce-right.tq",
1859   "src/builtins/array-reduce.tq",
1860   "src/builtins/array-reverse.tq",
1861   "src/builtins/array-shift.tq",
1862   "src/builtins/array-slice.tq",
1863   "src/builtins/array-some.tq",
1864   "src/builtins/array-splice.tq",
1865   "src/builtins/array-to-reversed.tq",
1866   "src/builtins/array-to-sorted.tq",
1867   "src/builtins/array-to-spliced.tq",
1868   "src/builtins/array-unshift.tq",
1869   "src/builtins/array-with.tq",
1870   "src/builtins/array.tq",
1871   "src/builtins/arraybuffer.tq",
1872   "src/builtins/base.tq",
1873   "src/builtins/boolean.tq",
1874   "src/builtins/builtins-bigint.tq",
1875   "src/builtins/builtins-string.tq",
1876   "src/builtins/cast.tq",
1877   "src/builtins/collections.tq",
1878   "src/builtins/constructor.tq",
1879   "src/builtins/conversion.tq",
1880   "src/builtins/convert.tq",
1881   "src/builtins/console.tq",
1882   "src/builtins/data-view.tq",
1883   "src/builtins/finalization-registry.tq",
1884   "src/builtins/frames.tq",
1885   "src/builtins/frame-arguments.tq",
1886   "src/builtins/function.tq",
1887   "src/builtins/growable-fixed-array.tq",
1888   "src/builtins/ic-callable.tq",
1889   "src/builtins/ic.tq",
1890   "src/builtins/internal-coverage.tq",
1891   "src/builtins/internal.tq",
1892   "src/builtins/iterator.tq",
1893   "src/builtins/iterator-from.tq",
1894   "src/builtins/iterator-helpers.tq",
1895   "src/builtins/map-groupby.tq",
1896   "src/builtins/math.tq",
1897   "src/builtins/number.tq",
1898   "src/builtins/object-fromentries.tq",
1899   "src/builtins/object-groupby.tq",
1900   "src/builtins/object.tq",
1901   "src/builtins/promise-abstract-operations.tq",
1902   "src/builtins/promise-all.tq",
1903   "src/builtins/promise-all-element-closure.tq",
1904   "src/builtins/promise-any.tq",
1905   "src/builtins/promise-constructor.tq",
1906   "src/builtins/promise-finally.tq",
1907   "src/builtins/promise-jobs.tq",
1908   "src/builtins/promise-misc.tq",
1909   "src/builtins/promise-race.tq",
1910   "src/builtins/promise-reaction-job.tq",
1911   "src/builtins/promise-resolve.tq",
1912   "src/builtins/promise-then.tq",
1913   "src/builtins/promise-withresolvers.tq",
1914   "src/builtins/proxy-constructor.tq",
1915   "src/builtins/proxy-delete-property.tq",
1916   "src/builtins/proxy-get-property.tq",
1917   "src/builtins/proxy-get-prototype-of.tq",
1918   "src/builtins/proxy-has-property.tq",
1919   "src/builtins/proxy-is-extensible.tq",
1920   "src/builtins/proxy-prevent-extensions.tq",
1921   "src/builtins/proxy-revocable.tq",
1922   "src/builtins/proxy-revoke.tq",
1923   "src/builtins/proxy-set-property.tq",
1924   "src/builtins/proxy-set-prototype-of.tq",
1925   "src/builtins/proxy.tq",
1926   "src/builtins/reflect.tq",
1927   "src/builtins/regexp-exec.tq",
1928   "src/builtins/regexp-match-all.tq",
1929   "src/builtins/regexp-match.tq",
1930   "src/builtins/regexp-replace.tq",
1931   "src/builtins/regexp-search.tq",
1932   "src/builtins/regexp-source.tq",
1933   "src/builtins/regexp-split.tq",
1934   "src/builtins/regexp-test.tq",
1935   "src/builtins/regexp.tq",
1936   "src/builtins/set-difference.tq",
1937   "src/builtins/set-intersection.tq",
1938   "src/builtins/set-is-disjoint-from.tq",
1939   "src/builtins/set-is-subset-of.tq",
1940   "src/builtins/set-is-superset-of.tq",
1941   "src/builtins/set-symmetric-difference.tq",
1942   "src/builtins/set-union.tq",
1943   "src/builtins/string-at.tq",
1944   "src/builtins/string-endswith.tq",
1945   "src/builtins/string-html.tq",
1946   "src/builtins/string-includes.tq",
1947   "src/builtins/string-indexof.tq",
1948   "src/builtins/string-iswellformed.tq",
1949   "src/builtins/string-iterator.tq",
1950   "src/builtins/string-match-search.tq",
1951   "src/builtins/string-pad.tq",
1952   "src/builtins/string-repeat.tq",
1953   "src/builtins/string-replaceall.tq",
1954   "src/builtins/string-slice.tq",
1955   "src/builtins/string-startswith.tq",
1956   "src/builtins/string-substr.tq",
1957   "src/builtins/string-substring.tq",
1958   "src/builtins/string-towellformed.tq",
1959   "src/builtins/string-trim.tq",
1960   "src/builtins/symbol.tq",
1961   "src/builtins/torque-internal.tq",
1962   "src/builtins/typed-array-at.tq",
1963   "src/builtins/typed-array-createtypedarray.tq",
1964   "src/builtins/typed-array-every.tq",
1965   "src/builtins/typed-array-entries.tq",
1966   "src/builtins/typed-array-filter.tq",
1967   "src/builtins/typed-array-find.tq",
1968   "src/builtins/typed-array-findindex.tq",
1969   "src/builtins/typed-array-findlast.tq",
1970   "src/builtins/typed-array-findlastindex.tq",
1971   "src/builtins/typed-array-foreach.tq",
1972   "src/builtins/typed-array-from.tq",
1973   "src/builtins/typed-array-keys.tq",
1974   "src/builtins/typed-array-of.tq",
1975   "src/builtins/typed-array-reduce.tq",
1976   "src/builtins/typed-array-reduceright.tq",
1977   "src/builtins/typed-array-set.tq",
1978   "src/builtins/typed-array-slice.tq",
1979   "src/builtins/typed-array-some.tq",
1980   "src/builtins/typed-array-sort.tq",
1981   "src/builtins/typed-array-subarray.tq",
1982   "src/builtins/typed-array-to-reversed.tq",
1983   "src/builtins/typed-array-to-sorted.tq",
1984   "src/builtins/typed-array-values.tq",
1985   "src/builtins/typed-array-with.tq",
1986   "src/builtins/typed-array.tq",
1987   "src/builtins/weak-ref.tq",
1988   "src/ic/handler-configuration.tq",
1989   "src/objects/allocation-site.tq",
1990   "src/objects/api-callbacks.tq",
1991   "src/objects/arguments.tq",
1992   "src/objects/bigint.tq",
1993   "src/objects/call-site-info.tq",
1994   "src/objects/cell.tq",
1995   "src/objects/bytecode-array.tq",
1996   "src/objects/contexts.tq",
1997   "src/objects/data-handler.tq",
1998   "src/objects/debug-objects.tq",
1999   "src/objects/descriptor-array.tq",
2000   "src/objects/embedder-data-array.tq",
2001   "src/objects/feedback-cell.tq",
2002   "src/objects/feedback-vector.tq",
2003   "src/objects/fixed-array.tq",
2004   "src/objects/foreign.tq",
2005   "src/objects/free-space.tq",
2006   "src/objects/heap-number.tq",
2007   "src/objects/heap-object.tq",
2008   "src/objects/js-array-buffer.tq",
2009   "src/objects/js-array.tq",
2010   "src/objects/js-atomics-synchronization.tq",
2011   "src/objects/js-collection-iterator.tq",
2012   "src/objects/js-collection.tq",
2013   "src/objects/js-function.tq",
2014   "src/objects/js-generator.tq",
2015   "src/objects/js-iterator-helpers.tq",
2016   "src/objects/js-objects.tq",
2017   "src/objects/js-promise.tq",
2018   "src/objects/js-proxy.tq",
2019   "src/objects/js-raw-json.tq",
2020   "src/objects/js-regexp-string-iterator.tq",
2021   "src/objects/js-regexp.tq",
2022   "src/objects/js-shadow-realm.tq",
2023   "src/objects/js-shared-array.tq",
2024   "src/objects/js-struct.tq",
2025   "src/objects/js-temporal-objects.tq",
2026   "src/objects/js-weak-refs.tq",
2027   "src/objects/literal-objects.tq",
2028   "src/objects/map.tq",
2029   "src/objects/megadom-handler.tq",
2030   "src/objects/microtask.tq",
2031   "src/objects/module.tq",
2032   "src/objects/name.tq",
2033   "src/objects/oddball.tq",
2034   "src/objects/hole.tq",
2035   "src/objects/trusted-object.tq",
2036   "src/objects/ordered-hash-table.tq",
2037   "src/objects/primitive-heap-object.tq",
2038   "src/objects/promise.tq",
2039   "src/objects/property-array.tq",
2040   "src/objects/property-cell.tq",
2041   "src/objects/property-descriptor-object.tq",
2042   "src/objects/prototype-info.tq",
2043   "src/objects/regexp-match-info.tq",
2044   "src/objects/scope-info.tq",
2045   "src/objects/script.tq",
2046   "src/objects/shared-function-info.tq",
2047   "src/objects/source-text-module.tq",
2048   "src/objects/string.tq",
2049   "src/objects/struct.tq",
2050   "src/objects/swiss-hash-table-helpers.tq",
2051   "src/objects/swiss-name-dictionary.tq",
2052   "src/objects/synthetic-module.tq",
2053   "src/objects/template-objects.tq",
2054   "src/objects/templates.tq",
2055   "src/objects/torque-defined-classes.tq",
2056   "src/objects/turbofan-types.tq",
2057   "src/objects/turboshaft-types.tq",
2058   "test/torque/test-torque.tq",
2059   "third_party/v8/builtins/array-sort.tq",
2060 ]
2061
2062 if (v8_enable_i18n_support) {
2063   torque_files += [
2064     "src/objects/intl-objects.tq",
2065     "src/objects/js-break-iterator.tq",
2066     "src/objects/js-collator.tq",
2067     "src/objects/js-date-time-format.tq",
2068     "src/objects/js-display-names.tq",
2069     "src/objects/js-duration-format.tq",
2070     "src/objects/js-list-format.tq",
2071     "src/objects/js-locale.tq",
2072     "src/objects/js-number-format.tq",
2073     "src/objects/js-plural-rules.tq",
2074     "src/objects/js-relative-time-format.tq",
2075     "src/objects/js-segment-iterator.tq",
2076     "src/objects/js-segmenter.tq",
2077     "src/objects/js-segments.tq",
2078   ]
2079 }
2080
2081 if (v8_enable_webassembly) {
2082   torque_files += [
2083     "src/builtins/js-to-wasm.tq",
2084     "src/builtins/wasm.tq",
2085     "src/builtins/wasm-strings.tq",
2086     "src/builtins/wasm-to-js.tq",
2087     "src/debug/debug-wasm-objects.tq",
2088     "src/wasm/wasm-objects.tq",
2089   ]
2090 }
2091
2092 # Template for running torque
2093 # When building with v8_verify_torque_generation_invariance=true we need
2094 # to be able to run torque for both 32 and 64 bits in the same build
2095 template("run_torque") {
2096   if (target_name == "") {
2097     suffix = ""
2098   } else {
2099     suffix = "_$target_name"
2100   }
2101
2102   toolchain = invoker.toolchain
2103
2104   action("run_torque" + suffix) {
2105     visibility = [
2106       ":*",
2107       "test/cctest/:*",
2108       "tools/debug_helper/:*",
2109       "tools/gcmole/:*",
2110     ]
2111
2112     deps = [ ":torque($toolchain)" ]
2113
2114     script = "tools/run.py"
2115
2116     sources = torque_files
2117
2118     destination_folder = "$target_gen_dir/torque-generated$suffix"
2119
2120     outputs = [
2121       "$destination_folder/bit-fields.h",
2122       "$destination_folder/builtin-definitions.h",
2123       "$destination_folder/class-debug-readers.cc",
2124       "$destination_folder/class-debug-readers.h",
2125       "$destination_folder/class-forward-declarations.h",
2126       "$destination_folder/class-verifiers.cc",
2127       "$destination_folder/class-verifiers.h",
2128       "$destination_folder/csa-types.h",
2129       "$destination_folder/debug-macros.cc",
2130       "$destination_folder/debug-macros.h",
2131       "$destination_folder/enum-verifiers.cc",
2132       "$destination_folder/exported-macros-assembler.cc",
2133       "$destination_folder/exported-macros-assembler.h",
2134       "$destination_folder/factory.cc",
2135       "$destination_folder/factory.inc",
2136       "$destination_folder/instance-types.h",
2137       "$destination_folder/interface-descriptors.inc",
2138       "$destination_folder/objects-body-descriptors-inl.inc",
2139       "$destination_folder/objects-printer.cc",
2140       "$destination_folder/visitor-lists.h",
2141     ]
2142
2143     foreach(file, torque_files) {
2144       filetq = string_replace(file, ".tq", "-tq")
2145       outputs += [
2146         "$destination_folder/$filetq-csa.cc",
2147         "$destination_folder/$filetq-csa.h",
2148         "$destination_folder/$filetq-inl.inc",
2149         "$destination_folder/$filetq.cc",
2150         "$destination_folder/$filetq.inc",
2151       ]
2152     }
2153
2154     args = [
2155       "./" + rebase_path(
2156               get_label_info(":torque($toolchain)", "root_out_dir") + "/torque",
2157               root_build_dir),
2158       "-o",
2159       rebase_path("$destination_folder", root_build_dir),
2160       "-v8-root",
2161       rebase_path(".", root_build_dir),
2162     ]
2163     if (v8_annotate_torque_ir) {
2164       args += [ "-annotate-ir" ]
2165     }
2166     if (defined(invoker.args)) {
2167       args += invoker.args
2168     }
2169     args += torque_files
2170   }
2171 }
2172
2173 # Default run_torque action
2174 run_torque("") {
2175   toolchain = v8_generator_toolchain
2176 }
2177
2178 if (v8_verify_torque_generation_invariance) {
2179   run_torque("x86") {
2180     toolchain = "//build/toolchain/linux:clang_x86"
2181   }
2182
2183   run_torque("x64") {
2184     args = [ "-m32" ]
2185     toolchain = "//build/toolchain/linux:clang_x64"
2186   }
2187
2188   action("compare_torque_runs") {
2189     deps = [
2190       ":run_torque_x64",
2191       ":run_torque_x86",
2192     ]
2193     report_file = "$target_gen_dir/torque_comparison_results.txt"
2194     script = "tools/compare_torque_output.py"
2195     args = [
2196       rebase_path("$target_gen_dir/torque-generated_x64", root_build_dir),
2197       rebase_path("$target_gen_dir/torque-generated_x86", root_build_dir),
2198       rebase_path(report_file, root_build_dir),
2199     ]
2200     outputs = [ report_file ]
2201   }
2202 }
2203
2204 group("v8_maybe_icu") {
2205   if (v8_enable_i18n_support) {
2206     public_deps = [ v8_icu_path ]
2207   }
2208 }
2209
2210 group("v8_abseil") {
2211   public_deps = [ "//third_party/abseil-cpp:absl" ]
2212
2213   public_configs = [
2214     "//third_party/abseil-cpp:absl_define_config",
2215     "//third_party/abseil-cpp:absl_include_config",
2216   ]
2217 }
2218
2219 v8_header_set("torque_runtime_support") {
2220   visibility = [ ":*" ]
2221
2222   sources = [ "src/torque/runtime-support.h" ]
2223
2224   configs = [ ":internal_config" ]
2225 }
2226
2227 v8_source_set("torque_generated_initializers") {
2228   visibility = [ ":*" ]  # Only targets in this file can depend on this.
2229
2230   deps = [
2231     ":generate_bytecode_builtins_list",
2232     ":run_torque",
2233     ":v8_base_without_compiler",
2234     ":v8_tracing",
2235   ]
2236
2237   public_deps = [
2238     ":torque_runtime_support",
2239     ":v8_abseil",
2240     ":v8_maybe_icu",
2241   ]
2242
2243   sources = [
2244     "$target_gen_dir/torque-generated/csa-types.h",
2245     "$target_gen_dir/torque-generated/enum-verifiers.cc",
2246     "$target_gen_dir/torque-generated/exported-macros-assembler.cc",
2247     "$target_gen_dir/torque-generated/exported-macros-assembler.h",
2248   ]
2249   foreach(file, torque_files) {
2250     filetq = string_replace(file, ".tq", "-tq")
2251     sources += [
2252       "$target_gen_dir/torque-generated/$filetq-csa.cc",
2253       "$target_gen_dir/torque-generated/$filetq-csa.h",
2254     ]
2255   }
2256
2257   configs = [ ":internal_config" ]
2258
2259   if (v8_symbol_level > 1) {
2260     # Symbols cause huge compile time on some bigger torque files, see
2261     # https://crbug.com/1472715. Thus remove any symbol configs added in v8.gni
2262     # and instead add the "minimal_symbols" config.
2263     v8_add_configs -=
2264         filter_include(v8_add_configs, [ "//build/config/compiler:*symbols" ])
2265     if (v8_symbol_level == symbol_level) {
2266       v8_remove_configs += [ "//build/config/compiler:default_symbols" ]
2267     }
2268     configs += [ "//build/config/compiler:minimal_symbols" ]
2269   }
2270 }
2271
2272 v8_source_set("torque_generated_definitions") {
2273   visibility = [ ":*" ]  # Only targets in this file can depend on this.
2274
2275   deps = [
2276     ":generate_bytecode_builtins_list",
2277     ":run_torque",
2278     ":v8_internal_headers",
2279     ":v8_libbase",
2280     ":v8_tracing",
2281   ]
2282
2283   public_deps = [
2284     ":v8_abseil",
2285     ":v8_maybe_icu",
2286   ]
2287
2288   sources = [
2289     "$target_gen_dir/torque-generated/class-forward-declarations.h",
2290     "$target_gen_dir/torque-generated/class-verifiers.cc",
2291     "$target_gen_dir/torque-generated/class-verifiers.h",
2292     "$target_gen_dir/torque-generated/factory.cc",
2293     "$target_gen_dir/torque-generated/objects-printer.cc",
2294   ]
2295   foreach(file, torque_files) {
2296     filetq = string_replace(file, ".tq", "-tq")
2297     sources += [
2298       "$target_gen_dir/torque-generated/$filetq-inl.inc",
2299       "$target_gen_dir/torque-generated/$filetq.cc",
2300       "$target_gen_dir/torque-generated/$filetq.inc",
2301     ]
2302   }
2303
2304   configs = [ ":internal_config" ]
2305 }
2306
2307 action("generate_bytecode_builtins_list") {
2308   script = "tools/run.py"
2309   outputs = [ "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h" ]
2310   deps = [ ":bytecode_builtins_list_generator($v8_generator_toolchain)" ]
2311   args = [
2312     "./" + rebase_path(
2313             get_label_info(
2314                     ":bytecode_builtins_list_generator($v8_generator_toolchain)",
2315                     "root_out_dir") + "/bytecode_builtins_list_generator",
2316             root_build_dir),
2317     rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
2318                 root_build_dir),
2319   ]
2320 }
2321
2322 # Template to generate different V8 snapshots based on different runtime flags.
2323 # Can be invoked with run_mksnapshot(<name>). The target will resolve to
2324 # run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
2325 # Otherwise files are suffixed, e.g. embedded_<name>.S and
2326 # snapshot_blob_<name>.bin.
2327 #
2328 # The template exposes the variables:
2329 #   args: additional flags for mksnapshots
2330 #   embedded_suffix: a camel case suffix for method names in the embedded
2331 #       snapshot.
2332 template("run_mksnapshot") {
2333   name = target_name
2334   if (name == "default") {
2335     suffix = ""
2336   } else {
2337     suffix = "_$name"
2338   }
2339   action("run_mksnapshot_" + name) {
2340     deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
2341
2342     script = "tools/run.py"
2343
2344     sources = []
2345
2346     outputs = []
2347
2348     data = []
2349
2350     args = [
2351       "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
2352                                         "root_out_dir") + "/mksnapshot",
2353                          root_build_dir),
2354       "--turbo_instruction_scheduling",
2355
2356       # In cross builds, the snapshot may be generated for both the host and
2357       # target toolchains.  The same host binary is used to generate both, so
2358       # mksnapshot needs to know which target OS to use at runtime.  It's weird,
2359       # but the target OS is really |current_os|.
2360       "--target_os=$current_os",
2361       "--target_arch=$current_cpu",
2362
2363       "--embedded_src",
2364       rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
2365     ]
2366
2367     if (v8_log_builtins_block_count_input != "") {
2368       args += [
2369         "--trace-turbo",
2370
2371         "--turbo-log-builtins-count-input",
2372         v8_log_builtins_block_count_input,
2373       ]
2374     }
2375
2376     if (v8_enable_builtins_profiling) {
2377       args += [ "--turbo-profiling" ]
2378     }
2379     if (v8_enable_builtins_profiling_verbose) {
2380       args += [ "--turbo-profiling-verbose" ]
2381     }
2382     if (v8_builtins_profiling_log_file != "") {
2383       sources += [ v8_builtins_profiling_log_file ]
2384       args += [
2385         "--turbo-profiling-input",
2386         rebase_path(v8_builtins_profiling_log_file, root_build_dir),
2387
2388         # Replace this with --warn-about-builtin-profile-data to see the full
2389         # list of builtins with incompatible profiles.
2390         "--abort-on-bad-builtin-profile-data",
2391       ]
2392
2393       if (!v8_enable_builtins_profiling && v8_enable_builtins_reordering) {
2394         args += [ "--reorder-builtins" ]
2395       }
2396     }
2397
2398     # This is needed to distinguish between generating code for the simulator
2399     # and cross-compiling. The latter may need to run code on the host with the
2400     # simulator but cannot use simulator-specific instructions.
2401     if (target_is_simulator) {
2402       args += [ "--target_is_simulator" ]
2403     }
2404
2405     args += invoker.args
2406
2407     outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
2408     if (invoker.embedded_variant != "") {
2409       args += [
2410         "--embedded_variant",
2411         invoker.embedded_variant,
2412       ]
2413     }
2414
2415     if (v8_random_seed != "0") {
2416       args += [
2417         "--random-seed",
2418         v8_random_seed,
2419       ]
2420     }
2421
2422     if (v8_os_page_size != "0") {
2423       args += [
2424         "--v8_os_page_size",
2425         v8_os_page_size,
2426       ]
2427     }
2428
2429     if (v8_use_external_startup_data) {
2430       outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
2431       data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
2432       args += [
2433         "--startup_blob",
2434         rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
2435       ]
2436     } else {
2437       outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
2438       args += [
2439         "--startup_src",
2440         rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
2441       ]
2442     }
2443
2444     if (v8_embed_script != "") {
2445       sources += [ v8_embed_script ]
2446       args += [ rebase_path(v8_embed_script, root_build_dir) ]
2447     }
2448
2449     if (v8_enable_snapshot_code_comments) {
2450       args += [ "--code-comments" ]
2451     }
2452
2453     if (v8_enable_snapshot_native_code_counters) {
2454       args += [ "--native-code-counters" ]
2455     } else {
2456       # --native-code-counters is the default in debug mode so make sure we can
2457       # unset it.
2458       args += [ "--no-native-code-counters" ]
2459     }
2460
2461     if (v8_enable_fast_mksnapshot) {
2462       args += [ "--no-turbo-verify-allocation" ]
2463
2464       if (v8_current_cpu == "x86" || v8_current_cpu == "x64") {
2465         args += [ "--no-turbo-rewrite-far-jumps" ]
2466       }
2467
2468       if (v8_enable_debugging_features && v8_enable_slow_dchecks) {
2469         # mksnapshot only accepts this flag if ENABLE_SLOW_DCHECKS is defined.
2470         args += [ "--no-enable-slow-asserts" ]
2471       }
2472     }
2473
2474     if (v8_enable_verify_heap) {
2475       args += [ "--verify-heap" ]
2476     }
2477   }
2478 }
2479
2480 run_mksnapshot("default") {
2481   args = []
2482   embedded_variant = "Default"
2483 }
2484 if (emit_builtins_as_inline_asm) {
2485   asm_to_inline_asm("default") {
2486     args = []
2487   }
2488 }
2489
2490 if (v8_verify_deterministic_mksnapshot) {
2491   runs = [
2492     "run_0",
2493     "run_1",
2494     "run_2",
2495     "run_3",
2496     "run_4",
2497     "run_5",
2498     "run_6",
2499   ]
2500
2501   foreach(i, runs) {
2502     run_mksnapshot(i) {
2503       args = []
2504       embedded_variant = "Default"
2505     }
2506   }
2507
2508   action("verify_deterministic_mksnapshot") {
2509     deps = []
2510     foreach(i, runs) {
2511       deps += [ ":run_mksnapshot_$i" ]
2512     }
2513     report_file = "$target_gen_dir/mksnapshot_comparison.txt"
2514     script = "tools/snapshot/compare_mksnapshot_output.py"
2515     args = [
2516       rebase_path("$report_file", root_build_dir),
2517       rebase_path("$target_gen_dir", root_build_dir),
2518       rebase_path("$root_out_dir", root_build_dir),
2519       "7",  # Length of the 'runs' list.
2520     ]
2521     outputs = [ report_file ]
2522   }
2523 }
2524
2525 if (v8_verify_builtins_compatibility) {
2526   # This specifies a separate mksnapshot target for each of:
2527   # x86, x64, arm, arm64.
2528   hashes = "builtins_hashes_$v8_current_cpu"
2529   run_mksnapshot("dump_$v8_current_cpu") {
2530     args = [
2531       "--dump-builtins-hashes-to-file",
2532       hashes,
2533     ]
2534     embedded_variant = "Default"
2535   }
2536
2537   # This template defines a comparison action for the architecture the pgo
2538   # profile is made for (e.g. x64) and the architecture the profile is used
2539   # for (e.g. arm64 with toolchain x64_v8_arm64).
2540   template("verify_builtins_hashes") {
2541     forward_variables_from(invoker,
2542                            [
2543                              "profile_arch",
2544                              "target_arch",
2545                            ])
2546     profile_toolchain = "//build/toolchain/linux:clang_${profile_arch}"
2547     target_toolchain =
2548         "//build/toolchain/linux:clang_${profile_arch}_v8_${target_arch}"
2549     action("compare_builtins_$target_name") {
2550       deps = [
2551         ":run_mksnapshot_dump_${profile_arch}($profile_toolchain)",
2552         ":run_mksnapshot_dump_${target_arch}($target_toolchain)",
2553       ]
2554       report_file = "$root_build_dir/builtins_comparison_$target_name"
2555       script = "tools/builtins-pgo/assert_builtins_hashes.py"
2556       args = [
2557         "builtins_hashes_${profile_arch}",
2558         "builtins_hashes_${target_arch}",
2559         rebase_path(report_file, root_build_dir),
2560       ]
2561       outputs = [ report_file ]
2562     }
2563   }
2564
2565   verify_builtins_hashes("x86_arm") {
2566     profile_arch = "x86"
2567     target_arch = "arm"
2568   }
2569
2570   verify_builtins_hashes("x64_arm64") {
2571     profile_arch = "x64"
2572     target_arch = "arm64"
2573   }
2574
2575   group("verify_all_builtins_hashes") {
2576     deps = [
2577       ":compare_builtins_x64_arm64",
2578       ":compare_builtins_x86_arm",
2579     ]
2580   }
2581 }
2582
2583 action("v8_dump_build_config") {
2584   script = "tools/testrunner/utils/dump_build_config.py"
2585   outputs = [ "$root_out_dir/v8_build_config.json" ]
2586   is_DEBUG_defined = v8_enable_debugging_features || dcheck_always_on
2587   is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
2588
2589   arch = v8_target_cpu
2590   if (v8_target_cpu == "x86") {
2591     arch = "ia32"
2592   }
2593
2594   mips_arch_variant_var = ""
2595   mips_use_msa_var = false
2596   if (arch == "mips64" || arch == "mips64el") {
2597     mips_arch_variant_var = mips_arch_variant
2598     mips_use_msa_var = mips_use_msa
2599   }
2600
2601   js_shared_memory =
2602       v8_enable_shared_ro_heap && (!v8_enable_pointer_compression ||
2603                                    v8_enable_pointer_compression_shared_cage) &&
2604       !v8_disable_write_barriers
2605   simd_mips = mips_arch_variant_var == "r6" && mips_use_msa
2606   simulator_run = target_cpu != v8_target_cpu
2607   use_sanitizer = is_asan || is_cfi || is_msan || is_tsan || is_ubsan
2608
2609   # This lists all build-time switches consumed by the test framework. All
2610   # switches can be used automatically in the status files as is - no
2611   # further files need to be modified.
2612   #
2613   # Naming conventions: Keep switch names short and remove unnecessary
2614   # qualifiers. Drop v8_enable_, v8_, is_ where possible.
2615   # Keep only qualifiers that disambiguate the switches from other things.
2616   # Examples: has_turbofan disambiguates from the turbofan runtime variant,
2617   # is_android disambiguates from the android keyword in status files,
2618   # v8_cfi disambiguates from the global cfi flag.
2619   args = [
2620     rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
2621     "arch=\"$arch\"",
2622     "asan=$is_asan",
2623     "atomic_object_field_writes=$v8_enable_atomic_object_field_writes",
2624     "cet_shadow_stack=$v8_enable_cet_shadow_stack",
2625     "cfi=$is_cfi",
2626     "clang=$is_clang",
2627     "clang_coverage=$use_clang_coverage",
2628     "code_comments=$v8_code_comments",
2629     "component_build=$is_component_build",
2630     "concurrent_marking=$v8_enable_concurrent_marking",
2631     "conservative_stack_scanning=$v8_enable_conservative_stack_scanning",
2632     "current_cpu=\"$current_cpu\"",
2633     "dcheck_always_on=$dcheck_always_on",
2634     "debug_code=$v8_enable_debug_code",
2635     "DEBUG_defined=$is_DEBUG_defined",
2636     "debugging_features=$v8_enable_debugging_features",
2637     "dict_property_const_tracking=$v8_dict_property_const_tracking",
2638     "direct_handle=$v8_enable_direct_handle",
2639     "direct_local=$v8_enable_direct_local",
2640     "disassembler=$v8_enable_disassembler",
2641     "full_debug=$is_full_debug",
2642     "gdbjit=$v8_enable_gdbjit",
2643     "has_jitless=$v8_jitless",
2644     "has_maglev=$v8_enable_maglev",
2645     "has_turbofan=$v8_enable_turbofan",
2646     "has_webassembly=$v8_enable_webassembly",
2647     "i18n=$v8_enable_i18n_support",
2648     "is_android=$is_android",
2649     "is_ios=$is_ios",
2650     "js_shared_memory=$js_shared_memory",
2651     "lite_mode=$v8_enable_lite_mode",
2652     "local_off_stack_check=$v8_enable_local_off_stack_check",
2653     "mips_arch_variant=\"$mips_arch_variant_var\"",
2654     "mips_use_msa=$mips_use_msa_var",
2655     "msan=$is_msan",
2656     "official_build=$is_official_build",
2657     "pointer_compression=$v8_enable_pointer_compression",
2658     "pointer_compression_shared_cage=$v8_enable_pointer_compression_shared_cage",
2659     "runtime_call_stats=$v8_enable_runtime_call_stats",
2660     "sandbox=$v8_enable_sandbox",
2661     "shared_ro_heap=$v8_enable_shared_ro_heap",
2662     "simd_mips=$simd_mips",
2663     "simulator_run=$simulator_run",
2664     "single_generation=$v8_enable_single_generation",
2665     "slow_dchecks=$v8_enable_slow_dchecks",
2666     "target_cpu=\"$target_cpu\"",
2667     "third_party_heap=$v8_enable_third_party_heap",
2668     "tsan=$is_tsan",
2669     "ubsan=$is_ubsan",
2670     "use_sanitizer=$use_sanitizer",
2671     "v8_cfi=$v8_control_flow_integrity",
2672     "v8_current_cpu=\"$v8_current_cpu\"",
2673     "v8_target_cpu=\"$v8_target_cpu\"",
2674     "verify_csa=$v8_enable_verify_csa",
2675     "verify_heap=$v8_enable_verify_heap",
2676     "verify_predictable=$v8_enable_verify_predictable",
2677   ]
2678 }
2679
2680 ###############################################################################
2681 # Source Sets (aka static libraries)
2682 #
2683
2684 v8_source_set("v8_snapshot") {
2685   # Let external targets depend on v8_snapshot.
2686   if (v8_use_external_startup_data) {
2687     visibility = [ ":*" ]  # Targets in this file can depend on this.
2688   }
2689
2690   deps = [
2691     ":v8_internal_headers",
2692     ":v8_libbase",
2693     ":v8_tracing",
2694   ]
2695   public_deps = [
2696     # This should be public so downstream targets can declare the snapshot
2697     # output file as their inputs.
2698     ":run_mksnapshot_default",
2699   ]
2700
2701   # Do not publicize any header to remove build dependency.
2702   public = []
2703
2704   sources = [ "src/init/setup-isolate-deserialize.cc" ]
2705   if (v8_control_flow_integrity) {
2706     sources += [ "src/deoptimizer/deoptimizer-cfi-builtins.cc" ]
2707   }
2708   if (emit_builtins_as_inline_asm) {
2709     deps += [ ":asm_to_inline_asm_default" ]
2710     sources += [ "$target_gen_dir/embedded.cc" ]
2711   } else {
2712     sources += [ "$target_gen_dir/embedded.S" ]
2713   }
2714
2715   configs = [ ":internal_config" ]
2716
2717   if (v8_use_external_startup_data) {
2718     deps += [ ":v8_base" ]
2719
2720     sources += [ "src/snapshot/snapshot-external.cc" ]
2721   } else {
2722     public_deps += [
2723       ":v8_abseil",
2724       ":v8_maybe_icu",
2725     ]
2726
2727     sources += [ "$target_gen_dir/snapshot.cc" ]
2728   }
2729 }
2730
2731 v8_source_set("v8_initializers") {
2732   visibility = [
2733     ":*",
2734     "test/cctest:*",
2735   ]
2736
2737   allow_circular_includes_from = [ ":torque_generated_initializers" ]
2738
2739   deps = [
2740     ":torque_generated_initializers",
2741     ":v8_base_without_compiler",
2742     ":v8_shared_internal_headers",
2743     ":v8_tracing",
2744   ]
2745
2746   sources = [
2747     ### gcmole(all) ###
2748     "src/builtins/builtins-array-gen.cc",
2749     "src/builtins/builtins-array-gen.h",
2750     "src/builtins/builtins-async-function-gen.cc",
2751     "src/builtins/builtins-async-gen.cc",
2752     "src/builtins/builtins-async-gen.h",
2753     "src/builtins/builtins-async-generator-gen.cc",
2754     "src/builtins/builtins-async-iterator-gen.cc",
2755     "src/builtins/builtins-bigint-gen.cc",
2756     "src/builtins/builtins-bigint-gen.h",
2757     "src/builtins/builtins-call-gen.cc",
2758     "src/builtins/builtins-call-gen.h",
2759     "src/builtins/builtins-collections-gen.cc",
2760     "src/builtins/builtins-collections-gen.h",
2761     "src/builtins/builtins-constructor-gen.cc",
2762     "src/builtins/builtins-constructor-gen.h",
2763     "src/builtins/builtins-constructor.h",
2764     "src/builtins/builtins-conversion-gen.cc",
2765     "src/builtins/builtins-data-view-gen.h",
2766     "src/builtins/builtins-date-gen.cc",
2767     "src/builtins/builtins-generator-gen.cc",
2768     "src/builtins/builtins-global-gen.cc",
2769     "src/builtins/builtins-handler-gen.cc",
2770     "src/builtins/builtins-ic-gen.cc",
2771     "src/builtins/builtins-internal-gen.cc",
2772     "src/builtins/builtins-interpreter-gen.cc",
2773     "src/builtins/builtins-intl-gen.cc",
2774     "src/builtins/builtins-iterator-gen.cc",
2775     "src/builtins/builtins-iterator-gen.h",
2776     "src/builtins/builtins-lazy-gen.cc",
2777     "src/builtins/builtins-lazy-gen.h",
2778     "src/builtins/builtins-microtask-queue-gen.cc",
2779     "src/builtins/builtins-number-gen.cc",
2780     "src/builtins/builtins-object-gen.cc",
2781     "src/builtins/builtins-object-gen.h",
2782     "src/builtins/builtins-promise-gen.cc",
2783     "src/builtins/builtins-promise-gen.h",
2784     "src/builtins/builtins-proxy-gen.cc",
2785     "src/builtins/builtins-proxy-gen.h",
2786     "src/builtins/builtins-regexp-gen.cc",
2787     "src/builtins/builtins-regexp-gen.h",
2788     "src/builtins/builtins-shadow-realm-gen.cc",
2789     "src/builtins/builtins-sharedarraybuffer-gen.cc",
2790     "src/builtins/builtins-string-gen.cc",
2791     "src/builtins/builtins-string-gen.h",
2792     "src/builtins/builtins-temporal-gen.cc",
2793     "src/builtins/builtins-typed-array-gen.cc",
2794     "src/builtins/builtins-typed-array-gen.h",
2795     "src/builtins/builtins-utils-gen.h",
2796     "src/builtins/growable-fixed-array-gen.cc",
2797     "src/builtins/growable-fixed-array-gen.h",
2798     "src/builtins/profile-data-reader.cc",
2799     "src/builtins/profile-data-reader.h",
2800     "src/builtins/setup-builtins-internal.cc",
2801     "src/builtins/torque-csa-header-includes.h",
2802     "src/codegen/code-stub-assembler.cc",
2803     "src/codegen/code-stub-assembler.h",
2804     "src/heap/setup-heap-internal.cc",
2805     "src/ic/accessor-assembler.cc",
2806     "src/ic/accessor-assembler.h",
2807     "src/ic/binary-op-assembler.cc",
2808     "src/ic/binary-op-assembler.h",
2809     "src/ic/keyed-store-generic.cc",
2810     "src/ic/keyed-store-generic.h",
2811     "src/ic/unary-op-assembler.cc",
2812     "src/ic/unary-op-assembler.h",
2813     "src/interpreter/interpreter-assembler.cc",
2814     "src/interpreter/interpreter-assembler.h",
2815     "src/interpreter/interpreter-generator.cc",
2816     "src/interpreter/interpreter-generator.h",
2817     "src/interpreter/interpreter-intrinsics-generator.cc",
2818     "src/interpreter/interpreter-intrinsics-generator.h",
2819     "src/numbers/integer-literal-inl.h",
2820     "src/numbers/integer-literal.h",
2821   ]
2822
2823   if (v8_enable_webassembly) {
2824     sources += [
2825       "src/builtins/builtins-wasm-gen.cc",
2826       "src/builtins/builtins-wasm-gen.h",
2827     ]
2828   }
2829
2830   if (v8_current_cpu == "x86") {
2831     sources += [
2832       ### gcmole(ia32) ###
2833       "src/builtins/ia32/builtins-ia32.cc",
2834     ]
2835   } else if (v8_current_cpu == "x64") {
2836     sources += [
2837       ### gcmole(x64) ###
2838       "src/builtins/x64/builtins-x64.cc",
2839     ]
2840   } else if (v8_current_cpu == "arm") {
2841     sources += [
2842       ### gcmole(arm) ###
2843       "src/builtins/arm/builtins-arm.cc",
2844     ]
2845   } else if (v8_current_cpu == "arm64") {
2846     sources += [
2847       ### gcmole(arm64) ###
2848       "src/builtins/arm64/builtins-arm64.cc",
2849     ]
2850   } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
2851     sources += [
2852       ### gcmole(mips64el) ###
2853       "src/builtins/mips64/builtins-mips64.cc",
2854     ]
2855   } else if (v8_current_cpu == "loong64") {
2856     sources += [
2857       ### gcmole(loong64) ###
2858       "src/builtins/loong64/builtins-loong64.cc",
2859     ]
2860   } else if (v8_current_cpu == "ppc") {
2861     sources += [
2862       ### gcmole(ppc) ###
2863       "src/builtins/ppc/builtins-ppc.cc",
2864     ]
2865   } else if (v8_current_cpu == "ppc64") {
2866     sources += [
2867       ### gcmole(ppc64) ###
2868       "src/builtins/ppc/builtins-ppc.cc",
2869     ]
2870   } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
2871     sources += [
2872       ### gcmole(s390) ###
2873       "src/builtins/s390/builtins-s390.cc",
2874     ]
2875   } else if (v8_current_cpu == "riscv64") {
2876     sources += [
2877       ### gcmole(riscv64) ###
2878       "src/builtins/riscv/builtins-riscv.cc",
2879     ]
2880   } else if (v8_current_cpu == "riscv32") {
2881     sources += [
2882       ### gcmole(riscv32) ###
2883       "src/builtins/riscv/builtins-riscv.cc",
2884     ]
2885   }
2886
2887   if (!v8_enable_i18n_support) {
2888     sources -= [ "src/builtins/builtins-intl-gen.cc" ]
2889   }
2890
2891   configs = [ ":internal_config" ]
2892 }
2893
2894 v8_source_set("v8_init") {
2895   visibility = [ ":*" ]  # Only targets in this file can depend on this.
2896
2897   deps = [
2898     ":v8_base_without_compiler",
2899     ":v8_initializers",
2900     ":v8_tracing",
2901   ]
2902
2903   sources = [
2904     ### gcmole(all) ###
2905     "src/init/setup-isolate-full.cc",
2906   ]
2907
2908   public_deps = [
2909     ":v8_abseil",
2910     ":v8_maybe_icu",
2911   ]
2912
2913   configs = [ ":internal_config" ]
2914 }
2915
2916 # This is split out to be a non-code containing target that the Chromium browser
2917 # DLL can depend upon to get only a version string.
2918 v8_header_set("v8_version") {
2919   configs = [ ":internal_config" ]
2920
2921   sources = [
2922     "include/v8-value-serializer-version.h",
2923     "include/v8-version-string.h",
2924     "include/v8-version.h",
2925   ]
2926 }
2927
2928 v8_header_set("v8_config_headers") {
2929   configs = [ ":internal_config" ]
2930
2931   sources = [
2932     "include/v8-platform.h",
2933     "include/v8-source-location.h",
2934     "include/v8config.h",
2935   ]
2936
2937   deps = []
2938
2939   if (v8_generate_external_defines_header) {
2940     sources += [ "$target_gen_dir/include/v8-gn.h" ]
2941     deps += [ ":gen_v8_gn" ]
2942   }
2943 }
2944
2945 # This is split out to be a non-code containing target that the Chromium browser
2946 # can depend upon to get basic v8 types.
2947 v8_header_set("v8_headers") {
2948   configs = [ ":internal_config" ]
2949   public_configs = [ ":headers_config" ]
2950
2951   sources = [
2952     "include/v8-array-buffer.h",
2953     "include/v8-callbacks.h",
2954     "include/v8-container.h",
2955     "include/v8-context.h",
2956     "include/v8-cppgc.h",
2957     "include/v8-data.h",
2958     "include/v8-date.h",
2959     "include/v8-debug.h",
2960     "include/v8-embedder-heap.h",
2961     "include/v8-embedder-state-scope.h",
2962     "include/v8-exception.h",
2963     "include/v8-extension.h",
2964     "include/v8-external.h",
2965     "include/v8-fast-api-calls.h",
2966     "include/v8-forward.h",
2967     "include/v8-function-callback.h",
2968     "include/v8-function.h",
2969     "include/v8-handle-base.h",
2970     "include/v8-initialization.h",
2971     "include/v8-internal.h",
2972     "include/v8-isolate.h",
2973     "include/v8-json.h",
2974     "include/v8-local-handle.h",
2975     "include/v8-locker.h",
2976     "include/v8-maybe.h",
2977     "include/v8-memory-span.h",
2978     "include/v8-message.h",
2979     "include/v8-microtask-queue.h",
2980     "include/v8-microtask.h",
2981     "include/v8-object.h",
2982     "include/v8-persistent-handle.h",
2983     "include/v8-primitive-object.h",
2984     "include/v8-primitive.h",
2985     "include/v8-profiler.h",
2986     "include/v8-promise.h",
2987     "include/v8-proxy.h",
2988     "include/v8-regexp.h",
2989     "include/v8-script.h",
2990     "include/v8-snapshot.h",
2991     "include/v8-statistics.h",
2992     "include/v8-template.h",
2993     "include/v8-traced-handle.h",
2994     "include/v8-typed-array.h",
2995     "include/v8-unwinder.h",
2996     "include/v8-util.h",
2997     "include/v8-value-serializer.h",
2998     "include/v8-value.h",
2999     "include/v8-wasm.h",
3000     "include/v8-weak-callback-info.h",
3001     "include/v8.h",
3002   ]
3003
3004   sources += [
3005     # The following headers cannot be platform-specific. The include validation
3006     # of `gn gen $dir --check` requires all header files to be available on all
3007     # platforms.
3008     "include/v8-wasm-trap-handler-posix.h",
3009     "include/v8-wasm-trap-handler-win.h",
3010   ]
3011
3012   public_deps = [ ":v8_config_headers" ]
3013
3014   deps = [
3015     ":cppgc_headers",
3016     ":v8_version",
3017   ]
3018 }
3019
3020 if (v8_generate_external_defines_header) {
3021   action("gen_v8_gn") {
3022     visibility = [ ":*" ]
3023
3024     script = "tools/gen-v8-gn.py"
3025     outputs = [ "$target_gen_dir/include/v8-gn.h" ]
3026
3027     args = [
3028       "-o",
3029       rebase_path("$target_gen_dir/include/v8-gn.h", root_build_dir),
3030     ]
3031     foreach(define, enabled_external_defines) {
3032       args += [
3033         "-p",
3034         define,
3035       ]
3036     }
3037     foreach(define, disabled_external_defines) {
3038       args += [
3039         "-n",
3040         define,
3041       ]
3042     }
3043   }
3044 }
3045
3046 # This is split out to share basic headers with Torque and everything else:(
3047 v8_header_set("v8_shared_internal_headers") {
3048   visibility = [
3049     ":*",
3050     "test/*",
3051     "tools/*",
3052   ]
3053   configs = [ ":internal_config" ]
3054
3055   sources = [
3056     "src/common/globals.h",
3057     "src/wasm/wasm-constants.h",
3058     "src/wasm/wasm-limits.h",
3059   ]
3060
3061   deps = [
3062     ":v8_headers",
3063     ":v8_libbase",
3064   ]
3065 }
3066
3067 v8_header_set("v8_flags") {
3068   visibility = [
3069     ":*",
3070     "tools/*",
3071   ]
3072
3073   configs = [ ":internal_config" ]
3074
3075   sources = [
3076     "src/flags/flag-definitions.h",
3077     "src/flags/flags.h",
3078   ]
3079
3080   deps = [
3081     ":v8_libbase",
3082     ":v8_shared_internal_headers",
3083   ]
3084 }
3085
3086 v8_header_set("v8_internal_headers") {
3087   configs = [ ":internal_config" ]
3088
3089   sources = [
3090     ### gcmole(all) ###
3091     "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
3092     "//base/trace_event/common/trace_event_common.h",
3093     "include/cppgc/common.h",
3094     "include/v8-inspector-protocol.h",
3095     "include/v8-inspector.h",
3096     "include/v8-metrics.h",
3097     "include/v8-unwinder-state.h",
3098     "include/v8-wasm-trap-handler-posix.h",
3099     "src/api/api-arguments-inl.h",
3100     "src/api/api-arguments.h",
3101     "src/api/api-inl.h",
3102     "src/api/api-macros-undef.h",
3103     "src/api/api-macros.h",
3104     "src/api/api-natives.h",
3105     "src/api/api.h",
3106     "src/ast/ast-function-literal-id-reindexer.h",
3107     "src/ast/ast-source-ranges.h",
3108     "src/ast/ast-traversal-visitor.h",
3109     "src/ast/ast-value-factory.h",
3110     "src/ast/ast.h",
3111     "src/ast/modules.h",
3112     "src/ast/prettyprinter.h",
3113     "src/ast/scopes.h",
3114     "src/ast/source-range-ast-visitor.h",
3115     "src/ast/variables.h",
3116     "src/baseline/baseline.h",
3117     "src/baseline/bytecode-offset-iterator.h",
3118     "src/builtins/accessors.h",
3119     "src/builtins/builtins-constructor.h",
3120     "src/builtins/builtins-definitions.h",
3121     "src/builtins/builtins-descriptors.h",
3122     "src/builtins/builtins-promise.h",
3123     "src/builtins/builtins-utils-inl.h",
3124     "src/builtins/builtins-utils.h",
3125     "src/builtins/builtins.h",
3126     "src/builtins/constants-table-builder.h",
3127     "src/builtins/profile-data-reader.h",
3128     "src/codegen/aligned-slot-allocator.h",
3129     "src/codegen/assembler-arch.h",
3130     "src/codegen/assembler-inl.h",
3131     "src/codegen/assembler.h",
3132     "src/codegen/atomic-memory-order.h",
3133     "src/codegen/background-merge-task.h",
3134     "src/codegen/bailout-reason.h",
3135     "src/codegen/callable.h",
3136     "src/codegen/code-comments.h",
3137     "src/codegen/code-desc.h",
3138     "src/codegen/code-factory.h",
3139     "src/codegen/code-reference.h",
3140     "src/codegen/compilation-cache.h",
3141     "src/codegen/compiler.h",
3142     "src/codegen/constant-pool.h",
3143     "src/codegen/constants-arch.h",
3144     "src/codegen/cpu-features.h",
3145     "src/codegen/external-reference-encoder.h",
3146     "src/codegen/external-reference-table.h",
3147     "src/codegen/external-reference.h",
3148     "src/codegen/flush-instruction-cache.h",
3149     "src/codegen/handler-table.h",
3150     "src/codegen/interface-descriptors-inl.h",
3151     "src/codegen/interface-descriptors.h",
3152     "src/codegen/label.h",
3153     "src/codegen/linkage-location.h",
3154     "src/codegen/machine-type.h",
3155     "src/codegen/macro-assembler-base.h",
3156     "src/codegen/macro-assembler-inl.h",
3157     "src/codegen/macro-assembler.h",
3158     "src/codegen/maglev-safepoint-table.h",
3159     "src/codegen/optimized-compilation-info.h",
3160     "src/codegen/pending-optimization-table.h",
3161     "src/codegen/register-arch.h",
3162     "src/codegen/register-base.h",
3163     "src/codegen/register-configuration.h",
3164     "src/codegen/register.h",
3165     "src/codegen/reglist-base.h",
3166     "src/codegen/reglist.h",
3167     "src/codegen/reloc-info-inl.h",
3168     "src/codegen/reloc-info.h",
3169     "src/codegen/safepoint-table-base.h",
3170     "src/codegen/safepoint-table.h",
3171     "src/codegen/script-details.h",
3172     "src/codegen/signature.h",
3173     "src/codegen/source-position-table.h",
3174     "src/codegen/source-position.h",
3175     "src/codegen/tick-counter.h",
3176     "src/codegen/tnode.h",
3177     "src/codegen/unoptimized-compilation-info.h",
3178     "src/common/assert-scope.h",
3179     "src/common/checks.h",
3180     "src/common/code-memory-access-inl.h",
3181     "src/common/code-memory-access.h",
3182     "src/common/high-allocation-throughput-scope.h",
3183     "src/common/message-template.h",
3184     "src/common/operation.h",
3185     "src/common/ptr-compr-inl.h",
3186     "src/common/ptr-compr.h",
3187     "src/compiler-dispatcher/lazy-compile-dispatcher.h",
3188     "src/compiler-dispatcher/optimizing-compile-dispatcher.h",
3189     "src/compiler/access-builder.h",
3190     "src/compiler/access-info.h",
3191     "src/compiler/add-type-assertions-reducer.h",
3192     "src/compiler/all-nodes.h",
3193     "src/compiler/allocation-builder-inl.h",
3194     "src/compiler/allocation-builder.h",
3195     "src/compiler/backend/bitcast-elider.h",
3196     "src/compiler/backend/code-generator-impl.h",
3197     "src/compiler/backend/code-generator.h",
3198     "src/compiler/backend/frame-elider.h",
3199     "src/compiler/backend/gap-resolver.h",
3200     "src/compiler/backend/instruction-codes.h",
3201     "src/compiler/backend/instruction-scheduler.h",
3202     "src/compiler/backend/instruction-selector-adapter.h",
3203     "src/compiler/backend/instruction-selector-impl.h",
3204     "src/compiler/backend/instruction-selector.h",
3205     "src/compiler/backend/instruction.h",
3206     "src/compiler/backend/jump-threading.h",
3207     "src/compiler/backend/mid-tier-register-allocator.h",
3208     "src/compiler/backend/move-optimizer.h",
3209     "src/compiler/backend/register-allocation.h",
3210     "src/compiler/backend/register-allocator-verifier.h",
3211     "src/compiler/backend/register-allocator.h",
3212     "src/compiler/backend/spill-placer.h",
3213     "src/compiler/backend/unwinding-info-writer.h",
3214     "src/compiler/basic-block-instrumentor.h",
3215     "src/compiler/branch-condition-duplicator.h",
3216     "src/compiler/branch-elimination.h",
3217     "src/compiler/bytecode-analysis.h",
3218     "src/compiler/bytecode-graph-builder.h",
3219     "src/compiler/bytecode-liveness-map.h",
3220     "src/compiler/checkpoint-elimination.h",
3221     "src/compiler/code-assembler.h",
3222     "src/compiler/common-node-cache.h",
3223     "src/compiler/common-operator-reducer.h",
3224     "src/compiler/common-operator.h",
3225     "src/compiler/compilation-dependencies.h",
3226     "src/compiler/compiler-source-position-table.h",
3227     "src/compiler/constant-folding-reducer.h",
3228     "src/compiler/control-equivalence.h",
3229     "src/compiler/control-flow-optimizer.h",
3230     "src/compiler/control-path-state.h",
3231     "src/compiler/csa-load-elimination.h",
3232     "src/compiler/dead-code-elimination.h",
3233     "src/compiler/decompression-optimizer.h",
3234     "src/compiler/diamond.h",
3235     "src/compiler/effect-control-linearizer.h",
3236     "src/compiler/escape-analysis-reducer.h",
3237     "src/compiler/escape-analysis.h",
3238     "src/compiler/fast-api-calls.h",
3239     "src/compiler/feedback-source.h",
3240     "src/compiler/frame-states.h",
3241     "src/compiler/frame.h",
3242     "src/compiler/functional-list.h",
3243     "src/compiler/globals.h",
3244     "src/compiler/graph-assembler.h",
3245     "src/compiler/graph-reducer.h",
3246     "src/compiler/graph-trimmer.h",
3247     "src/compiler/graph-visualizer.h",
3248     "src/compiler/graph-zone-traits.h",
3249     "src/compiler/graph.h",
3250     "src/compiler/heap-refs.h",
3251     "src/compiler/js-call-reducer.h",
3252     "src/compiler/js-context-specialization.h",
3253     "src/compiler/js-create-lowering.h",
3254     "src/compiler/js-generic-lowering.h",
3255     "src/compiler/js-graph.h",
3256     "src/compiler/js-heap-broker-inl.h",
3257     "src/compiler/js-heap-broker.h",
3258     "src/compiler/js-inlining-heuristic.h",
3259     "src/compiler/js-inlining.h",
3260     "src/compiler/js-intrinsic-lowering.h",
3261     "src/compiler/js-native-context-specialization.h",
3262     "src/compiler/js-operator.h",
3263     "src/compiler/js-type-hint-lowering.h",
3264     "src/compiler/js-typed-lowering.h",
3265     "src/compiler/late-escape-analysis.h",
3266     "src/compiler/linkage.h",
3267     "src/compiler/load-elimination.h",
3268     "src/compiler/loop-analysis.h",
3269     "src/compiler/loop-peeling.h",
3270     "src/compiler/loop-unrolling.h",
3271     "src/compiler/loop-variable-optimizer.h",
3272     "src/compiler/machine-graph-verifier.h",
3273     "src/compiler/machine-graph.h",
3274     "src/compiler/machine-operator-reducer.h",
3275     "src/compiler/machine-operator.h",
3276     "src/compiler/map-inference.h",
3277     "src/compiler/memory-lowering.h",
3278     "src/compiler/memory-optimizer.h",
3279     "src/compiler/node-aux-data.h",
3280     "src/compiler/node-cache.h",
3281     "src/compiler/node-marker.h",
3282     "src/compiler/node-matchers.h",
3283     "src/compiler/node-observer.h",
3284     "src/compiler/node-origin-table.h",
3285     "src/compiler/node-properties.h",
3286     "src/compiler/node.h",
3287     "src/compiler/opcodes.h",
3288     "src/compiler/operation-typer.h",
3289     "src/compiler/operator-properties.h",
3290     "src/compiler/operator.h",
3291     "src/compiler/osr.h",
3292     "src/compiler/pair-load-store-reducer.h",
3293     "src/compiler/per-isolate-compiler-cache.h",
3294     "src/compiler/persistent-map.h",
3295     "src/compiler/phase.h",
3296     "src/compiler/pipeline-statistics.h",
3297     "src/compiler/pipeline.h",
3298     "src/compiler/processed-feedback.h",
3299     "src/compiler/property-access-builder.h",
3300     "src/compiler/raw-machine-assembler.h",
3301     "src/compiler/redundancy-elimination.h",
3302     "src/compiler/refs-map.h",
3303     "src/compiler/representation-change.h",
3304     "src/compiler/schedule.h",
3305     "src/compiler/scheduler.h",
3306     "src/compiler/select-lowering.h",
3307     "src/compiler/simplified-lowering-verifier.h",
3308     "src/compiler/simplified-lowering.h",
3309     "src/compiler/simplified-operator-reducer.h",
3310     "src/compiler/simplified-operator.h",
3311     "src/compiler/state-values-utils.h",
3312     "src/compiler/store-store-elimination.h",
3313     "src/compiler/string-builder-optimizer.h",
3314     "src/compiler/turbofan.h",
3315     "src/compiler/turboshaft/analyzer-iterator.h",
3316     "src/compiler/turboshaft/assembler.h",
3317     "src/compiler/turboshaft/assert-types-reducer.h",
3318     "src/compiler/turboshaft/branch-elimination-reducer.h",
3319     "src/compiler/turboshaft/build-graph-phase.h",
3320     "src/compiler/turboshaft/builtin-call-descriptors.h",
3321     "src/compiler/turboshaft/dataview-reducer.h",
3322     "src/compiler/turboshaft/dead-code-elimination-phase.h",
3323     "src/compiler/turboshaft/dead-code-elimination-reducer.h",
3324     "src/compiler/turboshaft/debug-feature-lowering-phase.h",
3325     "src/compiler/turboshaft/debug-feature-lowering-reducer.h",
3326     "src/compiler/turboshaft/decompression-optimization-phase.h",
3327     "src/compiler/turboshaft/decompression-optimization.h",
3328     "src/compiler/turboshaft/define-assembler-macros.inc",
3329     "src/compiler/turboshaft/deopt-data.h",
3330     "src/compiler/turboshaft/doubly-threaded-list.h",
3331     "src/compiler/turboshaft/explicit-truncation-reducer.h",
3332     "src/compiler/turboshaft/fast-api-call-reducer.h",
3333     "src/compiler/turboshaft/fast-hash.h",
3334     "src/compiler/turboshaft/graph-builder.h",
3335     "src/compiler/turboshaft/graph-visualizer.h",
3336     "src/compiler/turboshaft/graph.h",
3337     "src/compiler/turboshaft/index.h",
3338     "src/compiler/turboshaft/instruction-selection-phase.h",
3339     "src/compiler/turboshaft/late-escape-analysis-reducer.h",
3340     "src/compiler/turboshaft/late-load-elimination-reducer.h",
3341     "src/compiler/turboshaft/layered-hash-map.h",
3342     "src/compiler/turboshaft/loop-finder.h",
3343     "src/compiler/turboshaft/loop-unrolling-phase.h",
3344     "src/compiler/turboshaft/loop-unrolling-reducer.h",
3345     "src/compiler/turboshaft/machine-lowering-phase.h",
3346     "src/compiler/turboshaft/machine-lowering-reducer-inl.h",
3347     "src/compiler/turboshaft/machine-optimization-reducer.h",
3348     "src/compiler/turboshaft/memory-optimization-reducer.h",
3349     "src/compiler/turboshaft/operation-matcher.h",
3350     "src/compiler/turboshaft/operations.h",
3351     "src/compiler/turboshaft/optimization-phase.h",
3352     "src/compiler/turboshaft/optimize-phase.h",
3353     "src/compiler/turboshaft/phase.h",
3354     "src/compiler/turboshaft/pretenuring-propagation-reducer.h",
3355     "src/compiler/turboshaft/recreate-schedule-phase.h",
3356     "src/compiler/turboshaft/recreate-schedule.h",
3357     "src/compiler/turboshaft/reduce-args-helper.h",
3358     "src/compiler/turboshaft/reducer-traits.h",
3359     "src/compiler/turboshaft/representations.h",
3360     "src/compiler/turboshaft/required-optimization-reducer.h",
3361     "src/compiler/turboshaft/runtime-call-descriptors.h",
3362     "src/compiler/turboshaft/select-lowering-reducer.h",
3363     "src/compiler/turboshaft/sidetable.h",
3364     "src/compiler/turboshaft/simplified-lowering-phase.h",
3365     "src/compiler/turboshaft/simplify-tf-loops.h",
3366     "src/compiler/turboshaft/snapshot-table-opindex.h",
3367     "src/compiler/turboshaft/snapshot-table.h",
3368     "src/compiler/turboshaft/stack-check-reducer.h",
3369     "src/compiler/turboshaft/store-store-elimination-phase.h",
3370     "src/compiler/turboshaft/store-store-elimination-reducer.h",
3371     "src/compiler/turboshaft/structural-optimization-reducer.h",
3372     "src/compiler/turboshaft/tracing.h",
3373     "src/compiler/turboshaft/type-assertions-phase.h",
3374     "src/compiler/turboshaft/type-inference-analysis.h",
3375     "src/compiler/turboshaft/type-inference-reducer.h",
3376     "src/compiler/turboshaft/type-parser.h",
3377     "src/compiler/turboshaft/typed-optimizations-phase.h",
3378     "src/compiler/turboshaft/typed-optimizations-reducer.h",
3379     "src/compiler/turboshaft/typer.h",
3380     "src/compiler/turboshaft/types.h",
3381     "src/compiler/turboshaft/undef-assembler-macros.inc",
3382     "src/compiler/turboshaft/uniform-reducer-adapter.h",
3383     "src/compiler/turboshaft/use-map.h",
3384     "src/compiler/turboshaft/utils.h",
3385     "src/compiler/turboshaft/value-numbering-reducer.h",
3386     "src/compiler/turboshaft/variable-reducer.h",
3387     "src/compiler/turboshaft/wasm-dead-code-elimination-phase.h",
3388     "src/compiler/type-cache.h",
3389     "src/compiler/type-narrowing-reducer.h",
3390     "src/compiler/typed-optimization.h",
3391     "src/compiler/typer.h",
3392     "src/compiler/types.h",
3393     "src/compiler/use-info.h",
3394     "src/compiler/value-numbering-reducer.h",
3395     "src/compiler/verifier.h",
3396     "src/compiler/write-barrier-kind.h",
3397     "src/compiler/zone-stats.h",
3398     "src/date/date.h",
3399     "src/date/dateparser-inl.h",
3400     "src/date/dateparser.h",
3401     "src/debug/debug-coverage.h",
3402     "src/debug/debug-evaluate.h",
3403     "src/debug/debug-frames.h",
3404     "src/debug/debug-interface.h",
3405     "src/debug/debug-property-iterator.h",
3406     "src/debug/debug-scope-iterator.h",
3407     "src/debug/debug-scopes.h",
3408     "src/debug/debug-stack-trace-iterator.h",
3409     "src/debug/debug.h",
3410     "src/debug/interface-types.h",
3411     "src/debug/liveedit-diff.h",
3412     "src/debug/liveedit.h",
3413     "src/deoptimizer/deoptimize-reason.h",
3414     "src/deoptimizer/deoptimized-frame-info.h",
3415     "src/deoptimizer/deoptimizer.h",
3416     "src/deoptimizer/frame-description.h",
3417     "src/deoptimizer/frame-translation-builder.h",
3418     "src/deoptimizer/materialized-object-store.h",
3419     "src/deoptimizer/translated-state.h",
3420     "src/deoptimizer/translation-opcode.h",
3421     "src/diagnostics/basic-block-profiler.h",
3422     "src/diagnostics/code-tracer.h",
3423     "src/diagnostics/compilation-statistics.h",
3424     "src/diagnostics/disasm.h",
3425     "src/diagnostics/disassembler.h",
3426     "src/diagnostics/eh-frame.h",
3427     "src/diagnostics/gdb-jit.h",
3428     "src/diagnostics/perf-jit.h",
3429     "src/diagnostics/unwinder.h",
3430     "src/execution/arguments-inl.h",
3431     "src/execution/arguments.h",
3432     "src/execution/clobber-registers.h",
3433     "src/execution/embedder-state.h",
3434     "src/execution/encoded-c-signature.h",
3435     "src/execution/execution.h",
3436     "src/execution/frame-constants.h",
3437     "src/execution/frames-inl.h",
3438     "src/execution/frames.h",
3439     "src/execution/futex-emulation.h",
3440     "src/execution/interrupts-scope.h",
3441     "src/execution/isolate-data.h",
3442     "src/execution/isolate-inl.h",
3443     "src/execution/isolate-utils-inl.h",
3444     "src/execution/isolate-utils.h",
3445     "src/execution/isolate.h",
3446     "src/execution/local-isolate-inl.h",
3447     "src/execution/local-isolate.h",
3448     "src/execution/messages.h",
3449     "src/execution/microtask-queue.h",
3450     "src/execution/pointer-authentication.h",
3451     "src/execution/protectors-inl.h",
3452     "src/execution/protectors.h",
3453     "src/execution/shared-mutex-guard-if-off-thread.h",
3454     "src/execution/simulator-base.h",
3455     "src/execution/simulator.h",
3456     "src/execution/stack-guard.h",
3457     "src/execution/thread-id.h",
3458     "src/execution/thread-local-top.h",
3459     "src/execution/tiering-manager.h",
3460     "src/execution/v8threads.h",
3461     "src/execution/vm-state-inl.h",
3462     "src/execution/vm-state.h",
3463     "src/extensions/cputracemark-extension.h",
3464     "src/extensions/externalize-string-extension.h",
3465     "src/extensions/gc-extension.h",
3466     "src/extensions/ignition-statistics-extension.h",
3467     "src/extensions/statistics-extension.h",
3468     "src/extensions/trigger-failure-extension.h",
3469     "src/handles/global-handles-inl.h",
3470     "src/handles/global-handles.h",
3471     "src/handles/handles-inl.h",
3472     "src/handles/handles.h",
3473     "src/handles/local-handles-inl.h",
3474     "src/handles/local-handles.h",
3475     "src/handles/maybe-handles-inl.h",
3476     "src/handles/maybe-handles.h",
3477     "src/handles/persistent-handles.h",
3478     "src/handles/shared-object-conveyor-handles.h",
3479     "src/handles/traced-handles.h",
3480     "src/heap/allocation-observer.h",
3481     "src/heap/allocation-result.h",
3482     "src/heap/allocation-stats.h",
3483     "src/heap/array-buffer-sweeper.h",
3484     "src/heap/base-space.h",
3485     "src/heap/basic-memory-chunk.h",
3486     "src/heap/code-range.h",
3487     "src/heap/code-stats.h",
3488     "src/heap/collection-barrier.h",
3489     "src/heap/combined-heap.h",
3490     "src/heap/concurrent-allocator-inl.h",
3491     "src/heap/concurrent-allocator.h",
3492     "src/heap/concurrent-marking.h",
3493     "src/heap/cppgc-js/cpp-heap.h",
3494     "src/heap/cppgc-js/cpp-marking-state-inl.h",
3495     "src/heap/cppgc-js/cpp-marking-state.h",
3496     "src/heap/cppgc-js/cpp-snapshot.h",
3497     "src/heap/cppgc-js/cross-heap-remembered-set.h",
3498     "src/heap/cppgc-js/unified-heap-marking-state-inl.h",
3499     "src/heap/cppgc-js/unified-heap-marking-state.h",
3500     "src/heap/cppgc-js/unified-heap-marking-verifier.h",
3501     "src/heap/cppgc-js/unified-heap-marking-visitor.h",
3502     "src/heap/cppgc-js/wrappable-info-inl.h",
3503     "src/heap/cppgc-js/wrappable-info.h",
3504     "src/heap/ephemeron-remembered-set.h",
3505     "src/heap/evacuation-allocator-inl.h",
3506     "src/heap/evacuation-allocator.h",
3507     "src/heap/evacuation-verifier-inl.h",
3508     "src/heap/evacuation-verifier.h",
3509     "src/heap/factory-base-inl.h",
3510     "src/heap/factory-base.h",
3511     "src/heap/factory-inl.h",
3512     "src/heap/factory.h",
3513     "src/heap/finalization-registry-cleanup-task.h",
3514     "src/heap/free-list-inl.h",
3515     "src/heap/free-list.h",
3516     "src/heap/gc-callbacks.h",
3517     "src/heap/gc-idle-time-handler.h",
3518     "src/heap/gc-tracer-inl.h",
3519     "src/heap/gc-tracer.h",
3520     "src/heap/heap-allocator-inl.h",
3521     "src/heap/heap-allocator.h",
3522     "src/heap/heap-controller.h",
3523     "src/heap/heap-inl.h",
3524     "src/heap/heap-layout-tracer.h",
3525     "src/heap/heap-write-barrier-inl.h",
3526     "src/heap/heap-write-barrier.h",
3527     "src/heap/heap.h",
3528     "src/heap/incremental-marking-inl.h",
3529     "src/heap/incremental-marking-job.h",
3530     "src/heap/incremental-marking.h",
3531     "src/heap/index-generator.h",
3532     "src/heap/large-page.h",
3533     "src/heap/large-spaces.h",
3534     "src/heap/linear-allocation-area.h",
3535     "src/heap/list.h",
3536     "src/heap/local-factory-inl.h",
3537     "src/heap/local-factory.h",
3538     "src/heap/local-heap-inl.h",
3539     "src/heap/local-heap.h",
3540     "src/heap/main-allocator-inl.h",
3541     "src/heap/main-allocator.h",
3542     "src/heap/mark-compact-inl.h",
3543     "src/heap/mark-compact.h",
3544     "src/heap/mark-sweep-utilities.h",
3545     "src/heap/marking-barrier-inl.h",
3546     "src/heap/marking-barrier.h",
3547     "src/heap/marking-inl.h",
3548     "src/heap/marking-state-inl.h",
3549     "src/heap/marking-state.h",
3550     "src/heap/marking-visitor-inl.h",
3551     "src/heap/marking-visitor.h",
3552     "src/heap/marking-worklist-inl.h",
3553     "src/heap/marking-worklist.h",
3554     "src/heap/marking.h",
3555     "src/heap/memory-allocator.h",
3556     "src/heap/memory-balancer.h",
3557     "src/heap/memory-chunk-inl.h",
3558     "src/heap/memory-chunk-layout.h",
3559     "src/heap/memory-chunk.h",
3560     "src/heap/memory-measurement-inl.h",
3561     "src/heap/memory-measurement.h",
3562     "src/heap/memory-reducer.h",
3563     "src/heap/minor-gc-job.h",
3564     "src/heap/minor-mark-sweep-inl.h",
3565     "src/heap/minor-mark-sweep.h",
3566     "src/heap/new-spaces-inl.h",
3567     "src/heap/new-spaces.h",
3568     "src/heap/object-lock.h",
3569     "src/heap/object-stats.h",
3570     "src/heap/objects-visiting-inl.h",
3571     "src/heap/objects-visiting.h",
3572     "src/heap/page.h",
3573     "src/heap/paged-spaces-inl.h",
3574     "src/heap/paged-spaces.h",
3575     "src/heap/parallel-work-item.h",
3576     "src/heap/parked-scope-inl.h",
3577     "src/heap/parked-scope.h",
3578     "src/heap/pretenuring-handler-inl.h",
3579     "src/heap/pretenuring-handler.h",
3580     "src/heap/progress-bar.h",
3581     "src/heap/read-only-heap-inl.h",
3582     "src/heap/read-only-heap.h",
3583     "src/heap/read-only-promotion.h",
3584     "src/heap/read-only-spaces.h",
3585     "src/heap/remembered-set-inl.h",
3586     "src/heap/remembered-set.h",
3587     "src/heap/safepoint.h",
3588     "src/heap/scavenger-inl.h",
3589     "src/heap/scavenger.h",
3590     "src/heap/slot-set.h",
3591     "src/heap/spaces-inl.h",
3592     "src/heap/spaces.h",
3593     "src/heap/sweeper.h",
3594     "src/heap/traced-handles-marking-visitor.h",
3595     "src/heap/trusted-range.h",
3596     "src/heap/weak-object-worklists.h",
3597     "src/heap/young-generation-marking-visitor-inl.h",
3598     "src/heap/young-generation-marking-visitor.h",
3599     "src/heap/zapping.h",
3600     "src/ic/call-optimization.h",
3601     "src/ic/handler-configuration-inl.h",
3602     "src/ic/handler-configuration.h",
3603     "src/ic/ic-inl.h",
3604     "src/ic/ic-stats.h",
3605     "src/ic/ic.h",
3606     "src/ic/stub-cache.h",
3607     "src/init/bootstrapper.h",
3608     "src/init/heap-symbols.h",
3609     "src/init/icu_util.h",
3610     "src/init/isolate-allocator.h",
3611     "src/init/setup-isolate.h",
3612     "src/init/startup-data-util.h",
3613     "src/init/v8.h",
3614     "src/interpreter/block-coverage-builder.h",
3615     "src/interpreter/bytecode-array-builder.h",
3616     "src/interpreter/bytecode-array-iterator.h",
3617     "src/interpreter/bytecode-array-random-iterator.h",
3618     "src/interpreter/bytecode-array-writer.h",
3619     "src/interpreter/bytecode-decoder.h",
3620     "src/interpreter/bytecode-flags.h",
3621     "src/interpreter/bytecode-generator.h",
3622     "src/interpreter/bytecode-jump-table.h",
3623     "src/interpreter/bytecode-label.h",
3624     "src/interpreter/bytecode-node.h",
3625     "src/interpreter/bytecode-operands.h",
3626     "src/interpreter/bytecode-register-allocator.h",
3627     "src/interpreter/bytecode-register-optimizer.h",
3628     "src/interpreter/bytecode-register.h",
3629     "src/interpreter/bytecode-source-info.h",
3630     "src/interpreter/bytecode-traits.h",
3631     "src/interpreter/bytecodes.h",
3632     "src/interpreter/constant-array-builder.h",
3633     "src/interpreter/control-flow-builders.h",
3634     "src/interpreter/handler-table-builder.h",
3635     "src/interpreter/interpreter-generator.h",
3636     "src/interpreter/interpreter-intrinsics.h",
3637     "src/interpreter/interpreter.h",
3638     "src/json/json-parser.h",
3639     "src/json/json-stringifier.h",
3640     "src/libsampler/sampler.h",
3641     "src/logging/code-events.h",
3642     "src/logging/counters-definitions.h",
3643     "src/logging/counters-scopes.h",
3644     "src/logging/counters.h",
3645     "src/logging/local-logger.h",
3646     "src/logging/log-file.h",
3647     "src/logging/log-inl.h",
3648     "src/logging/log.h",
3649     "src/logging/metrics.h",
3650     "src/logging/runtime-call-stats-scope.h",
3651     "src/logging/runtime-call-stats.h",
3652     "src/logging/tracing-flags.h",
3653     "src/numbers/conversions-inl.h",
3654     "src/numbers/conversions.h",
3655     "src/numbers/hash-seed-inl.h",
3656     "src/numbers/math-random.h",
3657     "src/objects/all-objects-inl.h",
3658     "src/objects/allocation-site-inl.h",
3659     "src/objects/allocation-site-scopes-inl.h",
3660     "src/objects/allocation-site-scopes.h",
3661     "src/objects/allocation-site.h",
3662     "src/objects/api-callbacks-inl.h",
3663     "src/objects/api-callbacks.h",
3664     "src/objects/arguments-inl.h",
3665     "src/objects/arguments.h",
3666     "src/objects/backing-store.h",
3667     "src/objects/bigint-inl.h",
3668     "src/objects/bigint.h",
3669     "src/objects/call-site-info-inl.h",
3670     "src/objects/call-site-info.h",
3671     "src/objects/cell-inl.h",
3672     "src/objects/cell.h",
3673     "src/objects/code-inl.h",
3674     "src/objects/code-kind.h",
3675     "src/objects/code.h",
3676     "src/objects/compilation-cache-table-inl.h",
3677     "src/objects/compilation-cache-table.h",
3678     "src/objects/compressed-slots-inl.h",
3679     "src/objects/compressed-slots.h",
3680     "src/objects/contexts-inl.h",
3681     "src/objects/contexts.h",
3682     "src/objects/data-handler-inl.h",
3683     "src/objects/data-handler.h",
3684     "src/objects/debug-objects-inl.h",
3685     "src/objects/debug-objects.h",
3686     "src/objects/descriptor-array-inl.h",
3687     "src/objects/descriptor-array.h",
3688     "src/objects/dictionary-inl.h",
3689     "src/objects/dictionary.h",
3690     "src/objects/elements-inl.h",
3691     "src/objects/elements-kind.h",
3692     "src/objects/elements.h",
3693     "src/objects/embedder-data-array-inl.h",
3694     "src/objects/embedder-data-array.h",
3695     "src/objects/embedder-data-slot-inl.h",
3696     "src/objects/embedder-data-slot.h",
3697     "src/objects/feedback-cell-inl.h",
3698     "src/objects/feedback-cell.h",
3699     "src/objects/feedback-vector-inl.h",
3700     "src/objects/feedback-vector.h",
3701     "src/objects/field-index-inl.h",
3702     "src/objects/field-index.h",
3703     "src/objects/field-type.h",
3704     "src/objects/fixed-array-inl.h",
3705     "src/objects/fixed-array.h",
3706     "src/objects/foreign-inl.h",
3707     "src/objects/foreign.h",
3708     "src/objects/free-space-inl.h",
3709     "src/objects/free-space.h",
3710     "src/objects/function-kind.h",
3711     "src/objects/function-syntax-kind.h",
3712     "src/objects/hash-table-inl.h",
3713     "src/objects/hash-table.h",
3714     "src/objects/heap-number-inl.h",
3715     "src/objects/heap-number.h",
3716     "src/objects/heap-object-inl.h",
3717     "src/objects/heap-object.h",
3718     "src/objects/hole-inl.h",
3719     "src/objects/hole.h",
3720     "src/objects/instance-type-checker.h",
3721     "src/objects/instance-type-inl.h",
3722     "src/objects/instance-type.h",
3723     "src/objects/internal-index.h",
3724     "src/objects/js-array-buffer-inl.h",
3725     "src/objects/js-array-buffer.h",
3726     "src/objects/js-array-inl.h",
3727     "src/objects/js-array.h",
3728     "src/objects/js-atomics-synchronization-inl.h",
3729     "src/objects/js-atomics-synchronization.h",
3730     "src/objects/js-collection-inl.h",
3731     "src/objects/js-collection-iterator-inl.h",
3732     "src/objects/js-collection-iterator.h",
3733     "src/objects/js-collection.h",
3734     "src/objects/js-function-inl.h",
3735     "src/objects/js-function.h",
3736     "src/objects/js-generator-inl.h",
3737     "src/objects/js-generator.h",
3738     "src/objects/js-iterator-helpers-inl.h",
3739     "src/objects/js-iterator-helpers.h",
3740     "src/objects/js-objects-inl.h",
3741     "src/objects/js-objects.h",
3742     "src/objects/js-promise-inl.h",
3743     "src/objects/js-promise.h",
3744     "src/objects/js-proxy-inl.h",
3745     "src/objects/js-proxy.h",
3746     "src/objects/js-raw-json-inl.h",
3747     "src/objects/js-raw-json.h",
3748     "src/objects/js-regexp-inl.h",
3749     "src/objects/js-regexp-string-iterator-inl.h",
3750     "src/objects/js-regexp-string-iterator.h",
3751     "src/objects/js-regexp.h",
3752     "src/objects/js-segments-inl.h",
3753     "src/objects/js-segments.h",
3754     "src/objects/js-shadow-realm-inl.h",
3755     "src/objects/js-shadow-realm.h",
3756     "src/objects/js-shared-array-inl.h",
3757     "src/objects/js-shared-array.h",
3758     "src/objects/js-struct-inl.h",
3759     "src/objects/js-struct.h",
3760     "src/objects/js-temporal-objects-inl.h",
3761     "src/objects/js-temporal-objects.h",
3762     "src/objects/js-weak-refs-inl.h",
3763     "src/objects/js-weak-refs.h",
3764     "src/objects/keys.h",
3765     "src/objects/literal-objects-inl.h",
3766     "src/objects/literal-objects.h",
3767     "src/objects/lookup-cache-inl.h",
3768     "src/objects/lookup-cache.h",
3769     "src/objects/lookup-inl.h",
3770     "src/objects/lookup.h",
3771     "src/objects/managed-inl.h",
3772     "src/objects/managed.h",
3773     "src/objects/map-inl.h",
3774     "src/objects/map-updater.h",
3775     "src/objects/map.h",
3776     "src/objects/maybe-object-inl.h",
3777     "src/objects/maybe-object.h",
3778     "src/objects/megadom-handler-inl.h",
3779     "src/objects/megadom-handler.h",
3780     "src/objects/microtask-inl.h",
3781     "src/objects/microtask.h",
3782     "src/objects/module-inl.h",
3783     "src/objects/module.h",
3784     "src/objects/name-inl.h",
3785     "src/objects/name.h",
3786     "src/objects/object-list-macros.h",
3787     "src/objects/object-macros-undef.h",
3788     "src/objects/object-macros.h",
3789     "src/objects/object-type.h",
3790     "src/objects/objects-body-descriptors-inl.h",
3791     "src/objects/objects-body-descriptors.h",
3792     "src/objects/objects-definitions.h",
3793     "src/objects/objects-inl.h",
3794     "src/objects/objects.h",
3795     "src/objects/oddball-inl.h",
3796     "src/objects/oddball.h",
3797     "src/objects/option-utils.h",
3798     "src/objects/ordered-hash-table-inl.h",
3799     "src/objects/ordered-hash-table.h",
3800     "src/objects/primitive-heap-object-inl.h",
3801     "src/objects/primitive-heap-object.h",
3802     "src/objects/promise-inl.h",
3803     "src/objects/promise.h",
3804     "src/objects/property-array-inl.h",
3805     "src/objects/property-array.h",
3806     "src/objects/property-cell-inl.h",
3807     "src/objects/property-cell.h",
3808     "src/objects/property-descriptor-object-inl.h",
3809     "src/objects/property-descriptor-object.h",
3810     "src/objects/property-descriptor.h",
3811     "src/objects/property-details.h",
3812     "src/objects/property.h",
3813     "src/objects/prototype-info-inl.h",
3814     "src/objects/prototype-info.h",
3815     "src/objects/prototype-inl.h",
3816     "src/objects/prototype.h",
3817     "src/objects/regexp-match-info.h",
3818     "src/objects/scope-info-inl.h",
3819     "src/objects/scope-info.h",
3820     "src/objects/script-inl.h",
3821     "src/objects/script.h",
3822     "src/objects/shared-function-info-inl.h",
3823     "src/objects/shared-function-info.h",
3824     "src/objects/simd.h",
3825     "src/objects/slots-atomic-inl.h",
3826     "src/objects/slots-inl.h",
3827     "src/objects/slots.h",
3828     "src/objects/smi-inl.h",
3829     "src/objects/smi.h",
3830     "src/objects/source-text-module-inl.h",
3831     "src/objects/source-text-module.h",
3832     "src/objects/string-comparator.h",
3833     "src/objects/string-forwarding-table-inl.h",
3834     "src/objects/string-forwarding-table.h",
3835     "src/objects/string-inl.h",
3836     "src/objects/string-set-inl.h",
3837     "src/objects/string-set.h",
3838     "src/objects/string-table-inl.h",
3839     "src/objects/string-table.h",
3840     "src/objects/string.h",
3841     "src/objects/struct-inl.h",
3842     "src/objects/struct.h",
3843     "src/objects/swiss-hash-table-helpers.h",
3844     "src/objects/swiss-name-dictionary-inl.h",
3845     "src/objects/swiss-name-dictionary.h",
3846     "src/objects/synthetic-module-inl.h",
3847     "src/objects/synthetic-module.h",
3848     "src/objects/tagged-field-inl.h",
3849     "src/objects/tagged-field.h",
3850     "src/objects/tagged-impl-inl.h",
3851     "src/objects/tagged-impl.h",
3852     "src/objects/tagged-index.h",
3853     "src/objects/tagged-value-inl.h",
3854     "src/objects/tagged-value.h",
3855     "src/objects/tagged.h",
3856     "src/objects/template-objects-inl.h",
3857     "src/objects/template-objects.h",
3858     "src/objects/templates-inl.h",
3859     "src/objects/templates.h",
3860     "src/objects/torque-defined-classes-inl.h",
3861     "src/objects/torque-defined-classes.h",
3862     "src/objects/transitions-inl.h",
3863     "src/objects/transitions.h",
3864     "src/objects/trusted-object-inl.h",
3865     "src/objects/trusted-object.h",
3866     "src/objects/turbofan-types-inl.h",
3867     "src/objects/turbofan-types.h",
3868     "src/objects/turboshaft-types-inl.h",
3869     "src/objects/turboshaft-types.h",
3870     "src/objects/type-hints.h",
3871     "src/objects/value-serializer.h",
3872     "src/objects/visitors-inl.h",
3873     "src/objects/visitors.h",
3874     "src/parsing/expression-scope.h",
3875     "src/parsing/func-name-inferrer.h",
3876     "src/parsing/import-assertions.h",
3877     "src/parsing/keywords-gen.h",
3878     "src/parsing/literal-buffer.h",
3879     "src/parsing/parse-info.h",
3880     "src/parsing/parser-base.h",
3881     "src/parsing/parser.h",
3882     "src/parsing/parsing.h",
3883     "src/parsing/pending-compilation-error-handler.h",
3884     "src/parsing/preparse-data-impl.h",
3885     "src/parsing/preparse-data.h",
3886     "src/parsing/preparser-logger.h",
3887     "src/parsing/preparser.h",
3888     "src/parsing/rewriter.h",
3889     "src/parsing/scanner-character-streams.h",
3890     "src/parsing/scanner-inl.h",
3891     "src/parsing/scanner.h",
3892     "src/parsing/token.h",
3893     "src/profiler/allocation-tracker.h",
3894     "src/profiler/circular-queue-inl.h",
3895     "src/profiler/circular-queue.h",
3896     "src/profiler/cpu-profiler-inl.h",
3897     "src/profiler/cpu-profiler.h",
3898     "src/profiler/heap-profiler.h",
3899     "src/profiler/heap-snapshot-generator-inl.h",
3900     "src/profiler/heap-snapshot-generator.h",
3901     "src/profiler/output-stream-writer.h",
3902     "src/profiler/profile-generator-inl.h",
3903     "src/profiler/profile-generator.h",
3904     "src/profiler/profiler-listener.h",
3905     "src/profiler/profiler-stats.h",
3906     "src/profiler/sampling-heap-profiler.h",
3907     "src/profiler/strings-storage.h",
3908     "src/profiler/symbolizer.h",
3909     "src/profiler/tick-sample.h",
3910     "src/profiler/tracing-cpu-profiler.h",
3911     "src/profiler/weak-code-registry.h",
3912     "src/regexp/experimental/experimental-bytecode.h",
3913     "src/regexp/experimental/experimental-compiler.h",
3914     "src/regexp/experimental/experimental-interpreter.h",
3915     "src/regexp/experimental/experimental.h",
3916     "src/regexp/regexp-ast.h",
3917     "src/regexp/regexp-bytecode-generator-inl.h",
3918     "src/regexp/regexp-bytecode-generator.h",
3919     "src/regexp/regexp-bytecode-peephole.h",
3920     "src/regexp/regexp-bytecodes.h",
3921     "src/regexp/regexp-compiler.h",
3922     "src/regexp/regexp-dotprinter.h",
3923     "src/regexp/regexp-error.h",
3924     "src/regexp/regexp-flags.h",
3925     "src/regexp/regexp-interpreter.h",
3926     "src/regexp/regexp-macro-assembler-arch.h",
3927     "src/regexp/regexp-macro-assembler-tracer.h",
3928     "src/regexp/regexp-macro-assembler.h",
3929     "src/regexp/regexp-nodes.h",
3930     "src/regexp/regexp-parser.h",
3931     "src/regexp/regexp-stack.h",
3932     "src/regexp/regexp-utils.h",
3933     "src/regexp/regexp.h",
3934     "src/regexp/special-case.h",
3935     "src/roots/roots-inl.h",
3936     "src/roots/roots.h",
3937     "src/roots/static-roots.h",
3938     "src/runtime/runtime-utils.h",
3939     "src/runtime/runtime.h",
3940     "src/sandbox/bounded-size-inl.h",
3941     "src/sandbox/bounded-size.h",
3942     "src/sandbox/code-pointer-inl.h",
3943     "src/sandbox/code-pointer-table-inl.h",
3944     "src/sandbox/code-pointer-table.h",
3945     "src/sandbox/code-pointer.h",
3946     "src/sandbox/external-entity-table-inl.h",
3947     "src/sandbox/external-entity-table.h",
3948     "src/sandbox/external-pointer-inl.h",
3949     "src/sandbox/external-pointer-table-inl.h",
3950     "src/sandbox/external-pointer-table.h",
3951     "src/sandbox/external-pointer.h",
3952     "src/sandbox/indirect-pointer-inl.h",
3953     "src/sandbox/indirect-pointer-tag.h",
3954     "src/sandbox/indirect-pointer.h",
3955     "src/sandbox/sandbox.h",
3956     "src/sandbox/sandboxed-pointer-inl.h",
3957     "src/sandbox/sandboxed-pointer.h",
3958     "src/sandbox/testing.h",
3959     "src/sandbox/trusted-pointer-table-inl.h",
3960     "src/sandbox/trusted-pointer-table.h",
3961     "src/snapshot/code-serializer.h",
3962     "src/snapshot/context-deserializer.h",
3963     "src/snapshot/context-serializer.h",
3964     "src/snapshot/deserializer.h",
3965     "src/snapshot/embedded/embedded-data-inl.h",
3966     "src/snapshot/embedded/embedded-data.h",
3967     "src/snapshot/embedded/embedded-file-writer-interface.h",
3968     "src/snapshot/object-deserializer.h",
3969     "src/snapshot/read-only-deserializer.h",
3970     "src/snapshot/read-only-serializer-deserializer.h",
3971     "src/snapshot/read-only-serializer.h",
3972     "src/snapshot/references.h",
3973     "src/snapshot/roots-serializer.h",
3974     "src/snapshot/serializer-deserializer.h",
3975     "src/snapshot/serializer-inl.h",
3976     "src/snapshot/serializer.h",
3977     "src/snapshot/shared-heap-deserializer.h",
3978     "src/snapshot/shared-heap-serializer.h",
3979     "src/snapshot/snapshot-data.h",
3980     "src/snapshot/snapshot-source-sink.h",
3981     "src/snapshot/snapshot-utils.h",
3982     "src/snapshot/snapshot.h",
3983     "src/snapshot/sort-builtins.h",
3984     "src/snapshot/startup-deserializer.h",
3985     "src/snapshot/startup-serializer.h",
3986     "src/strings/char-predicates-inl.h",
3987     "src/strings/char-predicates.h",
3988     "src/strings/string-builder-inl.h",
3989     "src/strings/string-case.h",
3990     "src/strings/string-hasher-inl.h",
3991     "src/strings/string-hasher.h",
3992     "src/strings/string-search.h",
3993     "src/strings/string-stream.h",
3994     "src/strings/unicode-decoder.h",
3995     "src/strings/unicode-inl.h",
3996     "src/strings/unicode.h",
3997     "src/strings/uri.h",
3998     "src/tasks/cancelable-task.h",
3999     "src/tasks/operations-barrier.h",
4000     "src/tasks/task-utils.h",
4001     "src/temporal/temporal-parser.h",
4002     "src/third_party/siphash/halfsiphash.h",
4003     "src/third_party/utf8-decoder/utf8-decoder.h",
4004     "src/torque/runtime-macro-shims.h",
4005     "src/tracing/trace-event.h",
4006     "src/tracing/traced-value.h",
4007     "src/tracing/tracing-category-observer.h",
4008     "src/utils/address-map.h",
4009     "src/utils/allocation.h",
4010     "src/utils/bit-vector.h",
4011     "src/utils/boxed-float.h",
4012     "src/utils/detachable-vector.h",
4013     "src/utils/hex-format.h",
4014     "src/utils/identity-map.h",
4015     "src/utils/locked-queue-inl.h",
4016     "src/utils/locked-queue.h",
4017     "src/utils/memcopy.h",
4018     "src/utils/ostreams.h",
4019     "src/utils/scoped-list.h",
4020     "src/utils/sha-256.h",
4021     "src/utils/sparse-bit-vector.h",
4022     "src/utils/utils-inl.h",
4023     "src/utils/utils.h",
4024     "src/utils/version.h",
4025     "src/zone/accounting-allocator.h",
4026     "src/zone/compressed-zone-ptr.h",
4027     "src/zone/type-stats.h",
4028     "src/zone/zone-allocator.h",
4029     "src/zone/zone-chunk-list.h",
4030     "src/zone/zone-compact-set.h",
4031     "src/zone/zone-compression.h",
4032     "src/zone/zone-containers.h",
4033     "src/zone/zone-hashmap.h",
4034     "src/zone/zone-list-inl.h",
4035     "src/zone/zone-list.h",
4036     "src/zone/zone-segment.h",
4037     "src/zone/zone-type-traits.h",
4038     "src/zone/zone-utils.h",
4039     "src/zone/zone.h",
4040   ]
4041
4042   if (v8_enable_snapshot_compression) {
4043     sources += [ "src/snapshot/snapshot-compression.h" ]
4044   }
4045
4046   if (v8_use_perfetto) {
4047     sources -= [ "//base/trace_event/common/trace_event_common.h" ]
4048   }
4049
4050   if (v8_enable_sparkplug) {
4051     sources += [
4052       "src/baseline/baseline-assembler-inl.h",
4053       "src/baseline/baseline-assembler.h",
4054       "src/baseline/baseline-batch-compiler.h",
4055       "src/baseline/baseline-compiler.h",
4056     ]
4057   }
4058
4059   if (v8_enable_maglev) {
4060     sources += [
4061       "src/maglev/maglev-assembler-inl.h",
4062       "src/maglev/maglev-assembler.h",
4063       "src/maglev/maglev-basic-block.h",
4064       "src/maglev/maglev-code-gen-state.h",
4065       "src/maglev/maglev-code-generator.h",
4066       "src/maglev/maglev-compilation-info.h",
4067       "src/maglev/maglev-compilation-unit.h",
4068       "src/maglev/maglev-compiler.h",
4069       "src/maglev/maglev-concurrent-dispatcher.h",
4070       "src/maglev/maglev-graph-builder.h",
4071       "src/maglev/maglev-graph-labeller.h",
4072       "src/maglev/maglev-graph-printer.h",
4073       "src/maglev/maglev-graph-processor.h",
4074       "src/maglev/maglev-graph-verifier.h",
4075       "src/maglev/maglev-graph.h",
4076       "src/maglev/maglev-interpreter-frame-state.h",
4077       "src/maglev/maglev-ir-inl.h",
4078       "src/maglev/maglev-ir.h",
4079       "src/maglev/maglev-phi-representation-selector.h",
4080       "src/maglev/maglev-pipeline-statistics.h",
4081       "src/maglev/maglev-regalloc-data.h",
4082       "src/maglev/maglev-regalloc.h",
4083       "src/maglev/maglev-register-frame-array.h",
4084       "src/maglev/maglev.h",
4085     ]
4086     if (v8_current_cpu == "arm") {
4087       sources += [ "src/maglev/arm/maglev-assembler-arm-inl.h" ]
4088     } else if (v8_current_cpu == "arm64") {
4089       sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ]
4090     } else if (v8_current_cpu == "x64") {
4091       sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ]
4092     }
4093   }
4094
4095   if (v8_enable_webassembly) {
4096     sources += [
4097       "src/asmjs/asm-js.h",
4098       "src/asmjs/asm-names.h",
4099       "src/asmjs/asm-parser.h",
4100       "src/asmjs/asm-scanner.h",
4101       "src/asmjs/asm-types.h",
4102       "src/compiler/int64-lowering.h",
4103       "src/compiler/turboshaft/int64-lowering-phase.h",
4104       "src/compiler/turboshaft/int64-lowering-reducer.h",
4105       "src/compiler/turboshaft/wasm-assembler-helpers.h",
4106       "src/compiler/turboshaft/wasm-gc-optimize-phase.h",
4107       "src/compiler/turboshaft/wasm-gc-type-reducer.h",
4108       "src/compiler/turboshaft/wasm-js-lowering-reducer.h",
4109       "src/compiler/turboshaft/wasm-load-elimination-reducer.h",
4110       "src/compiler/turboshaft/wasm-lowering-phase.h",
4111       "src/compiler/turboshaft/wasm-lowering-reducer.h",
4112       "src/compiler/turboshaft/wasm-optimize-phase.h",
4113       "src/compiler/turboshaft/wasm-turboshaft-compiler.h",
4114       "src/compiler/wasm-address-reassociation.h",
4115       "src/compiler/wasm-call-descriptors.h",
4116       "src/compiler/wasm-compiler-definitions.h",
4117       "src/compiler/wasm-compiler.h",
4118       "src/compiler/wasm-escape-analysis.h",
4119       "src/compiler/wasm-gc-lowering.h",
4120       "src/compiler/wasm-gc-operator-reducer.h",
4121       "src/compiler/wasm-graph-assembler.h",
4122       "src/compiler/wasm-inlining-into-js.h",
4123       "src/compiler/wasm-inlining.h",
4124       "src/compiler/wasm-js-lowering.h",
4125       "src/compiler/wasm-load-elimination.h",
4126       "src/compiler/wasm-loop-peeling.h",
4127       "src/compiler/wasm-typer.h",
4128       "src/debug/debug-wasm-objects-inl.h",
4129       "src/debug/debug-wasm-objects.h",
4130       "src/third_party/utf8-decoder/generalized-utf8-decoder.h",
4131       "src/trap-handler/trap-handler-internal.h",
4132       "src/trap-handler/trap-handler.h",
4133       "src/wasm/baseline/liftoff-assembler-defs.h",
4134       "src/wasm/baseline/liftoff-assembler-inl.h",
4135       "src/wasm/baseline/liftoff-assembler.h",
4136       "src/wasm/baseline/liftoff-compiler.h",
4137       "src/wasm/baseline/liftoff-register.h",
4138       "src/wasm/baseline/parallel-move-inl.h",
4139       "src/wasm/baseline/parallel-move.h",
4140       "src/wasm/canonical-types.h",
4141       "src/wasm/code-space-access.h",
4142       "src/wasm/compilation-environment.h",
4143       "src/wasm/constant-expression-interface.h",
4144       "src/wasm/constant-expression.h",
4145       "src/wasm/decoder.h",
4146       "src/wasm/function-body-decoder-impl.h",
4147       "src/wasm/function-body-decoder.h",
4148       "src/wasm/function-compiler.h",
4149       "src/wasm/graph-builder-interface.h",
4150       "src/wasm/inlining-tree.h",
4151       "src/wasm/jump-table-assembler.h",
4152       "src/wasm/leb-helper.h",
4153       "src/wasm/local-decl-encoder.h",
4154       "src/wasm/memory-tracing.h",
4155       "src/wasm/module-compiler.h",
4156       "src/wasm/module-decoder-impl.h",
4157       "src/wasm/module-decoder.h",
4158       "src/wasm/module-instantiate.h",
4159       "src/wasm/names-provider.h",
4160       "src/wasm/object-access.h",
4161       "src/wasm/pgo.h",
4162       "src/wasm/serialized-signature-inl.h",
4163       "src/wasm/simd-shuffle.h",
4164       "src/wasm/stacks.h",
4165       "src/wasm/std-object-sizes.h",
4166       "src/wasm/streaming-decoder.h",
4167       "src/wasm/string-builder-multiline.h",
4168       "src/wasm/string-builder.h",
4169       "src/wasm/struct-types.h",
4170       "src/wasm/turboshaft-graph-interface.h",
4171       "src/wasm/value-type.h",
4172       "src/wasm/wasm-arguments.h",
4173       "src/wasm/wasm-builtin-list.h",
4174       "src/wasm/wasm-code-manager.h",
4175       "src/wasm/wasm-debug.h",
4176       "src/wasm/wasm-disassembler-impl.h",
4177       "src/wasm/wasm-disassembler.h",
4178       "src/wasm/wasm-engine.h",
4179       "src/wasm/wasm-external-refs.h",
4180       "src/wasm/wasm-feature-flags.h",
4181       "src/wasm/wasm-features.h",
4182       "src/wasm/wasm-import-wrapper-cache.h",
4183       "src/wasm/wasm-init-expr.h",
4184       "src/wasm/wasm-js.h",
4185       "src/wasm/wasm-linkage.h",
4186       "src/wasm/wasm-module-builder.h",
4187       "src/wasm/wasm-module-sourcemap.h",
4188       "src/wasm/wasm-module.h",
4189       "src/wasm/wasm-objects-inl.h",
4190       "src/wasm/wasm-objects.h",
4191       "src/wasm/wasm-opcodes-inl.h",
4192       "src/wasm/wasm-opcodes.h",
4193       "src/wasm/wasm-result.h",
4194       "src/wasm/wasm-serialization.h",
4195       "src/wasm/wasm-subtyping.h",
4196       "src/wasm/wasm-tier.h",
4197       "src/wasm/wasm-value.h",
4198       "src/wasm/well-known-imports.h",
4199     ]
4200   }
4201
4202   if (v8_enable_wasm_simd256_revec) {
4203     sources += [
4204       "src/compiler/linear-scheduler.h",
4205       "src/compiler/revectorizer.h",
4206     ]
4207   }
4208
4209   if (!v8_enable_third_party_heap) {
4210     sources += filter_include(v8_third_party_heap_files, [ "*.h" ])
4211   } else {
4212     sources += [ "src/heap/third-party/heap-api.h" ]
4213   }
4214
4215   if (v8_enable_i18n_support) {
4216     sources += [
4217       "src/objects/intl-objects.h",
4218       "src/objects/js-break-iterator-inl.h",
4219       "src/objects/js-break-iterator.h",
4220       "src/objects/js-collator-inl.h",
4221       "src/objects/js-collator.h",
4222       "src/objects/js-date-time-format-inl.h",
4223       "src/objects/js-date-time-format.h",
4224       "src/objects/js-display-names-inl.h",
4225       "src/objects/js-display-names.h",
4226       "src/objects/js-duration-format-inl.h",
4227       "src/objects/js-duration-format.h",
4228       "src/objects/js-list-format-inl.h",
4229       "src/objects/js-list-format.h",
4230       "src/objects/js-locale-inl.h",
4231       "src/objects/js-locale.h",
4232       "src/objects/js-number-format-inl.h",
4233       "src/objects/js-number-format.h",
4234       "src/objects/js-plural-rules-inl.h",
4235       "src/objects/js-plural-rules.h",
4236       "src/objects/js-relative-time-format-inl.h",
4237       "src/objects/js-relative-time-format.h",
4238       "src/objects/js-segment-iterator-inl.h",
4239       "src/objects/js-segment-iterator.h",
4240       "src/objects/js-segmenter-inl.h",
4241       "src/objects/js-segmenter.h",
4242     ]
4243   }
4244
4245   if (!v8_control_flow_integrity) {
4246     sources += [ "src/execution/pointer-authentication-dummy.h" ]
4247   }
4248
4249   if (v8_enable_conservative_stack_scanning) {
4250     sources += [ "src/heap/conservative-stack-visitor.h" ]
4251   }
4252
4253   if (v8_enable_wasm_gdb_remote_debugging) {
4254     sources += [
4255       "src/debug/wasm/gdb-server/gdb-remote-util.h",
4256       "src/debug/wasm/gdb-server/gdb-server-thread.h",
4257       "src/debug/wasm/gdb-server/gdb-server.h",
4258       "src/debug/wasm/gdb-server/packet.h",
4259       "src/debug/wasm/gdb-server/session.h",
4260       "src/debug/wasm/gdb-server/target.h",
4261       "src/debug/wasm/gdb-server/transport.h",
4262       "src/debug/wasm/gdb-server/wasm-module-debug.h",
4263     ]
4264   }
4265
4266   if (v8_enable_heap_snapshot_verify) {
4267     sources += [ "src/heap/reference-summarizer.h" ]
4268   }
4269
4270   if (v8_current_cpu == "x86") {
4271     sources += [
4272       ### gcmole(ia32) ###
4273       "src/baseline/ia32/baseline-assembler-ia32-inl.h",
4274       "src/baseline/ia32/baseline-compiler-ia32-inl.h",
4275       "src/codegen/ia32/assembler-ia32-inl.h",
4276       "src/codegen/ia32/assembler-ia32.h",
4277       "src/codegen/ia32/constants-ia32.h",
4278       "src/codegen/ia32/interface-descriptors-ia32-inl.h",
4279       "src/codegen/ia32/macro-assembler-ia32.h",
4280       "src/codegen/ia32/register-ia32.h",
4281       "src/codegen/ia32/reglist-ia32.h",
4282       "src/codegen/ia32/sse-instr.h",
4283       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h",
4284       "src/compiler/backend/ia32/instruction-codes-ia32.h",
4285       "src/execution/ia32/frame-constants-ia32.h",
4286       "src/regexp/ia32/regexp-macro-assembler-ia32.h",
4287       "src/wasm/baseline/ia32/liftoff-assembler-ia32-inl.h",
4288     ]
4289     if (v8_enable_sparkplug) {
4290       sources += [
4291         "src/baseline/ia32/baseline-assembler-ia32-inl.h",
4292         "src/baseline/ia32/baseline-compiler-ia32-inl.h",
4293       ]
4294     }
4295   } else if (v8_current_cpu == "x64") {
4296     sources += [
4297       ### gcmole(x64) ###
4298       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h",
4299       "src/codegen/x64/assembler-x64-inl.h",
4300       "src/codegen/x64/assembler-x64.h",
4301       "src/codegen/x64/constants-x64.h",
4302       "src/codegen/x64/fma-instr.h",
4303       "src/codegen/x64/interface-descriptors-x64-inl.h",
4304       "src/codegen/x64/macro-assembler-x64.h",
4305       "src/codegen/x64/register-x64.h",
4306       "src/codegen/x64/reglist-x64.h",
4307       "src/codegen/x64/sse-instr.h",
4308       "src/compiler/backend/x64/instruction-codes-x64.h",
4309       "src/compiler/backend/x64/unwinding-info-writer-x64.h",
4310       "src/execution/x64/frame-constants-x64.h",
4311       "src/regexp/x64/regexp-macro-assembler-x64.h",
4312       "src/third_party/valgrind/valgrind.h",
4313       "src/wasm/baseline/x64/liftoff-assembler-x64-inl.h",
4314     ]
4315
4316     if (is_win) {
4317       sources += [ "src/diagnostics/unwinding-info-win64.h" ]
4318     }
4319
4320     if (v8_enable_sparkplug) {
4321       sources += [
4322         "src/baseline/x64/baseline-assembler-x64-inl.h",
4323         "src/baseline/x64/baseline-compiler-x64-inl.h",
4324       ]
4325     }
4326
4327     if (v8_enable_webassembly) {
4328       # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
4329       # based on Darwin and thus POSIX-compliant to a similar degree.
4330       if (is_linux || is_chromeos || is_mac || is_ios ||
4331           target_os == "freebsd") {
4332         sources += [ "src/trap-handler/handler-inside-posix.h" ]
4333       } else if (is_win) {
4334         sources += [ "src/trap-handler/handler-inside-win.h" ]
4335       }
4336     }
4337   } else if (v8_current_cpu == "arm") {
4338     sources += [
4339       ### gcmole(arm) ###
4340       "src/codegen/arm/assembler-arm-inl.h",
4341       "src/codegen/arm/assembler-arm.h",
4342       "src/codegen/arm/constants-arm.h",
4343       "src/codegen/arm/interface-descriptors-arm-inl.h",
4344       "src/codegen/arm/macro-assembler-arm.h",
4345       "src/codegen/arm/register-arm.h",
4346       "src/codegen/arm/reglist-arm.h",
4347       "src/compiler/backend/arm/instruction-codes-arm.h",
4348       "src/compiler/backend/arm/unwinding-info-writer-arm.h",
4349       "src/execution/arm/frame-constants-arm.h",
4350       "src/execution/arm/simulator-arm.h",
4351       "src/regexp/arm/regexp-macro-assembler-arm.h",
4352       "src/wasm/baseline/arm/liftoff-assembler-arm-inl.h",
4353     ]
4354
4355     if (v8_enable_sparkplug) {
4356       sources += [
4357         "src/baseline/arm/baseline-assembler-arm-inl.h",
4358         "src/baseline/arm/baseline-compiler-arm-inl.h",
4359       ]
4360     }
4361   } else if (v8_current_cpu == "arm64") {
4362     sources += [
4363       ### gcmole(arm64) ###
4364       "src/codegen/arm64/assembler-arm64-inl.h",
4365       "src/codegen/arm64/assembler-arm64.h",
4366       "src/codegen/arm64/constants-arm64.h",
4367       "src/codegen/arm64/decoder-arm64-inl.h",
4368       "src/codegen/arm64/decoder-arm64.h",
4369       "src/codegen/arm64/instructions-arm64.h",
4370       "src/codegen/arm64/interface-descriptors-arm64-inl.h",
4371       "src/codegen/arm64/macro-assembler-arm64-inl.h",
4372       "src/codegen/arm64/macro-assembler-arm64.h",
4373       "src/codegen/arm64/register-arm64.h",
4374       "src/codegen/arm64/reglist-arm64.h",
4375       "src/codegen/arm64/utils-arm64.h",
4376       "src/compiler/backend/arm64/instruction-codes-arm64.h",
4377       "src/compiler/backend/arm64/unwinding-info-writer-arm64.h",
4378       "src/diagnostics/arm64/disasm-arm64.h",
4379       "src/execution/arm64/frame-constants-arm64.h",
4380       "src/execution/arm64/simulator-arm64.h",
4381       "src/regexp/arm64/regexp-macro-assembler-arm64.h",
4382       "src/wasm/baseline/arm64/liftoff-assembler-arm64-inl.h",
4383     ]
4384     if (v8_control_flow_integrity) {
4385       sources += [ "src/execution/arm64/pointer-authentication-arm64.h" ]
4386     }
4387     if (v8_enable_sparkplug) {
4388       sources += [
4389         "src/baseline/arm64/baseline-assembler-arm64-inl.h",
4390         "src/baseline/arm64/baseline-compiler-arm64-inl.h",
4391       ]
4392     }
4393     if (v8_enable_webassembly) {
4394       # Trap handling is enabled on arm64 Mac and Linux and in simulators on
4395       # x64 on Linux and Mac.
4396       if ((current_cpu == "arm64" &&
4397            (is_linux || is_chromeos || is_mac || is_ios)) ||
4398           (current_cpu == "x64" && (is_linux || is_chromeos || is_mac  || is_tizen))) {
4399         sources += [ "src/trap-handler/handler-inside-posix.h" ]
4400       }
4401       if (current_cpu == "x64" &&
4402           (is_linux || is_chromeos || is_mac || is_win)) {
4403         sources += [ "src/trap-handler/trap-handler-simulator.h" ]
4404       }
4405     }
4406     if (is_win) {
4407       sources += [ "src/diagnostics/unwinding-info-win64.h" ]
4408     }
4409   } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
4410     sources += [
4411       ### gcmole(mips64el) ###
4412       "src/codegen/mips64/assembler-mips64-inl.h",
4413       "src/codegen/mips64/assembler-mips64.h",
4414       "src/codegen/mips64/constants-mips64.h",
4415       "src/codegen/mips64/macro-assembler-mips64.h",
4416       "src/codegen/mips64/register-mips64.h",
4417       "src/codegen/mips64/reglist-mips64.h",
4418       "src/compiler/backend/mips64/instruction-codes-mips64.h",
4419       "src/execution/mips64/frame-constants-mips64.h",
4420       "src/execution/mips64/simulator-mips64.h",
4421       "src/regexp/mips64/regexp-macro-assembler-mips64.h",
4422       "src/wasm/baseline/mips64/liftoff-assembler-mips64-inl.h",
4423     ]
4424     if (v8_enable_sparkplug) {
4425       sources += [
4426         "src/baseline/mips64/baseline-assembler-mips64-inl.h",
4427         "src/baseline/mips64/baseline-compiler-mips64-inl.h",
4428       ]
4429     }
4430   } else if (v8_current_cpu == "loong64") {
4431     sources += [
4432       ### gcmole(loong64) ###
4433       "src/codegen/loong64/assembler-loong64-inl.h",
4434       "src/codegen/loong64/assembler-loong64.h",
4435       "src/codegen/loong64/constants-loong64.h",
4436       "src/codegen/loong64/macro-assembler-loong64.h",
4437       "src/codegen/loong64/register-loong64.h",
4438       "src/codegen/loong64/reglist-loong64.h",
4439       "src/compiler/backend/loong64/instruction-codes-loong64.h",
4440       "src/execution/loong64/frame-constants-loong64.h",
4441       "src/execution/loong64/simulator-loong64.h",
4442       "src/regexp/loong64/regexp-macro-assembler-loong64.h",
4443       "src/wasm/baseline/loong64/liftoff-assembler-loong64-inl.h",
4444     ]
4445     if (v8_enable_sparkplug) {
4446       sources += [
4447         "src/baseline/loong64/baseline-assembler-loong64-inl.h",
4448         "src/baseline/loong64/baseline-compiler-loong64-inl.h",
4449       ]
4450     }
4451     if (v8_enable_webassembly) {
4452       # Trap handling is enabled on loong64 Linux and in simulators on
4453       # x64 on Linux.
4454       if ((current_cpu == "loong64" && is_linux) ||
4455           (current_cpu == "x64" && is_linux)) {
4456         sources += [ "src/trap-handler/handler-inside-posix.h" ]
4457       }
4458       if (current_cpu == "x64" && is_linux) {
4459         sources += [ "src/trap-handler/trap-handler-simulator.h" ]
4460       }
4461     }
4462   } else if (v8_current_cpu == "ppc") {
4463     sources += [
4464       ### gcmole(ppc) ###
4465       "src/codegen/ppc/assembler-ppc-inl.h",
4466       "src/codegen/ppc/assembler-ppc.h",
4467       "src/codegen/ppc/constants-ppc.h",
4468       "src/codegen/ppc/interface-descriptors-ppc-inl.h",
4469       "src/codegen/ppc/macro-assembler-ppc.h",
4470       "src/codegen/ppc/register-ppc.h",
4471       "src/codegen/ppc/reglist-ppc.h",
4472       "src/compiler/backend/ppc/instruction-codes-ppc.h",
4473       "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
4474       "src/execution/ppc/frame-constants-ppc.h",
4475       "src/execution/ppc/simulator-ppc.h",
4476       "src/regexp/ppc/regexp-macro-assembler-ppc.h",
4477       "src/wasm/baseline/ppc/liftoff-assembler-ppc-inl.h",
4478     ]
4479   } else if (v8_current_cpu == "ppc64") {
4480     sources += [
4481       ### gcmole(ppc64) ###
4482       "src/codegen/ppc/assembler-ppc-inl.h",
4483       "src/codegen/ppc/assembler-ppc.h",
4484       "src/codegen/ppc/constants-ppc.h",
4485       "src/codegen/ppc/interface-descriptors-ppc-inl.h",
4486       "src/codegen/ppc/macro-assembler-ppc.h",
4487       "src/codegen/ppc/register-ppc.h",
4488       "src/codegen/ppc/reglist-ppc.h",
4489       "src/compiler/backend/ppc/instruction-codes-ppc.h",
4490       "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
4491       "src/execution/ppc/frame-constants-ppc.h",
4492       "src/execution/ppc/simulator-ppc.h",
4493       "src/regexp/ppc/regexp-macro-assembler-ppc.h",
4494       "src/wasm/baseline/ppc/liftoff-assembler-ppc-inl.h",
4495     ]
4496     if (v8_enable_sparkplug) {
4497       sources += [
4498         "src/baseline/ppc/baseline-assembler-ppc-inl.h",
4499         "src/baseline/ppc/baseline-compiler-ppc-inl.h",
4500       ]
4501     }
4502   } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
4503     sources += [
4504       ### gcmole(s390) ###
4505       "src/codegen/s390/assembler-s390-inl.h",
4506       "src/codegen/s390/assembler-s390.h",
4507       "src/codegen/s390/constants-s390.h",
4508       "src/codegen/s390/interface-descriptors-s390-inl.h",
4509       "src/codegen/s390/macro-assembler-s390.h",
4510       "src/codegen/s390/register-s390.h",
4511       "src/codegen/s390/reglist-s390.h",
4512       "src/compiler/backend/s390/instruction-codes-s390.h",
4513       "src/compiler/backend/s390/unwinding-info-writer-s390.h",
4514       "src/execution/s390/frame-constants-s390.h",
4515       "src/execution/s390/simulator-s390.h",
4516       "src/regexp/s390/regexp-macro-assembler-s390.h",
4517       "src/wasm/baseline/s390/liftoff-assembler-s390-inl.h",
4518     ]
4519     if (v8_enable_sparkplug) {
4520       sources += [
4521         "src/baseline/s390/baseline-assembler-s390-inl.h",
4522         "src/baseline/s390/baseline-compiler-s390-inl.h",
4523       ]
4524     }
4525   } else if (v8_current_cpu == "riscv64") {
4526     sources += [
4527       ### gcmole(riscv64) ###
4528       "src/baseline/riscv/baseline-assembler-riscv-inl.h",
4529       "src/baseline/riscv/baseline-compiler-riscv-inl.h",
4530       "src/codegen/riscv/assembler-riscv-inl.h",
4531       "src/codegen/riscv/assembler-riscv.h",
4532       "src/codegen/riscv/base-assembler-riscv.h",
4533       "src/codegen/riscv/base-constants-riscv.h",
4534       "src/codegen/riscv/base-riscv-i.h",
4535       "src/codegen/riscv/constant-riscv-a.h",
4536       "src/codegen/riscv/constant-riscv-c.h",
4537       "src/codegen/riscv/constant-riscv-d.h",
4538       "src/codegen/riscv/constant-riscv-f.h",
4539       "src/codegen/riscv/constant-riscv-m.h",
4540       "src/codegen/riscv/constant-riscv-v.h",
4541       "src/codegen/riscv/constant-riscv-zicsr.h",
4542       "src/codegen/riscv/constant-riscv-zifencei.h",
4543       "src/codegen/riscv/constants-riscv.h",
4544       "src/codegen/riscv/extension-riscv-a.h",
4545       "src/codegen/riscv/extension-riscv-c.h",
4546       "src/codegen/riscv/extension-riscv-d.h",
4547       "src/codegen/riscv/extension-riscv-f.h",
4548       "src/codegen/riscv/extension-riscv-inl.h",
4549       "src/codegen/riscv/extension-riscv-m.h",
4550       "src/codegen/riscv/extension-riscv-v.h",
4551       "src/codegen/riscv/extension-riscv-zicsr.h",
4552       "src/codegen/riscv/extension-riscv-zifencei.h",
4553       "src/codegen/riscv/interface-descriptors-riscv-inl.h",
4554       "src/codegen/riscv/macro-assembler-riscv.h",
4555       "src/codegen/riscv/register-riscv.h",
4556       "src/codegen/riscv/reglist-riscv.h",
4557       "src/compiler/backend/riscv/instruction-codes-riscv.h",
4558       "src/execution/riscv/frame-constants-riscv.h",
4559       "src/execution/riscv/simulator-riscv.h",
4560       "src/regexp/riscv/regexp-macro-assembler-riscv.h",
4561       "src/wasm/baseline/riscv64/liftoff-assembler-riscv64-inl.h",
4562     ]
4563     if (v8_enable_sparkplug) {
4564       sources += [
4565         "src/baseline/riscv/baseline-assembler-riscv-inl.h",
4566         "src/baseline/riscv/baseline-compiler-riscv-inl.h",
4567       ]
4568     }
4569   } else if (v8_current_cpu == "riscv32") {
4570     sources += [
4571       ### gcmole(riscv32) ###
4572       "src/codegen/riscv/assembler-riscv-inl.h",
4573       "src/codegen/riscv/assembler-riscv.h",
4574       "src/codegen/riscv/base-assembler-riscv.h",
4575       "src/codegen/riscv/base-constants-riscv.h",
4576       "src/codegen/riscv/base-riscv-i.h",
4577       "src/codegen/riscv/constant-riscv-a.h",
4578       "src/codegen/riscv/constant-riscv-c.h",
4579       "src/codegen/riscv/constant-riscv-d.h",
4580       "src/codegen/riscv/constant-riscv-f.h",
4581       "src/codegen/riscv/constant-riscv-i.h",
4582       "src/codegen/riscv/constant-riscv-m.h",
4583       "src/codegen/riscv/constant-riscv-v.h",
4584       "src/codegen/riscv/constant-riscv-zicsr.h",
4585       "src/codegen/riscv/constant-riscv-zifencei.h",
4586       "src/codegen/riscv/constants-riscv.h",
4587       "src/codegen/riscv/extension-riscv-a.h",
4588       "src/codegen/riscv/extension-riscv-c.h",
4589       "src/codegen/riscv/extension-riscv-d.h",
4590       "src/codegen/riscv/extension-riscv-f.h",
4591       "src/codegen/riscv/extension-riscv-inl.h",
4592       "src/codegen/riscv/extension-riscv-m.h",
4593       "src/codegen/riscv/extension-riscv-v.h",
4594       "src/codegen/riscv/extension-riscv-zicsr.h",
4595       "src/codegen/riscv/extension-riscv-zifencei.h",
4596       "src/codegen/riscv/interface-descriptors-riscv-inl.h",
4597       "src/codegen/riscv/macro-assembler-riscv.h",
4598       "src/codegen/riscv/register-riscv.h",
4599       "src/codegen/riscv/reglist-riscv.h",
4600       "src/compiler/backend/riscv/instruction-codes-riscv.h",
4601       "src/execution/riscv/frame-constants-riscv.h",
4602       "src/execution/riscv/simulator-riscv.h",
4603       "src/regexp/riscv/regexp-macro-assembler-riscv.h",
4604       "src/wasm/baseline/riscv32/liftoff-assembler-riscv32-inl.h",
4605     ]
4606     if (v8_enable_sparkplug) {
4607       sources += [
4608         "src/baseline/riscv/baseline-assembler-riscv-inl.h",
4609         "src/baseline/riscv/baseline-compiler-riscv-inl.h",
4610       ]
4611     }
4612   }
4613
4614   public_deps = [
4615     ":torque_runtime_support",
4616     ":v8_flags",
4617     ":v8_headers",
4618     ":v8_maybe_icu",
4619     ":v8_shared_internal_headers",
4620   ]
4621
4622   deps = [
4623     ":cppgc_headers",
4624     ":generate_bytecode_builtins_list",
4625     ":run_torque",
4626     ":v8_heap_base_headers",
4627     ":v8_libbase",
4628   ]
4629 }
4630
4631 v8_compiler_sources = [
4632   ### gcmole(all) ###
4633   "src/compiler/access-builder.cc",
4634   "src/compiler/access-info.cc",
4635   "src/compiler/add-type-assertions-reducer.cc",
4636   "src/compiler/all-nodes.cc",
4637   "src/compiler/backend/bitcast-elider.cc",
4638   "src/compiler/backend/code-generator.cc",
4639   "src/compiler/backend/frame-elider.cc",
4640   "src/compiler/backend/gap-resolver.cc",
4641   "src/compiler/backend/instruction-scheduler.cc",
4642   "src/compiler/backend/instruction-selector.cc",
4643   "src/compiler/backend/instruction.cc",
4644   "src/compiler/backend/jump-threading.cc",
4645   "src/compiler/backend/mid-tier-register-allocator.cc",
4646   "src/compiler/backend/move-optimizer.cc",
4647   "src/compiler/backend/register-allocator-verifier.cc",
4648   "src/compiler/backend/register-allocator.cc",
4649   "src/compiler/backend/spill-placer.cc",
4650   "src/compiler/basic-block-instrumentor.cc",
4651   "src/compiler/branch-condition-duplicator.cc",
4652   "src/compiler/branch-elimination.cc",
4653   "src/compiler/bytecode-analysis.cc",
4654   "src/compiler/bytecode-graph-builder.cc",
4655   "src/compiler/bytecode-liveness-map.cc",
4656   "src/compiler/c-linkage.cc",
4657   "src/compiler/checkpoint-elimination.cc",
4658   "src/compiler/code-assembler.cc",
4659   "src/compiler/common-node-cache.cc",
4660   "src/compiler/common-operator-reducer.cc",
4661   "src/compiler/common-operator.cc",
4662   "src/compiler/compilation-dependencies.cc",
4663   "src/compiler/compiler-source-position-table.cc",
4664   "src/compiler/constant-folding-reducer.cc",
4665   "src/compiler/control-equivalence.cc",
4666   "src/compiler/control-flow-optimizer.cc",
4667   "src/compiler/csa-load-elimination.cc",
4668   "src/compiler/dead-code-elimination.cc",
4669   "src/compiler/decompression-optimizer.cc",
4670   "src/compiler/effect-control-linearizer.cc",
4671   "src/compiler/escape-analysis-reducer.cc",
4672   "src/compiler/escape-analysis.cc",
4673   "src/compiler/fast-api-calls.cc",
4674   "src/compiler/feedback-source.cc",
4675   "src/compiler/frame-states.cc",
4676   "src/compiler/frame.cc",
4677   "src/compiler/graph-assembler.cc",
4678   "src/compiler/graph-reducer.cc",
4679   "src/compiler/graph-trimmer.cc",
4680   "src/compiler/graph-visualizer.cc",
4681   "src/compiler/graph.cc",
4682   "src/compiler/heap-refs.cc",
4683   "src/compiler/js-call-reducer.cc",
4684   "src/compiler/js-context-specialization.cc",
4685   "src/compiler/js-create-lowering.cc",
4686   "src/compiler/js-generic-lowering.cc",
4687   "src/compiler/js-graph.cc",
4688   "src/compiler/js-heap-broker.cc",
4689   "src/compiler/js-inlining-heuristic.cc",
4690   "src/compiler/js-inlining.cc",
4691   "src/compiler/js-intrinsic-lowering.cc",
4692   "src/compiler/js-native-context-specialization.cc",
4693   "src/compiler/js-operator.cc",
4694   "src/compiler/js-type-hint-lowering.cc",
4695   "src/compiler/js-typed-lowering.cc",
4696   "src/compiler/late-escape-analysis.cc",
4697   "src/compiler/linkage.cc",
4698   "src/compiler/load-elimination.cc",
4699   "src/compiler/loop-analysis.cc",
4700   "src/compiler/loop-peeling.cc",
4701   "src/compiler/loop-unrolling.cc",
4702   "src/compiler/loop-variable-optimizer.cc",
4703   "src/compiler/machine-graph-verifier.cc",
4704   "src/compiler/machine-graph.cc",
4705   "src/compiler/machine-operator-reducer.cc",
4706   "src/compiler/machine-operator.cc",
4707   "src/compiler/map-inference.cc",
4708   "src/compiler/memory-lowering.cc",
4709   "src/compiler/memory-optimizer.cc",
4710   "src/compiler/node-marker.cc",
4711   "src/compiler/node-matchers.cc",
4712   "src/compiler/node-observer.cc",
4713   "src/compiler/node-origin-table.cc",
4714   "src/compiler/node-properties.cc",
4715   "src/compiler/node.cc",
4716   "src/compiler/opcodes.cc",
4717   "src/compiler/operation-typer.cc",
4718   "src/compiler/operator-properties.cc",
4719   "src/compiler/operator.cc",
4720   "src/compiler/osr.cc",
4721   "src/compiler/pair-load-store-reducer.cc",
4722   "src/compiler/pipeline-statistics.cc",
4723   "src/compiler/pipeline.cc",
4724   "src/compiler/property-access-builder.cc",
4725   "src/compiler/raw-machine-assembler.cc",
4726   "src/compiler/redundancy-elimination.cc",
4727   "src/compiler/refs-map.cc",
4728   "src/compiler/representation-change.cc",
4729   "src/compiler/schedule.cc",
4730   "src/compiler/scheduler.cc",
4731   "src/compiler/select-lowering.cc",
4732   "src/compiler/simplified-lowering-verifier.cc",
4733   "src/compiler/simplified-lowering.cc",
4734   "src/compiler/simplified-operator-reducer.cc",
4735   "src/compiler/simplified-operator.cc",
4736   "src/compiler/state-values-utils.cc",
4737   "src/compiler/store-store-elimination.cc",
4738   "src/compiler/string-builder-optimizer.cc",
4739   "src/compiler/turbofan-enabled.cc",
4740   "src/compiler/type-cache.cc",
4741   "src/compiler/type-narrowing-reducer.cc",
4742   "src/compiler/typed-optimization.cc",
4743   "src/compiler/typer.cc",
4744   "src/compiler/types.cc",
4745   "src/compiler/value-numbering-reducer.cc",
4746   "src/compiler/verifier.cc",
4747   "src/compiler/zone-stats.cc",
4748 ]
4749
4750 if (v8_current_cpu == "x86") {
4751   v8_compiler_sources += [
4752     ### gcmole(ia32) ###
4753     "src/compiler/backend/ia32/code-generator-ia32.cc",
4754     "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
4755     "src/compiler/backend/ia32/instruction-selector-ia32.cc",
4756   ]
4757 } else if (v8_current_cpu == "x64") {
4758   v8_compiler_sources += [
4759     ### gcmole(x64) ###
4760     "src/compiler/backend/x64/code-generator-x64.cc",
4761     "src/compiler/backend/x64/instruction-scheduler-x64.cc",
4762     "src/compiler/backend/x64/instruction-selector-x64.cc",
4763     "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
4764   ]
4765 } else if (v8_current_cpu == "arm") {
4766   v8_compiler_sources += [
4767     ### gcmole(arm) ###
4768     "src/compiler/backend/arm/code-generator-arm.cc",
4769     "src/compiler/backend/arm/instruction-scheduler-arm.cc",
4770     "src/compiler/backend/arm/instruction-selector-arm.cc",
4771     "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
4772   ]
4773 } else if (v8_current_cpu == "arm64") {
4774   v8_compiler_sources += [
4775     ### gcmole(arm64) ###
4776     "src/compiler/backend/arm64/code-generator-arm64.cc",
4777     "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
4778     "src/compiler/backend/arm64/instruction-selector-arm64.cc",
4779     "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
4780   ]
4781 } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
4782   v8_compiler_sources += [
4783     ### gcmole(mips64el) ###
4784     "src/compiler/backend/mips64/code-generator-mips64.cc",
4785     "src/compiler/backend/mips64/instruction-scheduler-mips64.cc",
4786     "src/compiler/backend/mips64/instruction-selector-mips64.cc",
4787   ]
4788 } else if (v8_current_cpu == "loong64") {
4789   v8_compiler_sources += [
4790     ### gcmole(loong64) ###
4791     "src/compiler/backend/loong64/code-generator-loong64.cc",
4792     "src/compiler/backend/loong64/instruction-scheduler-loong64.cc",
4793     "src/compiler/backend/loong64/instruction-selector-loong64.cc",
4794   ]
4795 } else if (v8_current_cpu == "ppc") {
4796   v8_compiler_sources += [
4797     ### gcmole(ppc) ###
4798     "src/compiler/backend/ppc/code-generator-ppc.cc",
4799     "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
4800     "src/compiler/backend/ppc/instruction-selector-ppc.cc",
4801     "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
4802   ]
4803 } else if (v8_current_cpu == "ppc64") {
4804   v8_compiler_sources += [
4805     ### gcmole(ppc64) ###
4806     "src/compiler/backend/ppc/code-generator-ppc.cc",
4807     "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
4808     "src/compiler/backend/ppc/instruction-selector-ppc.cc",
4809     "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
4810   ]
4811 } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
4812   v8_compiler_sources += [
4813     ### gcmole(s390) ###
4814     "src/compiler/backend/s390/code-generator-s390.cc",
4815     "src/compiler/backend/s390/instruction-scheduler-s390.cc",
4816     "src/compiler/backend/s390/instruction-selector-s390.cc",
4817     "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
4818   ]
4819 } else if (v8_current_cpu == "riscv64") {
4820   v8_compiler_sources += [
4821     ### gcmole(riscv64) ###
4822     "src/compiler/backend/riscv/code-generator-riscv.cc",
4823     "src/compiler/backend/riscv/instruction-scheduler-riscv.cc",
4824     "src/compiler/backend/riscv/instruction-selector-riscv64.cc",
4825   ]
4826 } else if (v8_current_cpu == "riscv32") {
4827   v8_compiler_sources += [
4828     ### gcmole(riscv32) ###
4829     "src/compiler/backend/riscv/code-generator-riscv.cc",
4830     "src/compiler/backend/riscv/instruction-scheduler-riscv.cc",
4831     "src/compiler/backend/riscv/instruction-selector-riscv32.cc",
4832   ]
4833 }
4834
4835 if (v8_enable_webassembly) {
4836   v8_compiler_sources += [
4837     "src/compiler/int64-lowering.cc",
4838     "src/compiler/turboshaft/int64-lowering-phase.cc",
4839     "src/compiler/turboshaft/wasm-gc-optimize-phase.cc",
4840     "src/compiler/turboshaft/wasm-gc-type-reducer.cc",
4841     "src/compiler/turboshaft/wasm-lowering-phase.cc",
4842     "src/compiler/turboshaft/wasm-optimize-phase.cc",
4843     "src/compiler/turboshaft/wasm-turboshaft-compiler.cc",
4844     "src/compiler/wasm-address-reassociation.cc",
4845     "src/compiler/wasm-call-descriptors.cc",
4846     "src/compiler/wasm-compiler-definitions.cc",
4847     "src/compiler/wasm-compiler.cc",
4848     "src/compiler/wasm-escape-analysis.cc",
4849     "src/compiler/wasm-gc-lowering.cc",
4850     "src/compiler/wasm-gc-operator-reducer.cc",
4851     "src/compiler/wasm-graph-assembler.cc",
4852     "src/compiler/wasm-inlining-into-js.cc",
4853     "src/compiler/wasm-inlining.cc",
4854     "src/compiler/wasm-js-lowering.cc",
4855     "src/compiler/wasm-load-elimination.cc",
4856     "src/compiler/wasm-loop-peeling.cc",
4857     "src/compiler/wasm-typer.cc",
4858   ]
4859 }
4860
4861 if (v8_enable_wasm_simd256_revec) {
4862   v8_compiler_sources += [
4863     "src/compiler/linear-scheduler.cc",
4864     "src/compiler/revectorizer.cc",
4865   ]
4866 }
4867
4868 # The src/compiler files for use in mksnapshot.
4869 # - These might be built with additional optimizations if
4870 #   v8_enable_fast_mksnapshot is set.
4871 # - We always include Turbofan even if v8_enable_turbofan is unset s.t.
4872 #   builtins can be generated by mksnapshot.
4873 v8_source_set("v8_compiler_for_mksnapshot_source_set") {
4874   visibility = [ ":*" ]  # Only targets in this file can depend on this.
4875
4876   sources = v8_compiler_sources
4877
4878   public_deps = [
4879     ":generate_bytecode_builtins_list",
4880     ":run_torque",
4881     ":v8_abseil",
4882     ":v8_maybe_icu",
4883     ":v8_tracing",
4884   ]
4885
4886   deps = [
4887     ":v8_base_without_compiler",
4888     ":v8_internal_headers",
4889     ":v8_libbase",
4890     ":v8_shared_internal_headers",
4891   ]
4892
4893   if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
4894     # The :no_optimize config is added to v8_add_configs in v8.gni.
4895     remove_configs = [ "//build/config/compiler:no_optimize" ]
4896     configs = [ ":always_turbofanimize" ]
4897   } else {
4898     # Without this else branch, gn fails to generate build files for non-debug
4899     # builds (because we try to remove a config that is not present).
4900     # So we include it, even if this config is not used outside of debug builds.
4901     configs = [ ":internal_config" ]
4902   }
4903 }
4904
4905 # The src/compiler files with default behavior.
4906 v8_source_set("v8_compiler") {
4907   visibility = [ ":*" ]  # Only targets in this file can depend on this.
4908
4909   if (v8_enable_turbofan) {
4910     sources = v8_compiler_sources
4911   } else {
4912     # With Turbofan disabled, we only include the stubbed-out API.
4913     sources = [ "src/compiler/turbofan-disabled.cc" ]
4914   }
4915
4916   public_deps = [
4917     ":generate_bytecode_builtins_list",
4918     ":run_torque",
4919     ":v8_abseil",
4920     ":v8_internal_headers",
4921     ":v8_maybe_icu",
4922     ":v8_tracing",
4923   ]
4924
4925   deps = [
4926     ":v8_base_without_compiler",
4927     ":v8_libbase",
4928     ":v8_shared_internal_headers",
4929   ]
4930
4931   configs = [ ":internal_config" ]
4932 }
4933
4934 # The src/compiler files with default optimization behavior.
4935 v8_source_set("v8_turboshaft") {
4936   visibility = [ ":*" ]  # Only targets in this file can depend on this.
4937
4938   sources = [
4939     "src/compiler/turboshaft/analyzer-iterator.cc",
4940     "src/compiler/turboshaft/assembler.cc",
4941     "src/compiler/turboshaft/build-graph-phase.cc",
4942     "src/compiler/turboshaft/dead-code-elimination-phase.cc",
4943     "src/compiler/turboshaft/debug-feature-lowering-phase.cc",
4944     "src/compiler/turboshaft/decompression-optimization-phase.cc",
4945     "src/compiler/turboshaft/decompression-optimization.cc",
4946     "src/compiler/turboshaft/graph-builder.cc",
4947     "src/compiler/turboshaft/graph-visualizer.cc",
4948     "src/compiler/turboshaft/graph.cc",
4949     "src/compiler/turboshaft/instruction-selection-phase.cc",
4950     "src/compiler/turboshaft/late-escape-analysis-reducer.cc",
4951     "src/compiler/turboshaft/late-load-elimination-reducer.cc",
4952     "src/compiler/turboshaft/loop-finder.cc",
4953     "src/compiler/turboshaft/loop-unrolling-phase.cc",
4954     "src/compiler/turboshaft/loop-unrolling-reducer.cc",
4955     "src/compiler/turboshaft/machine-lowering-phase.cc",
4956     "src/compiler/turboshaft/memory-optimization-reducer.cc",
4957     "src/compiler/turboshaft/operations.cc",
4958     "src/compiler/turboshaft/optimization-phase.cc",
4959     "src/compiler/turboshaft/optimize-phase.cc",
4960     "src/compiler/turboshaft/phase.cc",
4961     "src/compiler/turboshaft/pretenuring-propagation-reducer.cc",
4962     "src/compiler/turboshaft/recreate-schedule-phase.cc",
4963     "src/compiler/turboshaft/recreate-schedule.cc",
4964     "src/compiler/turboshaft/representations.cc",
4965     "src/compiler/turboshaft/sidetable.cc",
4966     "src/compiler/turboshaft/simplified-lowering-phase.cc",
4967     "src/compiler/turboshaft/simplify-tf-loops.cc",
4968     "src/compiler/turboshaft/store-store-elimination-phase.cc",
4969     "src/compiler/turboshaft/type-assertions-phase.cc",
4970     "src/compiler/turboshaft/type-parser.cc",
4971     "src/compiler/turboshaft/typed-optimizations-phase.cc",
4972     "src/compiler/turboshaft/typer.cc",
4973     "src/compiler/turboshaft/types.cc",
4974     "src/compiler/turboshaft/use-map.cc",
4975     "src/compiler/turboshaft/utils.cc",
4976   ]
4977
4978   public_deps = [
4979     ":generate_bytecode_builtins_list",
4980     ":run_torque",
4981     ":v8_internal_headers",
4982     ":v8_maybe_icu",
4983     ":v8_tracing",
4984   ]
4985
4986   deps = [
4987     ":v8_base_without_compiler",
4988     ":v8_libbase",
4989     ":v8_shared_internal_headers",
4990   ]
4991
4992   configs = [ ":internal_config" ]
4993 }
4994
4995 group("v8_compiler_for_mksnapshot") {
4996   if ((is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) ||
4997       !v8_enable_turbofan) {
4998     # mksnapshot needs its own version of the compiler, either because
4999     # a) we're optimizing for mksnapshot execution speed and the compiler
5000     #    should be optimized even if the rest of V8 is not; or
5001     # b) Turbofan is disabled and thus not compiled into the rest of V8, yet
5002     #    mksnapshot still needs TF to generate builtins.
5003     deps = [ ":v8_compiler_for_mksnapshot_source_set" ]
5004   } else {
5005     deps = [ ":v8_compiler" ]
5006   }
5007 }
5008
5009 # Any target using trace events must directly or indirectly depend on
5010 # v8_tracing.
5011 group("v8_tracing") {
5012   if (v8_use_perfetto) {
5013     if (build_with_chromium) {
5014       public_deps = [ "//third_party/perfetto:libperfetto" ]
5015     } else {
5016       public_deps = [ ":v8_libperfetto" ]
5017     }
5018   }
5019 }
5020
5021 v8_source_set("v8_base_without_compiler") {
5022   # Only targets in this file and gcmole can depend on this.
5023   visibility = [
5024     ":*",
5025     "tools/gcmole/:*",
5026   ]
5027
5028   # Split static libraries on windows into two.
5029   split_count = 2
5030
5031   sources = [
5032     ### gcmole(all) ###
5033     "src/api/api-arguments.cc",
5034     "src/api/api-natives.cc",
5035     "src/api/api.cc",
5036     "src/ast/ast-function-literal-id-reindexer.cc",
5037     "src/ast/ast-value-factory.cc",
5038     "src/ast/ast.cc",
5039     "src/ast/modules.cc",
5040     "src/ast/prettyprinter.cc",
5041     "src/ast/scopes.cc",
5042     "src/ast/source-range-ast-visitor.cc",
5043     "src/ast/variables.cc",
5044     "src/baseline/baseline.cc",
5045     "src/baseline/bytecode-offset-iterator.cc",
5046     "src/builtins/accessors.cc",
5047     "src/builtins/builtins-api.cc",
5048     "src/builtins/builtins-array.cc",
5049     "src/builtins/builtins-arraybuffer.cc",
5050     "src/builtins/builtins-async-module.cc",
5051     "src/builtins/builtins-atomics-synchronization.cc",
5052     "src/builtins/builtins-bigint.cc",
5053     "src/builtins/builtins-callsite.cc",
5054     "src/builtins/builtins-collections.cc",
5055     "src/builtins/builtins-console.cc",
5056     "src/builtins/builtins-dataview.cc",
5057     "src/builtins/builtins-date.cc",
5058     "src/builtins/builtins-error.cc",
5059     "src/builtins/builtins-function.cc",
5060     "src/builtins/builtins-global.cc",
5061     "src/builtins/builtins-internal.cc",
5062     "src/builtins/builtins-intl.cc",
5063     "src/builtins/builtins-json.cc",
5064     "src/builtins/builtins-number.cc",
5065     "src/builtins/builtins-object.cc",
5066     "src/builtins/builtins-reflect.cc",
5067     "src/builtins/builtins-regexp.cc",
5068     "src/builtins/builtins-shadow-realm.cc",
5069     "src/builtins/builtins-shared-array.cc",
5070     "src/builtins/builtins-sharedarraybuffer.cc",
5071     "src/builtins/builtins-string.cc",
5072     "src/builtins/builtins-struct.cc",
5073     "src/builtins/builtins-symbol.cc",
5074     "src/builtins/builtins-temporal.cc",
5075     "src/builtins/builtins-trace.cc",
5076     "src/builtins/builtins-typed-array.cc",
5077     "src/builtins/builtins-weak-refs.cc",
5078     "src/builtins/builtins.cc",
5079     "src/builtins/constants-table-builder.cc",
5080     "src/codegen/aligned-slot-allocator.cc",
5081     "src/codegen/assembler.cc",
5082     "src/codegen/bailout-reason.cc",
5083     "src/codegen/code-comments.cc",
5084     "src/codegen/code-desc.cc",
5085     "src/codegen/code-factory.cc",
5086     "src/codegen/code-reference.cc",
5087     "src/codegen/compilation-cache.cc",
5088     "src/codegen/compiler.cc",
5089     "src/codegen/constant-pool.cc",
5090     "src/codegen/external-reference-encoder.cc",
5091     "src/codegen/external-reference-table.cc",
5092     "src/codegen/external-reference.cc",
5093     "src/codegen/flush-instruction-cache.cc",
5094     "src/codegen/handler-table.cc",
5095     "src/codegen/interface-descriptors.cc",
5096     "src/codegen/machine-type.cc",
5097     "src/codegen/macro-assembler-base.cc",
5098     "src/codegen/maglev-safepoint-table.cc",
5099     "src/codegen/optimized-compilation-info.cc",
5100     "src/codegen/pending-optimization-table.cc",
5101     "src/codegen/register-configuration.cc",
5102     "src/codegen/reloc-info.cc",
5103     "src/codegen/safepoint-table.cc",
5104     "src/codegen/source-position-table.cc",
5105     "src/codegen/source-position.cc",
5106     "src/codegen/tick-counter.cc",
5107     "src/codegen/tnode.cc",
5108     "src/codegen/unoptimized-compilation-info.cc",
5109     "src/common/assert-scope.cc",
5110     "src/common/code-memory-access.cc",
5111     "src/common/ptr-compr.cc",
5112     "src/compiler-dispatcher/lazy-compile-dispatcher.cc",
5113     "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
5114     "src/date/date.cc",
5115     "src/date/dateparser.cc",
5116     "src/debug/debug-coverage.cc",
5117     "src/debug/debug-evaluate.cc",
5118     "src/debug/debug-frames.cc",
5119     "src/debug/debug-interface.cc",
5120     "src/debug/debug-property-iterator.cc",
5121     "src/debug/debug-scope-iterator.cc",
5122     "src/debug/debug-scopes.cc",
5123     "src/debug/debug-stack-trace-iterator.cc",
5124     "src/debug/debug.cc",
5125     "src/debug/liveedit-diff.cc",
5126     "src/debug/liveedit.cc",
5127     "src/deoptimizer/deoptimize-reason.cc",
5128     "src/deoptimizer/deoptimized-frame-info.cc",
5129     "src/deoptimizer/deoptimizer.cc",
5130     "src/deoptimizer/frame-translation-builder.cc",
5131     "src/deoptimizer/materialized-object-store.cc",
5132     "src/deoptimizer/translated-state.cc",
5133     "src/diagnostics/basic-block-profiler.cc",
5134     "src/diagnostics/compilation-statistics.cc",
5135     "src/diagnostics/disassembler.cc",
5136     "src/diagnostics/eh-frame.cc",
5137     "src/diagnostics/gdb-jit.cc",
5138     "src/diagnostics/objects-debug.cc",
5139     "src/diagnostics/objects-printer.cc",
5140     "src/diagnostics/perf-jit.cc",
5141     "src/diagnostics/unwinder.cc",
5142     "src/execution/arguments.cc",
5143     "src/execution/clobber-registers.cc",
5144     "src/execution/embedder-state.cc",
5145     "src/execution/encoded-c-signature.cc",
5146     "src/execution/execution.cc",
5147     "src/execution/frames.cc",
5148     "src/execution/futex-emulation.cc",
5149     "src/execution/interrupts-scope.cc",
5150     "src/execution/isolate.cc",
5151     "src/execution/local-isolate.cc",
5152     "src/execution/messages.cc",
5153     "src/execution/microtask-queue.cc",
5154     "src/execution/protectors.cc",
5155     "src/execution/simulator-base.cc",
5156     "src/execution/stack-guard.cc",
5157     "src/execution/thread-id.cc",
5158     "src/execution/thread-local-top.cc",
5159     "src/execution/tiering-manager.cc",
5160     "src/execution/v8threads.cc",
5161     "src/extensions/cputracemark-extension.cc",
5162     "src/extensions/externalize-string-extension.cc",
5163     "src/extensions/gc-extension.cc",
5164     "src/extensions/ignition-statistics-extension.cc",
5165     "src/extensions/statistics-extension.cc",
5166     "src/extensions/trigger-failure-extension.cc",
5167     "src/flags/flags.cc",
5168     "src/handles/global-handles.cc",
5169     "src/handles/handles.cc",
5170     "src/handles/local-handles.cc",
5171     "src/handles/persistent-handles.cc",
5172     "src/handles/shared-object-conveyor-handles.cc",
5173     "src/handles/traced-handles.cc",
5174     "src/heap/allocation-observer.cc",
5175     "src/heap/array-buffer-sweeper.cc",
5176     "src/heap/basic-memory-chunk.cc",
5177     "src/heap/code-range.cc",
5178     "src/heap/code-stats.cc",
5179     "src/heap/collection-barrier.cc",
5180     "src/heap/combined-heap.cc",
5181     "src/heap/concurrent-allocator.cc",
5182     "src/heap/concurrent-marking.cc",
5183     "src/heap/cppgc-js/cpp-heap.cc",
5184     "src/heap/cppgc-js/cpp-snapshot.cc",
5185     "src/heap/cppgc-js/cross-heap-remembered-set.cc",
5186     "src/heap/cppgc-js/unified-heap-marking-state.cc",
5187     "src/heap/cppgc-js/unified-heap-marking-verifier.cc",
5188     "src/heap/cppgc-js/unified-heap-marking-visitor.cc",
5189     "src/heap/ephemeron-remembered-set.cc",
5190     "src/heap/evacuation-allocator.cc",
5191     "src/heap/evacuation-verifier.cc",
5192     "src/heap/factory-base.cc",
5193     "src/heap/factory.cc",
5194     "src/heap/finalization-registry-cleanup-task.cc",
5195     "src/heap/free-list.cc",
5196     "src/heap/gc-idle-time-handler.cc",
5197     "src/heap/gc-tracer.cc",
5198     "src/heap/heap-allocator.cc",
5199     "src/heap/heap-controller.cc",
5200     "src/heap/heap-layout-tracer.cc",
5201     "src/heap/heap-verifier.cc",
5202     "src/heap/heap-write-barrier.cc",
5203     "src/heap/heap.cc",
5204     "src/heap/incremental-marking-job.cc",
5205     "src/heap/incremental-marking.cc",
5206     "src/heap/index-generator.cc",
5207     "src/heap/large-page.cc",
5208     "src/heap/large-spaces.cc",
5209     "src/heap/local-factory.cc",
5210     "src/heap/local-heap.cc",
5211     "src/heap/main-allocator.cc",
5212     "src/heap/mark-compact.cc",
5213     "src/heap/mark-sweep-utilities.cc",
5214     "src/heap/marking-barrier.cc",
5215     "src/heap/marking-worklist.cc",
5216     "src/heap/marking.cc",
5217     "src/heap/memory-allocator.cc",
5218     "src/heap/memory-balancer.cc",
5219     "src/heap/memory-chunk-layout.cc",
5220     "src/heap/memory-chunk.cc",
5221     "src/heap/memory-measurement.cc",
5222     "src/heap/memory-reducer.cc",
5223     "src/heap/minor-gc-job.cc",
5224     "src/heap/minor-mark-sweep.cc",
5225     "src/heap/new-spaces.cc",
5226     "src/heap/object-stats.cc",
5227     "src/heap/objects-visiting.cc",
5228     "src/heap/page.cc",
5229     "src/heap/paged-spaces.cc",
5230     "src/heap/pretenuring-handler.cc",
5231     "src/heap/read-only-heap.cc",
5232     "src/heap/read-only-promotion.cc",
5233     "src/heap/read-only-spaces.cc",
5234     "src/heap/safepoint.cc",
5235     "src/heap/scavenger.cc",
5236     "src/heap/slot-set.cc",
5237     "src/heap/spaces.cc",
5238     "src/heap/stress-scavenge-observer.cc",
5239     "src/heap/sweeper.cc",
5240     "src/heap/traced-handles-marking-visitor.cc",
5241     "src/heap/trusted-range.cc",
5242     "src/heap/weak-object-worklists.cc",
5243     "src/heap/zapping.cc",
5244     "src/ic/call-optimization.cc",
5245     "src/ic/handler-configuration.cc",
5246     "src/ic/ic-stats.cc",
5247     "src/ic/ic.cc",
5248     "src/ic/stub-cache.cc",
5249     "src/init/bootstrapper.cc",
5250     "src/init/icu_util.cc",
5251     "src/init/isolate-allocator.cc",
5252     "src/init/startup-data-util.cc",
5253     "src/init/v8.cc",
5254     "src/interpreter/bytecode-array-builder.cc",
5255     "src/interpreter/bytecode-array-iterator.cc",
5256     "src/interpreter/bytecode-array-random-iterator.cc",
5257     "src/interpreter/bytecode-array-writer.cc",
5258     "src/interpreter/bytecode-decoder.cc",
5259     "src/interpreter/bytecode-flags.cc",
5260     "src/interpreter/bytecode-generator.cc",
5261     "src/interpreter/bytecode-label.cc",
5262     "src/interpreter/bytecode-node.cc",
5263     "src/interpreter/bytecode-operands.cc",
5264     "src/interpreter/bytecode-register-optimizer.cc",
5265     "src/interpreter/bytecode-register.cc",
5266     "src/interpreter/bytecode-source-info.cc",
5267     "src/interpreter/bytecodes.cc",
5268     "src/interpreter/constant-array-builder.cc",
5269     "src/interpreter/control-flow-builders.cc",
5270     "src/interpreter/handler-table-builder.cc",
5271     "src/interpreter/interpreter-intrinsics.cc",
5272     "src/interpreter/interpreter.cc",
5273     "src/json/json-parser.cc",
5274     "src/json/json-stringifier.cc",
5275     "src/libsampler/sampler.cc",
5276     "src/logging/counters.cc",
5277     "src/logging/local-logger.cc",
5278     "src/logging/log-file.cc",
5279     "src/logging/log.cc",
5280     "src/logging/metrics.cc",
5281     "src/logging/runtime-call-stats.cc",
5282     "src/logging/tracing-flags.cc",
5283     "src/numbers/conversions.cc",
5284     "src/numbers/math-random.cc",
5285     "src/objects/abstract-code.cc",
5286     "src/objects/backing-store.cc",
5287     "src/objects/bigint.cc",
5288     "src/objects/bytecode-array.cc",
5289     "src/objects/call-site-info.cc",
5290     "src/objects/code-kind.cc",
5291     "src/objects/code.cc",
5292     "src/objects/compilation-cache-table.cc",
5293     "src/objects/contexts.cc",
5294     "src/objects/debug-objects.cc",
5295     "src/objects/deoptimization-data.cc",
5296     "src/objects/dependent-code.cc",
5297     "src/objects/elements-kind.cc",
5298     "src/objects/elements.cc",
5299     "src/objects/embedder-data-array.cc",
5300     "src/objects/feedback-vector.cc",
5301     "src/objects/field-type.cc",
5302     "src/objects/fixed-array.cc",
5303     "src/objects/instruction-stream.cc",
5304     "src/objects/intl-objects.cc",
5305     "src/objects/js-array-buffer.cc",
5306     "src/objects/js-atomics-synchronization.cc",
5307     "src/objects/js-break-iterator.cc",
5308     "src/objects/js-collator.cc",
5309     "src/objects/js-date-time-format.cc",
5310     "src/objects/js-display-names.cc",
5311     "src/objects/js-duration-format.cc",
5312     "src/objects/js-function.cc",
5313     "src/objects/js-list-format.cc",
5314     "src/objects/js-locale.cc",
5315     "src/objects/js-number-format.cc",
5316     "src/objects/js-objects.cc",
5317     "src/objects/js-plural-rules.cc",
5318     "src/objects/js-raw-json.cc",
5319     "src/objects/js-regexp.cc",
5320     "src/objects/js-relative-time-format.cc",
5321     "src/objects/js-segment-iterator.cc",
5322     "src/objects/js-segmenter.cc",
5323     "src/objects/js-segments.cc",
5324     "src/objects/js-struct.cc",
5325     "src/objects/js-temporal-objects.cc",
5326     "src/objects/keys.cc",
5327     "src/objects/literal-objects.cc",
5328     "src/objects/lookup-cache.cc",
5329     "src/objects/lookup.cc",
5330     "src/objects/managed.cc",
5331     "src/objects/map-updater.cc",
5332     "src/objects/map.cc",
5333     "src/objects/module.cc",
5334     "src/objects/object-type.cc",
5335     "src/objects/objects.cc",
5336     "src/objects/option-utils.cc",
5337     "src/objects/ordered-hash-table.cc",
5338     "src/objects/property-descriptor.cc",
5339     "src/objects/property.cc",
5340     "src/objects/regexp-match-info.cc",
5341     "src/objects/scope-info.cc",
5342     "src/objects/shared-function-info.cc",
5343     "src/objects/simd.cc",
5344     "src/objects/source-text-module.cc",
5345     "src/objects/string-comparator.cc",
5346     "src/objects/string-forwarding-table.cc",
5347     "src/objects/string-table.cc",
5348     "src/objects/string.cc",
5349     "src/objects/swiss-name-dictionary.cc",
5350     "src/objects/symbol-table.cc",
5351     "src/objects/synthetic-module.cc",
5352     "src/objects/tagged-impl.cc",
5353     "src/objects/template-objects.cc",
5354     "src/objects/templates.cc",
5355     "src/objects/transitions.cc",
5356     "src/objects/type-hints.cc",
5357     "src/objects/value-serializer.cc",
5358     "src/objects/visitors.cc",
5359     "src/parsing/func-name-inferrer.cc",
5360     "src/parsing/import-assertions.cc",
5361     "src/parsing/literal-buffer.cc",
5362     "src/parsing/parse-info.cc",
5363     "src/parsing/parser.cc",
5364     "src/parsing/parsing.cc",
5365     "src/parsing/pending-compilation-error-handler.cc",
5366     "src/parsing/preparse-data.cc",
5367     "src/parsing/preparser.cc",
5368     "src/parsing/rewriter.cc",
5369     "src/parsing/scanner-character-streams.cc",
5370     "src/parsing/scanner.cc",
5371     "src/parsing/token.cc",
5372     "src/profiler/allocation-tracker.cc",
5373     "src/profiler/cpu-profiler.cc",
5374     "src/profiler/heap-profiler.cc",
5375     "src/profiler/heap-snapshot-generator.cc",
5376     "src/profiler/profile-generator.cc",
5377     "src/profiler/profiler-listener.cc",
5378     "src/profiler/profiler-stats.cc",
5379     "src/profiler/sampling-heap-profiler.cc",
5380     "src/profiler/strings-storage.cc",
5381     "src/profiler/symbolizer.cc",
5382     "src/profiler/tick-sample.cc",
5383     "src/profiler/tracing-cpu-profiler.cc",
5384     "src/profiler/weak-code-registry.cc",
5385     "src/regexp/experimental/experimental-bytecode.cc",
5386     "src/regexp/experimental/experimental-compiler.cc",
5387     "src/regexp/experimental/experimental-interpreter.cc",
5388     "src/regexp/experimental/experimental.cc",
5389     "src/regexp/regexp-ast.cc",
5390     "src/regexp/regexp-bytecode-generator.cc",
5391     "src/regexp/regexp-bytecode-peephole.cc",
5392     "src/regexp/regexp-bytecodes.cc",
5393     "src/regexp/regexp-compiler-tonode.cc",
5394     "src/regexp/regexp-compiler.cc",
5395     "src/regexp/regexp-dotprinter.cc",
5396     "src/regexp/regexp-error.cc",
5397     "src/regexp/regexp-interpreter.cc",
5398     "src/regexp/regexp-macro-assembler-tracer.cc",
5399     "src/regexp/regexp-macro-assembler.cc",
5400     "src/regexp/regexp-parser.cc",
5401     "src/regexp/regexp-stack.cc",
5402     "src/regexp/regexp-utils.cc",
5403     "src/regexp/regexp.cc",
5404     "src/roots/roots.cc",
5405     "src/runtime/runtime-array.cc",
5406     "src/runtime/runtime-atomics.cc",
5407     "src/runtime/runtime-bigint.cc",
5408     "src/runtime/runtime-classes.cc",
5409     "src/runtime/runtime-collections.cc",
5410     "src/runtime/runtime-compiler.cc",
5411     "src/runtime/runtime-date.cc",
5412     "src/runtime/runtime-debug.cc",
5413     "src/runtime/runtime-forin.cc",
5414     "src/runtime/runtime-function.cc",
5415     "src/runtime/runtime-futex.cc",
5416     "src/runtime/runtime-generator.cc",
5417     "src/runtime/runtime-internal.cc",
5418     "src/runtime/runtime-intl.cc",
5419     "src/runtime/runtime-literals.cc",
5420     "src/runtime/runtime-module.cc",
5421     "src/runtime/runtime-numbers.cc",
5422     "src/runtime/runtime-object.cc",
5423     "src/runtime/runtime-operators.cc",
5424     "src/runtime/runtime-promise.cc",
5425     "src/runtime/runtime-proxy.cc",
5426     "src/runtime/runtime-regexp.cc",
5427     "src/runtime/runtime-scopes.cc",
5428     "src/runtime/runtime-shadow-realm.cc",
5429     "src/runtime/runtime-strings.cc",
5430     "src/runtime/runtime-symbol.cc",
5431     "src/runtime/runtime-temporal.cc",
5432     "src/runtime/runtime-test.cc",
5433     "src/runtime/runtime-trace.cc",
5434     "src/runtime/runtime-typedarray.cc",
5435     "src/runtime/runtime-weak-refs.cc",
5436     "src/runtime/runtime.cc",
5437     "src/sandbox/code-pointer-table.cc",
5438     "src/sandbox/external-pointer-table.cc",
5439     "src/sandbox/sandbox.cc",
5440     "src/sandbox/testing.cc",
5441     "src/sandbox/trusted-pointer-table.cc",
5442     "src/snapshot/code-serializer.cc",
5443     "src/snapshot/context-deserializer.cc",
5444     "src/snapshot/context-serializer.cc",
5445     "src/snapshot/deserializer.cc",
5446     "src/snapshot/embedded/embedded-data.cc",
5447     "src/snapshot/object-deserializer.cc",
5448     "src/snapshot/read-only-deserializer.cc",
5449     "src/snapshot/read-only-serializer.cc",
5450     "src/snapshot/roots-serializer.cc",
5451     "src/snapshot/serializer-deserializer.cc",
5452     "src/snapshot/serializer.cc",
5453     "src/snapshot/shared-heap-deserializer.cc",
5454     "src/snapshot/shared-heap-serializer.cc",
5455     "src/snapshot/snapshot-data.cc",
5456     "src/snapshot/snapshot-source-sink.cc",
5457     "src/snapshot/snapshot-utils.cc",
5458     "src/snapshot/snapshot.cc",
5459     "src/snapshot/sort-builtins.cc",
5460     "src/snapshot/startup-deserializer.cc",
5461     "src/snapshot/startup-serializer.cc",
5462     "src/strings/char-predicates.cc",
5463     "src/strings/string-builder.cc",
5464     "src/strings/string-case.cc",
5465     "src/strings/string-stream.cc",
5466     "src/strings/unicode-decoder.cc",
5467     "src/strings/unicode.cc",
5468     "src/strings/uri.cc",
5469     "src/tasks/cancelable-task.cc",
5470     "src/tasks/operations-barrier.cc",
5471     "src/tasks/task-utils.cc",
5472     "src/temporal/temporal-parser.cc",
5473     "src/third_party/siphash/halfsiphash.cc",
5474     "src/tracing/trace-event.cc",
5475     "src/tracing/traced-value.cc",
5476     "src/tracing/tracing-category-observer.cc",
5477     "src/utils/address-map.cc",
5478     "src/utils/allocation.cc",
5479     "src/utils/bit-vector.cc",
5480     "src/utils/detachable-vector.cc",
5481     "src/utils/hex-format.cc",
5482     "src/utils/identity-map.cc",
5483     "src/utils/memcopy.cc",
5484     "src/utils/ostreams.cc",
5485     "src/utils/sha-256.cc",
5486     "src/utils/utils.cc",
5487     "src/utils/version.cc",
5488     "src/zone/accounting-allocator.cc",
5489     "src/zone/type-stats.cc",
5490     "src/zone/zone-segment.cc",
5491     "src/zone/zone.cc",
5492   ]
5493
5494   if (v8_enable_snapshot_compression) {
5495     sources += [ "src/snapshot/snapshot-compression.cc" ]
5496   }
5497
5498   if (v8_enable_sparkplug) {
5499     sources += [
5500       "src/baseline/baseline-batch-compiler.cc",
5501       "src/baseline/baseline-compiler.cc",
5502     ]
5503   }
5504
5505   if (v8_enable_maglev) {
5506     sources += [
5507       "src/maglev/maglev-assembler.cc",
5508       "src/maglev/maglev-code-generator.cc",
5509       "src/maglev/maglev-compilation-info.cc",
5510       "src/maglev/maglev-compilation-unit.cc",
5511       "src/maglev/maglev-compiler.cc",
5512       "src/maglev/maglev-concurrent-dispatcher.cc",
5513       "src/maglev/maglev-graph-builder.cc",
5514       "src/maglev/maglev-graph-printer.cc",
5515       "src/maglev/maglev-interpreter-frame-state.cc",
5516       "src/maglev/maglev-ir.cc",
5517       "src/maglev/maglev-phi-representation-selector.cc",
5518       "src/maglev/maglev-pipeline-statistics.cc",
5519       "src/maglev/maglev-regalloc.cc",
5520       "src/maglev/maglev.cc",
5521     ]
5522     if (v8_current_cpu == "arm") {
5523       sources += [
5524         "src/maglev/arm/maglev-assembler-arm.cc",
5525         "src/maglev/arm/maglev-ir-arm.cc",
5526       ]
5527     } else if (v8_current_cpu == "arm64") {
5528       sources += [
5529         "src/maglev/arm64/maglev-assembler-arm64.cc",
5530         "src/maglev/arm64/maglev-ir-arm64.cc",
5531       ]
5532     } else if (v8_current_cpu == "x64") {
5533       sources += [
5534         "src/maglev/x64/maglev-assembler-x64.cc",
5535         "src/maglev/x64/maglev-ir-x64.cc",
5536       ]
5537     }
5538   }
5539
5540   if (v8_enable_webassembly) {
5541     sources += [
5542       ### gcmole(all) ###
5543       "src/asmjs/asm-js.cc",
5544       "src/asmjs/asm-parser.cc",
5545       "src/asmjs/asm-scanner.cc",
5546       "src/asmjs/asm-types.cc",
5547       "src/compiler/turboshaft/wasm-dead-code-elimination-phase.cc",
5548       "src/debug/debug-wasm-objects.cc",
5549       "src/runtime/runtime-test-wasm.cc",
5550       "src/runtime/runtime-wasm.cc",
5551       "src/trap-handler/handler-inside.cc",
5552       "src/trap-handler/handler-outside.cc",
5553       "src/trap-handler/handler-shared.cc",
5554       "src/wasm/baseline/liftoff-assembler.cc",
5555       "src/wasm/baseline/liftoff-compiler.cc",
5556       "src/wasm/baseline/parallel-move.cc",
5557       "src/wasm/canonical-types.cc",
5558       "src/wasm/code-space-access.cc",
5559       "src/wasm/constant-expression-interface.cc",
5560       "src/wasm/constant-expression.cc",
5561       "src/wasm/function-body-decoder.cc",
5562       "src/wasm/function-compiler.cc",
5563       "src/wasm/graph-builder-interface.cc",
5564       "src/wasm/jump-table-assembler.cc",
5565       "src/wasm/local-decl-encoder.cc",
5566       "src/wasm/memory-tracing.cc",
5567       "src/wasm/module-compiler.cc",
5568       "src/wasm/module-decoder.cc",
5569       "src/wasm/module-instantiate.cc",
5570       "src/wasm/names-provider.cc",
5571       "src/wasm/pgo.cc",
5572       "src/wasm/simd-shuffle.cc",
5573       "src/wasm/stacks.cc",
5574       "src/wasm/streaming-decoder.cc",
5575       "src/wasm/sync-streaming-decoder.cc",
5576       "src/wasm/turboshaft-graph-interface.cc",
5577       "src/wasm/value-type.cc",
5578       "src/wasm/wasm-code-manager.cc",
5579       "src/wasm/wasm-debug.cc",
5580       "src/wasm/wasm-disassembler.cc",
5581       "src/wasm/wasm-engine.cc",
5582       "src/wasm/wasm-external-refs.cc",
5583       "src/wasm/wasm-features.cc",
5584       "src/wasm/wasm-import-wrapper-cache.cc",
5585       "src/wasm/wasm-js.cc",
5586       "src/wasm/wasm-module-builder.cc",
5587       "src/wasm/wasm-module-sourcemap.cc",
5588       "src/wasm/wasm-module.cc",
5589       "src/wasm/wasm-objects.cc",
5590       "src/wasm/wasm-opcodes.cc",
5591       "src/wasm/wasm-result.cc",
5592       "src/wasm/wasm-serialization.cc",
5593       "src/wasm/wasm-subtyping.cc",
5594       "src/wasm/well-known-imports.cc",
5595     ]
5596   }
5597
5598   if (v8_enable_third_party_heap) {
5599     sources += filter_exclude(v8_third_party_heap_files, [ "*.h" ])
5600   } else {
5601     sources += [ "src/heap/third-party/heap-api-stub.cc" ]
5602   }
5603
5604   if (v8_enable_conservative_stack_scanning) {
5605     sources += [ "src/heap/conservative-stack-visitor.cc" ]
5606   }
5607
5608   if (v8_enable_wasm_gdb_remote_debugging) {
5609     sources += [
5610       "src/debug/wasm/gdb-server/gdb-remote-util.cc",
5611       "src/debug/wasm/gdb-server/gdb-server-thread.cc",
5612       "src/debug/wasm/gdb-server/gdb-server.cc",
5613       "src/debug/wasm/gdb-server/packet.cc",
5614       "src/debug/wasm/gdb-server/session.cc",
5615       "src/debug/wasm/gdb-server/target.cc",
5616       "src/debug/wasm/gdb-server/transport.cc",
5617       "src/debug/wasm/gdb-server/wasm-module-debug.cc",
5618     ]
5619   }
5620
5621   if (v8_enable_heap_snapshot_verify) {
5622     sources += [ "src/heap/reference-summarizer.cc" ]
5623   }
5624
5625   if (v8_current_cpu == "x86") {
5626     sources += [
5627       ### gcmole(ia32) ###
5628       "src/codegen/ia32/assembler-ia32.cc",
5629       "src/codegen/ia32/cpu-ia32.cc",
5630       "src/codegen/ia32/macro-assembler-ia32.cc",
5631       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc",
5632       "src/deoptimizer/ia32/deoptimizer-ia32.cc",
5633       "src/diagnostics/ia32/disasm-ia32.cc",
5634       "src/diagnostics/ia32/unwinder-ia32.cc",
5635       "src/execution/ia32/frame-constants-ia32.cc",
5636       "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
5637     ]
5638   } else if (v8_current_cpu == "x64") {
5639     sources += [
5640       ### gcmole(x64) ###
5641       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc",
5642       "src/codegen/x64/assembler-x64.cc",
5643       "src/codegen/x64/cpu-x64.cc",
5644       "src/codegen/x64/macro-assembler-x64.cc",
5645       "src/deoptimizer/x64/deoptimizer-x64.cc",
5646       "src/diagnostics/x64/disasm-x64.cc",
5647       "src/diagnostics/x64/eh-frame-x64.cc",
5648       "src/diagnostics/x64/unwinder-x64.cc",
5649       "src/execution/x64/frame-constants-x64.cc",
5650       "src/regexp/x64/regexp-macro-assembler-x64.cc",
5651     ]
5652
5653     if (is_win) {
5654       sources += [ "src/diagnostics/unwinding-info-win64.cc" ]
5655     }
5656
5657     if (v8_enable_webassembly) {
5658       # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
5659       # based on Darwin and thus POSIX-compliant to a similar degree.
5660       if (is_linux || is_chromeos || is_mac || is_ios || is_tizen ||
5661           target_os == "freebsd") {
5662         sources += [
5663           "src/trap-handler/handler-inside-posix.cc",
5664           "src/trap-handler/handler-outside-posix.cc",
5665         ]
5666       } else if (is_win) {
5667         sources += [
5668           "src/trap-handler/handler-inside-win.cc",
5669           "src/trap-handler/handler-outside-win.cc",
5670         ]
5671       }
5672     }
5673   } else if (v8_current_cpu == "arm") {
5674     sources += [
5675       ### gcmole(arm) ###
5676       "src/codegen/arm/assembler-arm.cc",
5677       "src/codegen/arm/constants-arm.cc",
5678       "src/codegen/arm/cpu-arm.cc",
5679       "src/codegen/arm/macro-assembler-arm.cc",
5680       "src/deoptimizer/arm/deoptimizer-arm.cc",
5681       "src/diagnostics/arm/disasm-arm.cc",
5682       "src/diagnostics/arm/eh-frame-arm.cc",
5683       "src/diagnostics/arm/unwinder-arm.cc",
5684       "src/execution/arm/frame-constants-arm.cc",
5685       "src/execution/arm/simulator-arm.cc",
5686       "src/regexp/arm/regexp-macro-assembler-arm.cc",
5687     ]
5688   } else if (v8_current_cpu == "arm64") {
5689     sources += [
5690       ### gcmole(arm64) ###
5691       "src/codegen/arm64/assembler-arm64.cc",
5692       "src/codegen/arm64/cpu-arm64.cc",
5693       "src/codegen/arm64/decoder-arm64.cc",
5694       "src/codegen/arm64/instructions-arm64-constants.cc",
5695       "src/codegen/arm64/instructions-arm64.cc",
5696       "src/codegen/arm64/macro-assembler-arm64.cc",
5697       "src/codegen/arm64/register-arm64.cc",
5698       "src/codegen/arm64/utils-arm64.cc",
5699       "src/deoptimizer/arm64/deoptimizer-arm64.cc",
5700       "src/diagnostics/arm64/disasm-arm64.cc",
5701       "src/diagnostics/arm64/eh-frame-arm64.cc",
5702       "src/diagnostics/arm64/unwinder-arm64.cc",
5703       "src/execution/arm64/frame-constants-arm64.cc",
5704       "src/execution/arm64/pointer-auth-arm64.cc",
5705       "src/execution/arm64/simulator-arm64.cc",
5706       "src/execution/arm64/simulator-logic-arm64.cc",
5707       "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
5708     ]
5709     if (v8_enable_webassembly) {
5710       # Trap handling is enabled on arm64 Mac and Linux and in simulators on
5711       # x64 on Linux, Mac, and Windows.
5712       if ((current_cpu == "arm64" && (is_linux || is_chromeos || is_apple)) ||
5713           (current_cpu == "x64" && (is_linux || is_chromeos || is_mac || is_tizen))) {
5714         sources += [
5715           "src/trap-handler/handler-inside-posix.cc",
5716           "src/trap-handler/handler-outside-posix.cc",
5717         ]
5718       } else if (current_cpu == "x64" && is_win) {
5719         sources += [
5720           "src/trap-handler/handler-inside-win.cc",
5721           "src/trap-handler/handler-outside-win.cc",
5722         ]
5723       }
5724       if (current_cpu == "x64" &&
5725           (is_linux || is_chromeos || is_mac || is_win)) {
5726         sources += [ "src/trap-handler/handler-outside-simulator.cc" ]
5727       }
5728     }
5729     if (is_win) {
5730       sources += [ "src/diagnostics/unwinding-info-win64.cc" ]
5731     }
5732   } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
5733     sources += [
5734       ### gcmole(mips64el) ###
5735       "src/codegen/mips64/assembler-mips64.cc",
5736       "src/codegen/mips64/constants-mips64.cc",
5737       "src/codegen/mips64/cpu-mips64.cc",
5738       "src/codegen/mips64/interface-descriptors-mips64-inl.h",
5739       "src/codegen/mips64/macro-assembler-mips64.cc",
5740       "src/deoptimizer/mips64/deoptimizer-mips64.cc",
5741       "src/diagnostics/mips64/disasm-mips64.cc",
5742       "src/diagnostics/mips64/unwinder-mips64.cc",
5743       "src/execution/mips64/frame-constants-mips64.cc",
5744       "src/execution/mips64/simulator-mips64.cc",
5745       "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
5746     ]
5747   } else if (v8_current_cpu == "loong64") {
5748     sources += [
5749       ### gcmole(loong64) ###
5750       "src/codegen/loong64/assembler-loong64.cc",
5751       "src/codegen/loong64/constants-loong64.cc",
5752       "src/codegen/loong64/cpu-loong64.cc",
5753       "src/codegen/loong64/interface-descriptors-loong64-inl.h",
5754       "src/codegen/loong64/macro-assembler-loong64.cc",
5755       "src/deoptimizer/loong64/deoptimizer-loong64.cc",
5756       "src/diagnostics/loong64/disasm-loong64.cc",
5757       "src/diagnostics/loong64/unwinder-loong64.cc",
5758       "src/execution/loong64/frame-constants-loong64.cc",
5759       "src/execution/loong64/simulator-loong64.cc",
5760       "src/regexp/loong64/regexp-macro-assembler-loong64.cc",
5761     ]
5762     if (v8_enable_webassembly) {
5763       # Trap handling is enabled on loong64 Linux and in simulators on
5764       # x64 on Linux.
5765       if ((current_cpu == "loong64" && is_linux) ||
5766           (current_cpu == "x64" && is_linux)) {
5767         sources += [
5768           "src/trap-handler/handler-inside-posix.cc",
5769           "src/trap-handler/handler-outside-posix.cc",
5770         ]
5771       }
5772       if (current_cpu == "x64" && is_linux) {
5773         sources += [ "src/trap-handler/handler-outside-simulator.cc" ]
5774       }
5775     }
5776   } else if (v8_current_cpu == "ppc") {
5777     sources += [
5778       ### gcmole(ppc) ###
5779       "src/codegen/ppc/assembler-ppc.cc",
5780       "src/codegen/ppc/constants-ppc.cc",
5781       "src/codegen/ppc/cpu-ppc.cc",
5782       "src/codegen/ppc/macro-assembler-ppc.cc",
5783       "src/deoptimizer/ppc/deoptimizer-ppc.cc",
5784       "src/diagnostics/ppc/disasm-ppc.cc",
5785       "src/diagnostics/ppc/eh-frame-ppc.cc",
5786       "src/diagnostics/ppc/unwinder-ppc.cc",
5787       "src/execution/ppc/frame-constants-ppc.cc",
5788       "src/execution/ppc/simulator-ppc.cc",
5789       "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
5790     ]
5791   } else if (v8_current_cpu == "ppc64") {
5792     sources += [
5793       ### gcmole(ppc64) ###
5794       "src/codegen/ppc/assembler-ppc.cc",
5795       "src/codegen/ppc/constants-ppc.cc",
5796       "src/codegen/ppc/cpu-ppc.cc",
5797       "src/codegen/ppc/macro-assembler-ppc.cc",
5798       "src/deoptimizer/ppc/deoptimizer-ppc.cc",
5799       "src/diagnostics/ppc/disasm-ppc.cc",
5800       "src/diagnostics/ppc/eh-frame-ppc.cc",
5801       "src/diagnostics/ppc/unwinder-ppc.cc",
5802       "src/execution/ppc/frame-constants-ppc.cc",
5803       "src/execution/ppc/simulator-ppc.cc",
5804       "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
5805     ]
5806   } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
5807     sources += [
5808       ### gcmole(s390) ###
5809       "src/codegen/s390/assembler-s390.cc",
5810       "src/codegen/s390/constants-s390.cc",
5811       "src/codegen/s390/cpu-s390.cc",
5812       "src/codegen/s390/macro-assembler-s390.cc",
5813       "src/deoptimizer/s390/deoptimizer-s390.cc",
5814       "src/diagnostics/s390/disasm-s390.cc",
5815       "src/diagnostics/s390/eh-frame-s390.cc",
5816       "src/diagnostics/s390/unwinder-s390.cc",
5817       "src/execution/s390/frame-constants-s390.cc",
5818       "src/execution/s390/simulator-s390.cc",
5819       "src/regexp/s390/regexp-macro-assembler-s390.cc",
5820     ]
5821   } else if (v8_current_cpu == "riscv64") {
5822     sources += [
5823       ### gcmole(riscv64) ###
5824       "src/codegen/riscv/assembler-riscv.cc",
5825       "src/codegen/riscv/base-assembler-riscv.cc",
5826       "src/codegen/riscv/base-constants-riscv.cc",
5827       "src/codegen/riscv/base-riscv-i.cc",
5828       "src/codegen/riscv/cpu-riscv.cc",
5829       "src/codegen/riscv/extension-riscv-a.cc",
5830       "src/codegen/riscv/extension-riscv-c.cc",
5831       "src/codegen/riscv/extension-riscv-d.cc",
5832       "src/codegen/riscv/extension-riscv-f.cc",
5833       "src/codegen/riscv/extension-riscv-m.cc",
5834       "src/codegen/riscv/extension-riscv-v.cc",
5835       "src/codegen/riscv/extension-riscv-zicsr.cc",
5836       "src/codegen/riscv/extension-riscv-zifencei.cc",
5837       "src/codegen/riscv/macro-assembler-riscv.cc",
5838       "src/deoptimizer/riscv/deoptimizer-riscv.cc",
5839       "src/diagnostics/riscv/disasm-riscv.cc",
5840       "src/diagnostics/riscv/unwinder-riscv.cc",
5841       "src/execution/riscv/frame-constants-riscv.cc",
5842       "src/execution/riscv/simulator-riscv.cc",
5843       "src/regexp/riscv/regexp-macro-assembler-riscv.cc",
5844     ]
5845   } else if (v8_current_cpu == "riscv32") {
5846     sources += [
5847       ### gcmole(riscv32) ###
5848       "src/codegen/riscv/assembler-riscv.cc",
5849       "src/codegen/riscv/base-assembler-riscv.cc",
5850       "src/codegen/riscv/base-constants-riscv.cc",
5851       "src/codegen/riscv/base-riscv-i.cc",
5852       "src/codegen/riscv/cpu-riscv.cc",
5853       "src/codegen/riscv/extension-riscv-a.cc",
5854       "src/codegen/riscv/extension-riscv-c.cc",
5855       "src/codegen/riscv/extension-riscv-d.cc",
5856       "src/codegen/riscv/extension-riscv-f.cc",
5857       "src/codegen/riscv/extension-riscv-m.cc",
5858       "src/codegen/riscv/extension-riscv-v.cc",
5859       "src/codegen/riscv/extension-riscv-zicsr.cc",
5860       "src/codegen/riscv/extension-riscv-zifencei.cc",
5861       "src/codegen/riscv/macro-assembler-riscv.cc",
5862       "src/deoptimizer/riscv/deoptimizer-riscv.cc",
5863       "src/diagnostics/riscv/disasm-riscv.cc",
5864       "src/diagnostics/riscv/unwinder-riscv.cc",
5865       "src/execution/riscv/frame-constants-riscv.cc",
5866       "src/execution/riscv/simulator-riscv.cc",
5867       "src/regexp/riscv/regexp-macro-assembler-riscv.cc",
5868     ]
5869   }
5870
5871   # Architecture independent but platform-specific sources
5872   if (is_win) {
5873     if (v8_enable_etw_stack_walking) {
5874       sources += [
5875         "src/diagnostics/etw-jit-win.cc",
5876         "src/diagnostics/etw-jit-win.h",
5877       ]
5878     }
5879   }
5880
5881   configs = [
5882     ":internal_config",
5883     ":cppgc_base_config",
5884   ]
5885
5886   deps = [
5887     ":torque_generated_definitions",
5888     ":v8_bigint",
5889     ":v8_headers",
5890     ":v8_heap_base",
5891     ":v8_libbase",
5892     ":v8_shared_internal_headers",
5893     ":v8_tracing",
5894     ":v8_version",
5895     "src/inspector:inspector",
5896   ]
5897
5898   public_deps = [
5899     ":cppgc_base",
5900     ":generate_bytecode_builtins_list",
5901     ":run_torque",
5902     ":v8_abseil",
5903     ":v8_headers",
5904     ":v8_internal_headers",
5905     ":v8_maybe_icu",
5906   ]
5907
5908   if (v8_enable_i18n_support) {
5909     deps += [ ":run_gen-regexp-special-case" ]
5910     sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
5911     if (is_win) {
5912       deps += [ "$v8_icu_path:icudata" ]
5913     }
5914   } else {
5915     sources -= [
5916       "src/builtins/builtins-intl.cc",
5917       "src/objects/intl-objects.cc",
5918       "src/objects/js-break-iterator.cc",
5919       "src/objects/js-collator.cc",
5920       "src/objects/js-date-time-format.cc",
5921       "src/objects/js-display-names.cc",
5922       "src/objects/js-duration-format.cc",
5923       "src/objects/js-list-format.cc",
5924       "src/objects/js-locale.cc",
5925       "src/objects/js-number-format.cc",
5926       "src/objects/js-plural-rules.cc",
5927       "src/objects/js-relative-time-format.cc",
5928       "src/objects/js-segment-iterator.cc",
5929       "src/objects/js-segmenter.cc",
5930       "src/objects/js-segments.cc",
5931       "src/runtime/runtime-intl.cc",
5932       "src/strings/char-predicates.cc",
5933     ]
5934   }
5935
5936   if (v8_use_zlib) {
5937     deps += [
5938       "$v8_zlib_path",
5939       "$v8_zlib_path/google:compression_utils_portable",
5940     ]
5941   }
5942
5943   if (v8_postmortem_support) {
5944     sources += [ "$target_gen_dir/debug-support.cc" ]
5945     deps += [ ":postmortem-metadata" ]
5946   }
5947
5948   libs = []
5949
5950   if (v8_enable_third_party_heap) {
5951     libs += v8_third_party_heap_libs
5952   }
5953
5954   # Platforms that don't have CAS support need to link atomic library
5955   # to implement atomic memory access
5956   if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" ||
5957       v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
5958       v8_current_cpu == "s390" || v8_current_cpu == "s390x" ||
5959       v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
5960     if (!is_clang) {
5961       libs += [ "atomic" ]
5962     }
5963   }
5964
5965   if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) {
5966     sources += [
5967       "src/extensions/vtunedomain-support-extension.cc",
5968       "src/extensions/vtunedomain-support-extension.h",
5969     ]
5970     deps += [ "src/third_party/vtune:v8_vtune_trace_mark" ]
5971   }
5972 }
5973
5974 group("v8_base") {
5975   public_deps = [
5976     ":v8_base_without_compiler",
5977     ":v8_compiler",
5978   ]
5979
5980   if (v8_enable_turbofan) {
5981     public_deps += [ ":v8_turboshaft" ]
5982   }
5983 }
5984
5985 v8_source_set("torque_base") {
5986   visibility = [ ":*" ]  # Only targets in this file can depend on this.
5987
5988   sources = [
5989     "src/numbers/integer-literal-inl.h",
5990     "src/numbers/integer-literal.h",
5991     "src/torque/ast.h",
5992     "src/torque/cc-generator.cc",
5993     "src/torque/cc-generator.h",
5994     "src/torque/cfg.cc",
5995     "src/torque/cfg.h",
5996     "src/torque/class-debug-reader-generator.cc",
5997     "src/torque/constants.h",
5998     "src/torque/cpp-builder.cc",
5999     "src/torque/cpp-builder.h",
6000     "src/torque/csa-generator.cc",
6001     "src/torque/csa-generator.h",
6002     "src/torque/declarable.cc",
6003     "src/torque/declarable.h",
6004     "src/torque/declaration-visitor.cc",
6005     "src/torque/declaration-visitor.h",
6006     "src/torque/declarations.cc",
6007     "src/torque/declarations.h",
6008     "src/torque/earley-parser.cc",
6009     "src/torque/earley-parser.h",
6010     "src/torque/global-context.cc",
6011     "src/torque/global-context.h",
6012     "src/torque/implementation-visitor.cc",
6013     "src/torque/implementation-visitor.h",
6014     "src/torque/instance-type-generator.cc",
6015     "src/torque/instructions.cc",
6016     "src/torque/instructions.h",
6017     "src/torque/kythe-data.cc",
6018     "src/torque/kythe-data.h",
6019     "src/torque/parameter-difference.h",
6020     "src/torque/server-data.cc",
6021     "src/torque/server-data.h",
6022     "src/torque/source-positions.cc",
6023     "src/torque/source-positions.h",
6024     "src/torque/torque-code-generator.cc",
6025     "src/torque/torque-code-generator.h",
6026     "src/torque/torque-compiler.cc",
6027     "src/torque/torque-compiler.h",
6028     "src/torque/torque-parser.cc",
6029     "src/torque/torque-parser.h",
6030     "src/torque/type-inference.cc",
6031     "src/torque/type-inference.h",
6032     "src/torque/type-oracle.cc",
6033     "src/torque/type-oracle.h",
6034     "src/torque/type-visitor.cc",
6035     "src/torque/type-visitor.h",
6036     "src/torque/types.cc",
6037     "src/torque/types.h",
6038     "src/torque/utils.cc",
6039     "src/torque/utils.h",
6040   ]
6041
6042   deps = [
6043     ":v8_flags",
6044     ":v8_shared_internal_headers",
6045   ]
6046
6047   public_deps = [ ":v8_libbase" ]
6048
6049   # The use of exceptions for Torque in violation of the Chromium style-guide
6050   # is justified by the fact that it is only used from the non-essential
6051   # language server and can be removed anytime if it causes problems.
6052   configs = [
6053     ":internal_config",
6054     "//build/config/compiler:exceptions",
6055     "//build/config/compiler:rtti",
6056   ]
6057
6058   remove_configs = [
6059     "//build/config/compiler:no_exceptions",
6060     "//build/config/compiler:no_rtti",
6061   ]
6062
6063   if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
6064     # The :no_optimize config is added to v8_add_configs in v8.gni.
6065     remove_configs += [ "//build/config/compiler:no_optimize" ]
6066     configs += [ ":always_turbofanimize" ]
6067   }
6068 }
6069
6070 v8_source_set("torque_ls_base") {
6071   sources = [
6072     "src/torque/ls/globals.h",
6073     "src/torque/ls/json-parser.cc",
6074     "src/torque/ls/json-parser.h",
6075     "src/torque/ls/json.cc",
6076     "src/torque/ls/json.h",
6077     "src/torque/ls/message-handler.cc",
6078     "src/torque/ls/message-handler.h",
6079     "src/torque/ls/message-macros.h",
6080     "src/torque/ls/message-pipe.h",
6081     "src/torque/ls/message.h",
6082   ]
6083
6084   public_deps = [ ":torque_base" ]
6085
6086   # The use of exceptions for Torque in violation of the Chromium style-guide
6087   # is justified by the fact that it is only used from the non-essential
6088   # language server and can be removed anytime if it causes problems.
6089   configs = [
6090     ":internal_config",
6091     "//build/config/compiler:exceptions",
6092     "//build/config/compiler:rtti",
6093   ]
6094
6095   remove_configs = [
6096     "//build/config/compiler:no_exceptions",
6097     "//build/config/compiler:no_rtti",
6098   ]
6099 }
6100
6101 v8_component("v8_libbase") {
6102   sources = [
6103     "src/base/abort-mode.cc",
6104     "src/base/abort-mode.h",
6105     "src/base/address-region.h",
6106     "src/base/atomic-utils.h",
6107     "src/base/atomicops.h",
6108     "src/base/base-export.h",
6109     "src/base/bit-field.h",
6110     "src/base/bits-iterator.h",
6111     "src/base/bits.cc",
6112     "src/base/bits.h",
6113     "src/base/bounded-page-allocator.cc",
6114     "src/base/bounded-page-allocator.h",
6115     "src/base/bounds.h",
6116     "src/base/build_config.h",
6117     "src/base/compiler-specific.h",
6118     "src/base/container-utils.h",
6119     "src/base/contextual.h",
6120     "src/base/cpu.cc",
6121     "src/base/cpu.h",
6122     "src/base/debug/stack_trace.cc",
6123     "src/base/debug/stack_trace.h",
6124     "src/base/discriminated-union.h",
6125     "src/base/division-by-constant.cc",
6126     "src/base/division-by-constant.h",
6127     "src/base/emulated-virtual-address-subspace.cc",
6128     "src/base/emulated-virtual-address-subspace.h",
6129     "src/base/enum-set.h",
6130     "src/base/export-template.h",
6131     "src/base/file-utils.cc",
6132     "src/base/file-utils.h",
6133     "src/base/flags.h",
6134     "src/base/free_deleter.h",
6135     "src/base/functional.h",
6136     "src/base/hashmap-entry.h",
6137     "src/base/hashmap.h",
6138     "src/base/ieee754.cc",
6139     "src/base/ieee754.h",
6140     "src/base/immediate-crash.h",
6141     "src/base/intrusive-set.h",
6142     "src/base/iterator.h",
6143     "src/base/lazy-instance.h",
6144     "src/base/logging.cc",
6145     "src/base/logging.h",
6146     "src/base/macros.h",
6147     "src/base/memory.h",
6148     "src/base/numbers/bignum-dtoa.cc",
6149     "src/base/numbers/bignum-dtoa.h",
6150     "src/base/numbers/bignum.cc",
6151     "src/base/numbers/bignum.h",
6152     "src/base/numbers/cached-powers.cc",
6153     "src/base/numbers/cached-powers.h",
6154     "src/base/numbers/diy-fp.cc",
6155     "src/base/numbers/diy-fp.h",
6156     "src/base/numbers/double.h",
6157     "src/base/numbers/dtoa.cc",
6158     "src/base/numbers/dtoa.h",
6159     "src/base/numbers/fast-dtoa.cc",
6160     "src/base/numbers/fast-dtoa.h",
6161     "src/base/numbers/fixed-dtoa.cc",
6162     "src/base/numbers/fixed-dtoa.h",
6163     "src/base/numbers/strtod.cc",
6164     "src/base/numbers/strtod.h",
6165     "src/base/once.cc",
6166     "src/base/once.h",
6167     "src/base/optional.h",
6168     "src/base/overflowing-math.h",
6169     "src/base/page-allocator.cc",
6170     "src/base/page-allocator.h",
6171     "src/base/platform/condition-variable.cc",
6172     "src/base/platform/condition-variable.h",
6173     "src/base/platform/elapsed-timer.h",
6174     "src/base/platform/memory-protection-key.cc",
6175     "src/base/platform/memory-protection-key.h",
6176     "src/base/platform/memory.h",
6177     "src/base/platform/mutex.cc",
6178     "src/base/platform/mutex.h",
6179     "src/base/platform/platform.cc",
6180     "src/base/platform/platform.h",
6181     "src/base/platform/semaphore.cc",
6182     "src/base/platform/semaphore.h",
6183     "src/base/platform/time.cc",
6184     "src/base/platform/time.h",
6185     "src/base/platform/wrappers.h",
6186     "src/base/platform/yield-processor.h",
6187     "src/base/pointer-with-payload.h",
6188     "src/base/region-allocator.cc",
6189     "src/base/region-allocator.h",
6190     "src/base/ring-buffer.h",
6191     "src/base/safe_conversions.h",
6192     "src/base/safe_conversions_arm_impl.h",
6193     "src/base/safe_conversions_impl.h",
6194     "src/base/sanitizer/asan.h",
6195     "src/base/sanitizer/lsan-page-allocator.cc",
6196     "src/base/sanitizer/lsan-page-allocator.h",
6197     "src/base/sanitizer/lsan-virtual-address-space.cc",
6198     "src/base/sanitizer/lsan-virtual-address-space.h",
6199     "src/base/sanitizer/lsan.h",
6200     "src/base/sanitizer/msan.h",
6201     "src/base/sanitizer/tsan.h",
6202     "src/base/small-map.h",
6203     "src/base/small-vector.h",
6204     "src/base/string-format.h",
6205     "src/base/strings.cc",
6206     "src/base/strings.h",
6207     "src/base/sys-info.cc",
6208     "src/base/sys-info.h",
6209     "src/base/template-utils.h",
6210     "src/base/threaded-list.h",
6211     "src/base/timezone-cache.h",
6212     "src/base/utils/random-number-generator.cc",
6213     "src/base/utils/random-number-generator.h",
6214     "src/base/v8-fallthrough.h",
6215     "src/base/vector.h",
6216     "src/base/virtual-address-space-page-allocator.cc",
6217     "src/base/virtual-address-space-page-allocator.h",
6218     "src/base/virtual-address-space.cc",
6219     "src/base/virtual-address-space.h",
6220     "src/base/vlq-base64.cc",
6221     "src/base/vlq-base64.h",
6222     "src/base/vlq.h",
6223   ]
6224
6225   configs = [ ":internal_config_base" ]
6226
6227   public_configs = [ ":libbase_config" ]
6228
6229   deps = [ ":v8_config_headers" ]
6230
6231   libs = []
6232
6233   data = []
6234
6235   data_deps = []
6236
6237   defines = []
6238
6239   if (is_component_build) {
6240     defines = [ "BUILDING_V8_BASE_SHARED" ]
6241   }
6242
6243   if (is_posix || is_fuchsia) {
6244     sources += [
6245       "src/base/platform/platform-posix.cc",
6246       "src/base/platform/platform-posix.h",
6247     ]
6248     if (current_os != "aix") {
6249       sources += [
6250         "src/base/platform/platform-posix-time.cc",
6251         "src/base/platform/platform-posix-time.h",
6252       ]
6253     }
6254   }
6255
6256   if (is_linux || is_tizen || is_chromeos) {
6257     sources += [
6258       "src/base/debug/stack_trace_posix.cc",
6259       "src/base/platform/platform-linux.cc",
6260       "src/base/platform/platform-linux.h",
6261     ]
6262     libs = [
6263       "dl",
6264       "rt",
6265     ]
6266     if (is_tizen) {
6267       libs += [
6268         "dlog",
6269         "pthread",
6270       ]
6271     }
6272     if (use_ttrace) {
6273       deps += [ "//tizen_src/chromium_impl/base:trace_event_ttrace" ]
6274     }
6275   } else if (current_os == "aix") {
6276     sources += [
6277       "src/base/debug/stack_trace_posix.cc",
6278       "src/base/platform/platform-aix.cc",
6279     ]
6280     libs = [ "dl" ]
6281   } else if (is_android) {
6282     if (current_toolchain == host_toolchain) {
6283       libs = [
6284         "dl",
6285         "rt",
6286       ]
6287       if (host_os == "mac") {
6288         sources += [
6289           "src/base/debug/stack_trace_posix.cc",
6290           "src/base/platform/platform-darwin.cc",
6291         ]
6292       } else {
6293         sources += [
6294           "src/base/debug/stack_trace_posix.cc",
6295           "src/base/platform/platform-linux.cc",
6296         ]
6297       }
6298     } else {
6299       sources += [
6300         "src/base/debug/stack_trace_android.cc",
6301         "src/base/platform/platform-linux.cc",
6302       ]
6303     }
6304   } else if (is_fuchsia) {
6305     sources += [
6306       "src/base/debug/stack_trace_fuchsia.cc",
6307       "src/base/platform/platform-fuchsia.cc",
6308     ]
6309     deps += [
6310       "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp",
6311       "//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp",
6312       "//third_party/fuchsia-sdk/sdk/pkg/zx",
6313     ]
6314   } else if (is_mac) {
6315     sources += [
6316       "src/base/debug/stack_trace_posix.cc",
6317       "src/base/platform/platform-darwin.cc",
6318     ]
6319   } else if (is_ios) {
6320     sources += [
6321       "src/base/debug/stack_trace_posix.cc",
6322       "src/base/platform/platform-darwin.cc",
6323       "src/base/platform/platform-ios.cc",
6324     ]
6325   } else if (is_win) {
6326     # TODO(infra): Add support for cygwin.
6327     sources += [
6328       "src/base/debug/stack_trace_win.cc",
6329       "src/base/platform/platform-win32.cc",
6330       "src/base/platform/platform-win32.h",
6331       "src/base/win32-headers.h",
6332     ]
6333
6334     defines += [ "_CRT_RAND_S" ]  # for rand_s()
6335
6336     libs = [
6337       "dbghelp.lib",
6338       "winmm.lib",
6339       "ws2_32.lib",
6340     ]
6341
6342     if (v8_enable_etw_stack_walking) {
6343       libs += [ "advapi32.lib" ]  # Needed for TraceLoggingProvider.h
6344     }
6345
6346     data_deps += [ "//build/win:runtime_libs" ]
6347   }
6348
6349   if (v8_current_cpu == "mips64") {
6350     # Add runtime libs for mips.
6351     data += [
6352       "tools/mips_toolchain/sysroot/usr/lib/",
6353       "tools/mips_toolchain/mips-mti-linux-gnu/lib",
6354     ]
6355   }
6356
6357   if (is_ubsan && (v8_current_cpu == "x86" || v8_current_cpu == "arm")) {
6358     # Special UBSan 32-bit requirement.
6359     sources += [ "src/base/ubsan.cc" ]
6360   }
6361
6362   if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
6363     if (!is_clang) {
6364       libs += [ "atomic" ]
6365     }
6366   }
6367
6368   if (is_tsan && !build_with_chromium) {
6369     data += [ "tools/sanitizers/tsan_suppressions.txt" ]
6370   }
6371
6372   if (using_sanitizer && !build_with_chromium) {
6373     data_deps +=
6374         [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ]
6375   }
6376
6377   if (v8_use_libm_trig_functions) {
6378     deps += [ ":libm" ]
6379   }
6380
6381   # TODO(infra): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
6382 }
6383
6384 if (v8_use_libm_trig_functions) {
6385   source_set("libm") {
6386     sources = [
6387       "third_party/glibc/src/sysdeps/ieee754/dbl-64/branred.c",
6388       "third_party/glibc/src/sysdeps/ieee754/dbl-64/branred.h",
6389       "third_party/glibc/src/sysdeps/ieee754/dbl-64/dla.h",
6390       "third_party/glibc/src/sysdeps/ieee754/dbl-64/endian.h",
6391       "third_party/glibc/src/sysdeps/ieee754/dbl-64/mydefs.h",
6392       "third_party/glibc/src/sysdeps/ieee754/dbl-64/s_sin.c",
6393       "third_party/glibc/src/sysdeps/ieee754/dbl-64/sincostab.c",
6394       "third_party/glibc/src/sysdeps/ieee754/dbl-64/trig.h",
6395       "third_party/glibc/src/sysdeps/ieee754/dbl-64/usncs.h",
6396     ]
6397     configs += [ "//build/config/compiler:no_chromium_code" ]
6398     configs -= [ "//build/config/compiler:chromium_code" ]
6399     if (!is_debug) {
6400       # Build code using -O3, see: crbug.com/1084371.
6401       configs += [ "//build/config/compiler:optimize_speed" ]
6402     }
6403   }
6404 }
6405
6406 v8_component("v8_libplatform") {
6407   sources = [
6408     "//base/trace_event/common/trace_event_common.h",
6409     "include/libplatform/libplatform-export.h",
6410     "include/libplatform/libplatform.h",
6411     "include/libplatform/v8-tracing.h",
6412     "src/libplatform/default-foreground-task-runner.cc",
6413     "src/libplatform/default-foreground-task-runner.h",
6414     "src/libplatform/default-job.cc",
6415     "src/libplatform/default-job.h",
6416     "src/libplatform/default-platform.cc",
6417     "src/libplatform/default-platform.h",
6418     "src/libplatform/default-thread-isolated-allocator.cc",
6419     "src/libplatform/default-thread-isolated-allocator.h",
6420     "src/libplatform/default-worker-threads-task-runner.cc",
6421     "src/libplatform/default-worker-threads-task-runner.h",
6422     "src/libplatform/delayed-task-queue.cc",
6423     "src/libplatform/delayed-task-queue.h",
6424     "src/libplatform/task-queue.cc",
6425     "src/libplatform/task-queue.h",
6426     "src/libplatform/tracing/trace-buffer.cc",
6427     "src/libplatform/tracing/trace-buffer.h",
6428     "src/libplatform/tracing/trace-config.cc",
6429     "src/libplatform/tracing/trace-object.cc",
6430     "src/libplatform/tracing/trace-writer.cc",
6431     "src/libplatform/tracing/trace-writer.h",
6432     "src/libplatform/tracing/tracing-controller.cc",
6433     "src/libplatform/worker-thread.cc",
6434     "src/libplatform/worker-thread.h",
6435   ]
6436
6437   configs = [ ":internal_config_base" ]
6438
6439   if (is_component_build) {
6440     defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
6441   }
6442
6443   public_configs = [ ":libplatform_config" ]
6444
6445   public_deps = []
6446
6447   deps = [
6448     ":v8_config_headers",
6449     ":v8_libbase",
6450     ":v8_tracing",
6451   ]
6452
6453   if (v8_use_perfetto) {
6454     sources -= [
6455       "//base/trace_event/common/trace_event_common.h",
6456       "src/libplatform/tracing/trace-buffer.cc",
6457       "src/libplatform/tracing/trace-buffer.h",
6458       "src/libplatform/tracing/trace-object.cc",
6459       "src/libplatform/tracing/trace-writer.cc",
6460       "src/libplatform/tracing/trace-writer.h",
6461     ]
6462     sources += [ "src/libplatform/tracing/trace-event-listener.h" ]
6463   }
6464
6465   if (v8_enable_system_instrumentation) {
6466     sources += [ "src/libplatform/tracing/recorder.h" ]
6467     if (is_mac) {
6468       sources += [ "src/libplatform/tracing/recorder-mac.cc" ]
6469     } else if (is_win) {
6470       sources += [ "src/libplatform/tracing/recorder-win.cc" ]
6471     }
6472   }
6473
6474   if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
6475     if (!is_clang) {
6476       libs = [ "atomic" ]
6477     }
6478   }
6479 }
6480
6481 v8_source_set("fuzzer_support") {
6482   visibility = [ ":*" ]  # Only targets in this file can depend on this.
6483
6484   sources = [
6485     "test/fuzzer/fuzzer-support.cc",
6486     "test/fuzzer/fuzzer-support.h",
6487   ]
6488
6489   configs = [ ":internal_config_base" ]
6490
6491   public_deps = [
6492     ":v8",
6493     ":v8_libbase",
6494     ":v8_libplatform",
6495     ":v8_maybe_icu",
6496   ]
6497 }
6498
6499 v8_source_set("v8_bigint") {
6500   sources = [
6501     "src/bigint/bigint-internal.cc",
6502     "src/bigint/bigint-internal.h",
6503     "src/bigint/bigint.h",
6504     "src/bigint/bitwise.cc",
6505     "src/bigint/digit-arithmetic.h",
6506     "src/bigint/div-burnikel.cc",
6507     "src/bigint/div-helpers.cc",
6508     "src/bigint/div-helpers.h",
6509     "src/bigint/div-schoolbook.cc",
6510     "src/bigint/fromstring.cc",
6511     "src/bigint/mul-karatsuba.cc",
6512     "src/bigint/mul-schoolbook.cc",
6513     "src/bigint/tostring.cc",
6514     "src/bigint/util.h",
6515     "src/bigint/vector-arithmetic.cc",
6516     "src/bigint/vector-arithmetic.h",
6517   ]
6518
6519   if (v8_advanced_bigint_algorithms) {
6520     sources += [
6521       "src/bigint/div-barrett.cc",
6522       "src/bigint/mul-fft.cc",
6523       "src/bigint/mul-toom.cc",
6524     ]
6525   }
6526
6527   configs = [ ":internal_config" ]
6528 }
6529
6530 v8_header_set("v8_heap_base_headers") {
6531   sources = [
6532     "src/heap/base/active-system-pages.h",
6533     "src/heap/base/basic-slot-set.h",
6534     "src/heap/base/bytes.h",
6535     "src/heap/base/incremental-marking-schedule.h",
6536     "src/heap/base/memory-tagging.h",
6537     "src/heap/base/stack.h",
6538     "src/heap/base/worklist.h",
6539   ]
6540
6541   configs = [ ":internal_config" ]
6542
6543   public_deps = [ ":v8_libbase" ]
6544 }
6545
6546 v8_source_set("v8_heap_base") {
6547   sources = [
6548     "src/heap/base/active-system-pages.cc",
6549     "src/heap/base/incremental-marking-schedule.cc",
6550     "src/heap/base/memory-tagging.cc",
6551     "src/heap/base/stack.cc",
6552     "src/heap/base/worklist.cc",
6553   ]
6554
6555   if (is_clang || !is_win) {
6556     if (current_cpu == "x64") {
6557       sources += [ "src/heap/base/asm/x64/push_registers_asm.cc" ]
6558     } else if (current_cpu == "x86") {
6559       sources += [ "src/heap/base/asm/ia32/push_registers_asm.cc" ]
6560     } else if (current_cpu == "arm") {
6561       sources += [ "src/heap/base/asm/arm/push_registers_asm.cc" ]
6562     } else if (current_cpu == "arm64") {
6563       sources += [ "src/heap/base/asm/arm64/push_registers_asm.cc" ]
6564     } else if (current_cpu == "ppc64") {
6565       sources += [ "src/heap/base/asm/ppc/push_registers_asm.cc" ]
6566     } else if (current_cpu == "s390x") {
6567       sources += [ "src/heap/base/asm/s390/push_registers_asm.cc" ]
6568     } else if (current_cpu == "mips64el") {
6569       sources += [ "src/heap/base/asm/mips64/push_registers_asm.cc" ]
6570     } else if (current_cpu == "loong64") {
6571       sources += [ "src/heap/base/asm/loong64/push_registers_asm.cc" ]
6572     } else if (current_cpu == "riscv64" || current_cpu == "riscv32") {
6573       sources += [ "src/heap/base/asm/riscv/push_registers_asm.cc" ]
6574     }
6575   } else if (is_win) {
6576     if (current_cpu == "x64") {
6577       sources += [ "src/heap/base/asm/x64/push_registers_masm.asm" ]
6578     } else if (current_cpu == "x86") {
6579       sources += [ "src/heap/base/asm/ia32/push_registers_masm.asm" ]
6580     } else if (current_cpu == "arm64") {
6581       sources += [ "src/heap/base/asm/arm64/push_registers_masm.S" ]
6582     }
6583   }
6584
6585   configs = [ ":internal_config" ]
6586
6587   deps = [ ":v8_config_headers" ]
6588
6589   public_deps = [
6590     ":v8_heap_base_headers",
6591     ":v8_libbase",
6592   ]
6593 }
6594
6595 # This is split out to be a non-code containing target that the Chromium browser
6596 # can depend upon to get basic cppgc types.
6597 v8_header_set("cppgc_headers") {
6598   configs = [ ":internal_config" ]
6599   public_configs = [
6600     ":v8_header_features",
6601     ":cppgc_header_features",
6602   ]
6603
6604   sources = [
6605     "include/cppgc/allocation.h",
6606     "include/cppgc/common.h",
6607     "include/cppgc/cross-thread-persistent.h",
6608     "include/cppgc/custom-space.h",
6609     "include/cppgc/default-platform.h",
6610     "include/cppgc/ephemeron-pair.h",
6611     "include/cppgc/explicit-management.h",
6612     "include/cppgc/garbage-collected.h",
6613     "include/cppgc/heap-consistency.h",
6614     "include/cppgc/heap-handle.h",
6615     "include/cppgc/heap-state.h",
6616     "include/cppgc/heap-statistics.h",
6617     "include/cppgc/heap.h",
6618     "include/cppgc/internal/api-constants.h",
6619     "include/cppgc/internal/atomic-entry-flag.h",
6620     "include/cppgc/internal/base-page-handle.h",
6621     "include/cppgc/internal/compiler-specific.h",
6622     "include/cppgc/internal/finalizer-trait.h",
6623     "include/cppgc/internal/gc-info.h",
6624     "include/cppgc/internal/member-storage.h",
6625     "include/cppgc/internal/name-trait.h",
6626     "include/cppgc/internal/persistent-node.h",
6627     "include/cppgc/internal/pointer-policies.h",
6628     "include/cppgc/internal/write-barrier.h",
6629     "include/cppgc/liveness-broker.h",
6630     "include/cppgc/macros.h",
6631     "include/cppgc/member.h",
6632     "include/cppgc/name-provider.h",
6633     "include/cppgc/object-size-trait.h",
6634     "include/cppgc/persistent.h",
6635     "include/cppgc/platform.h",
6636     "include/cppgc/prefinalizer.h",
6637     "include/cppgc/process-heap-statistics.h",
6638     "include/cppgc/sentinel-pointer.h",
6639     "include/cppgc/source-location.h",
6640
6641     # TODO(v8:11952): Remove the testing header here once depending on both,
6642     # //v8:v8 and //v8:v8_for_testing does not result in ODR violations.
6643     "include/cppgc/testing.h",
6644     "include/cppgc/trace-trait.h",
6645     "include/cppgc/type-traits.h",
6646     "include/cppgc/visitor.h",
6647   ]
6648
6649   if (cppgc_enable_caged_heap) {
6650     sources += [ "include/cppgc/internal/caged-heap-local-data.h" ]
6651     sources += [ "include/cppgc/internal/caged-heap.h" ]
6652   }
6653
6654   deps = [
6655     ":v8_libbase",
6656     ":v8_libplatform",
6657   ]
6658
6659   public_deps = [ ":v8_config_headers" ]
6660 }
6661
6662 v8_source_set("cppgc_base") {
6663   visibility = [ ":*" ]
6664
6665   sources = [
6666     "src/heap/cppgc/allocation.cc",
6667     "src/heap/cppgc/compaction-worklists.cc",
6668     "src/heap/cppgc/compaction-worklists.h",
6669     "src/heap/cppgc/compactor.cc",
6670     "src/heap/cppgc/compactor.h",
6671     "src/heap/cppgc/concurrent-marker.cc",
6672     "src/heap/cppgc/concurrent-marker.h",
6673     "src/heap/cppgc/explicit-management.cc",
6674     "src/heap/cppgc/free-list.cc",
6675     "src/heap/cppgc/free-list.h",
6676     "src/heap/cppgc/garbage-collector.h",
6677     "src/heap/cppgc/gc-info-table.cc",
6678     "src/heap/cppgc/gc-info-table.h",
6679     "src/heap/cppgc/gc-info.cc",
6680     "src/heap/cppgc/gc-invoker.cc",
6681     "src/heap/cppgc/gc-invoker.h",
6682     "src/heap/cppgc/globals.h",
6683     "src/heap/cppgc/heap-base.cc",
6684     "src/heap/cppgc/heap-base.h",
6685     "src/heap/cppgc/heap-config.h",
6686     "src/heap/cppgc/heap-consistency.cc",
6687     "src/heap/cppgc/heap-growing.cc",
6688     "src/heap/cppgc/heap-growing.h",
6689     "src/heap/cppgc/heap-object-header.cc",
6690     "src/heap/cppgc/heap-object-header.h",
6691     "src/heap/cppgc/heap-page.cc",
6692     "src/heap/cppgc/heap-page.h",
6693     "src/heap/cppgc/heap-space.cc",
6694     "src/heap/cppgc/heap-space.h",
6695     "src/heap/cppgc/heap-state.cc",
6696     "src/heap/cppgc/heap-statistics-collector.cc",
6697     "src/heap/cppgc/heap-statistics-collector.h",
6698     "src/heap/cppgc/heap-visitor.h",
6699     "src/heap/cppgc/heap.cc",
6700     "src/heap/cppgc/heap.h",
6701     "src/heap/cppgc/liveness-broker.cc",
6702     "src/heap/cppgc/liveness-broker.h",
6703     "src/heap/cppgc/logging.cc",
6704     "src/heap/cppgc/marker.cc",
6705     "src/heap/cppgc/marker.h",
6706     "src/heap/cppgc/marking-state.cc",
6707     "src/heap/cppgc/marking-state.h",
6708     "src/heap/cppgc/marking-verifier.cc",
6709     "src/heap/cppgc/marking-verifier.h",
6710     "src/heap/cppgc/marking-visitor.cc",
6711     "src/heap/cppgc/marking-visitor.h",
6712     "src/heap/cppgc/marking-worklists.cc",
6713     "src/heap/cppgc/marking-worklists.h",
6714     "src/heap/cppgc/member-storage.cc",
6715     "src/heap/cppgc/member-storage.h",
6716     "src/heap/cppgc/memory.cc",
6717     "src/heap/cppgc/memory.h",
6718     "src/heap/cppgc/metric-recorder.h",
6719     "src/heap/cppgc/name-trait.cc",
6720     "src/heap/cppgc/object-allocator.cc",
6721     "src/heap/cppgc/object-allocator.h",
6722     "src/heap/cppgc/object-poisoner.h",
6723     "src/heap/cppgc/object-size-trait.cc",
6724     "src/heap/cppgc/object-start-bitmap.h",
6725     "src/heap/cppgc/object-view.h",
6726     "src/heap/cppgc/page-memory.cc",
6727     "src/heap/cppgc/page-memory.h",
6728     "src/heap/cppgc/persistent-node.cc",
6729     "src/heap/cppgc/platform.cc",
6730     "src/heap/cppgc/platform.h",
6731     "src/heap/cppgc/pointer-policies.cc",
6732     "src/heap/cppgc/prefinalizer-handler.cc",
6733     "src/heap/cppgc/prefinalizer-handler.h",
6734     "src/heap/cppgc/process-heap-statistics.cc",
6735     "src/heap/cppgc/process-heap-statistics.h",
6736     "src/heap/cppgc/process-heap.cc",
6737     "src/heap/cppgc/process-heap.h",
6738     "src/heap/cppgc/raw-heap.cc",
6739     "src/heap/cppgc/raw-heap.h",
6740     "src/heap/cppgc/remembered-set.cc",
6741     "src/heap/cppgc/remembered-set.h",
6742     "src/heap/cppgc/stats-collector.cc",
6743     "src/heap/cppgc/stats-collector.h",
6744     "src/heap/cppgc/sweeper.cc",
6745     "src/heap/cppgc/sweeper.h",
6746     "src/heap/cppgc/task-handle.h",
6747     "src/heap/cppgc/unmarker.h",
6748
6749     # TODO(v8:11952): Remove the testing header here once depending on both,
6750     # //v8:v8 and //v8:v8_for_testing does not result in ODR violations.
6751     "src/heap/cppgc/testing.cc",
6752     "src/heap/cppgc/trace-event.h",
6753     "src/heap/cppgc/trace-trait.cc",
6754     "src/heap/cppgc/virtual-memory.cc",
6755     "src/heap/cppgc/virtual-memory.h",
6756     "src/heap/cppgc/visitor.cc",
6757     "src/heap/cppgc/visitor.h",
6758     "src/heap/cppgc/write-barrier.cc",
6759     "src/heap/cppgc/write-barrier.h",
6760   ]
6761
6762   if (cppgc_enable_caged_heap) {
6763     sources += [
6764       "src/heap/cppgc/caged-heap-local-data.cc",
6765       "src/heap/cppgc/caged-heap.cc",
6766       "src/heap/cppgc/caged-heap.h",
6767     ]
6768   }
6769
6770   configs = [
6771     ":internal_config",
6772     ":cppgc_base_config",
6773   ]
6774
6775   public_deps = [
6776     ":cppgc_headers",
6777     ":v8_heap_base",
6778     ":v8_libbase",
6779     ":v8_libplatform",
6780   ]
6781
6782   if (cppgc_is_standalone && !v8_use_perfetto) {
6783     sources += [ "//base/trace_event/common/trace_event_common.h" ]
6784   } else {
6785     public_deps += [ ":v8_tracing" ]
6786   }
6787
6788   if (v8_use_perfetto) {
6789     sources += [
6790       "src/tracing/trace-categories.cc",
6791       "src/tracing/trace-categories.h",
6792     ]
6793   }
6794 }
6795
6796 if (v8_check_header_includes) {
6797   # This file will be generated by tools/generate-header-include-checks.py
6798   # if the "check_v8_header_includes" gclient variable is set.
6799   import("check-header-includes/sources.gni")
6800   v8_source_set("check_headers") {
6801     configs = [ ":internal_config" ]
6802     sources = check_header_includes_sources
6803
6804     # Any rules that contain headers files should be added here either directly
6805     # or indirectly by including something that has it transitively in its
6806     # public_deps.
6807     deps = [
6808       ":d8",
6809       ":mksnapshot",
6810       ":torque_base",
6811       ":torque_ls_base",
6812       ":v8_base_without_compiler",
6813       ":v8_bigint",
6814       ":v8_headers",
6815       ":v8_initializers",
6816       ":v8_internal_headers",
6817       ":v8_libbase",
6818       ":v8_maybe_icu",
6819       ":v8_version",
6820       ":wee8",
6821       "src/inspector:inspector",
6822       "src/inspector:inspector_string_conversions",
6823     ]
6824   }
6825 }
6826
6827 ###############################################################################
6828 # Produce a single static library for embedders
6829 #
6830
6831 if (v8_monolithic) {
6832   assert(!is_component_build,
6833          "Set `is_component_build = false` for v8_monolithic.")
6834
6835   # Using external startup data would produce separate files.
6836   assert(!v8_use_external_startup_data,
6837          "Set `v8_use_external_startup_data = false` for v8_monolithic.")
6838   v8_static_library("v8_monolith") {
6839     deps = [
6840       ":v8",
6841       ":v8_libbase",
6842       ":v8_libplatform",
6843       "//build/win:default_exe_manifest",
6844     ]
6845
6846     configs = [ ":internal_config" ]
6847   }
6848 }
6849
6850 if (v8_enable_webassembly) {
6851   v8_static_library("wee8") {
6852     deps = [
6853       ":v8_base",
6854       ":v8_libbase",
6855       ":v8_libplatform",
6856       ":v8_shared_internal_headers",
6857       ":v8_snapshot",
6858       "//build/win:default_exe_manifest",
6859     ]
6860     if (v8_enable_vtunejit) {
6861       deps += [ "src/third_party/vtune:v8_vtune" ]
6862     }
6863
6864     # TODO: v8dll-main.cc equivalent for shared library builds
6865
6866     configs = [ ":internal_config" ]
6867
6868     sources = [
6869       ### gcmole(all) ###
6870       "src/wasm/c-api.cc",
6871       "src/wasm/c-api.h",
6872       "third_party/wasm-api/wasm.h",
6873       "third_party/wasm-api/wasm.hh",
6874     ]
6875   }
6876 }
6877
6878 ###############################################################################
6879 # Executables
6880 #
6881
6882 if (current_toolchain == v8_generator_toolchain) {
6883   v8_executable("bytecode_builtins_list_generator") {
6884     visibility = [ ":*" ]  # Only targets in this file can depend on this.
6885
6886     include_dirs = [ "." ]
6887
6888     sources = [
6889       "src/builtins/generate-bytecodes-builtins-list.cc",
6890       "src/interpreter/bytecode-operands.cc",
6891       "src/interpreter/bytecode-operands.h",
6892       "src/interpreter/bytecode-traits.h",
6893       "src/interpreter/bytecodes.cc",
6894       "src/interpreter/bytecodes.h",
6895     ]
6896
6897     configs = [ ":internal_config" ]
6898
6899     deps = [
6900       ":v8_libbase",
6901       ":v8_shared_internal_headers",
6902       "//build/win:default_exe_manifest",
6903     ]
6904   }
6905 }
6906
6907 if (current_toolchain == v8_snapshot_toolchain) {
6908   v8_executable("mksnapshot") {
6909     visibility = [ ":*" ]  # Only targets in this file can depend on this.
6910
6911     sources = [
6912       "src/snapshot/embedded/embedded-empty.cc",
6913       "src/snapshot/embedded/embedded-file-writer.cc",
6914       "src/snapshot/embedded/embedded-file-writer.h",
6915       "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
6916       "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
6917       "src/snapshot/embedded/platform-embedded-file-writer-base.cc",
6918       "src/snapshot/embedded/platform-embedded-file-writer-base.h",
6919       "src/snapshot/embedded/platform-embedded-file-writer-generic.cc",
6920       "src/snapshot/embedded/platform-embedded-file-writer-generic.h",
6921       "src/snapshot/embedded/platform-embedded-file-writer-mac.cc",
6922       "src/snapshot/embedded/platform-embedded-file-writer-mac.h",
6923       "src/snapshot/embedded/platform-embedded-file-writer-win.cc",
6924       "src/snapshot/embedded/platform-embedded-file-writer-win.h",
6925       "src/snapshot/mksnapshot.cc",
6926       "src/snapshot/snapshot-empty.cc",
6927       "src/snapshot/static-roots-gen.cc",
6928       "src/snapshot/static-roots-gen.h",
6929     ]
6930
6931     if (v8_control_flow_integrity) {
6932       sources += [ "src/deoptimizer/deoptimizer-cfi-empty.cc" ]
6933     }
6934
6935     configs = [ ":internal_config" ]
6936
6937     deps = [
6938       ":v8_base_without_compiler",
6939       ":v8_compiler_for_mksnapshot",
6940       ":v8_init",
6941       ":v8_libbase",
6942       ":v8_libplatform",
6943       ":v8_maybe_icu",
6944       ":v8_shared_internal_headers",
6945       ":v8_tracing",
6946       ":v8_turboshaft",
6947       "//build/win:default_exe_manifest",
6948     ]
6949   }
6950 }
6951
6952 if (current_toolchain == v8_snapshot_toolchain) {
6953   v8_executable("torque") {
6954     visibility = [ ":*" ]  # Only targets in this file can depend on this.
6955
6956     sources = [ "src/torque/torque.cc" ]
6957
6958     deps = [
6959       ":torque_base",
6960       "//build/win:default_exe_manifest",
6961     ]
6962
6963     # The use of exceptions for Torque in violation of the Chromium style-guide
6964     # is justified by the fact that it is only used from the non-essential
6965     # language server and can be removed anytime if it causes problems.
6966     configs = [
6967       ":internal_config",
6968       "//build/config/compiler:exceptions",
6969       "//build/config/compiler:rtti",
6970     ]
6971
6972     remove_configs = [
6973       "//build/config/compiler:no_exceptions",
6974       "//build/config/compiler:no_rtti",
6975     ]
6976   }
6977 }
6978
6979 v8_executable("torque-language-server") {
6980   visibility = [ ":*" ]  # Only targets in this file can depend on this.
6981
6982   sources = [ "src/torque/ls/torque-language-server.cc" ]
6983
6984   deps = [
6985     ":torque_base",
6986     ":torque_ls_base",
6987     "//build/win:default_exe_manifest",
6988   ]
6989
6990   # The use of exceptions for Torque in violation of the Chromium style-guide
6991   # is justified by the fact that it is only used from the non-essential
6992   # language server and can be removed anytime if it causes problems.
6993   configs = [
6994     ":internal_config",
6995     "//build/config/compiler:exceptions",
6996     "//build/config/compiler:rtti",
6997   ]
6998
6999   remove_configs = [
7000     "//build/config/compiler:no_exceptions",
7001     "//build/config/compiler:no_rtti",
7002   ]
7003 }
7004
7005 if (v8_enable_i18n_support) {
7006   if (current_toolchain == v8_generator_toolchain) {
7007     v8_executable("gen-regexp-special-case") {
7008       visibility = [ ":*" ]  # Only targets in this file can depend on this.
7009
7010       sources = [
7011         "src/regexp/gen-regexp-special-case.cc",
7012         "src/regexp/special-case.h",
7013       ]
7014
7015       deps = [
7016         ":v8_libbase",
7017         ":v8_shared_internal_headers",
7018         "//build/win:default_exe_manifest",
7019         v8_icu_path,
7020       ]
7021
7022       configs = [ ":internal_config" ]
7023     }
7024   }
7025
7026   action("run_gen-regexp-special-case") {
7027     visibility = [ ":*" ]  # Only targets in this file can depend on this.
7028
7029     script = "tools/run.py"
7030
7031     deps = [ ":gen-regexp-special-case($v8_generator_toolchain)" ]
7032
7033     output_file = "$target_gen_dir/src/regexp/special-case.cc"
7034
7035     outputs = [ output_file ]
7036
7037     args = [
7038       "./" + rebase_path(
7039               get_label_info(
7040                       ":gen-regexp-special-case($v8_generator_toolchain)",
7041                       "root_out_dir") + "/gen-regexp-special-case",
7042               root_build_dir),
7043       rebase_path(output_file, root_build_dir),
7044     ]
7045   }
7046 }
7047
7048 ###############################################################################
7049 # Public targets
7050 #
7051
7052 want_v8_shell =
7053     (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
7054     (current_toolchain == v8_snapshot_toolchain &&
7055      v8_toolset_for_shell == "host") ||
7056     (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
7057
7058 group("gn_all") {
7059   testonly = true
7060
7061   deps = [
7062     ":d8",
7063     ":v8_fuzzers",
7064     ":v8_hello_world",
7065     ":v8_sample_process",
7066     "test:gn_all",
7067     "tools:gn_all",
7068   ]
7069
7070   if (v8_custom_deps != "") {
7071     # Custom dependency from directory under v8/custom_deps.
7072     deps += [ v8_custom_deps ]
7073   }
7074
7075   if (want_v8_shell) {
7076     deps += [ ":v8_shell" ]
7077   }
7078
7079   if (v8_check_header_includes) {
7080     deps += [ ":check_headers" ]
7081   }
7082 }
7083
7084 group("v8_python_base") {
7085   data = [ ".vpython3" ]
7086 }
7087
7088 group("v8_clusterfuzz") {
7089   testonly = true
7090
7091   deps = [
7092     ":d8",
7093     ":v8_simple_inspector_fuzzer",
7094     "tools/clusterfuzz/trials:v8_clusterfuzz_resources",
7095   ]
7096
7097   if (v8_multi_arch_build) {
7098     deps += [
7099       ":d8(//build/toolchain/linux:clang_x64)",
7100       ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
7101       ":d8(//build/toolchain/linux:clang_x86)",
7102       ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
7103       ":d8(tools/clusterfuzz/foozzie/toolchain:clang_x64_pointer_compression)",
7104     ]
7105   }
7106 }
7107
7108 # Targets we ensure work with gcc. The aim is to keep this list small to have
7109 # a fast overall compile time.
7110 group("v8_gcc_light") {
7111   testonly = true
7112
7113   deps = [ ":d8" ]
7114 }
7115
7116 group("v8_archive") {
7117   testonly = true
7118
7119   deps = [ ":d8" ]
7120
7121   if (!is_win) {
7122     # On windows, cctest doesn't link with v8_static_library.
7123     deps += [ "test/cctest:cctest" ]
7124   }
7125 }
7126
7127 # TODO(dglazkov): Remove the "!build_with_chromium" condition once this clause
7128 # is removed from Chromium.
7129 if (is_fuchsia && !build_with_chromium) {
7130   import("//build/config/fuchsia/generate_runner_scripts.gni")
7131   import("//third_party/fuchsia-sdk/sdk/build/component.gni")
7132   import("//third_party/fuchsia-sdk/sdk/build/package.gni")
7133
7134   fuchsia_component("d8_component") {
7135     testonly = true
7136     manifest = "gni/v8.cml"
7137     data_deps = [ ":d8" ]
7138   }
7139
7140   fuchsia_package("d8_pkg") {
7141     testonly = true
7142     package_name = "d8"
7143     deps = [ ":d8_component" ]
7144   }
7145
7146   fuchsia_package_installer("d8_fuchsia") {
7147     testonly = true
7148     package = ":d8_pkg"
7149     package_name = "d8"
7150   }
7151 }
7152
7153 group("v8_fuzzers") {
7154   testonly = true
7155   data_deps = [
7156     ":v8_simple_inspector_fuzzer",
7157     ":v8_simple_json_fuzzer",
7158     ":v8_simple_parser_fuzzer",
7159     ":v8_simple_regexp_fuzzer",
7160   ]
7161
7162   if (v8_enable_webassembly) {
7163     data_deps += [
7164       ":v8_simple_multi_return_fuzzer",
7165       ":v8_simple_wasm_async_fuzzer",
7166       ":v8_simple_wasm_code_fuzzer",
7167       ":v8_simple_wasm_compile_fuzzer",
7168       ":v8_simple_wasm_fuzzer",
7169       ":v8_simple_wasm_streaming_fuzzer",
7170     ]
7171   }
7172 }
7173
7174 if (is_component_build) {
7175   v8_component("v8") {
7176     sources = [ "src/utils/v8dll-main.cc" ]
7177
7178     public_deps = [
7179       ":v8_base",
7180       ":v8_snapshot",
7181     ]
7182
7183     configs = [ ":internal_config" ]
7184
7185     public_configs = [ ":external_config" ]
7186   }
7187
7188   v8_component("v8_for_testing") {
7189     testonly = true
7190
7191     sources = [ "src/utils/v8dll-main.cc" ]
7192
7193     public_deps = [
7194       ":torque_base",
7195       ":torque_ls_base",
7196       ":v8_base",
7197       ":v8_headers",
7198       ":v8_snapshot",
7199     ]
7200
7201     if (v8_enable_turbofan) {
7202       # For cctest/test-serialize.
7203       public_deps += [ ":v8_initializers" ]
7204     }
7205
7206     configs = [ ":internal_config" ]
7207
7208     public_configs = [ ":external_config" ]
7209   }
7210
7211   v8_component("cppgc") {
7212     public_deps = [ ":cppgc_base" ]
7213
7214     if (!cppgc_is_standalone) {
7215       deps = [ ":v8" ]
7216     }
7217
7218     configs = []
7219     public_configs = [ ":external_config" ]
7220   }
7221
7222   if (cppgc_is_standalone) {
7223     v8_component("cppgc_for_testing") {
7224       testonly = true
7225
7226       public_deps = [ ":cppgc_base" ]
7227
7228       configs = []
7229       public_configs = [ ":external_config" ]
7230     }
7231   }
7232
7233   v8_component("v8_heap_base_for_testing") {
7234     testonly = true
7235
7236     public_deps = [ ":v8_heap_base" ]
7237
7238     configs = []
7239     public_configs = [ ":external_config" ]
7240   }
7241 } else {
7242   group("v8") {
7243     public_deps = [
7244       ":v8_base",
7245       ":v8_snapshot",
7246     ]
7247
7248     public_configs = [ ":external_config" ]
7249   }
7250
7251   group("v8_for_testing") {
7252     testonly = true
7253
7254     public_deps = [
7255       ":torque_base",
7256       ":torque_ls_base",
7257       ":v8_base",
7258       ":v8_snapshot",
7259     ]
7260
7261     if (v8_enable_turbofan) {
7262       # For cctest/test-serialize.
7263       public_deps += [ ":v8_initializers" ]
7264     }
7265
7266     public_configs = [ ":external_config" ]
7267   }
7268
7269   group("cppgc") {
7270     public_deps = [ ":cppgc_base" ]
7271
7272     if (!cppgc_is_standalone) {
7273       deps = [ ":v8" ]
7274     }
7275
7276     public_configs = [ ":external_config" ]
7277   }
7278
7279   if (cppgc_is_standalone) {
7280     group("cppgc_for_testing") {
7281       testonly = true
7282
7283       public_deps = [ ":cppgc_base" ]
7284
7285       public_configs = [ ":external_config" ]
7286     }
7287   }
7288
7289   group("v8_heap_base_for_testing") {
7290     testonly = true
7291
7292     public_deps = [ ":v8_heap_base" ]
7293
7294     public_configs = [ ":external_config" ]
7295   }
7296 }
7297
7298 v8_executable("d8") {
7299   sources = [
7300     "src/d8/async-hooks-wrapper.cc",
7301     "src/d8/async-hooks-wrapper.h",
7302     "src/d8/d8-console.cc",
7303     "src/d8/d8-console.h",
7304     "src/d8/d8-js.cc",
7305     "src/d8/d8-platforms.cc",
7306     "src/d8/d8-platforms.h",
7307     "src/d8/d8-test.cc",
7308     "src/d8/d8.cc",
7309     "src/d8/d8.h",
7310   ]
7311
7312   if (v8_fuzzilli) {
7313     sources += [
7314       "src/d8/cov.cc",
7315       "src/d8/cov.h",
7316     ]
7317   }
7318
7319   configs = [
7320     # Note: don't use :internal_config here because this target will get
7321     # the :external_config applied to it by virtue of depending on :v8, and
7322     # you can't have both applied to the same target.
7323     ":internal_config_base",
7324     ":v8_tracing_config",
7325   ]
7326
7327   deps = [
7328     ":v8",
7329     ":v8_libbase",
7330     ":v8_libplatform",
7331     ":v8_tracing",
7332     "//build/win:default_exe_manifest",
7333   ]
7334
7335   if (is_posix || is_fuchsia) {
7336     sources += [ "src/d8/d8-posix.cc" ]
7337   } else if (is_win) {
7338     sources += [ "src/d8/d8-windows.cc" ]
7339   }
7340
7341   if (v8_correctness_fuzzer) {
7342     deps += [ "tools/clusterfuzz/foozzie:v8_correctness_fuzzer_resources" ]
7343   }
7344
7345   defines = []
7346
7347   if (v8_enable_vtunejit) {
7348     deps += [ "src/third_party/vtune:v8_vtune" ]
7349   }
7350 }
7351
7352 v8_executable("v8_hello_world") {
7353   sources = [ "samples/hello-world.cc" ]
7354
7355   configs = [
7356     # Note: don't use :internal_config here because this target will get
7357     # the :external_config applied to it by virtue of depending on :v8, and
7358     # you can't have both applied to the same target.
7359     ":internal_config_base",
7360   ]
7361
7362   deps = [
7363     ":v8",
7364     ":v8_libbase",
7365     ":v8_libplatform",
7366     "//build/win:default_exe_manifest",
7367   ]
7368 }
7369
7370 v8_executable("v8_sample_process") {
7371   sources = [ "samples/process.cc" ]
7372
7373   configs = [
7374     # Note: don't use :internal_config here because this target will get
7375     # the :external_config applied to it by virtue of depending on :v8, and
7376     # you can't have both applied to the same target.
7377     ":internal_config_base",
7378   ]
7379
7380   deps = [
7381     ":v8",
7382     ":v8_libbase",
7383     ":v8_libplatform",
7384     "//build/win:default_exe_manifest",
7385   ]
7386 }
7387
7388 if (want_v8_shell) {
7389   v8_executable("v8_shell") {
7390     sources = [ "samples/shell.cc" ]
7391
7392     configs = [
7393       # Note: don't use :internal_config here because this target will get
7394       # the :external_config applied to it by virtue of depending on :v8, and
7395       # you can't have both applied to the same target.
7396       ":internal_config_base",
7397     ]
7398
7399     deps = [
7400       ":v8",
7401       ":v8_libbase",
7402       ":v8_libplatform",
7403       "//build/win:default_exe_manifest",
7404     ]
7405   }
7406 }
7407
7408 v8_executable("cppgc_hello_world") {
7409   sources = [ "samples/cppgc/hello-world.cc" ]
7410
7411   if (v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") {
7412     if (!is_clang) {
7413       libs = [ "atomic" ]
7414     }
7415   }
7416
7417   configs = [
7418     # Note: don't use :internal_config here because this target will get
7419     # the :external_config applied to it by virtue of depending on :cppgc, and
7420     # you can't have both applied to the same target.
7421     ":internal_config_base",
7422     ":cppgc_base_config",
7423   ]
7424
7425   deps = [ ":cppgc" ]
7426   if (!cppgc_is_standalone) {
7427     deps += [
7428       ":v8",
7429       "//build/win:default_exe_manifest",
7430     ]
7431   }
7432 }
7433
7434 template("v8_fuzzer") {
7435   name = target_name
7436   forward_variables_from(invoker, "*")
7437   v8_executable("v8_simple_" + name) {
7438     deps = [
7439       ":" + name,
7440       "//build/win:default_exe_manifest",
7441     ]
7442
7443     sources = [ "test/fuzzer/fuzzer.cc" ]
7444
7445     configs = [ ":external_config" ]
7446   }
7447 }
7448
7449 v8_source_set("json_fuzzer") {
7450   sources = [ "test/fuzzer/json.cc" ]
7451
7452   deps = [ ":fuzzer_support" ]
7453
7454   configs = [
7455     ":external_config",
7456     ":internal_config_base",
7457   ]
7458 }
7459
7460 v8_fuzzer("json_fuzzer") {
7461 }
7462
7463 v8_source_set("parser_fuzzer") {
7464   sources = [ "test/fuzzer/parser.cc" ]
7465
7466   deps = [ ":fuzzer_support" ]
7467
7468   configs = [
7469     ":external_config",
7470     ":internal_config_base",
7471   ]
7472 }
7473
7474 v8_fuzzer("parser_fuzzer") {
7475 }
7476
7477 v8_source_set("regexp_fuzzer") {
7478   sources = [ "test/fuzzer/regexp.cc" ]
7479
7480   deps = [ ":fuzzer_support" ]
7481
7482   configs = [
7483     ":external_config",
7484     ":internal_config_base",
7485   ]
7486 }
7487
7488 v8_fuzzer("regexp_fuzzer") {
7489 }
7490
7491 if (v8_enable_webassembly) {
7492   v8_source_set("multi_return_fuzzer") {
7493     sources = [ "test/fuzzer/multi-return.cc" ]
7494
7495     deps = [ ":fuzzer_support" ]
7496
7497     configs = [
7498       ":external_config",
7499       ":internal_config_base",
7500     ]
7501   }
7502
7503   v8_fuzzer("multi_return_fuzzer") {
7504   }
7505
7506   v8_source_set("wasm_test_common") {
7507     sources = [
7508       "test/common/flag-utils.h",
7509       "test/common/wasm/flag-utils.h",
7510       "test/common/wasm/wasm-module-runner.cc",
7511       "test/common/wasm/wasm-module-runner.h",
7512     ]
7513
7514     deps = [
7515       ":generate_bytecode_builtins_list",
7516       ":run_torque",
7517       ":v8_internal_headers",
7518       ":v8_libbase",
7519       ":v8_shared_internal_headers",
7520       ":v8_tracing",
7521     ]
7522
7523     public_deps = [
7524       ":v8_abseil",
7525       ":v8_maybe_icu",
7526     ]
7527
7528     configs = [
7529       ":external_config",
7530       ":internal_config_base",
7531     ]
7532   }
7533
7534   v8_source_set("wasm_fuzzer") {
7535     sources = [ "test/fuzzer/wasm.cc" ]
7536
7537     deps = [
7538       ":fuzzer_support",
7539       ":lib_wasm_fuzzer_common",
7540       ":wasm_test_common",
7541     ]
7542
7543     configs = [
7544       ":external_config",
7545       ":internal_config_base",
7546     ]
7547   }
7548
7549   v8_fuzzer("wasm_fuzzer") {
7550   }
7551
7552   v8_source_set("wasm_async_fuzzer") {
7553     sources = [ "test/fuzzer/wasm-async.cc" ]
7554
7555     deps = [
7556       ":fuzzer_support",
7557       ":lib_wasm_fuzzer_common",
7558       ":wasm_test_common",
7559     ]
7560
7561     configs = [
7562       ":external_config",
7563       ":internal_config_base",
7564     ]
7565   }
7566
7567   v8_fuzzer("wasm_async_fuzzer") {
7568   }
7569
7570   v8_source_set("wasm_code_fuzzer") {
7571     sources = [
7572       "test/common/wasm/test-signatures.h",
7573       "test/fuzzer/wasm-code.cc",
7574     ]
7575
7576     deps = [
7577       ":fuzzer_support",
7578       ":lib_wasm_fuzzer_common",
7579       ":wasm_test_common",
7580     ]
7581
7582     configs = [
7583       ":external_config",
7584       ":internal_config_base",
7585     ]
7586   }
7587
7588   v8_fuzzer("wasm_code_fuzzer") {
7589   }
7590
7591   v8_source_set("lib_wasm_fuzzer_common") {
7592     sources = [
7593       "test/fuzzer/wasm-fuzzer-common.cc",
7594       "test/fuzzer/wasm-fuzzer-common.h",
7595     ]
7596
7597     deps = [
7598       ":fuzzer_support",
7599       ":generate_bytecode_builtins_list",
7600       ":run_torque",
7601       ":v8_internal_headers",
7602       ":v8_tracing",
7603       ":wasm_test_common",
7604     ]
7605
7606     public_deps = [
7607       ":v8_abseil",
7608       ":v8_maybe_icu",
7609     ]
7610
7611     configs = [
7612       ":external_config",
7613       ":internal_config_base",
7614     ]
7615   }
7616
7617   v8_source_set("wasm_compile_fuzzer") {
7618     sources = [
7619       "test/common/wasm/test-signatures.h",
7620       "test/fuzzer/wasm-compile.cc",
7621     ]
7622
7623     deps = [
7624       ":fuzzer_support",
7625       ":lib_wasm_fuzzer_common",
7626       ":wasm_test_common",
7627     ]
7628
7629     configs = [
7630       ":external_config",
7631       ":internal_config_base",
7632     ]
7633   }
7634
7635   v8_fuzzer("wasm_compile_fuzzer") {
7636   }
7637
7638   v8_source_set("wasm_streaming_fuzzer") {
7639     sources = [ "test/fuzzer/wasm-streaming.cc" ]
7640
7641     deps = [
7642       ":fuzzer_support",
7643       ":lib_wasm_fuzzer_common",
7644       ":wasm_test_common",
7645     ]
7646
7647     configs = [
7648       ":external_config",
7649       ":internal_config_base",
7650     ]
7651   }
7652
7653   v8_fuzzer("wasm_streaming_fuzzer") {
7654   }
7655 }
7656
7657 v8_source_set("inspector_fuzzer") {
7658   sources = [ "test/fuzzer/inspector-fuzzer.cc" ]
7659
7660   deps = [
7661     ":fuzzer_support",
7662     "test/inspector:inspector_test",
7663   ]
7664
7665   configs = [
7666     ":external_config",
7667     ":internal_config_base",
7668   ]
7669 }
7670
7671 v8_fuzzer("inspector_fuzzer") {
7672 }
7673
7674 # Target to build all generated .cc files.
7675 group("v8_generated_cc_files") {
7676   testonly = true
7677
7678   deps = [
7679     ":generate_bytecode_builtins_list",
7680     ":run_torque",
7681     "src/inspector:v8_generated_cc_files",
7682   ]
7683 }
7684
7685 # Protobuf targets, used only when building outside of chromium.
7686
7687 if (!build_with_chromium && v8_use_perfetto) {
7688   # This config is applied to the autogenerated .pb.{cc,h} files in
7689   # proto_library.gni. This config is propagated up to the source sets
7690   # that depend on generated proto headers.
7691   config("protobuf_gen_config") {
7692     defines = [
7693       "GOOGLE_PROTOBUF_NO_RTTI",
7694       "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
7695     ]
7696     cflags = [
7697       "-Wno-unknown-warning-option",
7698       "-Wno-deprecated",
7699       "-Wno-undef",
7700       "-Wno-zero-as-null-pointer-constant",
7701       "-Wno-thread-safety-attributes",
7702     ]
7703     include_dirs = [ "third_party/protobuf/src" ]
7704   }
7705
7706   # Configuration used to build libprotobuf_* and the protoc compiler.
7707   config("protobuf_config") {
7708     # Apply the lighter supressions and macro definitions from above.
7709     configs = [ ":protobuf_gen_config" ]
7710
7711     if (!is_win) {
7712       defines = [ "HAVE_PTHREAD=1" ]
7713     }
7714     if (is_clang) {
7715       cflags = [
7716         "-Wno-unused-private-field",
7717         "-Wno-unused-function",
7718         "-Wno-inconsistent-missing-override",
7719         "-Wno-unknown-warning-option",
7720         "-Wno-enum-compare-switch",
7721         "-Wno-user-defined-warnings",
7722         "-Wno-tautological-constant-compare",
7723       ]
7724     }
7725     if (is_win && is_clang) {
7726       cflags += [ "-Wno-microsoft-unqualified-friend" ]
7727     }
7728   }
7729
7730   source_set("protobuf_lite") {
7731     sources = [
7732       "third_party/protobuf/src/google/protobuf/any_lite.cc",
7733       "third_party/protobuf/src/google/protobuf/arena.cc",
7734       "third_party/protobuf/src/google/protobuf/arena.h",
7735       "third_party/protobuf/src/google/protobuf/arena_impl.h",
7736       "third_party/protobuf/src/google/protobuf/arenastring.h",
7737       "third_party/protobuf/src/google/protobuf/extension_set.cc",
7738       "third_party/protobuf/src/google/protobuf/extension_set.h",
7739       "third_party/protobuf/src/google/protobuf/generated_enum_util.cc",
7740       "third_party/protobuf/src/google/protobuf/generated_enum_util.h",
7741       "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
7742       "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.h",
7743       "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
7744       "third_party/protobuf/src/google/protobuf/generated_message_util.h",
7745       "third_party/protobuf/src/google/protobuf/has_bits.h",
7746       "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
7747       "third_party/protobuf/src/google/protobuf/implicit_weak_message.h",
7748       "third_party/protobuf/src/google/protobuf/inlined_string_field.h",
7749       "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
7750       "third_party/protobuf/src/google/protobuf/io/coded_stream.h",
7751       "third_party/protobuf/src/google/protobuf/io/coded_stream_inl.h",
7752       "third_party/protobuf/src/google/protobuf/io/io_win32.cc",
7753       "third_party/protobuf/src/google/protobuf/io/io_win32.h",
7754       "third_party/protobuf/src/google/protobuf/io/strtod.cc",
7755       "third_party/protobuf/src/google/protobuf/io/strtod.h",
7756       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc",
7757       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.h",
7758       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
7759       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h",
7760       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
7761       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h",
7762       "third_party/protobuf/src/google/protobuf/map.h",
7763       "third_party/protobuf/src/google/protobuf/map_entry_lite.h",
7764       "third_party/protobuf/src/google/protobuf/map_field_lite.h",
7765       "third_party/protobuf/src/google/protobuf/map_type_handler.h",
7766       "third_party/protobuf/src/google/protobuf/message_lite.cc",
7767       "third_party/protobuf/src/google/protobuf/message_lite.h",
7768       "third_party/protobuf/src/google/protobuf/repeated_field.cc",
7769       "third_party/protobuf/src/google/protobuf/repeated_field.h",
7770       "third_party/protobuf/src/google/protobuf/stubs/bytestream.cc",
7771       "third_party/protobuf/src/google/protobuf/stubs/bytestream.h",
7772       "third_party/protobuf/src/google/protobuf/stubs/callback.h",
7773       "third_party/protobuf/src/google/protobuf/stubs/casts.h",
7774       "third_party/protobuf/src/google/protobuf/stubs/common.cc",
7775       "third_party/protobuf/src/google/protobuf/stubs/common.h",
7776       "third_party/protobuf/src/google/protobuf/stubs/fastmem.h",
7777       "third_party/protobuf/src/google/protobuf/stubs/hash.h",
7778       "third_party/protobuf/src/google/protobuf/stubs/int128.cc",
7779       "third_party/protobuf/src/google/protobuf/stubs/int128.h",
7780       "third_party/protobuf/src/google/protobuf/stubs/logging.h",
7781       "third_party/protobuf/src/google/protobuf/stubs/macros.h",
7782       "third_party/protobuf/src/google/protobuf/stubs/map_util.h",
7783       "third_party/protobuf/src/google/protobuf/stubs/mutex.h",
7784       "third_party/protobuf/src/google/protobuf/stubs/once.h",
7785       "third_party/protobuf/src/google/protobuf/stubs/platform_macros.h",
7786       "third_party/protobuf/src/google/protobuf/stubs/port.h",
7787       "third_party/protobuf/src/google/protobuf/stubs/status.cc",
7788       "third_party/protobuf/src/google/protobuf/stubs/status.h",
7789       "third_party/protobuf/src/google/protobuf/stubs/status_macros.h",
7790       "third_party/protobuf/src/google/protobuf/stubs/statusor.cc",
7791       "third_party/protobuf/src/google/protobuf/stubs/statusor.h",
7792       "third_party/protobuf/src/google/protobuf/stubs/stl_util.h",
7793       "third_party/protobuf/src/google/protobuf/stubs/stringpiece.cc",
7794       "third_party/protobuf/src/google/protobuf/stubs/stringpiece.h",
7795       "third_party/protobuf/src/google/protobuf/stubs/stringprintf.cc",
7796       "third_party/protobuf/src/google/protobuf/stubs/stringprintf.h",
7797       "third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc",
7798       "third_party/protobuf/src/google/protobuf/stubs/strutil.cc",
7799       "third_party/protobuf/src/google/protobuf/stubs/strutil.h",
7800       "third_party/protobuf/src/google/protobuf/stubs/template_util.h",
7801       "third_party/protobuf/src/google/protobuf/stubs/time.cc",
7802       "third_party/protobuf/src/google/protobuf/stubs/time.h",
7803       "third_party/protobuf/src/google/protobuf/wire_format_lite.cc",
7804       "third_party/protobuf/src/google/protobuf/wire_format_lite.h",
7805     ]
7806     configs -= [ "//build/config/compiler:chromium_code" ]
7807     configs += [
7808       "//build/config/compiler:no_chromium_code",
7809       ":protobuf_config",
7810     ]
7811     if (is_win) {
7812       configs -= [ "//build/config/win:lean_and_mean" ]
7813     }
7814     public_configs = [ ":protobuf_gen_config" ]
7815   }
7816
7817   # This target should be used only by the protoc compiler and by test targets.
7818   source_set("protobuf_full") {
7819     deps = [ ":protobuf_lite" ]
7820     sources = [
7821       "third_party/protobuf/src/google/protobuf/any.cc",
7822       "third_party/protobuf/src/google/protobuf/any.h",
7823       "third_party/protobuf/src/google/protobuf/any.pb.cc",
7824       "third_party/protobuf/src/google/protobuf/any.pb.h",
7825       "third_party/protobuf/src/google/protobuf/api.pb.cc",
7826       "third_party/protobuf/src/google/protobuf/api.pb.h",
7827       "third_party/protobuf/src/google/protobuf/compiler/importer.cc",
7828       "third_party/protobuf/src/google/protobuf/compiler/importer.h",
7829       "third_party/protobuf/src/google/protobuf/compiler/parser.cc",
7830       "third_party/protobuf/src/google/protobuf/compiler/parser.h",
7831       "third_party/protobuf/src/google/protobuf/descriptor.cc",
7832       "third_party/protobuf/src/google/protobuf/descriptor.h",
7833       "third_party/protobuf/src/google/protobuf/descriptor.pb.cc",
7834       "third_party/protobuf/src/google/protobuf/descriptor.pb.h",
7835       "third_party/protobuf/src/google/protobuf/descriptor_database.cc",
7836       "third_party/protobuf/src/google/protobuf/descriptor_database.h",
7837       "third_party/protobuf/src/google/protobuf/duration.pb.cc",
7838       "third_party/protobuf/src/google/protobuf/duration.pb.h",
7839       "third_party/protobuf/src/google/protobuf/dynamic_message.cc",
7840       "third_party/protobuf/src/google/protobuf/dynamic_message.h",
7841       "third_party/protobuf/src/google/protobuf/empty.pb.cc",
7842       "third_party/protobuf/src/google/protobuf/empty.pb.h",
7843       "third_party/protobuf/src/google/protobuf/extension_set_heavy.cc",
7844       "third_party/protobuf/src/google/protobuf/field_mask.pb.cc",
7845       "third_party/protobuf/src/google/protobuf/field_mask.pb.h",
7846       "third_party/protobuf/src/google/protobuf/generated_enum_reflection.h",
7847       "third_party/protobuf/src/google/protobuf/generated_message_reflection.cc",
7848       "third_party/protobuf/src/google/protobuf/generated_message_reflection.h",
7849       "third_party/protobuf/src/google/protobuf/io/gzip_stream.cc",
7850       "third_party/protobuf/src/google/protobuf/io/gzip_stream.h",
7851       "third_party/protobuf/src/google/protobuf/io/printer.cc",
7852       "third_party/protobuf/src/google/protobuf/io/printer.h",
7853       "third_party/protobuf/src/google/protobuf/io/tokenizer.cc",
7854       "third_party/protobuf/src/google/protobuf/io/tokenizer.h",
7855       "third_party/protobuf/src/google/protobuf/map_entry.h",
7856       "third_party/protobuf/src/google/protobuf/map_field.cc",
7857       "third_party/protobuf/src/google/protobuf/map_field.h",
7858       "third_party/protobuf/src/google/protobuf/map_field_inl.h",
7859       "third_party/protobuf/src/google/protobuf/message.cc",
7860       "third_party/protobuf/src/google/protobuf/message.h",
7861       "third_party/protobuf/src/google/protobuf/metadata.h",
7862       "third_party/protobuf/src/google/protobuf/reflection.h",
7863       "third_party/protobuf/src/google/protobuf/reflection_internal.h",
7864       "third_party/protobuf/src/google/protobuf/reflection_ops.cc",
7865       "third_party/protobuf/src/google/protobuf/reflection_ops.h",
7866       "third_party/protobuf/src/google/protobuf/service.cc",
7867       "third_party/protobuf/src/google/protobuf/service.h",
7868       "third_party/protobuf/src/google/protobuf/source_context.pb.cc",
7869       "third_party/protobuf/src/google/protobuf/source_context.pb.h",
7870       "third_party/protobuf/src/google/protobuf/struct.pb.cc",
7871       "third_party/protobuf/src/google/protobuf/struct.pb.h",
7872       "third_party/protobuf/src/google/protobuf/stubs/mathlimits.cc",
7873       "third_party/protobuf/src/google/protobuf/stubs/mathlimits.h",
7874       "third_party/protobuf/src/google/protobuf/stubs/mathutil.h",
7875       "third_party/protobuf/src/google/protobuf/stubs/substitute.cc",
7876       "third_party/protobuf/src/google/protobuf/stubs/substitute.h",
7877       "third_party/protobuf/src/google/protobuf/text_format.cc",
7878       "third_party/protobuf/src/google/protobuf/text_format.h",
7879       "third_party/protobuf/src/google/protobuf/timestamp.pb.cc",
7880       "third_party/protobuf/src/google/protobuf/timestamp.pb.h",
7881       "third_party/protobuf/src/google/protobuf/type.pb.cc",
7882       "third_party/protobuf/src/google/protobuf/type.pb.h",
7883       "third_party/protobuf/src/google/protobuf/unknown_field_set.cc",
7884       "third_party/protobuf/src/google/protobuf/unknown_field_set.h",
7885       "third_party/protobuf/src/google/protobuf/util/field_comparator.cc",
7886       "third_party/protobuf/src/google/protobuf/util/field_comparator.h",
7887       "third_party/protobuf/src/google/protobuf/util/field_mask_util.cc",
7888       "third_party/protobuf/src/google/protobuf/util/field_mask_util.h",
7889       "third_party/protobuf/src/google/protobuf/util/internal/constants.h",
7890       "third_party/protobuf/src/google/protobuf/util/internal/datapiece.cc",
7891       "third_party/protobuf/src/google/protobuf/util/internal/datapiece.h",
7892       "third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
7893       "third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.h",
7894       "third_party/protobuf/src/google/protobuf/util/internal/error_listener.cc",
7895       "third_party/protobuf/src/google/protobuf/util/internal/error_listener.h",
7896       "third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
7897       "third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.h",
7898       "third_party/protobuf/src/google/protobuf/util/internal/json_escaping.cc",
7899       "third_party/protobuf/src/google/protobuf/util/internal/json_escaping.h",
7900       "third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
7901       "third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.h",
7902       "third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
7903       "third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.h",
7904       "third_party/protobuf/src/google/protobuf/util/internal/location_tracker.h",
7905       "third_party/protobuf/src/google/protobuf/util/internal/object_location_tracker.h",
7906       "third_party/protobuf/src/google/protobuf/util/internal/object_source.h",
7907       "third_party/protobuf/src/google/protobuf/util/internal/object_writer.cc",
7908       "third_party/protobuf/src/google/protobuf/util/internal/object_writer.h",
7909       "third_party/protobuf/src/google/protobuf/util/internal/proto_writer.cc",
7910       "third_party/protobuf/src/google/protobuf/util/internal/proto_writer.h",
7911       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
7912       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h",
7913       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
7914       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.h",
7915       "third_party/protobuf/src/google/protobuf/util/internal/structured_objectwriter.h",
7916       "third_party/protobuf/src/google/protobuf/util/internal/type_info.cc",
7917       "third_party/protobuf/src/google/protobuf/util/internal/type_info.h",
7918       "third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
7919       "third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.h",
7920       "third_party/protobuf/src/google/protobuf/util/internal/utility.cc",
7921       "third_party/protobuf/src/google/protobuf/util/internal/utility.h",
7922       "third_party/protobuf/src/google/protobuf/util/json_util.cc",
7923       "third_party/protobuf/src/google/protobuf/util/json_util.h",
7924       "third_party/protobuf/src/google/protobuf/util/message_differencer.cc",
7925       "third_party/protobuf/src/google/protobuf/util/message_differencer.h",
7926       "third_party/protobuf/src/google/protobuf/util/time_util.cc",
7927       "third_party/protobuf/src/google/protobuf/util/time_util.h",
7928       "third_party/protobuf/src/google/protobuf/util/type_resolver.h",
7929       "third_party/protobuf/src/google/protobuf/util/type_resolver_util.cc",
7930       "third_party/protobuf/src/google/protobuf/util/type_resolver_util.h",
7931       "third_party/protobuf/src/google/protobuf/wire_format.cc",
7932       "third_party/protobuf/src/google/protobuf/wire_format.h",
7933       "third_party/protobuf/src/google/protobuf/wrappers.pb.cc",
7934       "third_party/protobuf/src/google/protobuf/wrappers.pb.h",
7935     ]
7936     configs -= [ "//build/config/compiler:chromium_code" ]
7937     configs += [
7938       "//build/config/compiler:no_chromium_code",
7939       ":protobuf_config",
7940     ]
7941     if (is_win) {
7942       configs -= [ "//build/config/win:lean_and_mean" ]
7943     }
7944     public_configs = [ ":protobuf_gen_config" ]
7945   }
7946
7947   if (current_toolchain == host_toolchain) {
7948     source_set("protoc_lib") {
7949       deps = [ ":protobuf_full" ]
7950       sources = [
7951         "third_party/protobuf/src/google/protobuf/compiler/code_generator.cc",
7952         "third_party/protobuf/src/google/protobuf/compiler/code_generator.h",
7953         "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc",
7954         "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h",
7955         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
7956         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.h",
7957         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
7958         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.h",
7959         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
7960         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.h",
7961         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
7962         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h",
7963         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
7964         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.h",
7965         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
7966         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h",
7967         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
7968         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h",
7969         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
7970         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.h",
7971         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
7972         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.h",
7973         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
7974         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h",
7975         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h",
7976         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h",
7977         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
7978         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h",
7979         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
7980         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.h",
7981         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
7982         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.h",
7983         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
7984         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.h",
7985         "third_party/protobuf/src/google/protobuf/compiler/plugin.cc",
7986         "third_party/protobuf/src/google/protobuf/compiler/plugin.h",
7987         "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc",
7988         "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h",
7989         "third_party/protobuf/src/google/protobuf/compiler/subprocess.cc",
7990         "third_party/protobuf/src/google/protobuf/compiler/subprocess.h",
7991         "third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc",
7992         "third_party/protobuf/src/google/protobuf/compiler/zip_writer.h",
7993       ]
7994       configs -= [ "//build/config/compiler:chromium_code" ]
7995       configs += [
7996         "//build/config/compiler:no_chromium_code",
7997         ":protobuf_config",
7998       ]
7999       if (is_win) {
8000         configs -= [ "//build/config/win:lean_and_mean" ]
8001       }
8002       public_configs = [ ":protobuf_gen_config" ]
8003     }
8004
8005     executable("protoc") {
8006       deps = [
8007         ":protoc_lib",
8008         "//build/win:default_exe_manifest",
8009       ]
8010       sources = [ "src/protobuf/protobuf-compiler-main.cc" ]
8011       configs -= [ "//build/config/compiler:chromium_code" ]
8012       configs += [ "//build/config/compiler:no_chromium_code" ]
8013     }
8014   }  # host_toolchain
8015
8016   v8_component("v8_libperfetto") {
8017     configs = [ ":v8_tracing_config" ]
8018     public_configs = [ "//third_party/perfetto/gn:public_config" ]
8019     deps = [
8020       "//third_party/perfetto/src/trace_processor:storage_minimal",
8021       "//third_party/perfetto/src/tracing/core",
8022
8023       # TODO(skyostil): Support non-POSIX platforms.
8024       "//third_party/perfetto/protos/perfetto/config:cpp",
8025       "//third_party/perfetto/protos/perfetto/trace/track_event:zero",
8026       "//third_party/perfetto/src/tracing:in_process_backend",
8027       "//third_party/perfetto/src/tracing:platform_impl",
8028     ]
8029
8030     public_deps = [
8031       "//third_party/perfetto/include/perfetto/trace_processor",
8032       "//third_party/perfetto/src/trace_processor:export_json",
8033       "//third_party/perfetto/src/tracing:client_api",
8034     ]
8035   }
8036 }  # if (!build_with_chromium && v8_use_perfetto)