Upload upstream chromium 94.0.4606.31
[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/dcheck_always_on.gni")
8 import("//build/config/host_byteorder.gni")
9 import("//build/config/mips.gni")
10 import("//build/config/sanitizers/sanitizers.gni")
11 import("//build_overrides/build.gni")
12
13 if (is_android) {
14   import("//build/config/android/rules.gni")
15 }
16
17 import("gni/snapshot_toolchain.gni")
18 import("gni/v8.gni")
19
20 # Specifies if the target build is a simulator build. Comparing target cpu
21 # with v8 target cpu to not affect simulator builds for making cross-compile
22 # snapshots.
23 target_is_simulator = (target_cpu != v8_target_cpu && !v8_multi_arch_build) ||
24                       (current_cpu != v8_current_cpu && v8_multi_arch_build)
25
26 # For faster Windows builds. See https://crbug.com/v8/8475.
27 emit_builtins_as_inline_asm = is_win && is_clang
28
29 declare_args() {
30   # Print to stdout on Android.
31   v8_android_log_stdout = false
32
33   # Dynamically set an additional dependency from v8/custom_deps.
34   v8_custom_deps = ""
35
36   # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode
37   # within a release Chrome.
38   v8_enable_debugging_features = is_debug
39
40   # Sets -DV8_ENABLE_FUTURE.
41   v8_enable_future = false
42
43   # Sets -DSYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing
44   v8_enable_system_instrumentation = is_win || is_mac
45
46   # Sets the GUID for the ETW provider
47   v8_etw_guid = ""
48
49   # Sets -DVERIFY_HEAP.
50   v8_enable_verify_heap = ""
51
52   # Sets -DVERIFY_PREDICTABLE
53   v8_enable_verify_predictable = false
54
55   # Enable compiler warnings when using V8_DEPRECATED apis.
56   v8_deprecation_warnings = true
57
58   # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
59   v8_imminent_deprecation_warnings = true
60
61   # Embeds the given script into the snapshot.
62   v8_embed_script = ""
63
64   # Allows the embedder to add a custom suffix to the version string.
65   v8_embedder_string = ""
66
67   # Sets -dENABLE_DISASSEMBLER.
68   v8_enable_disassembler = ""
69
70   # Sets the number of internal fields on promise objects.
71   v8_promise_internal_field_count = 0
72
73   # Sets -dENABLE_GDB_JIT_INTERFACE.
74   v8_enable_gdbjit = ""
75
76   # Sets -dENABLE_VTUNE_JIT_INTERFACE.
77   v8_enable_vtunejit = false
78
79   # Sets -dENABLE_VTUNE_TRACEMARK.
80   v8_enable_vtunetracemark = false
81
82   # Sets -dENABLE_HUGEPAGE
83   v8_enable_hugepage = false
84
85   # Sets -dENABLE_HANDLE_ZAPPING.
86   v8_enable_handle_zapping = is_debug
87
88   # Enable slow dchecks.
89   v8_enable_slow_dchecks = false
90
91   # Enable fast mksnapshot runs.
92   v8_enable_fast_mksnapshot = false
93
94   # Optimize code for Torque executable, even during a debug build.
95   v8_enable_fast_torque = ""
96
97   # Enable the registration of unwinding info for Windows x64 and ARM64.
98   v8_win64_unwinding_info = true
99
100   # Enable code comments for builtins in the snapshot (impacts performance).
101   # This also enables v8_code_comments.
102   v8_enable_snapshot_code_comments = false
103
104   # Allow runtime-enabled code comments (with --code-comments). Enabled by
105   # default in debug builds.
106   # Sets -dV8_CODE_COMMENTS
107   v8_code_comments = ""
108
109   # Allow runtime-enabled debug code (with --debug-code). Enabled by default in
110   # debug builds.
111   # Sets -dV8_ENABLE_DEBUG_CODE
112   v8_enable_debug_code = ""
113
114   # Enable native counters from the snapshot (impacts performance, sets
115   # -dV8_SNAPSHOT_NATIVE_CODE_COUNTERS).
116   # This option will generate extra code in the snapshot to increment counters,
117   # as per the --native-code-counters flag.
118   v8_enable_snapshot_native_code_counters = ""
119
120   # Enable code-generation-time checking of types in the CodeStubAssembler.
121   v8_enable_verify_csa = false
122
123   # Enable pointer compression (sets -dV8_COMPRESS_POINTERS).
124   v8_enable_pointer_compression = ""
125   v8_enable_pointer_compression_shared_cage = ""
126   v8_enable_31bit_smis_on_64bit_arch = false
127
128   # Sets -dOBJECT_PRINT.
129   v8_enable_object_print = ""
130
131   # Sets -dV8_TRACE_MAPS.
132   v8_enable_trace_maps = ""
133
134   # Sets -dV8_ENABLE_CHECKS.
135   v8_enable_v8_checks = ""
136
137   # Sets -dV8_TRACE_UNOPTIMIZED.
138   v8_enable_trace_unoptimized = ""
139   v8_enable_trace_ignition = false
140   v8_enable_trace_baseline_exec = false
141
142   # Sets -dV8_TRACE_FEEDBACK_UPDATES.
143   v8_enable_trace_feedback_updates = false
144
145   # Sets -dV8_ATOMIC_OBJECT_FIELD_WRITES and turns all field write operations
146   # into relaxed atomic operations.
147   v8_enable_atomic_object_field_writes = ""
148
149   # Sets -dV8_ATOMIC_MARKING_STATE
150   v8_enable_atomic_marking_state = ""
151
152   # Controls the default values of v8_enable_atomic_object_field_writes and
153   # v8_enable_concurrent_marking_state. See the default setting code below.
154   v8_enable_concurrent_marking = true
155
156   # Sets -dV8_IGNITION_DISPATCH_COUNTING.
157   # Enables counting frequencies of bytecode dispatches. After building in this
158   # configuration, subsequent runs of d8 can output frequencies for each pair
159   # of (current, next) bytecode instructions executed if you specify
160   # --trace-ignition-dispatches-output-file, or can generate a JS object with
161   # those frequencies if you run with --expose-ignition-statistics and call the
162   # extension function getIgnitionDispatchCounters().
163   v8_enable_ignition_dispatch_counting = false
164
165   # Runs mksnapshot with --turbo-profiling. After building in this
166   # configuration, any subsequent run of d8 will output information about usage
167   # of basic blocks in builtins.
168   v8_enable_builtins_profiling = false
169
170   # Runs mksnapshot with --turbo-profiling-verbose. After building in this
171   # configuration, any subsequent run of d8 will output information about usage
172   # of basic blocks in builtins, including the schedule and disassembly of all
173   # used builtins.
174   v8_enable_builtins_profiling_verbose = false
175
176   # Provides the given V8 log file as an input to mksnapshot, where it can be
177   # used for profile-guided optimization of builtins.
178   #
179   # To do profile-guided optimizations of builtins:
180   # 1. Build with v8_enable_builtins_profiling = true
181   # 2. Run your chosen workload with the --turbo-profiling-log-builtins flag.
182   #    For Chrome, the invocation might look like this:
183   #      chrome --no-sandbox --disable-extensions
184   #        --js-flags="--turbo-profiling-log-builtins --logfile=path/to/v8.log"
185   #        "http://localhost/test-suite"
186   # 3. Optionally repeat step 2 for additional workloads, and concatenate all of
187   #    the resulting log files into a single file.
188   # 4. Build again with v8_builtins_profiling_log_file set to the file created
189   #    in steps 2-3.
190   v8_builtins_profiling_log_file = ""
191
192   # Enables various testing features.
193   v8_enable_test_features = ""
194
195   # Enable short builtins call instruction sequences by un-embedding builtins.
196   # Sets -dV8_SHORT_BUILTIN_CALLS
197   v8_enable_short_builtin_calls = ""
198
199   # Enable support for external code range relative to the pointer compression
200   # cage.
201   # Sets -dV8_EXTERNAL_CODE_SPACE
202   v8_enable_external_code_space = ""
203
204   # With post mortem support enabled, metadata is embedded into libv8 that
205   # describes various parameters of the VM for use by debuggers. See
206   # tools/gen-postmortem-metadata.py for details.
207   v8_postmortem_support = false
208
209   # Use Siphash as added protection against hash flooding attacks.
210   v8_use_siphash = false
211
212   # Switches off inlining in V8.
213   v8_no_inline = false
214
215   # Override OS page size when generating snapshot
216   v8_os_page_size = "0"
217
218   # Similar to vfp but on MIPS.
219   v8_can_use_fpu_instructions = true
220
221   # Similar to the ARM hard float ABI but on MIPS.
222   v8_use_mips_abi_hardfloat = true
223
224   # Controls the threshold for on-heap/off-heap Typed Arrays.
225   v8_typed_array_max_size_in_heap = 64
226
227   v8_enable_gdbjit = ((v8_current_cpu == "x86" || v8_current_cpu == "x64") &&
228                       (is_linux || is_chromeos || is_mac)) ||
229                      (v8_current_cpu == "ppc64" && (is_linux || is_chromeos))
230
231   # Enable mitigations for executing untrusted code.
232   # Disabled by default on ia32 due to conflicting requirements with embedded
233   # builtins.
234   v8_untrusted_code_mitigations = false
235
236   # Enable minor mark compact.
237   v8_enable_minor_mc = true
238
239   # Check that each header can be included in isolation (requires also
240   # setting the "check_v8_header_includes" gclient variable to run a
241   # specific hook).
242   v8_check_header_includes = false
243
244   # Enable sharing read-only space across isolates.
245   # Sets -DV8_SHARED_RO_HEAP.
246   v8_enable_shared_ro_heap = ""
247
248   # Enable lazy source positions by default.
249   v8_enable_lazy_source_positions = true
250
251   # Enable third party HEAP library
252   v8_enable_third_party_heap = false
253
254   # Libaries used by third party heap
255   v8_third_party_heap_libs = []
256
257   # Source code used by third party heap
258   v8_third_party_heap_files = []
259
260   # Disable write barriers when GCs are non-incremental and
261   # heap has single generation.
262   v8_disable_write_barriers = false
263
264   # Ensure that write barriers are always used.
265   # Useful for debugging purposes.
266   v8_enable_unconditional_write_barriers = false
267
268   # Redirect allocation in young generation so that there will be
269   # only one single generation.
270   v8_enable_single_generation = ""
271
272   # Use token threaded dispatch for the regular expression interpreter.
273   # Use switch-based dispatch if this is false
274   v8_enable_regexp_interpreter_threaded_dispatch = true
275
276   # Enable additional targets necessary for verification of torque
277   # file generation
278   v8_verify_torque_generation_invariance = false
279
280   # Generate comments describing the Torque intermediate representation.
281   v8_annotate_torque_ir = false
282
283   # Disable all snapshot compression.
284   v8_enable_snapshot_compression = true
285
286   # Enable control-flow integrity features, such as pointer authentication for
287   # ARM64.
288   v8_control_flow_integrity = false
289
290   # Enable object names in cppgc for debug purposes.
291   cppgc_enable_object_names = false
292
293   # Enable heap reservation of size 4GB. Only possible for 64bit archs.
294   cppgc_enable_caged_heap = v8_current_cpu == "x64" || v8_current_cpu == "arm64"
295
296   # Enable verification of live bytes in the marking verifier.
297   # TODO(v8:11785): Enable by default when running with the verifier.
298   cppgc_enable_verify_live_bytes = false
299
300   # Enable assignment checks for Members/Persistents during prefinalizer invocations.
301   # TODO(v8:11749): Enable by default after fixing any existing issues in Blink.
302   cppgc_enable_check_assignments_in_prefinalizers = false
303
304   # Enable young generation in cppgc.
305   cppgc_enable_young_generation = false
306
307   # Enable V8 zone compression experimental feature.
308   # Sets -DV8_COMPRESS_ZONES.
309   v8_enable_zone_compression = ""
310
311   # Enable V8 heap sandbox experimental feature.
312   # Sets -DV8_HEAP_SANDBOX.
313   v8_enable_heap_sandbox = ""
314
315   # Experimental feature for collecting per-class zone memory stats.
316   # Requires use_rtti = true
317   v8_enable_precise_zone_stats = false
318
319   # Experimental feature that uses SwissNameDictionary instead of NameDictionary
320   # as the backing store for all dictionary mode objects.
321   v8_enable_swiss_name_dictionary = false
322
323   # If enabled then macro definitions that are used in externally visible
324   # header files are placed in a separate header file v8-gn.h.
325   v8_generate_external_defines_header = false
326
327   # Experimental feature for tracking constness of properties in non-global
328   # dictionaries. Enabling this also always keeps prototypes in dict mode,
329   # meaning that they are not switched to fast mode.
330   # Sets -DV8_DICT_PROPERTY_CONST_TRACKING
331   v8_dict_property_const_tracking = false
332
333   # Enable map packing & unpacking (sets -dV8_MAP_PACKING).
334   v8_enable_map_packing = false
335
336   # Allow for JS promise hooks (instead of just C++).
337   v8_allow_javascript_in_promise_hooks = false
338
339   # Enable allocation folding globally (sets -dV8_ALLOCATION_FOLDING).
340   # When it's disabled, the --turbo-allocation-folding runtime flag will be ignored.
341   v8_enable_allocation_folding = true
342
343   # Enable global allocation site tracking.
344   v8_allocation_site_tracking = true
345 }
346
347 # Derived defaults.
348 if (v8_enable_verify_heap == "") {
349   v8_enable_verify_heap = v8_enable_debugging_features
350 }
351 if (v8_enable_object_print == "") {
352   v8_enable_object_print = v8_enable_debugging_features
353 }
354 if (v8_enable_disassembler == "") {
355   v8_enable_disassembler = v8_enable_debugging_features
356 }
357 if (v8_enable_trace_maps == "") {
358   v8_enable_trace_maps = v8_enable_debugging_features
359 }
360 if (v8_enable_test_features == "") {
361   v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
362 }
363 if (v8_enable_v8_checks == "") {
364   v8_enable_v8_checks = v8_enable_debugging_features
365 }
366 if (v8_enable_snapshot_code_comments) {
367   assert(v8_code_comments == true || v8_code_comments == "",
368          "v8_enable_snapshot_code_comments conflicts with v8_code_comments.")
369   v8_code_comments = true
370 } else if (v8_code_comments == "") {
371   v8_code_comments = v8_enable_debugging_features
372 }
373 if (v8_enable_debug_code == "") {
374   v8_enable_debug_code = v8_enable_debugging_features
375 }
376 if (v8_enable_snapshot_native_code_counters == "") {
377   v8_enable_snapshot_native_code_counters = v8_enable_debugging_features
378 }
379 if (v8_enable_pointer_compression == "") {
380   v8_enable_pointer_compression =
381       v8_current_cpu == "arm64" || v8_current_cpu == "x64"
382 }
383 if (v8_enable_pointer_compression_shared_cage == "") {
384   v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression
385 }
386 if (v8_enable_fast_torque == "") {
387   v8_enable_fast_torque = v8_enable_fast_mksnapshot
388 }
389 if (v8_enable_zone_compression == "") {
390   v8_enable_zone_compression = false
391 }
392 if (v8_enable_heap_sandbox == "") {
393   v8_enable_heap_sandbox = false
394 }
395 if (v8_enable_short_builtin_calls == "") {
396   v8_enable_short_builtin_calls =
397       v8_current_cpu == "x64" || (!is_android && v8_current_cpu == "arm64")
398 }
399 if (v8_enable_external_code_space == "") {
400   v8_enable_external_code_space = false
401 }
402 if (v8_enable_single_generation == "") {
403   v8_enable_single_generation = v8_disable_write_barriers
404 }
405 if (v8_enable_atomic_object_field_writes == "") {
406   v8_enable_atomic_object_field_writes = v8_enable_concurrent_marking
407 }
408 if (v8_enable_atomic_marking_state == "") {
409   v8_enable_atomic_marking_state = v8_enable_concurrent_marking
410 }
411 if (v8_enable_third_party_heap) {
412   v8_disable_write_barriers = true
413   v8_enable_single_generation = true
414   v8_enable_shared_ro_heap = false
415   v8_enable_pointer_compression = false
416   v8_enable_pointer_compression_shared_cage = false
417   v8_enable_allocation_folding = false
418 }
419 if (v8_enable_single_generation) {
420   v8_allocation_site_tracking = false
421 }
422 assert(!v8_enable_concurrent_marking || v8_enable_atomic_object_field_writes,
423        "Concurrent marking requires atomic object field writes.")
424 assert(!v8_enable_concurrent_marking || v8_enable_atomic_marking_state,
425        "Concurrent marking requires atomic marking state.")
426 if (v8_enable_trace_unoptimized == "") {
427   v8_enable_trace_unoptimized =
428       v8_enable_trace_ignition || v8_enable_trace_baseline_exec
429 }
430 assert(!v8_enable_trace_ignition || v8_enable_trace_unoptimized,
431        "Ignition tracing requires unoptimized tracing to be enabled.")
432 assert(!v8_enable_trace_baseline_exec || v8_enable_trace_unoptimized,
433        "Baseline tracing requires unoptimized tracing to be enabled.")
434
435 # Toggle pointer compression for correctness fuzzing when building the
436 # clang_x64_pointer_compression toolchain. We'll correctness-compare the
437 # default build with the clang_x64_pointer_compression build.
438 if (v8_multi_arch_build &&
439     rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) ==
440     "clang_x64_pointer_compression") {
441   v8_enable_pointer_compression = !v8_enable_pointer_compression
442   v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression
443 }
444 if (v8_enable_short_builtin_calls &&
445     (!v8_enable_pointer_compression || v8_control_flow_integrity)) {
446   # Disable short calls when pointer compression is not enabled.
447   # Or when CFI is enabled (until the CFI-related issues are fixed).
448   v8_enable_short_builtin_calls = false
449 }
450 if (v8_enable_shared_ro_heap == "") {
451   v8_enable_shared_ro_heap = !v8_enable_pointer_compression ||
452                              v8_enable_pointer_compression_shared_cage
453 }
454
455 # Check if it is a Chromium build and activate PAC/BTI if needed.
456 if (build_with_chromium && v8_current_cpu == "arm64" &&
457     arm_control_flow_integrity == "standard") {
458   v8_control_flow_integrity = true
459 }
460
461 assert(!v8_disable_write_barriers || v8_enable_single_generation,
462        "Disabling write barriers works only with single generation")
463
464 assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations,
465        "Untrusted code mitigations are unsupported on ia32")
466
467 assert(v8_current_cpu == "arm64" || !v8_control_flow_integrity,
468        "Control-flow integrity is only supported on arm64")
469
470 if (v8_enable_shared_ro_heap && v8_enable_pointer_compression &&
471     !v8_enable_pointer_compression_shared_cage) {
472   assert(
473       is_linux || is_chromeos || is_android,
474       "Sharing read-only heap with pointer compression is only supported on Linux or Android")
475 }
476
477 assert(!v8_enable_map_packing || !v8_enable_pointer_compression,
478        "Map packing does not support pointer compression")
479
480 assert(!v8_enable_map_packing || v8_current_cpu == "x64",
481        "Map packing is only supported on x64")
482
483 assert(!v8_use_multi_snapshots || !v8_control_flow_integrity,
484        "Control-flow integrity does not support multisnapshots")
485
486 assert(!v8_enable_heap_sandbox || v8_enable_pointer_compression,
487        "V8 Heap Sandbox requires pointer compression")
488
489 assert(!v8_enable_heap_sandbox || !v8_enable_external_code_space,
490        "V8 Heap Sandbox is not compatible with external code space YET")
491
492 assert(
493     !v8_enable_pointer_compression_shared_cage || v8_enable_pointer_compression,
494     "Can't share a pointer compression cage if pointers aren't compressed")
495
496 assert(
497     !v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
498         v8_current_cpu == "arm64" || v8_current_cpu == "riscv64",
499     "Sharing a pointer compression cage is only supported on x64,arm64 and riscv64")
500
501 assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
502        "Write barriers can't be both enabled and disabled")
503
504 assert(!cppgc_enable_caged_heap || v8_current_cpu == "x64" ||
505            v8_current_cpu == "arm64",
506        "CppGC caged heap requires 64bit platforms")
507
508 assert(!cppgc_enable_young_generation || cppgc_enable_caged_heap,
509        "Young generation in CppGC requires caged heap")
510
511 if (v8_enable_single_generation == true) {
512   assert(
513       v8_enable_unconditional_write_barriers || v8_disable_write_barriers,
514       "Requires unconditional write barriers or none (which disables incremental marking)")
515 }
516
517 assert(!v8_enable_conservative_stack_scanning || v8_enable_single_generation,
518        "Conservative stack scanning requires single generation")
519
520 v8_random_seed = "314159265"
521 v8_toolset_for_shell = "host"
522
523 ###############################################################################
524 # Configurations
525 #
526
527 config("internal_config_base") {
528   # Only targets in this file and its subdirs can depend on this.
529   visibility = [ "./*" ]
530
531   configs = [ ":v8_tracing_config" ]
532
533   include_dirs = [
534     ".",
535     "include",
536     "$target_gen_dir",
537     "$target_gen_dir/include",
538   ]
539 }
540
541 config("internal_config") {
542   defines = []
543
544   # Only targets in this file and its subdirs can depend on this.
545   visibility = [ "./*" ]
546
547   configs = [
548     "//build/config/compiler:wexit_time_destructors",
549     ":internal_config_base",
550     ":v8_header_features",
551     ":cppgc_header_features",
552   ]
553
554   if (is_component_build) {
555     defines += [ "BUILDING_V8_SHARED" ]
556   }
557
558   if (v8_current_cpu == "riscv64") {
559     libs = [ "atomic" ]
560   }
561 }
562
563 # Should be applied to all targets that write trace events.
564 config("v8_tracing_config") {
565   if (v8_use_perfetto) {
566     include_dirs = [
567       "third_party/perfetto/include",
568       "$root_gen_dir/third_party/perfetto",
569       "$root_gen_dir/third_party/perfetto/build_config",
570     ]
571   }
572 }
573
574 # This config should be applied to code using the libplatform.
575 config("libplatform_config") {
576   include_dirs = [ "include" ]
577   if (is_component_build) {
578     defines = [ "USING_V8_PLATFORM_SHARED" ]
579   }
580 }
581
582 # This config should be applied to code using the libbase.
583 config("libbase_config") {
584   if (is_component_build) {
585     defines = [ "USING_V8_BASE_SHARED" ]
586   }
587   libs = []
588   if (is_android && current_toolchain != host_toolchain) {
589     libs += [ "log" ]
590   }
591   include_dirs = [ "$target_gen_dir/include" ]
592 }
593
594 # Standalone cppgc cannot be built within chrome or with perfetto.
595 assert(!cppgc_is_standalone || !build_with_chromium)
596 assert(!cppgc_is_standalone || !v8_use_perfetto)
597
598 # This config should be applied to code using the cppgc_base.
599 config("cppgc_base_config") {
600   defines = []
601   if (cppgc_is_standalone) {
602     defines += [ "CPPGC_IS_STANDALONE" ]
603   }
604 }
605
606 # This config is only applied to v8_headers and is the basis for external_config
607 # but without setting the USING_V8_SHARED define, which means v8_headers can be
608 # used inside v8 itself.
609 config("headers_config") {
610   defines = []
611   configs = [
612     ":v8_header_features",
613     ":cppgc_header_features",
614   ]
615   include_dirs = [
616     "include",
617     "$target_gen_dir/include",
618   ]
619 }
620
621 # This config should only be applied to code using V8 and not any V8 code
622 # itself.
623 config("external_config") {
624   configs = [ ":headers_config" ]
625   defines = []
626   if (is_component_build) {
627     defines += [ "USING_V8_SHARED" ]
628   }
629
630   if (current_cpu == "riscv64") {
631     libs = [ "atomic" ]
632   }
633 }
634
635 # This config should only be applied to code that needs to be explicitly
636 # aware of whether we are using startup data or not.
637 config("external_startup_data") {
638   if (v8_use_external_startup_data) {
639     defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
640   }
641 }
642
643 # List of defines that can appear in externally visible header files and that
644 # are controlled by args.gn.
645 external_v8_defines = [
646   "V8_ENABLE_CHECKS",
647   "V8_COMPRESS_POINTERS",
648   "V8_COMPRESS_POINTERS_IN_SHARED_CAGE",
649   "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE",
650   "V8_31BIT_SMIS_ON_64BIT_ARCH",
651   "V8_COMPRESS_ZONES",
652   "V8_HEAP_SANDBOX",
653   "V8_DEPRECATION_WARNINGS",
654   "V8_IMMINENT_DEPRECATION_WARNINGS",
655   "V8_NO_ARGUMENTS_ADAPTOR",
656   "V8_USE_PERFETTO",
657   "V8_MAP_PACKING",
658   "V8_IS_TSAN",
659 ]
660
661 enabled_external_v8_defines = []
662
663 if (v8_enable_v8_checks) {
664   enabled_external_v8_defines += [ "V8_ENABLE_CHECKS" ]
665 }
666 if (v8_enable_pointer_compression) {
667   enabled_external_v8_defines += [ "V8_COMPRESS_POINTERS" ]
668   if (v8_enable_pointer_compression_shared_cage) {
669     enabled_external_v8_defines += [ "V8_COMPRESS_POINTERS_IN_SHARED_CAGE" ]
670   } else {
671     enabled_external_v8_defines += [ "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE" ]
672   }
673 }
674 if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
675   enabled_external_v8_defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
676 }
677 if (v8_enable_zone_compression) {
678   enabled_external_v8_defines += [ "V8_COMPRESS_ZONES" ]
679 }
680 if (v8_enable_heap_sandbox) {
681   enabled_external_v8_defines += [ "V8_HEAP_SANDBOX" ]
682 }
683 if (v8_deprecation_warnings) {
684   enabled_external_v8_defines += [ "V8_DEPRECATION_WARNINGS" ]
685 }
686 if (v8_imminent_deprecation_warnings) {
687   enabled_external_v8_defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
688 }
689 if (v8_use_perfetto) {
690   enabled_external_v8_defines += [ "V8_USE_PERFETTO" ]
691 }
692 if (v8_enable_map_packing) {
693   enabled_external_v8_defines += [ "V8_MAP_PACKING" ]
694 }
695 if (is_tsan) {
696   enabled_external_v8_defines += [ "V8_IS_TSAN" ]
697 }
698
699 disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
700
701 # Put defines that are used in public headers here; public headers are
702 # defined in "v8_headers" and are included by embedders of V8.
703 config("v8_header_features") {
704   visibility = [ ":*" ]
705
706   if (v8_generate_external_defines_header) {
707     defines = [ "V8_GN_HEADER" ]
708   } else {
709     defines = enabled_external_v8_defines
710   }
711 }
712
713 # List of defines that can appear in externally visible cppgc header files and
714 # that are controlled by args.gn.
715 external_cppgc_defines = [
716   "CPPGC_SUPPORTS_OBJECT_NAMES",
717   "CPPGC_CAGED_HEAP",
718   "CPPGC_YOUNG_GENERATION",
719 ]
720
721 enabled_external_cppgc_defines = []
722
723 if (cppgc_enable_object_names) {
724   enabled_external_cppgc_defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ]
725 }
726 if (cppgc_enable_caged_heap) {
727   enabled_external_cppgc_defines += [ "CPPGC_CAGED_HEAP" ]
728 }
729 if (cppgc_enable_young_generation) {
730   enabled_external_cppgc_defines += [ "CPPGC_YOUNG_GENERATION" ]
731 }
732
733 disabled_external_cppgc_defines =
734     external_cppgc_defines - enabled_external_cppgc_defines
735
736 config("cppgc_header_features") {
737   visibility = [ ":*" ]
738
739   if (v8_generate_external_defines_header) {
740     defines = [ "V8_GN_HEADER" ]
741   } else {
742     defines = enabled_external_cppgc_defines
743   }
744 }
745
746 enabled_external_defines =
747     enabled_external_v8_defines + enabled_external_cppgc_defines
748 disabled_external_defines =
749     disabled_external_v8_defines + disabled_external_cppgc_defines
750
751 # Put defines here that are only used in our internal files and NEVER in
752 # external headers that embedders (such as chromium and node) might include.
753 config("features") {
754   # Only targets in this file and its subdirs can depend on this.
755   visibility = [ "./*" ]
756
757   defines = []
758
759   configs = [
760     ":v8_header_features",
761     ":cppgc_header_features",
762   ]
763
764   if (cppgc_enable_verify_live_bytes) {
765     defines += [ "CPPGC_VERIFY_LIVE_BYTES" ]
766   }
767
768   if (cppgc_enable_check_assignments_in_prefinalizers) {
769     defines += [ "CPPGC_CHECK_ASSIGNMENTS_IN_PREFINALIZERS" ]
770   }
771
772   if (v8_embedder_string != "") {
773     defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
774   }
775   if (v8_enable_disassembler) {
776     defines += [ "ENABLE_DISASSEMBLER" ]
777   }
778   if (v8_promise_internal_field_count != 0) {
779     defines +=
780         [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
781   }
782   defines +=
783       [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
784
785   assert(
786       !v8_enable_raw_heap_snapshots,
787       "This flag is deprecated and is now available through the inspector interface as an argument to profiler's method `takeHeapSnapshot`. Consider using blink's flag `enable_additional_blink_object_names` to get better naming of internal objects.")
788
789   if (v8_enable_future) {
790     defines += [ "V8_ENABLE_FUTURE" ]
791   }
792   if (v8_enable_lite_mode) {
793     defines += [ "V8_LITE_MODE" ]
794   }
795   if (v8_enable_gdbjit) {
796     defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
797   }
798   if (v8_enable_vtunejit) {
799     defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
800   }
801   if (v8_enable_vtunetracemark) {
802     defines += [ "ENABLE_VTUNE_TRACEMARK" ]
803   }
804   if (v8_enable_hugepage) {
805     defines += [ "ENABLE_HUGEPAGE" ]
806   }
807   if (v8_enable_minor_mc) {
808     defines += [ "ENABLE_MINOR_MC" ]
809   }
810   if (v8_enable_object_print) {
811     defines += [ "OBJECT_PRINT" ]
812   }
813   if (v8_enable_verify_heap) {
814     defines += [ "VERIFY_HEAP" ]
815   }
816   if (v8_enable_verify_predictable) {
817     defines += [ "VERIFY_PREDICTABLE" ]
818   }
819   if (v8_enable_trace_maps) {
820     defines += [ "V8_TRACE_MAPS" ]
821   }
822   if (v8_enable_trace_unoptimized) {
823     defines += [ "V8_TRACE_UNOPTIMIZED" ]
824   }
825   if (v8_enable_trace_feedback_updates) {
826     defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
827   }
828   if (v8_enable_test_features) {
829     defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
830     defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
831     defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
832   }
833   if (v8_enable_i18n_support) {
834     defines += [ "V8_INTL_SUPPORT" ]
835   }
836   if (v8_enable_handle_zapping) {
837     defines += [ "ENABLE_HANDLE_ZAPPING" ]
838   }
839   if (v8_code_comments == true) {
840     defines += [ "V8_CODE_COMMENTS" ]
841   }
842   if (v8_enable_debug_code) {
843     defines += [ "V8_ENABLE_DEBUG_CODE" ]
844   }
845   if (v8_enable_snapshot_native_code_counters) {
846     defines += [ "V8_SNAPSHOT_NATIVE_CODE_COUNTERS" ]
847   }
848   if (v8_enable_single_generation) {
849     defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
850   }
851   if (v8_enable_conservative_stack_scanning) {
852     defines += [ "V8_ENABLE_CONSERVATIVE_STACK_SCANNING" ]
853   }
854   if (v8_disable_write_barriers) {
855     defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
856   }
857   if (v8_enable_third_party_heap) {
858     defines += [ "V8_ENABLE_THIRD_PARTY_HEAP" ]
859   }
860   if (v8_use_external_startup_data) {
861     defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
862   }
863   if (v8_enable_atomic_object_field_writes) {
864     defines += [ "V8_ATOMIC_OBJECT_FIELD_WRITES" ]
865   }
866   if (v8_enable_atomic_marking_state) {
867     defines += [ "V8_ATOMIC_MARKING_STATE" ]
868   }
869   if (v8_enable_ignition_dispatch_counting) {
870     defines += [ "V8_IGNITION_DISPATCH_COUNTING" ]
871   }
872   if (v8_enable_lazy_source_positions) {
873     defines += [ "V8_ENABLE_LAZY_SOURCE_POSITIONS" ]
874   }
875   if (v8_use_multi_snapshots) {
876     defines += [ "V8_MULTI_SNAPSHOTS" ]
877   }
878   if (v8_use_siphash) {
879     defines += [ "V8_USE_SIPHASH" ]
880   }
881   if (v8_enable_shared_ro_heap) {
882     defines += [ "V8_SHARED_RO_HEAP" ]
883   }
884   if (v8_win64_unwinding_info) {
885     defines += [ "V8_WIN64_UNWINDING_INFO" ]
886   }
887   if (v8_enable_regexp_interpreter_threaded_dispatch) {
888     defines += [ "V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH" ]
889   }
890   if (v8_enable_snapshot_compression) {
891     defines += [ "V8_SNAPSHOT_COMPRESSION" ]
892   }
893   if (v8_control_flow_integrity) {
894     defines += [ "V8_ENABLE_CONTROL_FLOW_INTEGRITY" ]
895   }
896   if (v8_enable_wasm_gdb_remote_debugging) {
897     defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ]
898   }
899   if (v8_enable_precise_zone_stats) {
900     defines += [ "V8_ENABLE_PRECISE_ZONE_STATS" ]
901   }
902   if (v8_fuzzilli) {
903     defines += [ "V8_FUZZILLI" ]
904   }
905   if (v8_enable_short_builtin_calls) {
906     defines += [ "V8_SHORT_BUILTIN_CALLS" ]
907   }
908   if (v8_enable_external_code_space) {
909     defines += [ "V8_EXTERNAL_CODE_SPACE" ]
910   }
911   if (v8_enable_swiss_name_dictionary) {
912     defines += [ "V8_ENABLE_SWISS_NAME_DICTIONARY" ]
913   }
914   if (v8_enable_system_instrumentation) {
915     defines += [ "V8_ENABLE_SYSTEM_INSTRUMENTATION" ]
916   }
917   if (v8_etw_guid != "") {
918     defines += [ "V8_ETW_GUID=\"$v8_etw_guid\"" ]
919   }
920   if (v8_enable_webassembly) {
921     defines += [ "V8_ENABLE_WEBASSEMBLY" ]
922   }
923   if (v8_dict_property_const_tracking) {
924     defines += [ "V8_DICT_PROPERTY_CONST_TRACKING" ]
925   }
926   if (v8_allow_javascript_in_promise_hooks) {
927     defines += [ "V8_ALLOW_JAVASCRIPT_IN_PROMISE_HOOKS" ]
928   }
929   if (v8_enable_allocation_folding) {
930     defines += [ "V8_ALLOCATION_FOLDING" ]
931   }
932   if (v8_allocation_site_tracking) {
933     defines += [ "V8_ALLOCATION_SITE_TRACKING" ]
934   }
935   if (v8_advanced_bigint_algorithms) {
936     defines += [ "V8_ADVANCED_BIGINT_ALGORITHMS" ]
937   }
938 }
939
940 config("toolchain") {
941   # Only targets in this file and its subdirs can depend on this.
942   visibility = [ "./*" ]
943
944   defines = []
945   cflags = []
946   ldflags = []
947
948   if (v8_current_cpu == "arm") {
949     defines += [ "V8_TARGET_ARCH_ARM" ]
950     if (arm_version >= 7) {
951       defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
952     }
953     if (arm_fpu == "vfpv3-d16") {
954       defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
955     } else if (arm_fpu == "vfpv3") {
956       defines += [
957         "CAN_USE_VFP3_INSTRUCTIONS",
958         "CAN_USE_VFP32DREGS",
959       ]
960     } else if (arm_fpu == "neon") {
961       defines += [
962         "CAN_USE_VFP3_INSTRUCTIONS",
963         "CAN_USE_VFP32DREGS",
964         "CAN_USE_NEON",
965       ]
966     }
967
968     # TODO(jochen): Add support for arm_test_noprobe.
969
970     if (current_cpu != "arm") {
971       # These defines ares used for the ARM simulator.
972       if (arm_float_abi == "hard") {
973         defines += [ "USE_EABI_HARDFLOAT=1" ]
974       } else if (arm_float_abi == "softfp") {
975         defines += [ "USE_EABI_HARDFLOAT=0" ]
976       }
977     }
978   }
979   if (v8_current_cpu == "arm64") {
980     defines += [ "V8_TARGET_ARCH_ARM64" ]
981     if (v8_control_flow_integrity) {
982       # TODO(v8:10026): Enable this in src/build.
983       if (current_cpu == "arm64") {
984         cflags += [ "-mbranch-protection=standard" ]
985         asmflags = [ "-mmark-bti-property" ]
986       }
987     }
988   }
989
990   # Mips64el/mipsel simulators.
991   if (target_is_simulator &&
992       (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) {
993     defines += [ "_MIPS_TARGET_SIMULATOR" ]
994   }
995
996   if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") {
997     defines += [ "V8_TARGET_ARCH_MIPS" ]
998     if (v8_can_use_fpu_instructions) {
999       defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
1000     }
1001     if (v8_use_mips_abi_hardfloat) {
1002       defines += [
1003         "__mips_hard_float=1",
1004         "CAN_USE_FPU_INSTRUCTIONS",
1005       ]
1006     } else {
1007       defines += [ "__mips_soft_float=1" ]
1008     }
1009     if (mips_arch_variant == "r6") {
1010       defines += [
1011         "_MIPS_ARCH_MIPS32R6",
1012         "FPU_MODE_FP64",
1013       ]
1014       if (mips_use_msa) {
1015         defines += [ "_MIPS_MSA" ]
1016       }
1017     } else if (mips_arch_variant == "r2") {
1018       defines += [ "_MIPS_ARCH_MIPS32R2" ]
1019       if (mips_fpu_mode == "fp64") {
1020         defines += [ "FPU_MODE_FP64" ]
1021       } else if (mips_fpu_mode == "fpxx") {
1022         defines += [ "FPU_MODE_FPXX" ]
1023       } else if (mips_fpu_mode == "fp32") {
1024         defines += [ "FPU_MODE_FP32" ]
1025       }
1026     } else if (mips_arch_variant == "r1") {
1027       defines += [ "FPU_MODE_FP32" ]
1028     }
1029
1030     # TODO(jochen): Add support for mips_arch_variant rx and loongson.
1031   }
1032
1033   if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
1034     defines += [ "V8_TARGET_ARCH_MIPS64" ]
1035     if (v8_can_use_fpu_instructions) {
1036       defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
1037     }
1038     if (mips_use_msa) {
1039       defines += [ "_MIPS_MSA" ]
1040     }
1041     if (host_byteorder == "little") {
1042       defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
1043     } else if (host_byteorder == "big") {
1044       defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
1045     }
1046     if (v8_use_mips_abi_hardfloat) {
1047       defines += [
1048         "__mips_hard_float=1",
1049         "CAN_USE_FPU_INSTRUCTIONS",
1050       ]
1051     } else {
1052       defines += [ "__mips_soft_float=1" ]
1053     }
1054     if (mips_arch_variant == "r6") {
1055       defines += [ "_MIPS_ARCH_MIPS64R6" ]
1056     } else if (mips_arch_variant == "r2") {
1057       defines += [ "_MIPS_ARCH_MIPS64R2" ]
1058     }
1059   }
1060   if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
1061     defines += [ "V8_TARGET_ARCH_S390" ]
1062     cflags += [ "-ffp-contract=off" ]
1063     if (v8_current_cpu == "s390x") {
1064       defines += [ "V8_TARGET_ARCH_S390X" ]
1065     }
1066     if (host_byteorder == "little") {
1067       defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
1068     } else {
1069       cflags += [ "-march=z196" ]
1070     }
1071   }
1072   if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
1073     if (v8_current_cpu == "ppc") {
1074       defines += [ "V8_TARGET_ARCH_PPC" ]
1075     } else if (v8_current_cpu == "ppc64") {
1076       defines += [ "V8_TARGET_ARCH_PPC64" ]
1077       cflags += [ "-ffp-contract=off" ]
1078     }
1079     if (host_byteorder == "little") {
1080       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
1081     } else if (host_byteorder == "big") {
1082       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
1083       if (current_os == "aix") {
1084         cflags += [
1085           # Work around AIX ceil, trunc and round oddities.
1086           "-mcpu=power5+",
1087           "-mfprnd",
1088
1089           # Work around AIX assembler popcntb bug.
1090           "-mno-popcntb",
1091         ]
1092       }
1093     }
1094   }
1095
1096   # Under simulator build, compiler will not provide __riscv_xlen. Define here
1097   if (v8_current_cpu == "riscv64") {
1098     defines += [ "V8_TARGET_ARCH_RISCV64" ]
1099     defines += [ "__riscv_xlen=64" ]
1100
1101     #FIXME: Temporarily use MIPS macro for the building.
1102     defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
1103   }
1104
1105   if (v8_current_cpu == "x86") {
1106     defines += [ "V8_TARGET_ARCH_IA32" ]
1107     if (is_win) {
1108       # Ensure no surprising artifacts from 80bit double math with x86.
1109       cflags += [ "/arch:SSE2" ]
1110     }
1111   }
1112   if (v8_current_cpu == "x64") {
1113     defines += [ "V8_TARGET_ARCH_X64" ]
1114     if (is_win) {
1115       # Increase the initial stack size. The default is 1MB, this is 2MB. This
1116       # applies only to executables and shared libraries produced by V8 since
1117       # ldflags are not pushed to dependants.
1118       ldflags += [ "/STACK:2097152" ]
1119     }
1120   }
1121   if (is_android && v8_android_log_stdout) {
1122     defines += [ "V8_ANDROID_LOG_STDOUT" ]
1123   }
1124
1125   # V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
1126   # mksnapshot. We additionally set V8_HAVE_TARGET_OS to determine that a
1127   # target OS has in fact been set; otherwise we internally assume that target
1128   # OS == host OS (see v8config.h).
1129   if (target_os == "android") {
1130     defines += [ "V8_HAVE_TARGET_OS" ]
1131     defines += [ "V8_TARGET_OS_ANDROID" ]
1132   } else if (target_os == "fuchsia") {
1133     defines += [ "V8_HAVE_TARGET_OS" ]
1134     defines += [ "V8_TARGET_OS_FUCHSIA" ]
1135   } else if (target_os == "ios") {
1136     defines += [ "V8_HAVE_TARGET_OS" ]
1137     defines += [ "V8_TARGET_OS_IOS" ]
1138   } else if (target_os == "linux") {
1139     defines += [ "V8_HAVE_TARGET_OS" ]
1140     defines += [ "V8_TARGET_OS_LINUX" ]
1141   } else if (target_os == "mac") {
1142     defines += [ "V8_HAVE_TARGET_OS" ]
1143     defines += [ "V8_TARGET_OS_MACOSX" ]
1144   } else if (target_os == "win") {
1145     defines += [ "V8_HAVE_TARGET_OS" ]
1146     defines += [ "V8_TARGET_OS_WIN" ]
1147   }
1148
1149   # TODO(jochen): Support v8_enable_prof on Windows.
1150   # TODO(jochen): Add support for compiling with simulators.
1151
1152   if (v8_enable_debugging_features) {
1153     if ((is_linux || is_chromeos) && v8_enable_backtrace) {
1154       ldflags += [ "-rdynamic" ]
1155     }
1156
1157     defines += [ "DEBUG" ]
1158     if (v8_enable_slow_dchecks) {
1159       defines += [ "ENABLE_SLOW_DCHECKS" ]
1160     }
1161   } else if (dcheck_always_on) {
1162     defines += [ "DEBUG" ]
1163   }
1164
1165   if (v8_enable_verify_csa) {
1166     defines += [ "ENABLE_VERIFY_CSA" ]
1167   }
1168
1169   if (v8_enable_runtime_call_stats) {
1170     defines += [ "V8_RUNTIME_CALL_STATS" ]
1171   }
1172
1173   if (!v8_untrusted_code_mitigations) {
1174     defines += [ "DISABLE_UNTRUSTED_CODE_MITIGATIONS" ]
1175   }
1176
1177   if (v8_no_inline) {
1178     if (is_win) {
1179       cflags += [ "/Ob0" ]
1180     } else {
1181       cflags += [
1182         "-fno-inline-functions",
1183         "-fno-inline",
1184       ]
1185     }
1186   }
1187
1188   if (is_clang) {
1189     cflags += [ "-Wmissing-field-initializers" ]
1190
1191     if (v8_current_cpu != "mips" && v8_current_cpu != "mipsel") {
1192       # We exclude MIPS because the IsMipsArchVariant macro causes trouble.
1193       cflags += [ "-Wunreachable-code" ]
1194     }
1195
1196     if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
1197         v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") {
1198       cflags += [ "-Wshorten-64-to-32" ]
1199     }
1200   }
1201
1202   if (is_win) {
1203     cflags += [
1204       "/wd4245",  # Conversion with signed/unsigned mismatch.
1205       "/wd4267",  # Conversion with possible loss of data.
1206       "/wd4324",  # Padding structure due to alignment.
1207       "/wd4701",  # Potentially uninitialized local variable.
1208       "/wd4702",  # Unreachable code.
1209       "/wd4703",  # Potentially uninitialized local pointer variable.
1210       "/wd4709",  # Comma operator within array index expr (bugged).
1211       "/wd4714",  # Function marked forceinline not inlined.
1212
1213       # MSVC assumes that control can get past an exhaustive switch and then
1214       # warns if there's no return there (see https://crbug.com/v8/7658)
1215       "/wd4715",  # Not all control paths return a value.
1216
1217       "/wd4718",  # Recursive call has no side-effect.
1218       "/wd4723",  # https://crbug.com/v8/7771
1219       "/wd4724",  # https://crbug.com/v8/7771
1220       "/wd4800",  # Forcing value to bool.
1221     ]
1222   }
1223
1224   if (!is_clang && is_win) {
1225     cflags += [ "/wd4506" ]  # Benign "no definition for inline function"
1226   }
1227
1228   if (!is_clang && !is_win) {
1229     cflags += [
1230       # Disable gcc warnings for optimizations based on the assumption that
1231       # signed overflow does not occur. Generates false positives (see
1232       # http://crbug.com/v8/6341).
1233       "-Wno-strict-overflow",
1234
1235       # GCC assumes that control can get past an exhaustive switch and then
1236       # warns if there's no return there (see https://crbug.com/v8/7658).
1237       "-Wno-return-type",
1238
1239       # Disable gcc warnings for using enum constant in boolean context.
1240       # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97266
1241       "-Wno-int-in-bool-context",
1242     ]
1243   }
1244
1245   # Chromium uses a hand-picked subset of UBSan coverage. We want everything.
1246   if (is_ubsan) {
1247     cflags += [ "-fsanitize=undefined" ]
1248   }
1249 }
1250
1251 # For code that is hot during mksnapshot. In fast-mksnapshot builds, we
1252 # optimize some files even in debug builds to speed up mksnapshot times.
1253 config("always_optimize") {
1254   configs = [ ":internal_config" ]
1255
1256   # TODO(crbug.com/621335) Rework this so that we don't have the confusion
1257   # between "optimize_speed" and "optimize_max".
1258   if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
1259     configs += [ "//build/config/compiler:optimize_speed" ]
1260   } else {
1261     configs += [ "//build/config/compiler:optimize_max" ]
1262   }
1263 }
1264
1265 # Configs for code coverage with gcov. Separate configs for cflags and ldflags
1266 # to selectively influde cflags in non-test targets only.
1267 config("v8_gcov_coverage_cflags") {
1268   cflags = [
1269     "-fprofile-arcs",
1270     "-ftest-coverage",
1271   ]
1272 }
1273
1274 config("v8_gcov_coverage_ldflags") {
1275   ldflags = [ "-fprofile-arcs" ]
1276 }
1277
1278 ###############################################################################
1279 # Actions
1280 #
1281
1282 # Only for Windows clang builds. Converts the embedded.S file produced by
1283 # mksnapshot into an embedded.cc file with corresponding inline assembly.
1284 template("asm_to_inline_asm") {
1285   name = target_name
1286   if (name == "default") {
1287     suffix = ""
1288   } else {
1289     suffix = "_$name"
1290   }
1291
1292   action("asm_to_inline_asm_" + name) {
1293     visibility = [ ":*" ]  # Only targets in this file can depend on this.
1294
1295     assert(emit_builtins_as_inline_asm)
1296
1297     script = "tools/snapshot/asm_to_inline_asm.py"
1298     deps = [ ":run_mksnapshot_" + name ]
1299     sources = [ "$target_gen_dir/embedded${suffix}.S" ]
1300     outputs = [ "$target_gen_dir/embedded${suffix}.cc" ]
1301     args = invoker.args
1302     args += [
1303       rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1304       rebase_path("$target_gen_dir/embedded${suffix}.cc", root_build_dir),
1305     ]
1306   }
1307 }
1308
1309 if (is_android && enable_java_templates) {
1310   android_assets("v8_external_startup_data_assets") {
1311     if (v8_use_external_startup_data) {
1312       # We don't support side-by-side snapshots on Android within Chromium.
1313       assert(!v8_use_multi_snapshots)
1314       deps = [ "//v8" ]
1315       renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ]
1316       if (current_cpu == "arm" || current_cpu == "x86" ||
1317           current_cpu == "mipsel") {
1318         renaming_destinations = [ "snapshot_blob_32.bin" ]
1319       } else {
1320         renaming_destinations = [ "snapshot_blob_64.bin" ]
1321       }
1322       disable_compression = true
1323     }
1324   }
1325 }
1326
1327 action("postmortem-metadata") {
1328   # Only targets in this file and the top-level visibility target can
1329   # depend on this.
1330   visibility = [
1331     ":*",
1332     "//:gn_visibility",
1333   ]
1334
1335   script = "tools/gen-postmortem-metadata.py"
1336
1337   # NOSORT
1338   sources = [
1339     "$target_gen_dir/torque-generated/instance-types.h",
1340     "src/objects/allocation-site.h",
1341     "src/objects/allocation-site-inl.h",
1342     "src/objects/cell.h",
1343     "src/objects/cell-inl.h",
1344     "src/objects/code.h",
1345     "src/objects/code-inl.h",
1346     "src/objects/data-handler.h",
1347     "src/objects/data-handler-inl.h",
1348     "src/objects/descriptor-array.h",
1349     "src/objects/descriptor-array-inl.h",
1350     "src/objects/feedback-cell.h",
1351     "src/objects/feedback-cell-inl.h",
1352     "src/objects/fixed-array.h",
1353     "src/objects/fixed-array-inl.h",
1354     "src/objects/heap-number.h",
1355     "src/objects/heap-number-inl.h",
1356     "src/objects/heap-object.h",
1357     "src/objects/heap-object-inl.h",
1358     "src/objects/instance-type.h",
1359     "src/objects/js-array-buffer.h",
1360     "src/objects/js-array-buffer-inl.h",
1361     "src/objects/js-array.h",
1362     "src/objects/js-array-inl.h",
1363     "src/objects/js-function-inl.h",
1364     "src/objects/js-function.cc",
1365     "src/objects/js-function.h",
1366     "src/objects/js-objects.cc",
1367     "src/objects/js-objects.h",
1368     "src/objects/js-objects-inl.h",
1369     "src/objects/js-promise.h",
1370     "src/objects/js-promise-inl.h",
1371     "src/objects/js-regexp.cc",
1372     "src/objects/js-regexp.h",
1373     "src/objects/js-regexp-inl.h",
1374     "src/objects/js-regexp-string-iterator.h",
1375     "src/objects/js-regexp-string-iterator-inl.h",
1376     "src/objects/map.cc",
1377     "src/objects/map.h",
1378     "src/objects/map-inl.h",
1379     "src/objects/megadom-handler.h",
1380     "src/objects/megadom-handler-inl.h",
1381     "src/objects/name.h",
1382     "src/objects/name-inl.h",
1383     "src/objects/objects.h",
1384     "src/objects/objects-inl.h",
1385     "src/objects/oddball.h",
1386     "src/objects/oddball-inl.h",
1387     "src/objects/primitive-heap-object.h",
1388     "src/objects/primitive-heap-object-inl.h",
1389     "src/objects/scope-info.h",
1390     "src/objects/scope-info-inl.h",
1391     "src/objects/script.h",
1392     "src/objects/script-inl.h",
1393     "src/objects/shared-function-info.cc",
1394     "src/objects/shared-function-info.h",
1395     "src/objects/shared-function-info-inl.h",
1396     "src/objects/string.cc",
1397     "src/objects/string-comparator.cc",
1398     "src/objects/string-comparator.h",
1399     "src/objects/string.h",
1400     "src/objects/string-inl.h",
1401     "src/objects/struct.h",
1402     "src/objects/struct-inl.h",
1403   ]
1404
1405   outputs = [ "$target_gen_dir/debug-support.cc" ]
1406
1407   args = rebase_path(outputs, root_build_dir) +
1408          rebase_path(sources, root_build_dir)
1409
1410   deps = [ ":run_torque" ]
1411 }
1412
1413 torque_files = [
1414   "src/builtins/aggregate-error.tq",
1415   "src/builtins/array-at.tq",
1416   "src/builtins/array-concat.tq",
1417   "src/builtins/array-copywithin.tq",
1418   "src/builtins/array-every.tq",
1419   "src/builtins/array-filter.tq",
1420   "src/builtins/array-find.tq",
1421   "src/builtins/array-findindex.tq",
1422   "src/builtins/array-findlast.tq",
1423   "src/builtins/array-findlastindex.tq",
1424   "src/builtins/array-foreach.tq",
1425   "src/builtins/array-from.tq",
1426   "src/builtins/array-isarray.tq",
1427   "src/builtins/array-join.tq",
1428   "src/builtins/array-lastindexof.tq",
1429   "src/builtins/array-map.tq",
1430   "src/builtins/array-of.tq",
1431   "src/builtins/array-reduce-right.tq",
1432   "src/builtins/array-reduce.tq",
1433   "src/builtins/array-reverse.tq",
1434   "src/builtins/array-shift.tq",
1435   "src/builtins/array-slice.tq",
1436   "src/builtins/array-some.tq",
1437   "src/builtins/array-splice.tq",
1438   "src/builtins/array-unshift.tq",
1439   "src/builtins/array.tq",
1440   "src/builtins/arraybuffer.tq",
1441   "src/builtins/base.tq",
1442   "src/builtins/boolean.tq",
1443   "src/builtins/builtins-bigint.tq",
1444   "src/builtins/builtins-string.tq",
1445   "src/builtins/cast.tq",
1446   "src/builtins/collections.tq",
1447   "src/builtins/constructor.tq",
1448   "src/builtins/conversion.tq",
1449   "src/builtins/convert.tq",
1450   "src/builtins/console.tq",
1451   "src/builtins/data-view.tq",
1452   "src/builtins/finalization-registry.tq",
1453   "src/builtins/frames.tq",
1454   "src/builtins/frame-arguments.tq",
1455   "src/builtins/function.tq",
1456   "src/builtins/growable-fixed-array.tq",
1457   "src/builtins/ic-callable.tq",
1458   "src/builtins/ic-dynamic-check-maps.tq",
1459   "src/builtins/ic.tq",
1460   "src/builtins/internal-coverage.tq",
1461   "src/builtins/internal.tq",
1462   "src/builtins/iterator.tq",
1463   "src/builtins/math.tq",
1464   "src/builtins/number.tq",
1465   "src/builtins/object-fromentries.tq",
1466   "src/builtins/object.tq",
1467   "src/builtins/promise-abstract-operations.tq",
1468   "src/builtins/promise-all.tq",
1469   "src/builtins/promise-all-element-closure.tq",
1470   "src/builtins/promise-any.tq",
1471   "src/builtins/promise-constructor.tq",
1472   "src/builtins/promise-finally.tq",
1473   "src/builtins/promise-misc.tq",
1474   "src/builtins/promise-race.tq",
1475   "src/builtins/promise-reaction-job.tq",
1476   "src/builtins/promise-resolve.tq",
1477   "src/builtins/promise-then.tq",
1478   "src/builtins/promise-jobs.tq",
1479   "src/builtins/proxy-constructor.tq",
1480   "src/builtins/proxy-delete-property.tq",
1481   "src/builtins/proxy-get-property.tq",
1482   "src/builtins/proxy-get-prototype-of.tq",
1483   "src/builtins/proxy-has-property.tq",
1484   "src/builtins/proxy-is-extensible.tq",
1485   "src/builtins/proxy-prevent-extensions.tq",
1486   "src/builtins/proxy-revocable.tq",
1487   "src/builtins/proxy-revoke.tq",
1488   "src/builtins/proxy-set-property.tq",
1489   "src/builtins/proxy-set-prototype-of.tq",
1490   "src/builtins/proxy.tq",
1491   "src/builtins/reflect.tq",
1492   "src/builtins/regexp-exec.tq",
1493   "src/builtins/regexp-match-all.tq",
1494   "src/builtins/regexp-match.tq",
1495   "src/builtins/regexp-replace.tq",
1496   "src/builtins/regexp-search.tq",
1497   "src/builtins/regexp-source.tq",
1498   "src/builtins/regexp-split.tq",
1499   "src/builtins/regexp-test.tq",
1500   "src/builtins/regexp.tq",
1501   "src/builtins/string-at.tq",
1502   "src/builtins/string-endswith.tq",
1503   "src/builtins/string-html.tq",
1504   "src/builtins/string-includes.tq",
1505   "src/builtins/string-indexof.tq",
1506   "src/builtins/string-iterator.tq",
1507   "src/builtins/string-match-search.tq",
1508   "src/builtins/string-pad.tq",
1509   "src/builtins/string-repeat.tq",
1510   "src/builtins/string-replaceall.tq",
1511   "src/builtins/string-slice.tq",
1512   "src/builtins/string-startswith.tq",
1513   "src/builtins/string-substr.tq",
1514   "src/builtins/string-substring.tq",
1515   "src/builtins/string-trim.tq",
1516   "src/builtins/symbol.tq",
1517   "src/builtins/torque-internal.tq",
1518   "src/builtins/typed-array-at.tq",
1519   "src/builtins/typed-array-createtypedarray.tq",
1520   "src/builtins/typed-array-every.tq",
1521   "src/builtins/typed-array-entries.tq",
1522   "src/builtins/typed-array-filter.tq",
1523   "src/builtins/typed-array-find.tq",
1524   "src/builtins/typed-array-findindex.tq",
1525   "src/builtins/typed-array-findlast.tq",
1526   "src/builtins/typed-array-findlastindex.tq",
1527   "src/builtins/typed-array-foreach.tq",
1528   "src/builtins/typed-array-from.tq",
1529   "src/builtins/typed-array-keys.tq",
1530   "src/builtins/typed-array-of.tq",
1531   "src/builtins/typed-array-reduce.tq",
1532   "src/builtins/typed-array-reduceright.tq",
1533   "src/builtins/typed-array-set.tq",
1534   "src/builtins/typed-array-slice.tq",
1535   "src/builtins/typed-array-some.tq",
1536   "src/builtins/typed-array-sort.tq",
1537   "src/builtins/typed-array-subarray.tq",
1538   "src/builtins/typed-array-values.tq",
1539   "src/builtins/typed-array.tq",
1540   "src/builtins/weak-ref.tq",
1541   "src/ic/handler-configuration.tq",
1542   "src/objects/allocation-site.tq",
1543   "src/objects/api-callbacks.tq",
1544   "src/objects/arguments.tq",
1545   "src/objects/bigint.tq",
1546   "src/objects/cell.tq",
1547   "src/objects/code.tq",
1548   "src/objects/contexts.tq",
1549   "src/objects/data-handler.tq",
1550   "src/objects/debug-objects.tq",
1551   "src/objects/descriptor-array.tq",
1552   "src/objects/embedder-data-array.tq",
1553   "src/objects/feedback-cell.tq",
1554   "src/objects/feedback-vector.tq",
1555   "src/objects/fixed-array.tq",
1556   "src/objects/foreign.tq",
1557   "src/objects/free-space.tq",
1558   "src/objects/heap-number.tq",
1559   "src/objects/heap-object.tq",
1560   "src/objects/js-array-buffer.tq",
1561   "src/objects/js-array.tq",
1562   "src/objects/js-collection-iterator.tq",
1563   "src/objects/js-collection.tq",
1564   "src/objects/js-function.tq",
1565   "src/objects/js-generator.tq",
1566   "src/objects/js-objects.tq",
1567   "src/objects/js-promise.tq",
1568   "src/objects/js-proxy.tq",
1569   "src/objects/js-regexp-string-iterator.tq",
1570   "src/objects/js-regexp.tq",
1571   "src/objects/js-weak-refs.tq",
1572   "src/objects/literal-objects.tq",
1573   "src/objects/map.tq",
1574   "src/objects/megadom-handler.tq",
1575   "src/objects/microtask.tq",
1576   "src/objects/module.tq",
1577   "src/objects/name.tq",
1578   "src/objects/oddball.tq",
1579   "src/objects/ordered-hash-table.tq",
1580   "src/objects/primitive-heap-object.tq",
1581   "src/objects/promise.tq",
1582   "src/objects/property-array.tq",
1583   "src/objects/property-cell.tq",
1584   "src/objects/property-descriptor-object.tq",
1585   "src/objects/prototype-info.tq",
1586   "src/objects/regexp-match-info.tq",
1587   "src/objects/scope-info.tq",
1588   "src/objects/script.tq",
1589   "src/objects/shared-function-info.tq",
1590   "src/objects/source-text-module.tq",
1591   "src/objects/stack-frame-info.tq",
1592   "src/objects/string.tq",
1593   "src/objects/struct.tq",
1594   "src/objects/swiss-hash-table-helpers.tq",
1595   "src/objects/swiss-name-dictionary.tq",
1596   "src/objects/synthetic-module.tq",
1597   "src/objects/template-objects.tq",
1598   "src/objects/templates.tq",
1599   "src/objects/torque-defined-classes.tq",
1600   "test/torque/test-torque.tq",
1601   "third_party/v8/builtins/array-sort.tq",
1602 ]
1603
1604 if (v8_enable_i18n_support) {
1605   torque_files += [
1606     "src/objects/intl-objects.tq",
1607     "src/objects/js-break-iterator.tq",
1608     "src/objects/js-collator.tq",
1609     "src/objects/js-date-time-format.tq",
1610     "src/objects/js-display-names.tq",
1611     "src/objects/js-list-format.tq",
1612     "src/objects/js-locale.tq",
1613     "src/objects/js-number-format.tq",
1614     "src/objects/js-plural-rules.tq",
1615     "src/objects/js-relative-time-format.tq",
1616     "src/objects/js-segment-iterator.tq",
1617     "src/objects/js-segmenter.tq",
1618     "src/objects/js-segments.tq",
1619   ]
1620 }
1621
1622 if (v8_enable_webassembly) {
1623   torque_files += [
1624     "src/builtins/wasm.tq",
1625     "src/debug/debug-wasm-objects.tq",
1626     "src/wasm/wasm-objects.tq",
1627   ]
1628 }
1629
1630 # Template for running torque
1631 # When building with v8_verify_torque_generation_invariance=true we need
1632 # to be able to run torque for both 32 and 64 bits in the same build
1633 template("run_torque") {
1634   if (target_name == "") {
1635     suffix = ""
1636   } else {
1637     suffix = "_$target_name"
1638   }
1639
1640   toolchain = invoker.toolchain
1641
1642   action("run_torque" + suffix) {
1643     visibility = [
1644       ":*",
1645       "test/cctest/:*",
1646       "tools/debug_helper/:*",
1647       "tools/gcmole/:*",
1648     ]
1649
1650     deps = [ ":torque($toolchain)" ]
1651
1652     script = "tools/run.py"
1653
1654     sources = torque_files
1655
1656     destination_folder = "$target_gen_dir/torque-generated$suffix"
1657
1658     outputs = [
1659       "$destination_folder/bit-fields.h",
1660       "$destination_folder/builtin-definitions.h",
1661       "$destination_folder/class-debug-readers.cc",
1662       "$destination_folder/class-debug-readers.h",
1663       "$destination_folder/class-forward-declarations.h",
1664       "$destination_folder/class-verifiers.cc",
1665       "$destination_folder/class-verifiers.h",
1666       "$destination_folder/csa-types.h",
1667       "$destination_folder/debug-macros.cc",
1668       "$destination_folder/debug-macros.h",
1669       "$destination_folder/enum-verifiers.cc",
1670       "$destination_folder/exported-macros-assembler.cc",
1671       "$destination_folder/exported-macros-assembler.h",
1672       "$destination_folder/factory.cc",
1673       "$destination_folder/factory.inc",
1674       "$destination_folder/field-offsets.h",
1675       "$destination_folder/instance-types.h",
1676       "$destination_folder/interface-descriptors.inc",
1677       "$destination_folder/objects-body-descriptors-inl.inc",
1678       "$destination_folder/objects-printer.cc",
1679     ]
1680
1681     foreach(file, torque_files) {
1682       filetq = string_replace(file, ".tq", "-tq")
1683       outputs += [
1684         "$destination_folder/$filetq-csa.cc",
1685         "$destination_folder/$filetq-csa.h",
1686         "$destination_folder/$filetq-inl.inc",
1687         "$destination_folder/$filetq.cc",
1688         "$destination_folder/$filetq.inc",
1689       ]
1690     }
1691
1692     args = [
1693       "./" + rebase_path(
1694               get_label_info(":torque($toolchain)", "root_out_dir") + "/torque",
1695               root_build_dir),
1696       "-o",
1697       rebase_path("$destination_folder", root_build_dir),
1698       "-v8-root",
1699       rebase_path(".", root_build_dir),
1700     ]
1701     if (v8_annotate_torque_ir) {
1702       args += [ "-annotate-ir" ]
1703     }
1704     if (defined(invoker.args)) {
1705       args += invoker.args
1706     }
1707     args += torque_files
1708   }
1709 }
1710
1711 # Default run_torque action
1712 run_torque("") {
1713   toolchain = v8_generator_toolchain
1714 }
1715
1716 if (v8_verify_torque_generation_invariance) {
1717   run_torque("x86") {
1718     toolchain = "//build/toolchain/linux:clang_x86"
1719   }
1720
1721   run_torque("x64") {
1722     args = [ "-m32" ]
1723     toolchain = "//build/toolchain/linux:clang_x64"
1724   }
1725
1726   action("compare_torque_runs") {
1727     deps = [
1728       ":run_torque_x64",
1729       ":run_torque_x86",
1730     ]
1731     report_file = "$target_gen_dir/torque_comparison_results.txt"
1732     script = "tools/compare_torque_output.py"
1733     args = [
1734       rebase_path("$target_gen_dir/torque-generated_x64", root_build_dir),
1735       rebase_path("$target_gen_dir/torque-generated_x86", root_build_dir),
1736       rebase_path(report_file, root_build_dir),
1737     ]
1738     outputs = [ report_file ]
1739   }
1740 }
1741
1742 group("v8_maybe_icu") {
1743   if (v8_enable_i18n_support) {
1744     public_deps = [ "//third_party/icu" ]
1745   }
1746 }
1747
1748 v8_header_set("torque_runtime_support") {
1749   visibility = [ ":*" ]
1750
1751   sources = [ "src/torque/runtime-support.h" ]
1752
1753   configs = [ ":internal_config" ]
1754 }
1755
1756 v8_source_set("torque_generated_initializers") {
1757   visibility = [ ":*" ]  # Only targets in this file can depend on this.
1758
1759   deps = [
1760     ":generate_bytecode_builtins_list",
1761     ":run_torque",
1762     ":v8_base_without_compiler",
1763     ":v8_tracing",
1764   ]
1765
1766   public_deps = [
1767     ":torque_runtime_support",
1768     ":v8_maybe_icu",
1769   ]
1770
1771   sources = [
1772     "$target_gen_dir/torque-generated/csa-types.h",
1773     "$target_gen_dir/torque-generated/enum-verifiers.cc",
1774     "$target_gen_dir/torque-generated/exported-macros-assembler.cc",
1775     "$target_gen_dir/torque-generated/exported-macros-assembler.h",
1776   ]
1777   foreach(file, torque_files) {
1778     filetq = string_replace(file, ".tq", "-tq")
1779     sources += [
1780       "$target_gen_dir/torque-generated/$filetq-csa.cc",
1781       "$target_gen_dir/torque-generated/$filetq-csa.h",
1782     ]
1783   }
1784
1785   configs = [ ":internal_config" ]
1786 }
1787
1788 v8_source_set("torque_generated_definitions") {
1789   visibility = [ ":*" ]  # Only targets in this file can depend on this.
1790
1791   deps = [
1792     ":generate_bytecode_builtins_list",
1793     ":run_torque",
1794     ":v8_internal_headers",
1795     ":v8_libbase",
1796     ":v8_tracing",
1797   ]
1798
1799   public_deps = [ ":v8_maybe_icu" ]
1800
1801   sources = [
1802     "$target_gen_dir/torque-generated/class-forward-declarations.h",
1803     "$target_gen_dir/torque-generated/class-verifiers.cc",
1804     "$target_gen_dir/torque-generated/class-verifiers.h",
1805     "$target_gen_dir/torque-generated/factory.cc",
1806     "$target_gen_dir/torque-generated/objects-printer.cc",
1807   ]
1808   foreach(file, torque_files) {
1809     filetq = string_replace(file, ".tq", "-tq")
1810     sources += [
1811       "$target_gen_dir/torque-generated/$filetq-inl.inc",
1812       "$target_gen_dir/torque-generated/$filetq.cc",
1813       "$target_gen_dir/torque-generated/$filetq.inc",
1814     ]
1815   }
1816
1817   configs = [ ":internal_config" ]
1818 }
1819
1820 action("generate_bytecode_builtins_list") {
1821   script = "tools/run.py"
1822   outputs = [ "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h" ]
1823   deps = [ ":bytecode_builtins_list_generator($v8_generator_toolchain)" ]
1824   args = [
1825     "./" + rebase_path(
1826             get_label_info(
1827                     ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1828                     "root_out_dir") + "/bytecode_builtins_list_generator",
1829             root_build_dir),
1830     rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
1831                 root_build_dir),
1832   ]
1833 }
1834
1835 # Template to generate different V8 snapshots based on different runtime flags.
1836 # Can be invoked with run_mksnapshot(<name>). The target will resolve to
1837 # run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
1838 # Otherwise files are suffixed, e.g. embedded_<name>.S and
1839 # snapshot_blob_<name>.bin.
1840 #
1841 # The template exposes the variables:
1842 #   args: additional flags for mksnapshots
1843 #   embedded_suffix: a camel case suffix for method names in the embedded
1844 #       snapshot.
1845 template("run_mksnapshot") {
1846   name = target_name
1847   if (name == "default") {
1848     suffix = ""
1849   } else {
1850     suffix = "_$name"
1851   }
1852   action("run_mksnapshot_" + name) {
1853     # Only targets in this file and running mkgrokdump can depend on this.
1854     visibility = [
1855       ":*",
1856       "tools/debug_helper:run_mkgrokdump",
1857     ]
1858
1859     deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
1860
1861     script = "tools/run.py"
1862
1863     sources = []
1864
1865     outputs = []
1866
1867     data = []
1868
1869     args = [
1870       "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
1871                                         "root_out_dir") + "/mksnapshot",
1872                          root_build_dir),
1873       "--turbo_instruction_scheduling",
1874
1875       # In cross builds, the snapshot may be generated for both the host and
1876       # target toolchains.  The same host binary is used to generate both, so
1877       # mksnapshot needs to know which target OS to use at runtime.  It's weird,
1878       # but the target OS is really |current_os|.
1879       "--target_os=$current_os",
1880       "--target_arch=$current_cpu",
1881
1882       "--embedded_src",
1883       rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1884     ]
1885
1886     if (v8_enable_builtins_profiling) {
1887       args += [ "--turbo-profiling" ]
1888     }
1889     if (v8_enable_builtins_profiling_verbose) {
1890       args += [ "--turbo-profiling-verbose" ]
1891     }
1892     if (v8_builtins_profiling_log_file != "") {
1893       sources += [ v8_builtins_profiling_log_file ]
1894       args += [
1895         "--turbo-profiling-log-file",
1896         rebase_path(v8_builtins_profiling_log_file, root_build_dir),
1897       ]
1898     }
1899
1900     # This is needed to distinguish between generating code for the simulator
1901     # and cross-compiling. The latter may need to run code on the host with the
1902     # simulator but cannot use simulator-specific instructions.
1903     if (target_is_simulator) {
1904       args += [ "--target_is_simulator" ]
1905     }
1906
1907     args += invoker.args
1908
1909     outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
1910     if (invoker.embedded_variant != "") {
1911       args += [
1912         "--embedded_variant",
1913         invoker.embedded_variant,
1914       ]
1915     }
1916
1917     if (v8_random_seed != "0") {
1918       args += [
1919         "--random-seed",
1920         v8_random_seed,
1921       ]
1922     }
1923
1924     if (v8_os_page_size != "0") {
1925       args += [
1926         "--v8_os_page_size",
1927         v8_os_page_size,
1928       ]
1929     }
1930
1931     if (v8_use_external_startup_data) {
1932       outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1933       data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1934       args += [
1935         "--startup_blob",
1936         rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
1937       ]
1938     } else {
1939       outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
1940       args += [
1941         "--startup_src",
1942         rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
1943       ]
1944     }
1945
1946     if (v8_embed_script != "") {
1947       sources += [ v8_embed_script ]
1948       args += [ rebase_path(v8_embed_script, root_build_dir) ]
1949     }
1950
1951     if (v8_enable_snapshot_code_comments) {
1952       args += [ "--code-comments" ]
1953     }
1954
1955     if (v8_enable_snapshot_native_code_counters) {
1956       args += [ "--native-code-counters" ]
1957     } else {
1958       # --native-code-counters is the default in debug mode so make sure we can
1959       # unset it.
1960       args += [ "--no-native-code-counters" ]
1961     }
1962
1963     if (v8_enable_fast_mksnapshot) {
1964       args += [
1965         "--no-turbo-rewrite-far-jumps",
1966         "--no-turbo-verify-allocation",
1967       ]
1968
1969       if (v8_enable_debugging_features && v8_enable_slow_dchecks) {
1970         # mksnapshot only accepts this flag if ENABLE_SLOW_DCHECKS is defined.
1971         args += [ "--no-enable-slow-asserts" ]
1972       }
1973     }
1974
1975     if (v8_enable_verify_heap) {
1976       args += [ "--verify-heap" ]
1977     }
1978   }
1979 }
1980
1981 run_mksnapshot("default") {
1982   args = []
1983   embedded_variant = "Default"
1984 }
1985 if (emit_builtins_as_inline_asm) {
1986   asm_to_inline_asm("default") {
1987     args = []
1988   }
1989 }
1990 if (v8_use_multi_snapshots) {
1991   run_mksnapshot("trusted") {
1992     args = [ "--no-untrusted-code-mitigations" ]
1993     embedded_variant = "Trusted"
1994   }
1995   if (emit_builtins_as_inline_asm) {
1996     asm_to_inline_asm("trusted") {
1997       args = []
1998     }
1999   }
2000 }
2001
2002 action("v8_dump_build_config") {
2003   script = "tools/testrunner/utils/dump_build_config.py"
2004   outputs = [ "$root_out_dir/v8_build_config.json" ]
2005   is_gcov_coverage = v8_code_coverage && !is_clang
2006   is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
2007   args = [
2008     rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
2009     "current_cpu=\"$current_cpu\"",
2010     "dcheck_always_on=$dcheck_always_on",
2011     "is_android=$is_android",
2012     "is_asan=$is_asan",
2013     "is_cfi=$is_cfi",
2014     "is_clang=$is_clang",
2015     "is_component_build=$is_component_build",
2016     "is_debug=$v8_enable_debugging_features",
2017     "is_full_debug=$is_full_debug",
2018     "is_gcov_coverage=$is_gcov_coverage",
2019     "is_msan=$is_msan",
2020     "is_tsan=$is_tsan",
2021     "is_ubsan_vptr=$is_ubsan_vptr",
2022     "target_cpu=\"$target_cpu\"",
2023     "v8_current_cpu=\"$v8_current_cpu\"",
2024     "v8_enable_atomic_marking_state=$v8_enable_atomic_marking_state",
2025     "v8_enable_atomic_object_field_writes=" +
2026         "$v8_enable_atomic_object_field_writes",
2027     "v8_enable_concurrent_marking=$v8_enable_concurrent_marking",
2028     "v8_enable_single_generation=$v8_enable_single_generation",
2029     "v8_enable_i18n_support=$v8_enable_i18n_support",
2030     "v8_enable_verify_predictable=$v8_enable_verify_predictable",
2031     "v8_enable_verify_csa=$v8_enable_verify_csa",
2032     "v8_enable_lite_mode=$v8_enable_lite_mode",
2033     "v8_enable_runtime_call_stats=$v8_enable_runtime_call_stats",
2034     "v8_enable_pointer_compression=$v8_enable_pointer_compression",
2035     "v8_enable_pointer_compression_shared_cage=" +
2036         "$v8_enable_pointer_compression_shared_cage",
2037     "v8_enable_third_party_heap=$v8_enable_third_party_heap",
2038     "v8_enable_webassembly=$v8_enable_webassembly",
2039     "v8_control_flow_integrity=$v8_control_flow_integrity",
2040     "v8_target_cpu=\"$v8_target_cpu\"",
2041   ]
2042
2043   if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" ||
2044       v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
2045     args += [
2046       "mips_arch_variant=\"$mips_arch_variant\"",
2047       "mips_use_msa=$mips_use_msa",
2048     ]
2049   }
2050 }
2051
2052 ###############################################################################
2053 # Source Sets (aka static libraries)
2054 #
2055
2056 v8_source_set("v8_snapshot") {
2057   visibility = [ ":*" ]  # Targets in this file can depend on this.
2058
2059   deps = [
2060     ":v8_internal_headers",
2061     ":v8_libbase",
2062   ]
2063   public_deps = [
2064     # This should be public so downstream targets can declare the snapshot
2065     # output file as their inputs.
2066     ":run_mksnapshot_default",
2067   ]
2068
2069   # Do not publicize any header to remove build dependency.
2070   public = []
2071
2072   sources = [ "src/init/setup-isolate-deserialize.cc" ]
2073   if (v8_control_flow_integrity) {
2074     sources += [ "src/deoptimizer/deoptimizer-cfi-builtins.cc" ]
2075   }
2076   if (emit_builtins_as_inline_asm) {
2077     deps += [ ":asm_to_inline_asm_default" ]
2078     sources += [ "$target_gen_dir/embedded.cc" ]
2079   } else {
2080     sources += [ "$target_gen_dir/embedded.S" ]
2081   }
2082
2083   configs = [ ":internal_config" ]
2084
2085   if (v8_use_external_startup_data) {
2086     deps += [ ":v8_base" ]
2087
2088     sources += [ "src/snapshot/snapshot-external.cc" ]
2089
2090     if (v8_use_multi_snapshots) {
2091       public_deps += [ ":run_mksnapshot_trusted" ]
2092       if (emit_builtins_as_inline_asm) {
2093         deps += [ ":asm_to_inline_asm_trusted" ]
2094         sources += [ "$target_gen_dir/embedded_trusted.cc" ]
2095       } else {
2096         sources += [ "$target_gen_dir/embedded_trusted.S" ]
2097       }
2098     }
2099   } else {
2100     # Also top-level visibility targets can depend on this.
2101     visibility += [ "//:gn_visibility" ]
2102
2103     public_deps += [ ":v8_maybe_icu" ]
2104
2105     sources += [ "$target_gen_dir/snapshot.cc" ]
2106   }
2107 }
2108
2109 v8_source_set("v8_initializers") {
2110   visibility = [
2111     ":*",
2112     "test/cctest:*",
2113   ]
2114
2115   allow_circular_includes_from = [ ":torque_generated_initializers" ]
2116
2117   deps = [
2118     ":torque_generated_initializers",
2119     ":v8_base_without_compiler",
2120     ":v8_shared_internal_headers",
2121     ":v8_tracing",
2122   ]
2123
2124   sources = [
2125     ### gcmole(all) ###
2126     "src/builtins/builtins-array-gen.cc",
2127     "src/builtins/builtins-array-gen.h",
2128     "src/builtins/builtins-async-function-gen.cc",
2129     "src/builtins/builtins-async-gen.cc",
2130     "src/builtins/builtins-async-gen.h",
2131     "src/builtins/builtins-async-generator-gen.cc",
2132     "src/builtins/builtins-async-iterator-gen.cc",
2133     "src/builtins/builtins-bigint-gen.cc",
2134     "src/builtins/builtins-bigint-gen.h",
2135     "src/builtins/builtins-call-gen.cc",
2136     "src/builtins/builtins-call-gen.h",
2137     "src/builtins/builtins-collections-gen.cc",
2138     "src/builtins/builtins-collections-gen.h",
2139     "src/builtins/builtins-constructor-gen.cc",
2140     "src/builtins/builtins-constructor-gen.h",
2141     "src/builtins/builtins-constructor.h",
2142     "src/builtins/builtins-conversion-gen.cc",
2143     "src/builtins/builtins-data-view-gen.h",
2144     "src/builtins/builtins-date-gen.cc",
2145     "src/builtins/builtins-generator-gen.cc",
2146     "src/builtins/builtins-global-gen.cc",
2147     "src/builtins/builtins-handler-gen.cc",
2148     "src/builtins/builtins-ic-gen.cc",
2149     "src/builtins/builtins-internal-gen.cc",
2150     "src/builtins/builtins-interpreter-gen.cc",
2151     "src/builtins/builtins-intl-gen.cc",
2152     "src/builtins/builtins-iterator-gen.cc",
2153     "src/builtins/builtins-iterator-gen.h",
2154     "src/builtins/builtins-lazy-gen.cc",
2155     "src/builtins/builtins-lazy-gen.h",
2156     "src/builtins/builtins-microtask-queue-gen.cc",
2157     "src/builtins/builtins-number-gen.cc",
2158     "src/builtins/builtins-object-gen.cc",
2159     "src/builtins/builtins-promise-gen.cc",
2160     "src/builtins/builtins-promise-gen.h",
2161     "src/builtins/builtins-proxy-gen.cc",
2162     "src/builtins/builtins-proxy-gen.h",
2163     "src/builtins/builtins-regexp-gen.cc",
2164     "src/builtins/builtins-regexp-gen.h",
2165     "src/builtins/builtins-sharedarraybuffer-gen.cc",
2166     "src/builtins/builtins-string-gen.cc",
2167     "src/builtins/builtins-string-gen.h",
2168     "src/builtins/builtins-typed-array-gen.cc",
2169     "src/builtins/builtins-typed-array-gen.h",
2170     "src/builtins/builtins-utils-gen.h",
2171     "src/builtins/growable-fixed-array-gen.cc",
2172     "src/builtins/growable-fixed-array-gen.h",
2173     "src/builtins/profile-data-reader.cc",
2174     "src/builtins/profile-data-reader.h",
2175     "src/builtins/setup-builtins-internal.cc",
2176     "src/builtins/torque-csa-header-includes.h",
2177     "src/codegen/code-stub-assembler.cc",
2178     "src/codegen/code-stub-assembler.h",
2179     "src/heap/setup-heap-internal.cc",
2180     "src/ic/accessor-assembler.cc",
2181     "src/ic/accessor-assembler.h",
2182     "src/ic/binary-op-assembler.cc",
2183     "src/ic/binary-op-assembler.h",
2184     "src/ic/keyed-store-generic.cc",
2185     "src/ic/keyed-store-generic.h",
2186     "src/ic/unary-op-assembler.cc",
2187     "src/ic/unary-op-assembler.h",
2188     "src/interpreter/interpreter-assembler.cc",
2189     "src/interpreter/interpreter-assembler.h",
2190     "src/interpreter/interpreter-generator.cc",
2191     "src/interpreter/interpreter-generator.h",
2192     "src/interpreter/interpreter-intrinsics-generator.cc",
2193     "src/interpreter/interpreter-intrinsics-generator.h",
2194   ]
2195
2196   if (v8_enable_webassembly) {
2197     sources += [
2198       "src/builtins/builtins-wasm-gen.cc",
2199       "src/builtins/builtins-wasm-gen.h",
2200     ]
2201   }
2202
2203   if (v8_current_cpu == "x86") {
2204     sources += [
2205       ### gcmole(arch:ia32) ###
2206       "src/builtins/ia32/builtins-ia32.cc",
2207     ]
2208   } else if (v8_current_cpu == "x64") {
2209     sources += [
2210       ### gcmole(arch:x64) ###
2211       "src/builtins/x64/builtins-x64.cc",
2212     ]
2213   } else if (v8_current_cpu == "arm") {
2214     sources += [
2215       ### gcmole(arch:arm) ###
2216       "src/builtins/arm/builtins-arm.cc",
2217     ]
2218   } else if (v8_current_cpu == "arm64") {
2219     sources += [
2220       ### gcmole(arch:arm64) ###
2221       "src/builtins/arm64/builtins-arm64.cc",
2222     ]
2223   } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
2224     sources += [
2225       ### gcmole(arch:mipsel) ###
2226       "src/builtins/mips/builtins-mips.cc",
2227     ]
2228   } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
2229     sources += [
2230       ### gcmole(arch:mips64el) ###
2231       "src/builtins/mips64/builtins-mips64.cc",
2232     ]
2233   } else if (v8_current_cpu == "ppc") {
2234     sources += [
2235       ### gcmole(arch:ppc) ###
2236       "src/builtins/ppc/builtins-ppc.cc",
2237     ]
2238   } else if (v8_current_cpu == "ppc64") {
2239     sources += [
2240       ### gcmole(arch:ppc64) ###
2241       "src/builtins/ppc/builtins-ppc.cc",
2242     ]
2243   } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
2244     sources += [
2245       ### gcmole(arch:s390) ###
2246       "src/builtins/s390/builtins-s390.cc",
2247     ]
2248   } else if (v8_current_cpu == "riscv64") {
2249     sources += [
2250       ### gcmole(arch:riscv64) ###
2251       "src/builtins/riscv64/builtins-riscv64.cc",
2252     ]
2253   }
2254
2255   if (!v8_enable_i18n_support) {
2256     sources -= [ "src/builtins/builtins-intl-gen.cc" ]
2257   }
2258
2259   configs = [ ":internal_config" ]
2260 }
2261
2262 v8_source_set("v8_init") {
2263   visibility = [ ":*" ]  # Only targets in this file can depend on this.
2264
2265   deps = [
2266     ":v8_base_without_compiler",
2267     ":v8_initializers",
2268     ":v8_tracing",
2269   ]
2270
2271   sources = [
2272     ### gcmole(all) ###
2273     "src/init/setup-isolate-full.cc",
2274   ]
2275
2276   public_deps = [ ":v8_maybe_icu" ]
2277
2278   configs = [ ":internal_config" ]
2279 }
2280
2281 # This is split out to be a non-code containing target that the Chromium browser
2282 # DLL can depend upon to get only a version string.
2283 v8_header_set("v8_version") {
2284   configs = [ ":internal_config" ]
2285
2286   sources = [
2287     "include/v8-value-serializer-version.h",
2288     "include/v8-version-string.h",
2289     "include/v8-version.h",
2290   ]
2291 }
2292
2293 v8_header_set("v8_config_headers") {
2294   configs = [ ":internal_config" ]
2295
2296   sources = [
2297     "include/v8-platform.h",
2298     "include/v8config.h",
2299   ]
2300
2301   deps = []
2302
2303   if (v8_generate_external_defines_header) {
2304     sources += [ "$target_gen_dir/include/v8-gn.h" ]
2305     deps += [ ":gen_v8_gn" ]
2306   }
2307 }
2308
2309 # This is split out to be a non-code containing target that the Chromium browser
2310 # can depend upon to get basic v8 types.
2311 v8_header_set("v8_headers") {
2312   configs = [ ":internal_config" ]
2313   public_configs = [ ":headers_config" ]
2314
2315   sources = [
2316     "include/v8-cppgc.h",
2317     "include/v8-fast-api-calls.h",
2318     "include/v8-internal.h",
2319     "include/v8-profiler.h",
2320     "include/v8-util.h",
2321     "include/v8.h",
2322   ]
2323
2324   sources += [
2325     # The following headers cannot be platform-specific. The include validation
2326     # of `gn gen $dir --check` requires all header files to be available on all
2327     # platforms.
2328     "include/v8-wasm-trap-handler-posix.h",
2329     "include/v8-wasm-trap-handler-win.h",
2330   ]
2331
2332   public_deps = [ ":v8_config_headers" ]
2333
2334   deps = [
2335     ":cppgc_headers",
2336     ":v8_version",
2337   ]
2338 }
2339
2340 if (v8_generate_external_defines_header) {
2341   action("gen_v8_gn") {
2342     visibility = [ ":*" ]
2343
2344     script = "tools/gen-v8-gn.py"
2345     outputs = [ "$target_gen_dir/include/v8-gn.h" ]
2346
2347     args = [
2348       "-o",
2349       rebase_path("$target_gen_dir/include/v8-gn.h", root_build_dir),
2350     ]
2351     foreach(define, enabled_external_defines) {
2352       args += [
2353         "-p",
2354         define,
2355       ]
2356     }
2357     foreach(define, disabled_external_defines) {
2358       args += [
2359         "-n",
2360         define,
2361       ]
2362     }
2363   }
2364 }
2365
2366 # This is split out to share basic headers with Torque and everything else:(
2367 v8_header_set("v8_shared_internal_headers") {
2368   visibility = [
2369     ":*",
2370     "test/*",
2371     "tools/*",
2372   ]
2373   configs = [ ":internal_config" ]
2374
2375   sources = [
2376     "src/common/globals.h",
2377     "src/wasm/wasm-constants.h",
2378     "src/wasm/wasm-limits.h",
2379   ]
2380
2381   deps = [
2382     ":v8_headers",
2383     ":v8_libbase",
2384   ]
2385 }
2386
2387 v8_header_set("v8_flags") {
2388   visibility = [
2389     ":*",
2390     "tools/*",
2391   ]
2392
2393   configs = [ ":internal_config" ]
2394
2395   sources = [
2396     "src/flags/flag-definitions.h",
2397     "src/flags/flags.h",
2398   ]
2399
2400   deps = [ ":v8_shared_internal_headers" ]
2401 }
2402
2403 v8_header_set("v8_internal_headers") {
2404   configs = [ ":internal_config" ]
2405
2406   sources = [
2407     ### gcmole(all) ###
2408     "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
2409     "//base/trace_event/common/trace_event_common.h",
2410     "include/cppgc/common.h",
2411     "include/v8-inspector-protocol.h",
2412     "include/v8-inspector.h",
2413     "include/v8-metrics.h",
2414     "include/v8-unwinder-state.h",
2415     "include/v8-wasm-trap-handler-posix.h",
2416     "src/api/api-arguments-inl.h",
2417     "src/api/api-arguments.h",
2418     "src/api/api-inl.h",
2419     "src/api/api-macros-undef.h",
2420     "src/api/api-macros.h",
2421     "src/api/api-natives.h",
2422     "src/api/api.h",
2423     "src/ast/ast-function-literal-id-reindexer.h",
2424     "src/ast/ast-source-ranges.h",
2425     "src/ast/ast-traversal-visitor.h",
2426     "src/ast/ast-value-factory.h",
2427     "src/ast/ast.h",
2428     "src/ast/modules.h",
2429     "src/ast/prettyprinter.h",
2430     "src/ast/scopes.h",
2431     "src/ast/source-range-ast-visitor.h",
2432     "src/ast/variables.h",
2433     "src/baseline/baseline-assembler-inl.h",
2434     "src/baseline/baseline-assembler.h",
2435     "src/baseline/baseline-batch-compiler.h",
2436     "src/baseline/baseline-compiler.h",
2437     "src/baseline/baseline.h",
2438     "src/baseline/bytecode-offset-iterator.h",
2439     "src/builtins/accessors.h",
2440     "src/builtins/builtins-constructor.h",
2441     "src/builtins/builtins-definitions.h",
2442     "src/builtins/builtins-descriptors.h",
2443     "src/builtins/builtins-promise.h",
2444     "src/builtins/builtins-utils-inl.h",
2445     "src/builtins/builtins-utils.h",
2446     "src/builtins/builtins.h",
2447     "src/builtins/constants-table-builder.h",
2448     "src/builtins/profile-data-reader.h",
2449     "src/codegen/aligned-slot-allocator.h",
2450     "src/codegen/assembler-arch.h",
2451     "src/codegen/assembler-inl.h",
2452     "src/codegen/assembler.h",
2453     "src/codegen/bailout-reason.h",
2454     "src/codegen/callable.h",
2455     "src/codegen/code-comments.h",
2456     "src/codegen/code-desc.h",
2457     "src/codegen/code-factory.h",
2458     "src/codegen/code-reference.h",
2459     "src/codegen/compilation-cache.h",
2460     "src/codegen/compiler.h",
2461     "src/codegen/constant-pool.h",
2462     "src/codegen/constants-arch.h",
2463     "src/codegen/cpu-features.h",
2464     "src/codegen/external-reference-encoder.h",
2465     "src/codegen/external-reference-table.h",
2466     "src/codegen/external-reference.h",
2467     "src/codegen/flush-instruction-cache.h",
2468     "src/codegen/handler-table.h",
2469     "src/codegen/interface-descriptors-inl.h",
2470     "src/codegen/interface-descriptors.h",
2471     "src/codegen/label.h",
2472     "src/codegen/machine-type.h",
2473     "src/codegen/macro-assembler-inl.h",
2474     "src/codegen/macro-assembler.h",
2475     "src/codegen/optimized-compilation-info.h",
2476     "src/codegen/pending-optimization-table.h",
2477     "src/codegen/register-arch.h",
2478     "src/codegen/register-configuration.h",
2479     "src/codegen/register.h",
2480     "src/codegen/reglist.h",
2481     "src/codegen/reloc-info.h",
2482     "src/codegen/safepoint-table.h",
2483     "src/codegen/script-details.h",
2484     "src/codegen/signature.h",
2485     "src/codegen/source-position-table.h",
2486     "src/codegen/source-position.h",
2487     "src/codegen/string-constants.h",
2488     "src/codegen/tick-counter.h",
2489     "src/codegen/tnode.h",
2490     "src/codegen/turbo-assembler.h",
2491     "src/codegen/unoptimized-compilation-info.h",
2492     "src/common/assert-scope.h",
2493     "src/common/checks.h",
2494     "src/common/external-pointer-inl.h",
2495     "src/common/external-pointer.h",
2496     "src/common/message-template.h",
2497     "src/common/ptr-compr-inl.h",
2498     "src/common/ptr-compr.h",
2499     "src/compiler-dispatcher/lazy-compile-dispatcher.h",
2500     "src/compiler-dispatcher/optimizing-compile-dispatcher.h",
2501     "src/compiler/access-builder.h",
2502     "src/compiler/access-info.h",
2503     "src/compiler/add-type-assertions-reducer.h",
2504     "src/compiler/all-nodes.h",
2505     "src/compiler/allocation-builder-inl.h",
2506     "src/compiler/allocation-builder.h",
2507     "src/compiler/backend/code-generator-impl.h",
2508     "src/compiler/backend/code-generator.h",
2509     "src/compiler/backend/frame-elider.h",
2510     "src/compiler/backend/gap-resolver.h",
2511     "src/compiler/backend/instruction-codes.h",
2512     "src/compiler/backend/instruction-scheduler.h",
2513     "src/compiler/backend/instruction-selector-impl.h",
2514     "src/compiler/backend/instruction-selector.h",
2515     "src/compiler/backend/instruction.h",
2516     "src/compiler/backend/jump-threading.h",
2517     "src/compiler/backend/mid-tier-register-allocator.h",
2518     "src/compiler/backend/move-optimizer.h",
2519     "src/compiler/backend/register-allocation.h",
2520     "src/compiler/backend/register-allocator-verifier.h",
2521     "src/compiler/backend/register-allocator.h",
2522     "src/compiler/backend/spill-placer.h",
2523     "src/compiler/backend/unwinding-info-writer.h",
2524     "src/compiler/basic-block-instrumentor.h",
2525     "src/compiler/branch-elimination.h",
2526     "src/compiler/bytecode-analysis.h",
2527     "src/compiler/bytecode-graph-builder.h",
2528     "src/compiler/bytecode-liveness-map.h",
2529     "src/compiler/checkpoint-elimination.h",
2530     "src/compiler/code-assembler.h",
2531     "src/compiler/common-node-cache.h",
2532     "src/compiler/common-operator-reducer.h",
2533     "src/compiler/common-operator.h",
2534     "src/compiler/compilation-dependencies.h",
2535     "src/compiler/compilation-dependency.h",
2536     "src/compiler/compiler-source-position-table.h",
2537     "src/compiler/constant-folding-reducer.h",
2538     "src/compiler/control-equivalence.h",
2539     "src/compiler/control-flow-optimizer.h",
2540     "src/compiler/csa-load-elimination.h",
2541     "src/compiler/dead-code-elimination.h",
2542     "src/compiler/decompression-optimizer.h",
2543     "src/compiler/diamond.h",
2544     "src/compiler/effect-control-linearizer.h",
2545     "src/compiler/escape-analysis-reducer.h",
2546     "src/compiler/escape-analysis.h",
2547     "src/compiler/fast-api-calls.h",
2548     "src/compiler/feedback-source.h",
2549     "src/compiler/frame-states.h",
2550     "src/compiler/frame.h",
2551     "src/compiler/functional-list.h",
2552     "src/compiler/globals.h",
2553     "src/compiler/graph-assembler.h",
2554     "src/compiler/graph-reducer.h",
2555     "src/compiler/graph-trimmer.h",
2556     "src/compiler/graph-visualizer.h",
2557     "src/compiler/graph-zone-traits.h",
2558     "src/compiler/graph.h",
2559     "src/compiler/heap-refs.h",
2560     "src/compiler/js-call-reducer.h",
2561     "src/compiler/js-context-specialization.h",
2562     "src/compiler/js-create-lowering.h",
2563     "src/compiler/js-generic-lowering.h",
2564     "src/compiler/js-graph.h",
2565     "src/compiler/js-heap-broker.h",
2566     "src/compiler/js-heap-copy-reducer.h",
2567     "src/compiler/js-inlining-heuristic.h",
2568     "src/compiler/js-inlining.h",
2569     "src/compiler/js-intrinsic-lowering.h",
2570     "src/compiler/js-native-context-specialization.h",
2571     "src/compiler/js-operator.h",
2572     "src/compiler/js-type-hint-lowering.h",
2573     "src/compiler/js-typed-lowering.h",
2574     "src/compiler/linkage.h",
2575     "src/compiler/load-elimination.h",
2576     "src/compiler/loop-analysis.h",
2577     "src/compiler/loop-peeling.h",
2578     "src/compiler/loop-unrolling.h",
2579     "src/compiler/loop-variable-optimizer.h",
2580     "src/compiler/machine-graph-verifier.h",
2581     "src/compiler/machine-graph.h",
2582     "src/compiler/machine-operator-reducer.h",
2583     "src/compiler/machine-operator.h",
2584     "src/compiler/map-inference.h",
2585     "src/compiler/memory-lowering.h",
2586     "src/compiler/memory-optimizer.h",
2587     "src/compiler/node-aux-data.h",
2588     "src/compiler/node-cache.h",
2589     "src/compiler/node-marker.h",
2590     "src/compiler/node-matchers.h",
2591     "src/compiler/node-observer.h",
2592     "src/compiler/node-origin-table.h",
2593     "src/compiler/node-properties.h",
2594     "src/compiler/node.h",
2595     "src/compiler/opcodes.h",
2596     "src/compiler/operation-typer.h",
2597     "src/compiler/operator-properties.h",
2598     "src/compiler/operator.h",
2599     "src/compiler/osr.h",
2600     "src/compiler/per-isolate-compiler-cache.h",
2601     "src/compiler/persistent-map.h",
2602     "src/compiler/pipeline-statistics.h",
2603     "src/compiler/pipeline.h",
2604     "src/compiler/processed-feedback.h",
2605     "src/compiler/property-access-builder.h",
2606     "src/compiler/raw-machine-assembler.h",
2607     "src/compiler/redundancy-elimination.h",
2608     "src/compiler/refs-map.h",
2609     "src/compiler/representation-change.h",
2610     "src/compiler/schedule.h",
2611     "src/compiler/scheduler.h",
2612     "src/compiler/select-lowering.h",
2613     "src/compiler/simplified-lowering.h",
2614     "src/compiler/simplified-operator-reducer.h",
2615     "src/compiler/simplified-operator.h",
2616     "src/compiler/state-values-utils.h",
2617     "src/compiler/store-store-elimination.h",
2618     "src/compiler/type-cache.h",
2619     "src/compiler/type-narrowing-reducer.h",
2620     "src/compiler/typed-optimization.h",
2621     "src/compiler/typer.h",
2622     "src/compiler/types.h",
2623     "src/compiler/value-numbering-reducer.h",
2624     "src/compiler/verifier.h",
2625     "src/compiler/write-barrier-kind.h",
2626     "src/compiler/zone-stats.h",
2627     "src/date/date.h",
2628     "src/date/dateparser-inl.h",
2629     "src/date/dateparser.h",
2630     "src/debug/debug-coverage.h",
2631     "src/debug/debug-evaluate.h",
2632     "src/debug/debug-frames.h",
2633     "src/debug/debug-interface.h",
2634     "src/debug/debug-property-iterator.h",
2635     "src/debug/debug-scope-iterator.h",
2636     "src/debug/debug-scopes.h",
2637     "src/debug/debug-stack-trace-iterator.h",
2638     "src/debug/debug-type-profile.h",
2639     "src/debug/debug.h",
2640     "src/debug/interface-types.h",
2641     "src/debug/liveedit.h",
2642     "src/deoptimizer/deoptimize-reason.h",
2643     "src/deoptimizer/deoptimized-frame-info.h",
2644     "src/deoptimizer/deoptimizer.h",
2645     "src/deoptimizer/frame-description.h",
2646     "src/deoptimizer/materialized-object-store.h",
2647     "src/deoptimizer/translated-state.h",
2648     "src/deoptimizer/translation-array.h",
2649     "src/deoptimizer/translation-opcode.h",
2650     "src/diagnostics/basic-block-profiler.h",
2651     "src/diagnostics/code-tracer.h",
2652     "src/diagnostics/compilation-statistics.h",
2653     "src/diagnostics/disasm.h",
2654     "src/diagnostics/disassembler.h",
2655     "src/diagnostics/eh-frame.h",
2656     "src/diagnostics/gdb-jit.h",
2657     "src/diagnostics/perf-jit.h",
2658     "src/diagnostics/unwinder.h",
2659     "src/execution/arguments-inl.h",
2660     "src/execution/arguments.h",
2661     "src/execution/execution.h",
2662     "src/execution/external-pointer-table.h",
2663     "src/execution/frame-constants.h",
2664     "src/execution/frames-inl.h",
2665     "src/execution/frames.h",
2666     "src/execution/futex-emulation.h",
2667     "src/execution/interrupts-scope.h",
2668     "src/execution/isolate-data.h",
2669     "src/execution/isolate-inl.h",
2670     "src/execution/isolate-utils-inl.h",
2671     "src/execution/isolate-utils.h",
2672     "src/execution/isolate.h",
2673     "src/execution/local-isolate-inl.h",
2674     "src/execution/local-isolate.h",
2675     "src/execution/messages.h",
2676     "src/execution/microtask-queue.h",
2677     "src/execution/pointer-authentication.h",
2678     "src/execution/protectors-inl.h",
2679     "src/execution/protectors.h",
2680     "src/execution/runtime-profiler.h",
2681     "src/execution/shared-mutex-guard-if-off-thread.h",
2682     "src/execution/simulator-base.h",
2683     "src/execution/simulator.h",
2684     "src/execution/stack-guard.h",
2685     "src/execution/thread-id.h",
2686     "src/execution/thread-local-top.h",
2687     "src/execution/v8threads.h",
2688     "src/execution/vm-state-inl.h",
2689     "src/execution/vm-state.h",
2690     "src/extensions/cputracemark-extension.h",
2691     "src/extensions/externalize-string-extension.h",
2692     "src/extensions/gc-extension.h",
2693     "src/extensions/ignition-statistics-extension.h",
2694     "src/extensions/statistics-extension.h",
2695     "src/extensions/trigger-failure-extension.h",
2696     "src/handles/global-handles.h",
2697     "src/handles/handles-inl.h",
2698     "src/handles/handles.h",
2699     "src/handles/local-handles-inl.h",
2700     "src/handles/local-handles.h",
2701     "src/handles/maybe-handles-inl.h",
2702     "src/handles/maybe-handles.h",
2703     "src/handles/persistent-handles.h",
2704     "src/heap/allocation-observer.h",
2705     "src/heap/allocation-stats.h",
2706     "src/heap/array-buffer-sweeper.h",
2707     "src/heap/barrier.h",
2708     "src/heap/base-space.h",
2709     "src/heap/basic-memory-chunk.h",
2710     "src/heap/code-object-registry.h",
2711     "src/heap/code-range.h",
2712     "src/heap/code-stats.h",
2713     "src/heap/collection-barrier.h",
2714     "src/heap/combined-heap.h",
2715     "src/heap/concurrent-allocator-inl.h",
2716     "src/heap/concurrent-allocator.h",
2717     "src/heap/concurrent-marking.h",
2718     "src/heap/cppgc-js/cpp-heap.h",
2719     "src/heap/cppgc-js/cpp-snapshot.h",
2720     "src/heap/cppgc-js/unified-heap-marking-state.h",
2721     "src/heap/cppgc-js/unified-heap-marking-verifier.h",
2722     "src/heap/cppgc-js/unified-heap-marking-visitor.h",
2723     "src/heap/embedder-tracing.h",
2724     "src/heap/factory-base-inl.h",
2725     "src/heap/factory-base.h",
2726     "src/heap/factory-inl.h",
2727     "src/heap/factory.h",
2728     "src/heap/finalization-registry-cleanup-task.h",
2729     "src/heap/free-list-inl.h",
2730     "src/heap/free-list.h",
2731     "src/heap/gc-idle-time-handler.h",
2732     "src/heap/gc-tracer.h",
2733     "src/heap/heap-controller.h",
2734     "src/heap/heap-inl.h",
2735     "src/heap/heap-write-barrier-inl.h",
2736     "src/heap/heap-write-barrier.h",
2737     "src/heap/heap.h",
2738     "src/heap/incremental-marking-inl.h",
2739     "src/heap/incremental-marking-job.h",
2740     "src/heap/incremental-marking.h",
2741     "src/heap/index-generator.h",
2742     "src/heap/invalidated-slots-inl.h",
2743     "src/heap/invalidated-slots.h",
2744     "src/heap/large-spaces.h",
2745     "src/heap/linear-allocation-area.h",
2746     "src/heap/list.h",
2747     "src/heap/local-allocator-inl.h",
2748     "src/heap/local-allocator.h",
2749     "src/heap/local-factory-inl.h",
2750     "src/heap/local-factory.h",
2751     "src/heap/local-heap-inl.h",
2752     "src/heap/local-heap.h",
2753     "src/heap/mark-compact-inl.h",
2754     "src/heap/mark-compact.h",
2755     "src/heap/marking-barrier-inl.h",
2756     "src/heap/marking-barrier.h",
2757     "src/heap/marking-visitor-inl.h",
2758     "src/heap/marking-visitor.h",
2759     "src/heap/marking-worklist-inl.h",
2760     "src/heap/marking-worklist.h",
2761     "src/heap/marking.h",
2762     "src/heap/memory-allocator.h",
2763     "src/heap/memory-chunk-inl.h",
2764     "src/heap/memory-chunk-layout.h",
2765     "src/heap/memory-chunk.h",
2766     "src/heap/memory-measurement-inl.h",
2767     "src/heap/memory-measurement.h",
2768     "src/heap/memory-reducer.h",
2769     "src/heap/new-spaces-inl.h",
2770     "src/heap/new-spaces.h",
2771     "src/heap/object-stats.h",
2772     "src/heap/objects-visiting-inl.h",
2773     "src/heap/objects-visiting.h",
2774     "src/heap/paged-spaces-inl.h",
2775     "src/heap/paged-spaces.h",
2776     "src/heap/parallel-work-item.h",
2777     "src/heap/parked-scope.h",
2778     "src/heap/read-only-heap-inl.h",
2779     "src/heap/read-only-heap.h",
2780     "src/heap/read-only-spaces.h",
2781     "src/heap/remembered-set-inl.h",
2782     "src/heap/remembered-set.h",
2783     "src/heap/safepoint.h",
2784     "src/heap/scavenge-job.h",
2785     "src/heap/scavenger-inl.h",
2786     "src/heap/scavenger.h",
2787     "src/heap/slot-set.h",
2788     "src/heap/spaces-inl.h",
2789     "src/heap/spaces.h",
2790     "src/heap/stress-marking-observer.h",
2791     "src/heap/stress-scavenge-observer.h",
2792     "src/heap/sweeper.h",
2793     "src/heap/weak-object-worklists.h",
2794     "src/heap/worklist.h",
2795     "src/ic/call-optimization.h",
2796     "src/ic/handler-configuration-inl.h",
2797     "src/ic/handler-configuration.h",
2798     "src/ic/ic-inl.h",
2799     "src/ic/ic-stats.h",
2800     "src/ic/ic.h",
2801     "src/ic/stub-cache.h",
2802     "src/init/bootstrapper.h",
2803     "src/init/heap-symbols.h",
2804     "src/init/icu_util.h",
2805     "src/init/isolate-allocator.h",
2806     "src/init/setup-isolate.h",
2807     "src/init/startup-data-util.h",
2808     "src/init/v8.h",
2809     "src/interpreter/block-coverage-builder.h",
2810     "src/interpreter/bytecode-array-builder.h",
2811     "src/interpreter/bytecode-array-iterator.h",
2812     "src/interpreter/bytecode-array-random-iterator.h",
2813     "src/interpreter/bytecode-array-writer.h",
2814     "src/interpreter/bytecode-decoder.h",
2815     "src/interpreter/bytecode-flags.h",
2816     "src/interpreter/bytecode-generator.h",
2817     "src/interpreter/bytecode-jump-table.h",
2818     "src/interpreter/bytecode-label.h",
2819     "src/interpreter/bytecode-node.h",
2820     "src/interpreter/bytecode-operands.h",
2821     "src/interpreter/bytecode-register-allocator.h",
2822     "src/interpreter/bytecode-register-optimizer.h",
2823     "src/interpreter/bytecode-register.h",
2824     "src/interpreter/bytecode-source-info.h",
2825     "src/interpreter/bytecode-traits.h",
2826     "src/interpreter/bytecodes.h",
2827     "src/interpreter/constant-array-builder.h",
2828     "src/interpreter/control-flow-builders.h",
2829     "src/interpreter/handler-table-builder.h",
2830     "src/interpreter/interpreter-generator.h",
2831     "src/interpreter/interpreter-intrinsics.h",
2832     "src/interpreter/interpreter.h",
2833     "src/json/json-parser.h",
2834     "src/json/json-stringifier.h",
2835     "src/libsampler/sampler.h",
2836     "src/logging/code-events.h",
2837     "src/logging/counters-definitions.h",
2838     "src/logging/counters-scopes.h",
2839     "src/logging/counters.h",
2840     "src/logging/local-logger.h",
2841     "src/logging/log-inl.h",
2842     "src/logging/log-utils.h",
2843     "src/logging/log.h",
2844     "src/logging/metrics.h",
2845     "src/logging/runtime-call-stats-scope.h",
2846     "src/logging/runtime-call-stats.h",
2847     "src/logging/tracing-flags.h",
2848     "src/numbers/conversions-inl.h",
2849     "src/numbers/conversions.h",
2850     "src/numbers/hash-seed-inl.h",
2851     "src/numbers/math-random.h",
2852     "src/objects/all-objects-inl.h",
2853     "src/objects/allocation-site-inl.h",
2854     "src/objects/allocation-site-scopes-inl.h",
2855     "src/objects/allocation-site-scopes.h",
2856     "src/objects/allocation-site.h",
2857     "src/objects/api-callbacks-inl.h",
2858     "src/objects/api-callbacks.h",
2859     "src/objects/arguments-inl.h",
2860     "src/objects/arguments.h",
2861     "src/objects/backing-store.h",
2862     "src/objects/bigint-inl.h",
2863     "src/objects/bigint.h",
2864     "src/objects/cell-inl.h",
2865     "src/objects/cell.h",
2866     "src/objects/code-inl.h",
2867     "src/objects/code-kind.h",
2868     "src/objects/code.h",
2869     "src/objects/compilation-cache-table-inl.h",
2870     "src/objects/compilation-cache-table.h",
2871     "src/objects/compressed-slots-inl.h",
2872     "src/objects/compressed-slots.h",
2873     "src/objects/contexts-inl.h",
2874     "src/objects/contexts.h",
2875     "src/objects/data-handler-inl.h",
2876     "src/objects/data-handler.h",
2877     "src/objects/debug-objects-inl.h",
2878     "src/objects/debug-objects.h",
2879     "src/objects/descriptor-array-inl.h",
2880     "src/objects/descriptor-array.h",
2881     "src/objects/dictionary-inl.h",
2882     "src/objects/dictionary.h",
2883     "src/objects/elements-inl.h",
2884     "src/objects/elements-kind.h",
2885     "src/objects/elements.h",
2886     "src/objects/embedder-data-array-inl.h",
2887     "src/objects/embedder-data-array.h",
2888     "src/objects/embedder-data-slot-inl.h",
2889     "src/objects/embedder-data-slot.h",
2890     "src/objects/feedback-cell-inl.h",
2891     "src/objects/feedback-cell.h",
2892     "src/objects/feedback-vector-inl.h",
2893     "src/objects/feedback-vector.h",
2894     "src/objects/field-index-inl.h",
2895     "src/objects/field-index.h",
2896     "src/objects/field-type.h",
2897     "src/objects/fixed-array-inl.h",
2898     "src/objects/fixed-array.h",
2899     "src/objects/foreign-inl.h",
2900     "src/objects/foreign.h",
2901     "src/objects/free-space-inl.h",
2902     "src/objects/free-space.h",
2903     "src/objects/function-kind.h",
2904     "src/objects/function-syntax-kind.h",
2905     "src/objects/hash-table-inl.h",
2906     "src/objects/hash-table.h",
2907     "src/objects/heap-number-inl.h",
2908     "src/objects/heap-number.h",
2909     "src/objects/heap-object-inl.h",
2910     "src/objects/heap-object.h",
2911     "src/objects/instance-type-inl.h",
2912     "src/objects/instance-type.h",
2913     "src/objects/internal-index.h",
2914     "src/objects/js-array-buffer-inl.h",
2915     "src/objects/js-array-buffer.h",
2916     "src/objects/js-array-inl.h",
2917     "src/objects/js-array.h",
2918     "src/objects/js-collection-inl.h",
2919     "src/objects/js-collection-iterator-inl.h",
2920     "src/objects/js-collection-iterator.h",
2921     "src/objects/js-collection.h",
2922     "src/objects/js-function-inl.h",
2923     "src/objects/js-function.h",
2924     "src/objects/js-generator-inl.h",
2925     "src/objects/js-generator.h",
2926     "src/objects/js-objects-inl.h",
2927     "src/objects/js-objects.h",
2928     "src/objects/js-promise-inl.h",
2929     "src/objects/js-promise.h",
2930     "src/objects/js-proxy-inl.h",
2931     "src/objects/js-proxy.h",
2932     "src/objects/js-regexp-inl.h",
2933     "src/objects/js-regexp-string-iterator-inl.h",
2934     "src/objects/js-regexp-string-iterator.h",
2935     "src/objects/js-regexp.h",
2936     "src/objects/js-segments-inl.h",
2937     "src/objects/js-segments.h",
2938     "src/objects/js-weak-refs-inl.h",
2939     "src/objects/js-weak-refs.h",
2940     "src/objects/keys.h",
2941     "src/objects/literal-objects-inl.h",
2942     "src/objects/literal-objects.h",
2943     "src/objects/lookup-cache-inl.h",
2944     "src/objects/lookup-cache.h",
2945     "src/objects/lookup-inl.h",
2946     "src/objects/lookup.h",
2947     "src/objects/managed.h",
2948     "src/objects/map-inl.h",
2949     "src/objects/map-updater.h",
2950     "src/objects/map.h",
2951     "src/objects/maybe-object-inl.h",
2952     "src/objects/maybe-object.h",
2953     "src/objects/megadom-handler-inl.h",
2954     "src/objects/megadom-handler.h",
2955     "src/objects/microtask-inl.h",
2956     "src/objects/microtask.h",
2957     "src/objects/module-inl.h",
2958     "src/objects/module.h",
2959     "src/objects/name-inl.h",
2960     "src/objects/name.h",
2961     "src/objects/object-list-macros.h",
2962     "src/objects/object-macros-undef.h",
2963     "src/objects/object-macros.h",
2964     "src/objects/object-type.h",
2965     "src/objects/objects-body-descriptors-inl.h",
2966     "src/objects/objects-body-descriptors.h",
2967     "src/objects/objects-definitions.h",
2968     "src/objects/objects-inl.h",
2969     "src/objects/objects.h",
2970     "src/objects/oddball-inl.h",
2971     "src/objects/oddball.h",
2972     "src/objects/ordered-hash-table-inl.h",
2973     "src/objects/ordered-hash-table.h",
2974     "src/objects/osr-optimized-code-cache-inl.h",
2975     "src/objects/osr-optimized-code-cache.h",
2976     "src/objects/primitive-heap-object-inl.h",
2977     "src/objects/primitive-heap-object.h",
2978     "src/objects/promise-inl.h",
2979     "src/objects/promise.h",
2980     "src/objects/property-array-inl.h",
2981     "src/objects/property-array.h",
2982     "src/objects/property-cell-inl.h",
2983     "src/objects/property-cell.h",
2984     "src/objects/property-descriptor-object-inl.h",
2985     "src/objects/property-descriptor-object.h",
2986     "src/objects/property-descriptor.h",
2987     "src/objects/property-details.h",
2988     "src/objects/property.h",
2989     "src/objects/prototype-info-inl.h",
2990     "src/objects/prototype-info.h",
2991     "src/objects/prototype-inl.h",
2992     "src/objects/prototype.h",
2993     "src/objects/regexp-match-info.h",
2994     "src/objects/scope-info-inl.h",
2995     "src/objects/scope-info.h",
2996     "src/objects/script-inl.h",
2997     "src/objects/script.h",
2998     "src/objects/shared-function-info-inl.h",
2999     "src/objects/shared-function-info.h",
3000     "src/objects/slots-atomic-inl.h",
3001     "src/objects/slots-inl.h",
3002     "src/objects/slots.h",
3003     "src/objects/smi-inl.h",
3004     "src/objects/smi.h",
3005     "src/objects/source-text-module-inl.h",
3006     "src/objects/source-text-module.h",
3007     "src/objects/stack-frame-info-inl.h",
3008     "src/objects/stack-frame-info.h",
3009     "src/objects/string-comparator.h",
3010     "src/objects/string-inl.h",
3011     "src/objects/string-set-inl.h",
3012     "src/objects/string-set.h",
3013     "src/objects/string-table-inl.h",
3014     "src/objects/string-table.h",
3015     "src/objects/string.h",
3016     "src/objects/struct-inl.h",
3017     "src/objects/struct.h",
3018     "src/objects/swiss-hash-table-helpers.h",
3019     "src/objects/swiss-name-dictionary-inl.h",
3020     "src/objects/swiss-name-dictionary.h",
3021     "src/objects/synthetic-module-inl.h",
3022     "src/objects/synthetic-module.h",
3023     "src/objects/tagged-field-inl.h",
3024     "src/objects/tagged-field.h",
3025     "src/objects/tagged-impl-inl.h",
3026     "src/objects/tagged-impl.h",
3027     "src/objects/tagged-index.h",
3028     "src/objects/tagged-value-inl.h",
3029     "src/objects/tagged-value.h",
3030     "src/objects/template-objects-inl.h",
3031     "src/objects/template-objects.h",
3032     "src/objects/templates-inl.h",
3033     "src/objects/templates.h",
3034     "src/objects/torque-defined-classes-inl.h",
3035     "src/objects/torque-defined-classes.h",
3036     "src/objects/transitions-inl.h",
3037     "src/objects/transitions.h",
3038     "src/objects/type-hints.h",
3039     "src/objects/value-serializer.h",
3040     "src/objects/visitors.h",
3041     "src/parsing/expression-scope.h",
3042     "src/parsing/func-name-inferrer.h",
3043     "src/parsing/import-assertions.h",
3044     "src/parsing/keywords-gen.h",
3045     "src/parsing/literal-buffer.h",
3046     "src/parsing/parse-info.h",
3047     "src/parsing/parser-base.h",
3048     "src/parsing/parser.h",
3049     "src/parsing/parsing.h",
3050     "src/parsing/pending-compilation-error-handler.h",
3051     "src/parsing/preparse-data-impl.h",
3052     "src/parsing/preparse-data.h",
3053     "src/parsing/preparser-logger.h",
3054     "src/parsing/preparser.h",
3055     "src/parsing/rewriter.h",
3056     "src/parsing/scanner-character-streams.h",
3057     "src/parsing/scanner-inl.h",
3058     "src/parsing/scanner.h",
3059     "src/parsing/token.h",
3060     "src/profiler/allocation-tracker.h",
3061     "src/profiler/circular-queue-inl.h",
3062     "src/profiler/circular-queue.h",
3063     "src/profiler/cpu-profiler-inl.h",
3064     "src/profiler/cpu-profiler.h",
3065     "src/profiler/heap-profiler.h",
3066     "src/profiler/heap-snapshot-generator-inl.h",
3067     "src/profiler/heap-snapshot-generator.h",
3068     "src/profiler/profile-generator-inl.h",
3069     "src/profiler/profile-generator.h",
3070     "src/profiler/profiler-listener.h",
3071     "src/profiler/profiler-stats.h",
3072     "src/profiler/sampling-heap-profiler.h",
3073     "src/profiler/strings-storage.h",
3074     "src/profiler/symbolizer.h",
3075     "src/profiler/tick-sample.h",
3076     "src/profiler/tracing-cpu-profiler.h",
3077     "src/profiler/weak-code-registry.h",
3078     "src/regexp/experimental/experimental-bytecode.h",
3079     "src/regexp/experimental/experimental-compiler.h",
3080     "src/regexp/experimental/experimental-interpreter.h",
3081     "src/regexp/experimental/experimental.h",
3082     "src/regexp/property-sequences.h",
3083     "src/regexp/regexp-ast.h",
3084     "src/regexp/regexp-bytecode-generator-inl.h",
3085     "src/regexp/regexp-bytecode-generator.h",
3086     "src/regexp/regexp-bytecode-peephole.h",
3087     "src/regexp/regexp-bytecodes.h",
3088     "src/regexp/regexp-compiler.h",
3089     "src/regexp/regexp-dotprinter.h",
3090     "src/regexp/regexp-error.h",
3091     "src/regexp/regexp-interpreter.h",
3092     "src/regexp/regexp-macro-assembler-arch.h",
3093     "src/regexp/regexp-macro-assembler-tracer.h",
3094     "src/regexp/regexp-macro-assembler.h",
3095     "src/regexp/regexp-nodes.h",
3096     "src/regexp/regexp-parser.h",
3097     "src/regexp/regexp-stack.h",
3098     "src/regexp/regexp-utils.h",
3099     "src/regexp/regexp.h",
3100     "src/regexp/special-case.h",
3101     "src/roots/roots-inl.h",
3102     "src/roots/roots.h",
3103     "src/runtime/runtime-utils.h",
3104     "src/runtime/runtime.h",
3105     "src/snapshot/code-serializer.h",
3106     "src/snapshot/context-deserializer.h",
3107     "src/snapshot/context-serializer.h",
3108     "src/snapshot/deserializer.h",
3109     "src/snapshot/embedded/embedded-data.h",
3110     "src/snapshot/embedded/embedded-file-writer-interface.h",
3111     "src/snapshot/object-deserializer.h",
3112     "src/snapshot/read-only-deserializer.h",
3113     "src/snapshot/read-only-serializer.h",
3114     "src/snapshot/references.h",
3115     "src/snapshot/roots-serializer.h",
3116     "src/snapshot/serializer-deserializer.h",
3117     "src/snapshot/serializer.h",
3118     "src/snapshot/snapshot-compression.h",
3119     "src/snapshot/snapshot-data.h",
3120     "src/snapshot/snapshot-source-sink.h",
3121     "src/snapshot/snapshot-utils.h",
3122     "src/snapshot/snapshot.h",
3123     "src/snapshot/startup-deserializer.h",
3124     "src/snapshot/startup-serializer.h",
3125     "src/strings/char-predicates-inl.h",
3126     "src/strings/char-predicates.h",
3127     "src/strings/string-builder-inl.h",
3128     "src/strings/string-case.h",
3129     "src/strings/string-hasher-inl.h",
3130     "src/strings/string-hasher.h",
3131     "src/strings/string-search.h",
3132     "src/strings/string-stream.h",
3133     "src/strings/unicode-decoder.h",
3134     "src/strings/unicode-inl.h",
3135     "src/strings/unicode.h",
3136     "src/strings/uri.h",
3137     "src/tasks/cancelable-task.h",
3138     "src/tasks/operations-barrier.h",
3139     "src/tasks/task-utils.h",
3140     "src/third_party/siphash/halfsiphash.h",
3141     "src/third_party/utf8-decoder/utf8-decoder.h",
3142     "src/torque/runtime-macro-shims.h",
3143     "src/tracing/trace-event.h",
3144     "src/tracing/traced-value.h",
3145     "src/tracing/tracing-category-observer.h",
3146     "src/utils/address-map.h",
3147     "src/utils/allocation.h",
3148     "src/utils/bit-vector.h",
3149     "src/utils/boxed-float.h",
3150     "src/utils/detachable-vector.h",
3151     "src/utils/identity-map.h",
3152     "src/utils/locked-queue-inl.h",
3153     "src/utils/locked-queue.h",
3154     "src/utils/memcopy.h",
3155     "src/utils/ostreams.h",
3156     "src/utils/pointer-with-payload.h",
3157     "src/utils/scoped-list.h",
3158     "src/utils/utils-inl.h",
3159     "src/utils/utils.h",
3160     "src/utils/version.h",
3161     "src/zone/accounting-allocator.h",
3162     "src/zone/compressed-zone-ptr.h",
3163     "src/zone/type-stats.h",
3164     "src/zone/zone-allocator.h",
3165     "src/zone/zone-chunk-list.h",
3166     "src/zone/zone-compression.h",
3167     "src/zone/zone-containers.h",
3168     "src/zone/zone-handle-set.h",
3169     "src/zone/zone-hashmap.h",
3170     "src/zone/zone-list-inl.h",
3171     "src/zone/zone-list.h",
3172     "src/zone/zone-segment.h",
3173     "src/zone/zone-type-traits.h",
3174     "src/zone/zone-utils.h",
3175     "src/zone/zone.h",
3176   ]
3177
3178   if (v8_use_perfetto) {
3179     sources -= [ "//base/trace_event/common/trace_event_common.h" ]
3180   }
3181
3182   if (v8_enable_webassembly) {
3183     sources += [
3184       "src/asmjs/asm-js.h",
3185       "src/asmjs/asm-names.h",
3186       "src/asmjs/asm-parser.h",
3187       "src/asmjs/asm-scanner.h",
3188       "src/asmjs/asm-types.h",
3189       "src/compiler/int64-lowering.h",
3190       "src/compiler/wasm-compiler.h",
3191       "src/debug/debug-wasm-objects-inl.h",
3192       "src/debug/debug-wasm-objects.h",
3193       "src/trap-handler/trap-handler-internal.h",
3194       "src/trap-handler/trap-handler.h",
3195       "src/wasm/baseline/liftoff-assembler-defs.h",
3196       "src/wasm/baseline/liftoff-assembler.h",
3197       "src/wasm/baseline/liftoff-compiler.h",
3198       "src/wasm/baseline/liftoff-register.h",
3199       "src/wasm/code-space-access.h",
3200       "src/wasm/compilation-environment.h",
3201       "src/wasm/decoder.h",
3202       "src/wasm/function-body-decoder-impl.h",
3203       "src/wasm/function-body-decoder.h",
3204       "src/wasm/function-compiler.h",
3205       "src/wasm/graph-builder-interface.h",
3206       "src/wasm/init-expr-interface.h",
3207       "src/wasm/jump-table-assembler.h",
3208       "src/wasm/leb-helper.h",
3209       "src/wasm/local-decl-encoder.h",
3210       "src/wasm/memory-protection-key.h",
3211       "src/wasm/memory-tracing.h",
3212       "src/wasm/module-compiler.h",
3213       "src/wasm/module-decoder.h",
3214       "src/wasm/module-instantiate.h",
3215       "src/wasm/object-access.h",
3216       "src/wasm/signature-map.h",
3217       "src/wasm/simd-shuffle.h",
3218       "src/wasm/streaming-decoder.h",
3219       "src/wasm/struct-types.h",
3220       "src/wasm/value-type.h",
3221       "src/wasm/wasm-arguments.h",
3222       "src/wasm/wasm-code-manager.h",
3223       "src/wasm/wasm-engine.h",
3224       "src/wasm/wasm-external-refs.h",
3225       "src/wasm/wasm-feature-flags.h",
3226       "src/wasm/wasm-features.h",
3227       "src/wasm/wasm-import-wrapper-cache.h",
3228       "src/wasm/wasm-init-expr.h",
3229       "src/wasm/wasm-js.h",
3230       "src/wasm/wasm-linkage.h",
3231       "src/wasm/wasm-module-builder.h",
3232       "src/wasm/wasm-module-sourcemap.h",
3233       "src/wasm/wasm-module.h",
3234       "src/wasm/wasm-objects-inl.h",
3235       "src/wasm/wasm-objects.h",
3236       "src/wasm/wasm-opcodes-inl.h",
3237       "src/wasm/wasm-opcodes.h",
3238       "src/wasm/wasm-result.h",
3239       "src/wasm/wasm-serialization.h",
3240       "src/wasm/wasm-subtyping.h",
3241       "src/wasm/wasm-tier.h",
3242       "src/wasm/wasm-value.h",
3243     ]
3244   }
3245
3246   if (!v8_enable_third_party_heap) {
3247     sources += filter_include(v8_third_party_heap_files, [ "*.h" ])
3248   } else {
3249     sources += [ "src/heap/third-party/heap-api.h" ]
3250   }
3251
3252   if (v8_enable_i18n_support) {
3253     sources += [
3254       "src/objects/intl-objects.h",
3255       "src/objects/js-break-iterator-inl.h",
3256       "src/objects/js-break-iterator.h",
3257       "src/objects/js-collator-inl.h",
3258       "src/objects/js-collator.h",
3259       "src/objects/js-date-time-format-inl.h",
3260       "src/objects/js-date-time-format.h",
3261       "src/objects/js-display-names-inl.h",
3262       "src/objects/js-display-names.h",
3263       "src/objects/js-list-format-inl.h",
3264       "src/objects/js-list-format.h",
3265       "src/objects/js-locale-inl.h",
3266       "src/objects/js-locale.h",
3267       "src/objects/js-number-format-inl.h",
3268       "src/objects/js-number-format.h",
3269       "src/objects/js-plural-rules-inl.h",
3270       "src/objects/js-plural-rules.h",
3271       "src/objects/js-relative-time-format-inl.h",
3272       "src/objects/js-relative-time-format.h",
3273       "src/objects/js-segment-iterator-inl.h",
3274       "src/objects/js-segment-iterator.h",
3275       "src/objects/js-segmenter-inl.h",
3276       "src/objects/js-segmenter.h",
3277       "src/objects/js-segments-inl.h",
3278       "src/objects/js-segments.h",
3279     ]
3280   }
3281
3282   if (!v8_control_flow_integrity) {
3283     sources += [ "src/execution/pointer-authentication-dummy.h" ]
3284   }
3285
3286   if (v8_enable_conservative_stack_scanning) {
3287     sources += [
3288       "src/heap/conservative-stack-visitor.h",
3289       "src/heap/object-start-bitmap.h",
3290     ]
3291   }
3292
3293   if (v8_enable_wasm_gdb_remote_debugging) {
3294     sources += [
3295       "src/debug/wasm/gdb-server/gdb-remote-util.h",
3296       "src/debug/wasm/gdb-server/gdb-server-thread.h",
3297       "src/debug/wasm/gdb-server/gdb-server.h",
3298       "src/debug/wasm/gdb-server/packet.h",
3299       "src/debug/wasm/gdb-server/session.h",
3300       "src/debug/wasm/gdb-server/target.h",
3301       "src/debug/wasm/gdb-server/transport.h",
3302       "src/debug/wasm/gdb-server/wasm-module-debug.h",
3303     ]
3304   }
3305
3306   if (v8_current_cpu == "x86") {
3307     sources += [  ### gcmole(arch:ia32) ###
3308       "src/baseline/ia32/baseline-assembler-ia32-inl.h",
3309       "src/baseline/ia32/baseline-compiler-ia32-inl.h",
3310       "src/codegen/ia32/assembler-ia32-inl.h",
3311       "src/codegen/ia32/assembler-ia32.h",
3312       "src/codegen/ia32/constants-ia32.h",
3313       "src/codegen/ia32/interface-descriptors-ia32-inl.h",
3314       "src/codegen/ia32/macro-assembler-ia32.h",
3315       "src/codegen/ia32/register-ia32.h",
3316       "src/codegen/ia32/sse-instr.h",
3317       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h",
3318       "src/compiler/backend/ia32/instruction-codes-ia32.h",
3319       "src/execution/ia32/frame-constants-ia32.h",
3320       "src/regexp/ia32/regexp-macro-assembler-ia32.h",
3321       "src/wasm/baseline/ia32/liftoff-assembler-ia32.h",
3322     ]
3323   } else if (v8_current_cpu == "x64") {
3324     sources += [  ### gcmole(arch:x64) ###
3325       "src/baseline/x64/baseline-assembler-x64-inl.h",
3326       "src/baseline/x64/baseline-compiler-x64-inl.h",
3327       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h",
3328       "src/codegen/x64/assembler-x64-inl.h",
3329       "src/codegen/x64/assembler-x64.h",
3330       "src/codegen/x64/constants-x64.h",
3331       "src/codegen/x64/fma-instr.h",
3332       "src/codegen/x64/interface-descriptors-x64-inl.h",
3333       "src/codegen/x64/macro-assembler-x64.h",
3334       "src/codegen/x64/register-x64.h",
3335       "src/codegen/x64/sse-instr.h",
3336       "src/compiler/backend/x64/instruction-codes-x64.h",
3337       "src/compiler/backend/x64/unwinding-info-writer-x64.h",
3338       "src/execution/x64/frame-constants-x64.h",
3339       "src/regexp/x64/regexp-macro-assembler-x64.h",
3340       "src/third_party/valgrind/valgrind.h",
3341       "src/wasm/baseline/x64/liftoff-assembler-x64.h",
3342     ]
3343
3344     if (is_win) {
3345       sources += [ "src/diagnostics/unwinding-info-win64.h" ]
3346     }
3347
3348     if (v8_enable_webassembly) {
3349       # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
3350       # based on Darwin and thus POSIX-compliant to a similar degree.
3351       if (is_linux || is_chromeos || is_mac || is_ios ||
3352           target_os == "freebsd") {
3353         sources += [ "src/trap-handler/handler-inside-posix.h" ]
3354       } else if (is_win) {
3355         sources += [ "src/trap-handler/handler-inside-win.h" ]
3356       }
3357     }
3358   } else if (v8_current_cpu == "arm") {
3359     sources += [  ### gcmole(arch:arm) ###
3360       "src/baseline/arm/baseline-assembler-arm-inl.h",
3361       "src/baseline/arm/baseline-compiler-arm-inl.h",
3362       "src/codegen/arm/assembler-arm-inl.h",
3363       "src/codegen/arm/assembler-arm.h",
3364       "src/codegen/arm/constants-arm.h",
3365       "src/codegen/arm/interface-descriptors-arm-inl.h",
3366       "src/codegen/arm/macro-assembler-arm.h",
3367       "src/codegen/arm/register-arm.h",
3368       "src/compiler/backend/arm/instruction-codes-arm.h",
3369       "src/compiler/backend/arm/unwinding-info-writer-arm.h",
3370       "src/execution/arm/frame-constants-arm.h",
3371       "src/execution/arm/simulator-arm.h",
3372       "src/regexp/arm/regexp-macro-assembler-arm.h",
3373       "src/wasm/baseline/arm/liftoff-assembler-arm.h",
3374     ]
3375   } else if (v8_current_cpu == "arm64") {
3376     sources += [  ### gcmole(arch:arm64) ###
3377       "src/baseline/arm64/baseline-assembler-arm64-inl.h",
3378       "src/baseline/arm64/baseline-compiler-arm64-inl.h",
3379       "src/codegen/arm64/assembler-arm64-inl.h",
3380       "src/codegen/arm64/assembler-arm64.h",
3381       "src/codegen/arm64/constants-arm64.h",
3382       "src/codegen/arm64/decoder-arm64-inl.h",
3383       "src/codegen/arm64/decoder-arm64.h",
3384       "src/codegen/arm64/instructions-arm64.h",
3385       "src/codegen/arm64/interface-descriptors-arm64-inl.h",
3386       "src/codegen/arm64/macro-assembler-arm64-inl.h",
3387       "src/codegen/arm64/macro-assembler-arm64.h",
3388       "src/codegen/arm64/register-arm64.h",
3389       "src/codegen/arm64/utils-arm64.h",
3390       "src/compiler/backend/arm64/instruction-codes-arm64.h",
3391       "src/compiler/backend/arm64/unwinding-info-writer-arm64.h",
3392       "src/diagnostics/arm64/disasm-arm64.h",
3393       "src/execution/arm64/frame-constants-arm64.h",
3394       "src/execution/arm64/simulator-arm64.h",
3395       "src/regexp/arm64/regexp-macro-assembler-arm64.h",
3396       "src/wasm/baseline/arm64/liftoff-assembler-arm64.h",
3397     ]
3398     if (v8_control_flow_integrity) {
3399       sources += [ "src/execution/arm64/pointer-authentication-arm64.h" ]
3400     }
3401     if (v8_enable_webassembly) {
3402       # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux
3403       # and Mac.
3404       if ((current_cpu == "arm64" && is_mac) ||
3405           (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) {
3406         sources += [ "src/trap-handler/handler-inside-posix.h" ]
3407       }
3408       if (current_cpu == "x64" && (is_linux || is_chromeos || is_mac)) {
3409         sources += [ "src/trap-handler/trap-handler-simulator.h" ]
3410       }
3411     }
3412     if (is_win) {
3413       sources += [ "src/diagnostics/unwinding-info-win64.h" ]
3414     }
3415   } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
3416     sources += [  ### gcmole(arch:mipsel) ###
3417       "src/baseline/mips/baseline-assembler-mips-inl.h",
3418       "src/baseline/mips/baseline-compiler-mips-inl.h",
3419       "src/codegen/mips/assembler-mips-inl.h",
3420       "src/codegen/mips/assembler-mips.h",
3421       "src/codegen/mips/constants-mips.h",
3422       "src/codegen/mips/macro-assembler-mips.h",
3423       "src/codegen/mips/register-mips.h",
3424       "src/compiler/backend/mips/instruction-codes-mips.h",
3425       "src/execution/mips/frame-constants-mips.h",
3426       "src/execution/mips/simulator-mips.h",
3427       "src/regexp/mips/regexp-macro-assembler-mips.h",
3428       "src/wasm/baseline/mips/liftoff-assembler-mips.h",
3429     ]
3430   } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
3431     sources += [  ### gcmole(arch:mips64el) ###
3432       "src/baseline/mips64/baseline-assembler-mips64-inl.h",
3433       "src/baseline/mips64/baseline-compiler-mips64-inl.h",
3434       "src/codegen/mips64/assembler-mips64-inl.h",
3435       "src/codegen/mips64/assembler-mips64.h",
3436       "src/codegen/mips64/constants-mips64.h",
3437       "src/codegen/mips64/macro-assembler-mips64.h",
3438       "src/codegen/mips64/register-mips64.h",
3439       "src/compiler/backend/mips64/instruction-codes-mips64.h",
3440       "src/execution/mips64/frame-constants-mips64.h",
3441       "src/execution/mips64/simulator-mips64.h",
3442       "src/regexp/mips64/regexp-macro-assembler-mips64.h",
3443       "src/wasm/baseline/mips64/liftoff-assembler-mips64.h",
3444     ]
3445   } else if (v8_current_cpu == "ppc") {
3446     sources += [  ### gcmole(arch:ppc) ###
3447       "src/codegen/ppc/assembler-ppc-inl.h",
3448       "src/codegen/ppc/assembler-ppc.h",
3449       "src/codegen/ppc/constants-ppc.h",
3450       "src/codegen/ppc/interface-descriptors-ppc-inl.h",
3451       "src/codegen/ppc/macro-assembler-ppc.h",
3452       "src/codegen/ppc/register-ppc.h",
3453       "src/compiler/backend/ppc/instruction-codes-ppc.h",
3454       "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
3455       "src/execution/ppc/frame-constants-ppc.h",
3456       "src/execution/ppc/simulator-ppc.h",
3457       "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3458       "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3459     ]
3460   } else if (v8_current_cpu == "ppc64") {
3461     sources += [  ### gcmole(arch:ppc64) ###
3462       "src/codegen/ppc/assembler-ppc-inl.h",
3463       "src/codegen/ppc/assembler-ppc.h",
3464       "src/codegen/ppc/constants-ppc.h",
3465       "src/codegen/ppc/interface-descriptors-ppc-inl.h",
3466       "src/codegen/ppc/macro-assembler-ppc.h",
3467       "src/codegen/ppc/register-ppc.h",
3468       "src/compiler/backend/ppc/instruction-codes-ppc.h",
3469       "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
3470       "src/execution/ppc/frame-constants-ppc.h",
3471       "src/execution/ppc/simulator-ppc.h",
3472       "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3473       "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3474     ]
3475   } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3476     sources += [  ### gcmole(arch:s390) ###
3477       "src/baseline/s390/baseline-assembler-s390-inl.h",
3478       "src/baseline/s390/baseline-compiler-s390-inl.h",
3479       "src/codegen/s390/assembler-s390-inl.h",
3480       "src/codegen/s390/assembler-s390.h",
3481       "src/codegen/s390/constants-s390.h",
3482       "src/codegen/s390/interface-descriptors-s390-inl.h",
3483       "src/codegen/s390/macro-assembler-s390.h",
3484       "src/codegen/s390/register-s390.h",
3485       "src/compiler/backend/s390/instruction-codes-s390.h",
3486       "src/compiler/backend/s390/unwinding-info-writer-s390.h",
3487       "src/execution/s390/frame-constants-s390.h",
3488       "src/execution/s390/simulator-s390.h",
3489       "src/regexp/s390/regexp-macro-assembler-s390.h",
3490       "src/wasm/baseline/s390/liftoff-assembler-s390.h",
3491     ]
3492   } else if (v8_current_cpu == "riscv64") {
3493     sources += [  ### gcmole(arch:riscv64) ###
3494       "src/baseline/riscv64/baseline-assembler-riscv64-inl.h",
3495       "src/baseline/riscv64/baseline-compiler-riscv64-inl.h",
3496       "src/codegen/riscv64/assembler-riscv64-inl.h",
3497       "src/codegen/riscv64/assembler-riscv64.h",
3498       "src/codegen/riscv64/constants-riscv64.h",
3499       "src/codegen/riscv64/macro-assembler-riscv64.h",
3500       "src/codegen/riscv64/register-riscv64.h",
3501       "src/compiler/backend/riscv64/instruction-codes-riscv64.h",
3502       "src/execution/riscv64/frame-constants-riscv64.h",
3503       "src/execution/riscv64/simulator-riscv64.h",
3504       "src/regexp/riscv64/regexp-macro-assembler-riscv64.h",
3505       "src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h",
3506     ]
3507   }
3508
3509   public_deps = [
3510     ":torque_runtime_support",
3511     ":v8_flags",
3512     ":v8_headers",
3513     ":v8_maybe_icu",
3514     ":v8_shared_internal_headers",
3515   ]
3516
3517   deps = [
3518     ":cppgc_headers",
3519     ":generate_bytecode_builtins_list",
3520     ":run_torque",
3521     ":v8_libbase",
3522   ]
3523 }
3524
3525 v8_compiler_sources = [
3526   ### gcmole(all) ###
3527   "src/compiler/access-builder.cc",
3528   "src/compiler/access-info.cc",
3529   "src/compiler/add-type-assertions-reducer.cc",
3530   "src/compiler/all-nodes.cc",
3531   "src/compiler/backend/code-generator.cc",
3532   "src/compiler/backend/frame-elider.cc",
3533   "src/compiler/backend/gap-resolver.cc",
3534   "src/compiler/backend/instruction-scheduler.cc",
3535   "src/compiler/backend/instruction-selector.cc",
3536   "src/compiler/backend/instruction.cc",
3537   "src/compiler/backend/jump-threading.cc",
3538   "src/compiler/backend/mid-tier-register-allocator.cc",
3539   "src/compiler/backend/move-optimizer.cc",
3540   "src/compiler/backend/register-allocator-verifier.cc",
3541   "src/compiler/backend/register-allocator.cc",
3542   "src/compiler/backend/spill-placer.cc",
3543   "src/compiler/basic-block-instrumentor.cc",
3544   "src/compiler/branch-elimination.cc",
3545   "src/compiler/bytecode-analysis.cc",
3546   "src/compiler/bytecode-graph-builder.cc",
3547   "src/compiler/bytecode-liveness-map.cc",
3548   "src/compiler/c-linkage.cc",
3549   "src/compiler/checkpoint-elimination.cc",
3550   "src/compiler/code-assembler.cc",
3551   "src/compiler/common-node-cache.cc",
3552   "src/compiler/common-operator-reducer.cc",
3553   "src/compiler/common-operator.cc",
3554   "src/compiler/compilation-dependencies.cc",
3555   "src/compiler/compiler-source-position-table.cc",
3556   "src/compiler/constant-folding-reducer.cc",
3557   "src/compiler/control-equivalence.cc",
3558   "src/compiler/control-flow-optimizer.cc",
3559   "src/compiler/csa-load-elimination.cc",
3560   "src/compiler/dead-code-elimination.cc",
3561   "src/compiler/decompression-optimizer.cc",
3562   "src/compiler/effect-control-linearizer.cc",
3563   "src/compiler/escape-analysis-reducer.cc",
3564   "src/compiler/escape-analysis.cc",
3565   "src/compiler/fast-api-calls.cc",
3566   "src/compiler/feedback-source.cc",
3567   "src/compiler/frame-states.cc",
3568   "src/compiler/frame.cc",
3569   "src/compiler/graph-assembler.cc",
3570   "src/compiler/graph-reducer.cc",
3571   "src/compiler/graph-trimmer.cc",
3572   "src/compiler/graph-visualizer.cc",
3573   "src/compiler/graph.cc",
3574   "src/compiler/heap-refs.cc",
3575   "src/compiler/js-call-reducer.cc",
3576   "src/compiler/js-context-specialization.cc",
3577   "src/compiler/js-create-lowering.cc",
3578   "src/compiler/js-generic-lowering.cc",
3579   "src/compiler/js-graph.cc",
3580   "src/compiler/js-heap-broker.cc",
3581   "src/compiler/js-heap-copy-reducer.cc",
3582   "src/compiler/js-inlining-heuristic.cc",
3583   "src/compiler/js-inlining.cc",
3584   "src/compiler/js-intrinsic-lowering.cc",
3585   "src/compiler/js-native-context-specialization.cc",
3586   "src/compiler/js-operator.cc",
3587   "src/compiler/js-type-hint-lowering.cc",
3588   "src/compiler/js-typed-lowering.cc",
3589   "src/compiler/linkage.cc",
3590   "src/compiler/load-elimination.cc",
3591   "src/compiler/loop-analysis.cc",
3592   "src/compiler/loop-peeling.cc",
3593   "src/compiler/loop-unrolling.cc",
3594   "src/compiler/loop-variable-optimizer.cc",
3595   "src/compiler/machine-graph-verifier.cc",
3596   "src/compiler/machine-graph.cc",
3597   "src/compiler/machine-operator-reducer.cc",
3598   "src/compiler/machine-operator.cc",
3599   "src/compiler/map-inference.cc",
3600   "src/compiler/memory-lowering.cc",
3601   "src/compiler/memory-optimizer.cc",
3602   "src/compiler/node-marker.cc",
3603   "src/compiler/node-matchers.cc",
3604   "src/compiler/node-observer.cc",
3605   "src/compiler/node-origin-table.cc",
3606   "src/compiler/node-properties.cc",
3607   "src/compiler/node.cc",
3608   "src/compiler/opcodes.cc",
3609   "src/compiler/operation-typer.cc",
3610   "src/compiler/operator-properties.cc",
3611   "src/compiler/operator.cc",
3612   "src/compiler/osr.cc",
3613   "src/compiler/pipeline-statistics.cc",
3614   "src/compiler/pipeline.cc",
3615   "src/compiler/property-access-builder.cc",
3616   "src/compiler/raw-machine-assembler.cc",
3617   "src/compiler/redundancy-elimination.cc",
3618   "src/compiler/refs-map.cc",
3619   "src/compiler/representation-change.cc",
3620   "src/compiler/schedule.cc",
3621   "src/compiler/scheduler.cc",
3622   "src/compiler/select-lowering.cc",
3623   "src/compiler/simplified-lowering.cc",
3624   "src/compiler/simplified-operator-reducer.cc",
3625   "src/compiler/simplified-operator.cc",
3626   "src/compiler/state-values-utils.cc",
3627   "src/compiler/store-store-elimination.cc",
3628   "src/compiler/type-cache.cc",
3629   "src/compiler/type-narrowing-reducer.cc",
3630   "src/compiler/typed-optimization.cc",
3631   "src/compiler/typer.cc",
3632   "src/compiler/types.cc",
3633   "src/compiler/value-numbering-reducer.cc",
3634   "src/compiler/verifier.cc",
3635   "src/compiler/zone-stats.cc",
3636 ]
3637
3638 if (v8_enable_webassembly) {
3639   v8_compiler_sources += [
3640     "src/compiler/int64-lowering.cc",
3641     "src/compiler/wasm-compiler.cc",
3642   ]
3643 }
3644
3645 # The src/compiler files with optimizations.
3646 v8_source_set("v8_compiler_opt") {
3647   visibility = [ ":*" ]  # Only targets in this file can depend on this.
3648
3649   sources = v8_compiler_sources
3650
3651   public_deps = [
3652     ":generate_bytecode_builtins_list",
3653     ":run_torque",
3654     ":v8_maybe_icu",
3655     ":v8_tracing",
3656   ]
3657
3658   deps = [
3659     ":v8_base_without_compiler",
3660     ":v8_internal_headers",
3661     ":v8_libbase",
3662     ":v8_shared_internal_headers",
3663   ]
3664
3665   if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
3666     # The :no_optimize config is added to v8_add_configs in v8.gni.
3667     remove_configs = [ "//build/config/compiler:no_optimize" ]
3668     configs = [ ":always_optimize" ]
3669   } else {
3670     # Without this else branch, gn fails to generate build files for non-debug
3671     # builds (because we try to remove a config that is not present).
3672     # So we include it, even if this config is not used outside of debug builds.
3673     configs = [ ":internal_config" ]
3674   }
3675 }
3676
3677 # The src/compiler files with default optimization behavior.
3678 v8_source_set("v8_compiler") {
3679   visibility = [ ":*" ]  # Only targets in this file can depend on this.
3680
3681   sources = v8_compiler_sources
3682
3683   public_deps = [
3684     ":generate_bytecode_builtins_list",
3685     ":run_torque",
3686     ":v8_internal_headers",
3687     ":v8_maybe_icu",
3688     ":v8_tracing",
3689   ]
3690
3691   deps = [
3692     ":v8_base_without_compiler",
3693     ":v8_libbase",
3694     ":v8_shared_internal_headers",
3695   ]
3696
3697   configs = [ ":internal_config" ]
3698 }
3699
3700 group("v8_compiler_for_mksnapshot") {
3701   if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
3702     deps = [ ":v8_compiler_opt" ]
3703   } else {
3704     deps = [ ":v8_compiler" ]
3705   }
3706 }
3707
3708 # Any target using trace events must directly or indirectly depend on
3709 # v8_tracing.
3710 group("v8_tracing") {
3711   if (v8_use_perfetto) {
3712     if (build_with_chromium) {
3713       public_deps = [ "//third_party/perfetto:libperfetto" ]
3714     } else {
3715       public_deps = [ ":v8_libperfetto" ]
3716     }
3717   }
3718 }
3719
3720 v8_source_set("v8_base_without_compiler") {
3721   visibility = [ ":*" ]  # Only targets in this file can depend on this.
3722
3723   # Split static libraries on windows into two.
3724   split_count = 2
3725
3726   sources = [
3727     ### gcmole(all) ###
3728     "src/api/api-arguments.cc",
3729     "src/api/api-natives.cc",
3730     "src/api/api.cc",
3731     "src/ast/ast-function-literal-id-reindexer.cc",
3732     "src/ast/ast-value-factory.cc",
3733     "src/ast/ast.cc",
3734     "src/ast/modules.cc",
3735     "src/ast/prettyprinter.cc",
3736     "src/ast/scopes.cc",
3737     "src/ast/source-range-ast-visitor.cc",
3738     "src/ast/variables.cc",
3739     "src/baseline/baseline-batch-compiler.cc",
3740     "src/baseline/baseline-compiler.cc",
3741     "src/baseline/baseline.cc",
3742     "src/baseline/bytecode-offset-iterator.cc",
3743     "src/builtins/accessors.cc",
3744     "src/builtins/builtins-api.cc",
3745     "src/builtins/builtins-array.cc",
3746     "src/builtins/builtins-arraybuffer.cc",
3747     "src/builtins/builtins-async-module.cc",
3748     "src/builtins/builtins-bigint.cc",
3749     "src/builtins/builtins-callsite.cc",
3750     "src/builtins/builtins-collections.cc",
3751     "src/builtins/builtins-console.cc",
3752     "src/builtins/builtins-dataview.cc",
3753     "src/builtins/builtins-date.cc",
3754     "src/builtins/builtins-error.cc",
3755     "src/builtins/builtins-function.cc",
3756     "src/builtins/builtins-global.cc",
3757     "src/builtins/builtins-internal.cc",
3758     "src/builtins/builtins-intl.cc",
3759     "src/builtins/builtins-json.cc",
3760     "src/builtins/builtins-number.cc",
3761     "src/builtins/builtins-object.cc",
3762     "src/builtins/builtins-reflect.cc",
3763     "src/builtins/builtins-regexp.cc",
3764     "src/builtins/builtins-sharedarraybuffer.cc",
3765     "src/builtins/builtins-string.cc",
3766     "src/builtins/builtins-symbol.cc",
3767     "src/builtins/builtins-trace.cc",
3768     "src/builtins/builtins-typed-array.cc",
3769     "src/builtins/builtins-weak-refs.cc",
3770     "src/builtins/builtins.cc",
3771     "src/builtins/constants-table-builder.cc",
3772     "src/codegen/aligned-slot-allocator.cc",
3773     "src/codegen/assembler.cc",
3774     "src/codegen/bailout-reason.cc",
3775     "src/codegen/code-comments.cc",
3776     "src/codegen/code-desc.cc",
3777     "src/codegen/code-factory.cc",
3778     "src/codegen/code-reference.cc",
3779     "src/codegen/compilation-cache.cc",
3780     "src/codegen/compiler.cc",
3781     "src/codegen/constant-pool.cc",
3782     "src/codegen/external-reference-encoder.cc",
3783     "src/codegen/external-reference-table.cc",
3784     "src/codegen/external-reference.cc",
3785     "src/codegen/flush-instruction-cache.cc",
3786     "src/codegen/handler-table.cc",
3787     "src/codegen/interface-descriptors.cc",
3788     "src/codegen/machine-type.cc",
3789     "src/codegen/optimized-compilation-info.cc",
3790     "src/codegen/pending-optimization-table.cc",
3791     "src/codegen/register-configuration.cc",
3792     "src/codegen/reloc-info.cc",
3793     "src/codegen/safepoint-table.cc",
3794     "src/codegen/source-position-table.cc",
3795     "src/codegen/source-position.cc",
3796     "src/codegen/string-constants.cc",
3797     "src/codegen/tick-counter.cc",
3798     "src/codegen/tnode.cc",
3799     "src/codegen/turbo-assembler.cc",
3800     "src/codegen/unoptimized-compilation-info.cc",
3801     "src/common/assert-scope.cc",
3802     "src/compiler-dispatcher/lazy-compile-dispatcher.cc",
3803     "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
3804     "src/date/date.cc",
3805     "src/date/dateparser.cc",
3806     "src/debug/debug-coverage.cc",
3807     "src/debug/debug-evaluate.cc",
3808     "src/debug/debug-frames.cc",
3809     "src/debug/debug-interface.cc",
3810     "src/debug/debug-property-iterator.cc",
3811     "src/debug/debug-scope-iterator.cc",
3812     "src/debug/debug-scopes.cc",
3813     "src/debug/debug-stack-trace-iterator.cc",
3814     "src/debug/debug-type-profile.cc",
3815     "src/debug/debug.cc",
3816     "src/debug/liveedit.cc",
3817     "src/deoptimizer/deoptimize-reason.cc",
3818     "src/deoptimizer/deoptimized-frame-info.cc",
3819     "src/deoptimizer/deoptimizer.cc",
3820     "src/deoptimizer/materialized-object-store.cc",
3821     "src/deoptimizer/translated-state.cc",
3822     "src/deoptimizer/translation-array.cc",
3823     "src/diagnostics/basic-block-profiler.cc",
3824     "src/diagnostics/compilation-statistics.cc",
3825     "src/diagnostics/disassembler.cc",
3826     "src/diagnostics/eh-frame.cc",
3827     "src/diagnostics/gdb-jit.cc",
3828     "src/diagnostics/objects-debug.cc",
3829     "src/diagnostics/objects-printer.cc",
3830     "src/diagnostics/perf-jit.cc",
3831     "src/diagnostics/unwinder.cc",
3832     "src/execution/arguments.cc",
3833     "src/execution/execution.cc",
3834     "src/execution/external-pointer-table.cc",
3835     "src/execution/frames.cc",
3836     "src/execution/futex-emulation.cc",
3837     "src/execution/interrupts-scope.cc",
3838     "src/execution/isolate.cc",
3839     "src/execution/local-isolate.cc",
3840     "src/execution/messages.cc",
3841     "src/execution/microtask-queue.cc",
3842     "src/execution/protectors.cc",
3843     "src/execution/runtime-profiler.cc",
3844     "src/execution/simulator-base.cc",
3845     "src/execution/stack-guard.cc",
3846     "src/execution/thread-id.cc",
3847     "src/execution/thread-local-top.cc",
3848     "src/execution/v8threads.cc",
3849     "src/extensions/cputracemark-extension.cc",
3850     "src/extensions/externalize-string-extension.cc",
3851     "src/extensions/gc-extension.cc",
3852     "src/extensions/ignition-statistics-extension.cc",
3853     "src/extensions/statistics-extension.cc",
3854     "src/extensions/trigger-failure-extension.cc",
3855     "src/flags/flags.cc",
3856     "src/handles/global-handles.cc",
3857     "src/handles/handles.cc",
3858     "src/handles/local-handles.cc",
3859     "src/handles/persistent-handles.cc",
3860     "src/heap/allocation-observer.cc",
3861     "src/heap/array-buffer-sweeper.cc",
3862     "src/heap/base-space.cc",
3863     "src/heap/basic-memory-chunk.cc",
3864     "src/heap/code-object-registry.cc",
3865     "src/heap/code-range.cc",
3866     "src/heap/code-stats.cc",
3867     "src/heap/collection-barrier.cc",
3868     "src/heap/combined-heap.cc",
3869     "src/heap/concurrent-allocator.cc",
3870     "src/heap/concurrent-marking.cc",
3871     "src/heap/cppgc-js/cpp-heap.cc",
3872     "src/heap/cppgc-js/cpp-snapshot.cc",
3873     "src/heap/cppgc-js/unified-heap-marking-verifier.cc",
3874     "src/heap/cppgc-js/unified-heap-marking-visitor.cc",
3875     "src/heap/embedder-tracing.cc",
3876     "src/heap/factory-base.cc",
3877     "src/heap/factory.cc",
3878     "src/heap/finalization-registry-cleanup-task.cc",
3879     "src/heap/free-list.cc",
3880     "src/heap/gc-idle-time-handler.cc",
3881     "src/heap/gc-tracer.cc",
3882     "src/heap/heap-controller.cc",
3883     "src/heap/heap-write-barrier.cc",
3884     "src/heap/heap.cc",
3885     "src/heap/incremental-marking-job.cc",
3886     "src/heap/incremental-marking.cc",
3887     "src/heap/index-generator.cc",
3888     "src/heap/invalidated-slots.cc",
3889     "src/heap/large-spaces.cc",
3890     "src/heap/local-factory.cc",
3891     "src/heap/local-heap.cc",
3892     "src/heap/mark-compact.cc",
3893     "src/heap/marking-barrier.cc",
3894     "src/heap/marking-worklist.cc",
3895     "src/heap/marking.cc",
3896     "src/heap/memory-allocator.cc",
3897     "src/heap/memory-chunk-layout.cc",
3898     "src/heap/memory-chunk.cc",
3899     "src/heap/memory-measurement.cc",
3900     "src/heap/memory-reducer.cc",
3901     "src/heap/new-spaces.cc",
3902     "src/heap/object-stats.cc",
3903     "src/heap/objects-visiting.cc",
3904     "src/heap/paged-spaces.cc",
3905     "src/heap/read-only-heap.cc",
3906     "src/heap/read-only-spaces.cc",
3907     "src/heap/safepoint.cc",
3908     "src/heap/scavenge-job.cc",
3909     "src/heap/scavenger.cc",
3910     "src/heap/slot-set.cc",
3911     "src/heap/spaces.cc",
3912     "src/heap/stress-marking-observer.cc",
3913     "src/heap/stress-scavenge-observer.cc",
3914     "src/heap/sweeper.cc",
3915     "src/heap/weak-object-worklists.cc",
3916     "src/ic/call-optimization.cc",
3917     "src/ic/handler-configuration.cc",
3918     "src/ic/ic-stats.cc",
3919     "src/ic/ic.cc",
3920     "src/ic/stub-cache.cc",
3921     "src/init/bootstrapper.cc",
3922     "src/init/icu_util.cc",
3923     "src/init/isolate-allocator.cc",
3924     "src/init/startup-data-util.cc",
3925     "src/init/v8.cc",
3926     "src/interpreter/bytecode-array-builder.cc",
3927     "src/interpreter/bytecode-array-iterator.cc",
3928     "src/interpreter/bytecode-array-random-iterator.cc",
3929     "src/interpreter/bytecode-array-writer.cc",
3930     "src/interpreter/bytecode-decoder.cc",
3931     "src/interpreter/bytecode-flags.cc",
3932     "src/interpreter/bytecode-generator.cc",
3933     "src/interpreter/bytecode-label.cc",
3934     "src/interpreter/bytecode-node.cc",
3935     "src/interpreter/bytecode-operands.cc",
3936     "src/interpreter/bytecode-register-optimizer.cc",
3937     "src/interpreter/bytecode-register.cc",
3938     "src/interpreter/bytecode-source-info.cc",
3939     "src/interpreter/bytecodes.cc",
3940     "src/interpreter/constant-array-builder.cc",
3941     "src/interpreter/control-flow-builders.cc",
3942     "src/interpreter/handler-table-builder.cc",
3943     "src/interpreter/interpreter-intrinsics.cc",
3944     "src/interpreter/interpreter.cc",
3945     "src/json/json-parser.cc",
3946     "src/json/json-stringifier.cc",
3947     "src/libsampler/sampler.cc",
3948     "src/logging/counters.cc",
3949     "src/logging/local-logger.cc",
3950     "src/logging/log-utils.cc",
3951     "src/logging/log.cc",
3952     "src/logging/metrics.cc",
3953     "src/logging/runtime-call-stats.cc",
3954     "src/logging/tracing-flags.cc",
3955     "src/numbers/conversions.cc",
3956     "src/numbers/math-random.cc",
3957     "src/objects/backing-store.cc",
3958     "src/objects/bigint.cc",
3959     "src/objects/code-kind.cc",
3960     "src/objects/code.cc",
3961     "src/objects/compilation-cache-table.cc",
3962     "src/objects/contexts.cc",
3963     "src/objects/debug-objects.cc",
3964     "src/objects/elements-kind.cc",
3965     "src/objects/elements.cc",
3966     "src/objects/embedder-data-array.cc",
3967     "src/objects/feedback-vector.cc",
3968     "src/objects/field-type.cc",
3969     "src/objects/intl-objects.cc",
3970     "src/objects/js-array-buffer.cc",
3971     "src/objects/js-break-iterator.cc",
3972     "src/objects/js-collator.cc",
3973     "src/objects/js-date-time-format.cc",
3974     "src/objects/js-display-names.cc",
3975     "src/objects/js-function.cc",
3976     "src/objects/js-list-format.cc",
3977     "src/objects/js-locale.cc",
3978     "src/objects/js-number-format.cc",
3979     "src/objects/js-objects.cc",
3980     "src/objects/js-plural-rules.cc",
3981     "src/objects/js-regexp.cc",
3982     "src/objects/js-relative-time-format.cc",
3983     "src/objects/js-segment-iterator.cc",
3984     "src/objects/js-segmenter.cc",
3985     "src/objects/js-segments.cc",
3986     "src/objects/keys.cc",
3987     "src/objects/literal-objects.cc",
3988     "src/objects/lookup-cache.cc",
3989     "src/objects/lookup.cc",
3990     "src/objects/managed.cc",
3991     "src/objects/map-updater.cc",
3992     "src/objects/map.cc",
3993     "src/objects/module.cc",
3994     "src/objects/object-type.cc",
3995     "src/objects/objects.cc",
3996     "src/objects/ordered-hash-table.cc",
3997     "src/objects/osr-optimized-code-cache.cc",
3998     "src/objects/property-descriptor.cc",
3999     "src/objects/property.cc",
4000     "src/objects/scope-info.cc",
4001     "src/objects/shared-function-info.cc",
4002     "src/objects/source-text-module.cc",
4003     "src/objects/stack-frame-info.cc",
4004     "src/objects/string-comparator.cc",
4005     "src/objects/string-table.cc",
4006     "src/objects/string.cc",
4007     "src/objects/swiss-name-dictionary.cc",
4008     "src/objects/synthetic-module.cc",
4009     "src/objects/tagged-impl.cc",
4010     "src/objects/template-objects.cc",
4011     "src/objects/templates.cc",
4012     "src/objects/transitions.cc",
4013     "src/objects/type-hints.cc",
4014     "src/objects/value-serializer.cc",
4015     "src/objects/visitors.cc",
4016     "src/parsing/func-name-inferrer.cc",
4017     "src/parsing/import-assertions.cc",
4018     "src/parsing/literal-buffer.cc",
4019     "src/parsing/parse-info.cc",
4020     "src/parsing/parser.cc",
4021     "src/parsing/parsing.cc",
4022     "src/parsing/pending-compilation-error-handler.cc",
4023     "src/parsing/preparse-data.cc",
4024     "src/parsing/preparser.cc",
4025     "src/parsing/rewriter.cc",
4026     "src/parsing/scanner-character-streams.cc",
4027     "src/parsing/scanner.cc",
4028     "src/parsing/token.cc",
4029     "src/profiler/allocation-tracker.cc",
4030     "src/profiler/cpu-profiler.cc",
4031     "src/profiler/heap-profiler.cc",
4032     "src/profiler/heap-snapshot-generator.cc",
4033     "src/profiler/profile-generator.cc",
4034     "src/profiler/profiler-listener.cc",
4035     "src/profiler/profiler-stats.cc",
4036     "src/profiler/sampling-heap-profiler.cc",
4037     "src/profiler/strings-storage.cc",
4038     "src/profiler/symbolizer.cc",
4039     "src/profiler/tick-sample.cc",
4040     "src/profiler/tracing-cpu-profiler.cc",
4041     "src/profiler/weak-code-registry.cc",
4042     "src/regexp/experimental/experimental-bytecode.cc",
4043     "src/regexp/experimental/experimental-compiler.cc",
4044     "src/regexp/experimental/experimental-interpreter.cc",
4045     "src/regexp/experimental/experimental.cc",
4046     "src/regexp/property-sequences.cc",
4047     "src/regexp/regexp-ast.cc",
4048     "src/regexp/regexp-bytecode-generator.cc",
4049     "src/regexp/regexp-bytecode-peephole.cc",
4050     "src/regexp/regexp-bytecodes.cc",
4051     "src/regexp/regexp-compiler-tonode.cc",
4052     "src/regexp/regexp-compiler.cc",
4053     "src/regexp/regexp-dotprinter.cc",
4054     "src/regexp/regexp-error.cc",
4055     "src/regexp/regexp-interpreter.cc",
4056     "src/regexp/regexp-macro-assembler-tracer.cc",
4057     "src/regexp/regexp-macro-assembler.cc",
4058     "src/regexp/regexp-parser.cc",
4059     "src/regexp/regexp-stack.cc",
4060     "src/regexp/regexp-utils.cc",
4061     "src/regexp/regexp.cc",
4062     "src/roots/roots.cc",
4063     "src/runtime/runtime-array.cc",
4064     "src/runtime/runtime-atomics.cc",
4065     "src/runtime/runtime-bigint.cc",
4066     "src/runtime/runtime-classes.cc",
4067     "src/runtime/runtime-collections.cc",
4068     "src/runtime/runtime-compiler.cc",
4069     "src/runtime/runtime-date.cc",
4070     "src/runtime/runtime-debug.cc",
4071     "src/runtime/runtime-forin.cc",
4072     "src/runtime/runtime-function.cc",
4073     "src/runtime/runtime-futex.cc",
4074     "src/runtime/runtime-generator.cc",
4075     "src/runtime/runtime-internal.cc",
4076     "src/runtime/runtime-intl.cc",
4077     "src/runtime/runtime-literals.cc",
4078     "src/runtime/runtime-module.cc",
4079     "src/runtime/runtime-numbers.cc",
4080     "src/runtime/runtime-object.cc",
4081     "src/runtime/runtime-operators.cc",
4082     "src/runtime/runtime-promise.cc",
4083     "src/runtime/runtime-proxy.cc",
4084     "src/runtime/runtime-regexp.cc",
4085     "src/runtime/runtime-scopes.cc",
4086     "src/runtime/runtime-strings.cc",
4087     "src/runtime/runtime-symbol.cc",
4088     "src/runtime/runtime-test.cc",
4089     "src/runtime/runtime-trace.cc",
4090     "src/runtime/runtime-typedarray.cc",
4091     "src/runtime/runtime-weak-refs.cc",
4092     "src/runtime/runtime.cc",
4093     "src/snapshot/code-serializer.cc",
4094     "src/snapshot/context-deserializer.cc",
4095     "src/snapshot/context-serializer.cc",
4096     "src/snapshot/deserializer.cc",
4097     "src/snapshot/embedded/embedded-data.cc",
4098     "src/snapshot/object-deserializer.cc",
4099     "src/snapshot/read-only-deserializer.cc",
4100     "src/snapshot/read-only-serializer.cc",
4101     "src/snapshot/roots-serializer.cc",
4102     "src/snapshot/serializer-deserializer.cc",
4103     "src/snapshot/serializer.cc",
4104     "src/snapshot/snapshot-compression.cc",
4105     "src/snapshot/snapshot-data.cc",
4106     "src/snapshot/snapshot-source-sink.cc",
4107     "src/snapshot/snapshot-utils.cc",
4108     "src/snapshot/snapshot.cc",
4109     "src/snapshot/startup-deserializer.cc",
4110     "src/snapshot/startup-serializer.cc",
4111     "src/strings/char-predicates.cc",
4112     "src/strings/string-builder.cc",
4113     "src/strings/string-case.cc",
4114     "src/strings/string-stream.cc",
4115     "src/strings/unicode-decoder.cc",
4116     "src/strings/unicode.cc",
4117     "src/strings/uri.cc",
4118     "src/tasks/cancelable-task.cc",
4119     "src/tasks/operations-barrier.cc",
4120     "src/tasks/task-utils.cc",
4121     "src/third_party/siphash/halfsiphash.cc",
4122     "src/tracing/trace-event.cc",
4123     "src/tracing/traced-value.cc",
4124     "src/tracing/tracing-category-observer.cc",
4125     "src/utils/address-map.cc",
4126     "src/utils/allocation.cc",
4127     "src/utils/bit-vector.cc",
4128     "src/utils/detachable-vector.cc",
4129     "src/utils/identity-map.cc",
4130     "src/utils/memcopy.cc",
4131     "src/utils/ostreams.cc",
4132     "src/utils/utils.cc",
4133     "src/utils/version.cc",
4134     "src/web-snapshot/web-snapshot.cc",
4135     "src/web-snapshot/web-snapshot.h",
4136     "src/zone/accounting-allocator.cc",
4137     "src/zone/type-stats.cc",
4138     "src/zone/zone-segment.cc",
4139     "src/zone/zone.cc",
4140   ]
4141
4142   if (v8_enable_webassembly) {
4143     sources += [
4144       "src/asmjs/asm-js.cc",
4145       "src/asmjs/asm-parser.cc",
4146       "src/asmjs/asm-scanner.cc",
4147       "src/asmjs/asm-types.cc",
4148       "src/debug/debug-wasm-objects.cc",
4149       "src/runtime/runtime-test-wasm.cc",
4150       "src/runtime/runtime-wasm.cc",
4151       "src/trap-handler/handler-inside.cc",
4152       "src/trap-handler/handler-outside.cc",
4153       "src/trap-handler/handler-shared.cc",
4154       "src/wasm/baseline/liftoff-assembler.cc",
4155       "src/wasm/baseline/liftoff-compiler.cc",
4156       "src/wasm/code-space-access.cc",
4157       "src/wasm/function-body-decoder.cc",
4158       "src/wasm/function-compiler.cc",
4159       "src/wasm/graph-builder-interface.cc",
4160       "src/wasm/init-expr-interface.cc",
4161       "src/wasm/jump-table-assembler.cc",
4162       "src/wasm/local-decl-encoder.cc",
4163       "src/wasm/memory-protection-key.cc",
4164       "src/wasm/memory-tracing.cc",
4165       "src/wasm/module-compiler.cc",
4166       "src/wasm/module-decoder.cc",
4167       "src/wasm/module-instantiate.cc",
4168       "src/wasm/signature-map.cc",
4169       "src/wasm/simd-shuffle.cc",
4170       "src/wasm/streaming-decoder.cc",
4171       "src/wasm/sync-streaming-decoder.cc",
4172       "src/wasm/value-type.cc",
4173       "src/wasm/wasm-code-manager.cc",
4174       "src/wasm/wasm-debug.cc",
4175       "src/wasm/wasm-debug.h",
4176       "src/wasm/wasm-engine.cc",
4177       "src/wasm/wasm-external-refs.cc",
4178       "src/wasm/wasm-features.cc",
4179       "src/wasm/wasm-import-wrapper-cache.cc",
4180       "src/wasm/wasm-init-expr.cc",
4181       "src/wasm/wasm-js.cc",
4182       "src/wasm/wasm-module-builder.cc",
4183       "src/wasm/wasm-module-sourcemap.cc",
4184       "src/wasm/wasm-module.cc",
4185       "src/wasm/wasm-objects.cc",
4186       "src/wasm/wasm-opcodes.cc",
4187       "src/wasm/wasm-result.cc",
4188       "src/wasm/wasm-serialization.cc",
4189       "src/wasm/wasm-subtyping.cc",
4190     ]
4191   }
4192
4193   if (v8_enable_third_party_heap) {
4194     sources += filter_exclude(v8_third_party_heap_files, [ "*.h" ])
4195   } else {
4196     sources += [ "src/heap/third-party/heap-api-stub.cc" ]
4197   }
4198
4199   if (v8_enable_conservative_stack_scanning) {
4200     sources += [ "src/heap/conservative-stack-visitor.cc" ]
4201   }
4202
4203   if (v8_enable_wasm_gdb_remote_debugging) {
4204     sources += [
4205       "src/debug/wasm/gdb-server/gdb-remote-util.cc",
4206       "src/debug/wasm/gdb-server/gdb-server-thread.cc",
4207       "src/debug/wasm/gdb-server/gdb-server.cc",
4208       "src/debug/wasm/gdb-server/packet.cc",
4209       "src/debug/wasm/gdb-server/session.cc",
4210       "src/debug/wasm/gdb-server/target.cc",
4211       "src/debug/wasm/gdb-server/transport.cc",
4212       "src/debug/wasm/gdb-server/wasm-module-debug.cc",
4213     ]
4214   }
4215
4216   if (v8_current_cpu == "x86") {
4217     sources += [  ### gcmole(arch:ia32) ###
4218       "src/codegen/ia32/assembler-ia32.cc",
4219       "src/codegen/ia32/cpu-ia32.cc",
4220       "src/codegen/ia32/macro-assembler-ia32.cc",
4221       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc",
4222       "src/compiler/backend/ia32/code-generator-ia32.cc",
4223       "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
4224       "src/compiler/backend/ia32/instruction-selector-ia32.cc",
4225       "src/deoptimizer/ia32/deoptimizer-ia32.cc",
4226       "src/diagnostics/ia32/disasm-ia32.cc",
4227       "src/diagnostics/ia32/unwinder-ia32.cc",
4228       "src/execution/ia32/frame-constants-ia32.cc",
4229       "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
4230     ]
4231   } else if (v8_current_cpu == "x64") {
4232     sources += [  ### gcmole(arch:x64) ###
4233       "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc",
4234       "src/codegen/x64/assembler-x64.cc",
4235       "src/codegen/x64/cpu-x64.cc",
4236       "src/codegen/x64/macro-assembler-x64.cc",
4237       "src/compiler/backend/x64/code-generator-x64.cc",
4238       "src/compiler/backend/x64/instruction-scheduler-x64.cc",
4239       "src/compiler/backend/x64/instruction-selector-x64.cc",
4240       "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
4241       "src/deoptimizer/x64/deoptimizer-x64.cc",
4242       "src/diagnostics/x64/disasm-x64.cc",
4243       "src/diagnostics/x64/eh-frame-x64.cc",
4244       "src/diagnostics/x64/unwinder-x64.cc",
4245       "src/execution/x64/frame-constants-x64.cc",
4246       "src/regexp/x64/regexp-macro-assembler-x64.cc",
4247     ]
4248
4249     if (is_win) {
4250       sources += [ "src/diagnostics/unwinding-info-win64.cc" ]
4251     }
4252
4253     if (v8_enable_webassembly) {
4254       # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
4255       # based on Darwin and thus POSIX-compliant to a similar degree.
4256       if (is_linux || is_chromeos || is_mac || is_ios ||
4257           target_os == "freebsd") {
4258         sources += [
4259           "src/trap-handler/handler-inside-posix.cc",
4260           "src/trap-handler/handler-outside-posix.cc",
4261         ]
4262       } else if (is_win) {
4263         sources += [
4264           "src/trap-handler/handler-inside-win.cc",
4265           "src/trap-handler/handler-outside-win.cc",
4266         ]
4267       }
4268     }
4269   } else if (v8_current_cpu == "arm") {
4270     sources += [  ### gcmole(arch:arm) ###
4271       "src/codegen/arm/assembler-arm.cc",
4272       "src/codegen/arm/constants-arm.cc",
4273       "src/codegen/arm/cpu-arm.cc",
4274       "src/codegen/arm/macro-assembler-arm.cc",
4275       "src/compiler/backend/arm/code-generator-arm.cc",
4276       "src/compiler/backend/arm/instruction-scheduler-arm.cc",
4277       "src/compiler/backend/arm/instruction-selector-arm.cc",
4278       "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
4279       "src/deoptimizer/arm/deoptimizer-arm.cc",
4280       "src/diagnostics/arm/disasm-arm.cc",
4281       "src/diagnostics/arm/eh-frame-arm.cc",
4282       "src/diagnostics/arm/unwinder-arm.cc",
4283       "src/execution/arm/frame-constants-arm.cc",
4284       "src/execution/arm/simulator-arm.cc",
4285       "src/regexp/arm/regexp-macro-assembler-arm.cc",
4286     ]
4287   } else if (v8_current_cpu == "arm64") {
4288     sources += [  ### gcmole(arch:arm64) ###
4289       "src/codegen/arm64/assembler-arm64.cc",
4290       "src/codegen/arm64/cpu-arm64.cc",
4291       "src/codegen/arm64/decoder-arm64.cc",
4292       "src/codegen/arm64/instructions-arm64-constants.cc",
4293       "src/codegen/arm64/instructions-arm64.cc",
4294       "src/codegen/arm64/macro-assembler-arm64.cc",
4295       "src/codegen/arm64/register-arm64.cc",
4296       "src/codegen/arm64/utils-arm64.cc",
4297       "src/compiler/backend/arm64/code-generator-arm64.cc",
4298       "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
4299       "src/compiler/backend/arm64/instruction-selector-arm64.cc",
4300       "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
4301       "src/deoptimizer/arm64/deoptimizer-arm64.cc",
4302       "src/diagnostics/arm64/disasm-arm64.cc",
4303       "src/diagnostics/arm64/eh-frame-arm64.cc",
4304       "src/diagnostics/arm64/unwinder-arm64.cc",
4305       "src/execution/arm64/frame-constants-arm64.cc",
4306       "src/execution/arm64/pointer-auth-arm64.cc",
4307       "src/execution/arm64/simulator-arm64.cc",
4308       "src/execution/arm64/simulator-logic-arm64.cc",
4309       "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
4310     ]
4311     if (v8_enable_webassembly) {
4312       # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux
4313       # and Mac.
4314       if ((current_cpu == "arm64" && is_mac) ||
4315           (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) {
4316         sources += [
4317           "src/trap-handler/handler-inside-posix.cc",
4318           "src/trap-handler/handler-outside-posix.cc",
4319         ]
4320       }
4321       if (current_cpu == "x64" && (is_linux || is_chromeos || is_mac)) {
4322         sources += [ "src/trap-handler/handler-outside-simulator.cc" ]
4323       }
4324     }
4325     if (is_win) {
4326       sources += [ "src/diagnostics/unwinding-info-win64.cc" ]
4327     }
4328   } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
4329     sources += [  ### gcmole(arch:mipsel) ###
4330       "src/codegen/mips/assembler-mips.cc",
4331       "src/codegen/mips/constants-mips.cc",
4332       "src/codegen/mips/cpu-mips.cc",
4333       "src/codegen/mips/interface-descriptors-mips-inl.h",
4334       "src/codegen/mips/macro-assembler-mips.cc",
4335       "src/compiler/backend/mips/code-generator-mips.cc",
4336       "src/compiler/backend/mips/instruction-scheduler-mips.cc",
4337       "src/compiler/backend/mips/instruction-selector-mips.cc",
4338       "src/deoptimizer/mips/deoptimizer-mips.cc",
4339       "src/diagnostics/mips/disasm-mips.cc",
4340       "src/diagnostics/mips/unwinder-mips.cc",
4341       "src/execution/mips/frame-constants-mips.cc",
4342       "src/execution/mips/simulator-mips.cc",
4343       "src/regexp/mips/regexp-macro-assembler-mips.cc",
4344     ]
4345   } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
4346     sources += [  ### gcmole(arch:mips64el) ###
4347       "src/codegen/mips64/assembler-mips64.cc",
4348       "src/codegen/mips64/constants-mips64.cc",
4349       "src/codegen/mips64/cpu-mips64.cc",
4350       "src/codegen/mips64/interface-descriptors-mips64-inl.h",
4351       "src/codegen/mips64/macro-assembler-mips64.cc",
4352       "src/compiler/backend/mips64/code-generator-mips64.cc",
4353       "src/compiler/backend/mips64/instruction-scheduler-mips64.cc",
4354       "src/compiler/backend/mips64/instruction-selector-mips64.cc",
4355       "src/deoptimizer/mips64/deoptimizer-mips64.cc",
4356       "src/diagnostics/mips64/disasm-mips64.cc",
4357       "src/diagnostics/mips64/unwinder-mips64.cc",
4358       "src/execution/mips64/frame-constants-mips64.cc",
4359       "src/execution/mips64/simulator-mips64.cc",
4360       "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
4361     ]
4362   } else if (v8_current_cpu == "ppc") {
4363     sources += [  ### gcmole(arch:ppc) ###
4364       "src/codegen/ppc/assembler-ppc.cc",
4365       "src/codegen/ppc/constants-ppc.cc",
4366       "src/codegen/ppc/cpu-ppc.cc",
4367       "src/codegen/ppc/macro-assembler-ppc.cc",
4368       "src/compiler/backend/ppc/code-generator-ppc.cc",
4369       "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
4370       "src/compiler/backend/ppc/instruction-selector-ppc.cc",
4371       "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
4372       "src/deoptimizer/ppc/deoptimizer-ppc.cc",
4373       "src/diagnostics/ppc/disasm-ppc.cc",
4374       "src/diagnostics/ppc/eh-frame-ppc.cc",
4375       "src/diagnostics/ppc/unwinder-ppc.cc",
4376       "src/execution/ppc/frame-constants-ppc.cc",
4377       "src/execution/ppc/simulator-ppc.cc",
4378       "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
4379     ]
4380   } else if (v8_current_cpu == "ppc64") {
4381     sources += [  ### gcmole(arch:ppc64) ###
4382       "src/codegen/ppc/assembler-ppc.cc",
4383       "src/codegen/ppc/constants-ppc.cc",
4384       "src/codegen/ppc/cpu-ppc.cc",
4385       "src/codegen/ppc/macro-assembler-ppc.cc",
4386       "src/compiler/backend/ppc/code-generator-ppc.cc",
4387       "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
4388       "src/compiler/backend/ppc/instruction-selector-ppc.cc",
4389       "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
4390       "src/deoptimizer/ppc/deoptimizer-ppc.cc",
4391       "src/diagnostics/ppc/disasm-ppc.cc",
4392       "src/diagnostics/ppc/eh-frame-ppc.cc",
4393       "src/diagnostics/ppc/unwinder-ppc.cc",
4394       "src/execution/ppc/frame-constants-ppc.cc",
4395       "src/execution/ppc/simulator-ppc.cc",
4396       "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
4397     ]
4398   } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
4399     sources += [  ### gcmole(arch:s390) ###
4400       "src/codegen/s390/assembler-s390.cc",
4401       "src/codegen/s390/constants-s390.cc",
4402       "src/codegen/s390/cpu-s390.cc",
4403       "src/codegen/s390/macro-assembler-s390.cc",
4404       "src/compiler/backend/s390/code-generator-s390.cc",
4405       "src/compiler/backend/s390/instruction-scheduler-s390.cc",
4406       "src/compiler/backend/s390/instruction-selector-s390.cc",
4407       "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
4408       "src/deoptimizer/s390/deoptimizer-s390.cc",
4409       "src/diagnostics/s390/disasm-s390.cc",
4410       "src/diagnostics/s390/eh-frame-s390.cc",
4411       "src/diagnostics/s390/unwinder-s390.cc",
4412       "src/execution/s390/frame-constants-s390.cc",
4413       "src/execution/s390/simulator-s390.cc",
4414       "src/regexp/s390/regexp-macro-assembler-s390.cc",
4415     ]
4416   } else if (v8_current_cpu == "riscv64") {
4417     sources += [  ### gcmole(arch:riscv64) ###
4418       "src/baseline/riscv64/baseline-assembler-riscv64-inl.h",
4419       "src/baseline/riscv64/baseline-compiler-riscv64-inl.h",
4420       "src/codegen/riscv64/assembler-riscv64-inl.h",
4421       "src/codegen/riscv64/assembler-riscv64.cc",
4422       "src/codegen/riscv64/constants-riscv64.cc",
4423       "src/codegen/riscv64/cpu-riscv64.cc",
4424       "src/codegen/riscv64/interface-descriptors-riscv64-inl.h",
4425       "src/codegen/riscv64/macro-assembler-riscv64.cc",
4426       "src/compiler/backend/riscv64/code-generator-riscv64.cc",
4427       "src/compiler/backend/riscv64/instruction-scheduler-riscv64.cc",
4428       "src/compiler/backend/riscv64/instruction-selector-riscv64.cc",
4429       "src/deoptimizer/riscv64/deoptimizer-riscv64.cc",
4430       "src/diagnostics/riscv64/disasm-riscv64.cc",
4431       "src/diagnostics/riscv64/unwinder-riscv64.cc",
4432       "src/execution/riscv64/frame-constants-riscv64.cc",
4433       "src/execution/riscv64/simulator-riscv64.cc",
4434       "src/regexp/riscv64/regexp-macro-assembler-riscv64.cc",
4435     ]
4436   }
4437
4438   # Architecture independent but platform-specific sources
4439   if (is_win) {
4440     if (v8_enable_system_instrumentation) {
4441       sources += [
4442         "src/diagnostics/system-jit-metadata-win.h",
4443         "src/diagnostics/system-jit-win.cc",
4444         "src/diagnostics/system-jit-win.h",
4445       ]
4446     }
4447   }
4448
4449   configs = [
4450     ":internal_config",
4451     ":cppgc_base_config",
4452   ]
4453
4454   deps = [
4455     ":torque_generated_definitions",
4456     ":v8_bigint",
4457     ":v8_cppgc_shared",
4458     ":v8_headers",
4459     ":v8_libbase",
4460     ":v8_shared_internal_headers",
4461     ":v8_tracing",
4462     ":v8_version",
4463     "src/inspector:inspector",
4464   ]
4465
4466   public_deps = [
4467     ":cppgc_base",
4468     ":generate_bytecode_builtins_list",
4469     ":run_torque",
4470     ":v8_headers",
4471     ":v8_internal_headers",
4472     ":v8_maybe_icu",
4473   ]
4474
4475   if (v8_enable_i18n_support) {
4476     deps += [ ":run_gen-regexp-special-case" ]
4477     sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
4478     if (is_win) {
4479       deps += [ "//third_party/icu:icudata" ]
4480     }
4481   } else {
4482     sources -= [
4483       "src/builtins/builtins-intl.cc",
4484       "src/objects/intl-objects.cc",
4485       "src/objects/js-break-iterator.cc",
4486       "src/objects/js-collator.cc",
4487       "src/objects/js-date-time-format.cc",
4488       "src/objects/js-display-names.cc",
4489       "src/objects/js-list-format.cc",
4490       "src/objects/js-locale.cc",
4491       "src/objects/js-number-format.cc",
4492       "src/objects/js-plural-rules.cc",
4493       "src/objects/js-relative-time-format.cc",
4494       "src/objects/js-segment-iterator.cc",
4495       "src/objects/js-segmenter.cc",
4496       "src/objects/js-segments.cc",
4497       "src/runtime/runtime-intl.cc",
4498       "src/strings/char-predicates.cc",
4499     ]
4500   }
4501
4502   deps += [
4503     "//third_party/zlib",
4504     "//third_party/zlib/google:compression_utils_portable",
4505   ]
4506
4507   if (v8_postmortem_support) {
4508     sources += [ "$target_gen_dir/debug-support.cc" ]
4509     deps += [ ":postmortem-metadata" ]
4510   }
4511
4512   libs = []
4513
4514   if (v8_enable_third_party_heap) {
4515     libs += v8_third_party_heap_libs
4516   }
4517
4518   # Platforms that don't have CAS support need to link atomic library
4519   # to implement atomic memory access
4520   if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" ||
4521       v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" ||
4522       v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
4523       v8_current_cpu == "s390" || v8_current_cpu == "s390x" ||
4524       v8_current_cpu == "riscv64") {
4525     libs += [ "atomic" ]
4526   }
4527
4528   if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) {
4529     sources += [
4530       "src/extensions/vtunedomain-support-extension.cc",
4531       "src/extensions/vtunedomain-support-extension.h",
4532     ]
4533     deps += [ "src/third_party/vtune:v8_vtune_trace_mark" ]
4534   }
4535
4536   if (v8_use_perfetto) {
4537     sources += [
4538       "src/tracing/trace-categories.cc",
4539       "src/tracing/trace-categories.h",
4540     ]
4541   }
4542 }
4543
4544 group("v8_base") {
4545   public_deps = [
4546     ":v8_base_without_compiler",
4547     ":v8_compiler",
4548   ]
4549 }
4550
4551 v8_source_set("torque_base") {
4552   visibility = [ ":*" ]  # Only targets in this file can depend on this.
4553
4554   sources = [
4555     "src/torque/ast.h",
4556     "src/torque/cc-generator.cc",
4557     "src/torque/cc-generator.h",
4558     "src/torque/cfg.cc",
4559     "src/torque/cfg.h",
4560     "src/torque/class-debug-reader-generator.cc",
4561     "src/torque/constants.h",
4562     "src/torque/contextual.h",
4563     "src/torque/cpp-builder.cc",
4564     "src/torque/cpp-builder.h",
4565     "src/torque/csa-generator.cc",
4566     "src/torque/csa-generator.h",
4567     "src/torque/declarable.cc",
4568     "src/torque/declarable.h",
4569     "src/torque/declaration-visitor.cc",
4570     "src/torque/declaration-visitor.h",
4571     "src/torque/declarations.cc",
4572     "src/torque/declarations.h",
4573     "src/torque/earley-parser.cc",
4574     "src/torque/earley-parser.h",
4575     "src/torque/global-context.cc",
4576     "src/torque/global-context.h",
4577     "src/torque/implementation-visitor.cc",
4578     "src/torque/implementation-visitor.h",
4579     "src/torque/instance-type-generator.cc",
4580     "src/torque/instructions.cc",
4581     "src/torque/instructions.h",
4582     "src/torque/parameter-difference.h",
4583     "src/torque/server-data.cc",
4584     "src/torque/server-data.h",
4585     "src/torque/source-positions.cc",
4586     "src/torque/source-positions.h",
4587     "src/torque/torque-code-generator.cc",
4588     "src/torque/torque-code-generator.h",
4589     "src/torque/torque-compiler.cc",
4590     "src/torque/torque-compiler.h",
4591     "src/torque/torque-parser.cc",
4592     "src/torque/torque-parser.h",
4593     "src/torque/type-inference.cc",
4594     "src/torque/type-inference.h",
4595     "src/torque/type-oracle.cc",
4596     "src/torque/type-oracle.h",
4597     "src/torque/type-visitor.cc",
4598     "src/torque/type-visitor.h",
4599     "src/torque/types.cc",
4600     "src/torque/types.h",
4601     "src/torque/utils.cc",
4602     "src/torque/utils.h",
4603   ]
4604
4605   deps = [
4606     ":v8_flags",
4607     ":v8_shared_internal_headers",
4608   ]
4609
4610   public_deps = [ ":v8_libbase" ]
4611
4612   # The use of exceptions for Torque in violation of the Chromium style-guide
4613   # is justified by the fact that it is only used from the non-essential
4614   # language server and can be removed anytime if it causes problems.
4615   configs = [
4616     ":internal_config",
4617     "//build/config/compiler:exceptions",
4618     "//build/config/compiler:rtti",
4619   ]
4620
4621   remove_configs = [
4622     "//build/config/compiler:no_exceptions",
4623     "//build/config/compiler:no_rtti",
4624   ]
4625
4626   if (is_win && is_asan) {
4627     # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
4628     # Torque on Windows.
4629     remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
4630   }
4631
4632   if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
4633     # The :no_optimize config is added to v8_add_configs in v8.gni.
4634     remove_configs += [ "//build/config/compiler:no_optimize" ]
4635     configs += [ ":always_optimize" ]
4636   }
4637 }
4638
4639 v8_source_set("torque_ls_base") {
4640   sources = [
4641     "src/torque/ls/globals.h",
4642     "src/torque/ls/json-parser.cc",
4643     "src/torque/ls/json-parser.h",
4644     "src/torque/ls/json.cc",
4645     "src/torque/ls/json.h",
4646     "src/torque/ls/message-handler.cc",
4647     "src/torque/ls/message-handler.h",
4648     "src/torque/ls/message-macros.h",
4649     "src/torque/ls/message-pipe.h",
4650     "src/torque/ls/message.h",
4651   ]
4652
4653   public_deps = [ ":torque_base" ]
4654
4655   # The use of exceptions for Torque in violation of the Chromium style-guide
4656   # is justified by the fact that it is only used from the non-essential
4657   # language server and can be removed anytime if it causes problems.
4658   configs = [
4659     ":internal_config",
4660     "//build/config/compiler:exceptions",
4661     "//build/config/compiler:rtti",
4662   ]
4663
4664   remove_configs = [
4665     "//build/config/compiler:no_exceptions",
4666     "//build/config/compiler:no_rtti",
4667   ]
4668
4669   if (is_win && is_asan) {
4670     remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
4671   }
4672 }
4673
4674 v8_component("v8_libbase") {
4675   sources = [
4676     "src/base/address-region.h",
4677     "src/base/atomic-utils.h",
4678     "src/base/atomicops.h",
4679     "src/base/atomicops_internals_atomicword_compat.h",
4680     "src/base/base-export.h",
4681     "src/base/bit-field.h",
4682     "src/base/bits-iterator.h",
4683     "src/base/bits.cc",
4684     "src/base/bits.h",
4685     "src/base/bounded-page-allocator.cc",
4686     "src/base/bounded-page-allocator.h",
4687     "src/base/bounds.h",
4688     "src/base/build_config.h",
4689     "src/base/compiler-specific.h",
4690     "src/base/cpu.cc",
4691     "src/base/cpu.h",
4692     "src/base/debug/stack_trace.cc",
4693     "src/base/debug/stack_trace.h",
4694     "src/base/division-by-constant.cc",
4695     "src/base/division-by-constant.h",
4696     "src/base/enum-set.h",
4697     "src/base/export-template.h",
4698     "src/base/file-utils.cc",
4699     "src/base/file-utils.h",
4700     "src/base/flags.h",
4701     "src/base/free_deleter.h",
4702     "src/base/functional.cc",
4703     "src/base/functional.h",
4704     "src/base/hashmap-entry.h",
4705     "src/base/hashmap.h",
4706     "src/base/ieee754.cc",
4707     "src/base/ieee754.h",
4708     "src/base/immediate-crash.h",
4709     "src/base/iterator.h",
4710     "src/base/lazy-instance.h",
4711     "src/base/logging.cc",
4712     "src/base/logging.h",
4713     "src/base/macros.h",
4714     "src/base/memory.h",
4715     "src/base/numbers/bignum-dtoa.cc",
4716     "src/base/numbers/bignum-dtoa.h",
4717     "src/base/numbers/bignum.cc",
4718     "src/base/numbers/bignum.h",
4719     "src/base/numbers/cached-powers.cc",
4720     "src/base/numbers/cached-powers.h",
4721     "src/base/numbers/diy-fp.cc",
4722     "src/base/numbers/diy-fp.h",
4723     "src/base/numbers/double.h",
4724     "src/base/numbers/dtoa.cc",
4725     "src/base/numbers/dtoa.h",
4726     "src/base/numbers/fast-dtoa.cc",
4727     "src/base/numbers/fast-dtoa.h",
4728     "src/base/numbers/fixed-dtoa.cc",
4729     "src/base/numbers/fixed-dtoa.h",
4730     "src/base/numbers/strtod.cc",
4731     "src/base/numbers/strtod.h",
4732     "src/base/once.cc",
4733     "src/base/once.h",
4734     "src/base/optional.h",
4735     "src/base/overflowing-math.h",
4736     "src/base/page-allocator.cc",
4737     "src/base/page-allocator.h",
4738     "src/base/platform/condition-variable.cc",
4739     "src/base/platform/condition-variable.h",
4740     "src/base/platform/elapsed-timer.h",
4741     "src/base/platform/mutex.cc",
4742     "src/base/platform/mutex.h",
4743     "src/base/platform/platform.h",
4744     "src/base/platform/semaphore.cc",
4745     "src/base/platform/semaphore.h",
4746     "src/base/platform/time.cc",
4747     "src/base/platform/time.h",
4748     "src/base/platform/wrappers.h",
4749     "src/base/region-allocator.cc",
4750     "src/base/region-allocator.h",
4751     "src/base/ring-buffer.h",
4752     "src/base/safe_conversions.h",
4753     "src/base/safe_conversions_arm_impl.h",
4754     "src/base/safe_conversions_impl.h",
4755     "src/base/sanitizer/asan.h",
4756     "src/base/sanitizer/lsan-page-allocator.cc",
4757     "src/base/sanitizer/lsan-page-allocator.h",
4758     "src/base/sanitizer/lsan.h",
4759     "src/base/sanitizer/msan.h",
4760     "src/base/small-vector.h",
4761     "src/base/strings.cc",
4762     "src/base/strings.h",
4763     "src/base/sys-info.cc",
4764     "src/base/sys-info.h",
4765     "src/base/template-utils.h",
4766     "src/base/threaded-list.h",
4767     "src/base/timezone-cache.h",
4768     "src/base/type-traits.h",
4769     "src/base/utils/random-number-generator.cc",
4770     "src/base/utils/random-number-generator.h",
4771     "src/base/v8-fallthrough.h",
4772     "src/base/vector.h",
4773     "src/base/vlq-base64.cc",
4774     "src/base/vlq-base64.h",
4775     "src/base/vlq.h",
4776   ]
4777
4778   configs = [ ":internal_config_base" ]
4779
4780   public_configs = [ ":libbase_config" ]
4781
4782   deps = [ ":v8_config_headers" ]
4783
4784   data = []
4785
4786   data_deps = []
4787
4788   defines = []
4789
4790   if (is_component_build) {
4791     defines = [ "BUILDING_V8_BASE_SHARED" ]
4792   }
4793
4794   if (is_posix || is_fuchsia) {
4795     sources += [
4796       "src/base/platform/platform-posix.cc",
4797       "src/base/platform/platform-posix.h",
4798     ]
4799     if (current_os != "aix") {
4800       sources += [
4801         "src/base/platform/platform-posix-time.cc",
4802         "src/base/platform/platform-posix-time.h",
4803       ]
4804     }
4805   }
4806
4807   if (is_linux || is_tizen || is_chromeos) {
4808     sources += [
4809       "src/base/debug/stack_trace_posix.cc",
4810       "src/base/platform/platform-linux.cc",
4811     ]
4812     libs = [
4813       "dl",
4814       "rt",
4815     ]
4816     if (is_tizen) {
4817       libs += [
4818         "dlog",
4819         "pthread",
4820       ]
4821     }
4822   } else if (current_os == "aix") {
4823     sources += [
4824       "src/base/debug/stack_trace_posix.cc",
4825       "src/base/platform/platform-aix.cc",
4826     ]
4827     libs = [ "dl" ]
4828   } else if (is_android) {
4829     if (current_toolchain == host_toolchain) {
4830       libs = [
4831         "dl",
4832         "rt",
4833       ]
4834       if (host_os == "mac") {
4835         sources += [
4836           "src/base/debug/stack_trace_posix.cc",
4837           "src/base/platform/platform-macos.cc",
4838         ]
4839       } else {
4840         sources += [
4841           "src/base/debug/stack_trace_posix.cc",
4842           "src/base/platform/platform-linux.cc",
4843         ]
4844       }
4845     } else {
4846       sources += [
4847         "src/base/debug/stack_trace_android.cc",
4848         "src/base/platform/platform-linux.cc",
4849       ]
4850     }
4851   } else if (is_fuchsia) {
4852     sources += [
4853       "src/base/debug/stack_trace_fuchsia.cc",
4854       "src/base/platform/platform-fuchsia.cc",
4855     ]
4856     deps += [ "//third_party/fuchsia-sdk/sdk/pkg/zx" ]
4857   } else if (is_mac || is_ios) {
4858     sources += [
4859       "src/base/debug/stack_trace_posix.cc",
4860       "src/base/platform/platform-macos.cc",
4861     ]
4862   } else if (is_win) {
4863     # TODO(jochen): Add support for cygwin.
4864     sources += [
4865       "src/base/debug/stack_trace_win.cc",
4866       "src/base/platform/platform-win32.cc",
4867       "src/base/win32-headers.h",
4868     ]
4869
4870     defines += [ "_CRT_RAND_S" ]  # for rand_s()
4871
4872     libs = [
4873       "dbghelp.lib",
4874       "winmm.lib",
4875       "ws2_32.lib",
4876     ]
4877
4878     if (v8_enable_system_instrumentation) {
4879       libs += [ "advapi32.lib" ]  # Needed for TraceLoggingProvider.h
4880     }
4881
4882     data_deps += [ "//build/win:runtime_libs" ]
4883   }
4884
4885   if (v8_current_cpu == "mips" || v8_current_cpu == "mips64") {
4886     # Add runtime libs for mips.
4887     data += [
4888       "tools/mips_toolchain/sysroot/usr/lib/",
4889       "tools/mips_toolchain/mips-mti-linux-gnu/lib",
4890     ]
4891   }
4892
4893   if (is_ubsan && (v8_current_cpu == "x86" || v8_current_cpu == "arm" ||
4894                    v8_current_cpu == "mips")) {
4895     # Special UBSan 32-bit requirement.
4896     sources += [ "src/base/ubsan.cc" ]
4897   }
4898
4899   if (v8_current_cpu == "riscv64") {
4900     libs += [ "atomic" ]
4901   }
4902
4903   if (is_tsan && !build_with_chromium) {
4904     data += [ "tools/sanitizers/tsan_suppressions.txt" ]
4905   }
4906
4907   if (using_sanitizer && !build_with_chromium) {
4908     data_deps +=
4909         [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ]
4910   }
4911
4912   # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
4913 }
4914
4915 v8_component("v8_libplatform") {
4916   sources = [
4917     "//base/trace_event/common/trace_event_common.h",
4918     "include/libplatform/libplatform-export.h",
4919     "include/libplatform/libplatform.h",
4920     "include/libplatform/v8-tracing.h",
4921     "src/libplatform/default-foreground-task-runner.cc",
4922     "src/libplatform/default-foreground-task-runner.h",
4923     "src/libplatform/default-job.cc",
4924     "src/libplatform/default-job.h",
4925     "src/libplatform/default-platform.cc",
4926     "src/libplatform/default-platform.h",
4927     "src/libplatform/default-worker-threads-task-runner.cc",
4928     "src/libplatform/default-worker-threads-task-runner.h",
4929     "src/libplatform/delayed-task-queue.cc",
4930     "src/libplatform/delayed-task-queue.h",
4931     "src/libplatform/task-queue.cc",
4932     "src/libplatform/task-queue.h",
4933     "src/libplatform/tracing/trace-buffer.cc",
4934     "src/libplatform/tracing/trace-buffer.h",
4935     "src/libplatform/tracing/trace-config.cc",
4936     "src/libplatform/tracing/trace-object.cc",
4937     "src/libplatform/tracing/trace-writer.cc",
4938     "src/libplatform/tracing/trace-writer.h",
4939     "src/libplatform/tracing/tracing-controller.cc",
4940     "src/libplatform/worker-thread.cc",
4941     "src/libplatform/worker-thread.h",
4942   ]
4943
4944   configs = [ ":internal_config_base" ]
4945
4946   if (is_component_build) {
4947     defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
4948   }
4949
4950   public_configs = [ ":libplatform_config" ]
4951
4952   public_deps = []
4953
4954   deps = [
4955     ":v8_config_headers",
4956     ":v8_libbase",
4957     ":v8_tracing",
4958   ]
4959
4960   if (v8_use_perfetto) {
4961     sources -= [
4962       "//base/trace_event/common/trace_event_common.h",
4963       "src/libplatform/tracing/trace-buffer.cc",
4964       "src/libplatform/tracing/trace-buffer.h",
4965       "src/libplatform/tracing/trace-object.cc",
4966       "src/libplatform/tracing/trace-writer.cc",
4967       "src/libplatform/tracing/trace-writer.h",
4968     ]
4969     sources += [
4970       "src/libplatform/tracing/trace-event-listener.cc",
4971       "src/libplatform/tracing/trace-event-listener.h",
4972     ]
4973     deps += [
4974       # TODO(skyostil): Switch TraceEventListener to protozero.
4975       "//third_party/perfetto/protos/perfetto/trace:lite",
4976     ]
4977   }
4978
4979   if (v8_enable_system_instrumentation) {
4980     sources += [ "src/libplatform/tracing/recorder.h" ]
4981     if (is_mac) {
4982       sources += [ "src/libplatform/tracing/recorder-mac.cc" ]
4983     } else if (is_win) {
4984       sources += [ "src/libplatform/tracing/recorder-win.cc" ]
4985     }
4986   }
4987
4988   if (v8_current_cpu == "riscv64") {
4989     libs = [ "atomic" ]
4990   }
4991 }
4992
4993 v8_source_set("fuzzer_support") {
4994   visibility = [ ":*" ]  # Only targets in this file can depend on this.
4995
4996   sources = [
4997     "test/fuzzer/fuzzer-support.cc",
4998     "test/fuzzer/fuzzer-support.h",
4999   ]
5000
5001   configs = [ ":internal_config_base" ]
5002
5003   public_deps = [
5004     ":v8",
5005     ":v8_libbase",
5006     ":v8_libplatform",
5007     ":v8_maybe_icu",
5008   ]
5009 }
5010
5011 v8_source_set("v8_bigint") {
5012   sources = [
5013     "src/bigint/bigint-internal.cc",
5014     "src/bigint/bigint-internal.h",
5015     "src/bigint/bigint.h",
5016     "src/bigint/digit-arithmetic.h",
5017     "src/bigint/div-burnikel.cc",
5018     "src/bigint/div-helpers.cc",
5019     "src/bigint/div-helpers.h",
5020     "src/bigint/div-schoolbook.cc",
5021     "src/bigint/fromstring.cc",
5022     "src/bigint/mul-karatsuba.cc",
5023     "src/bigint/mul-schoolbook.cc",
5024     "src/bigint/tostring.cc",
5025     "src/bigint/util.h",
5026     "src/bigint/vector-arithmetic.cc",
5027     "src/bigint/vector-arithmetic.h",
5028   ]
5029
5030   if (v8_advanced_bigint_algorithms) {
5031     sources += [
5032       "src/bigint/div-barrett.cc",
5033       "src/bigint/mul-fft.cc",
5034       "src/bigint/mul-toom.cc",
5035     ]
5036   }
5037
5038   configs = [ ":internal_config" ]
5039 }
5040
5041 v8_source_set("v8_cppgc_shared") {
5042   sources = [
5043     "src/heap/base/stack.cc",
5044     "src/heap/base/stack.h",
5045     "src/heap/base/worklist.cc",
5046     "src/heap/base/worklist.h",
5047     "src/heap/cppgc/globals.h",
5048   ]
5049
5050   if (is_clang || !is_win) {
5051     if (current_cpu == "x64") {
5052       sources += [ "src/heap/base/asm/x64/push_registers_asm.cc" ]
5053     } else if (current_cpu == "x86") {
5054       sources += [ "src/heap/base/asm/ia32/push_registers_asm.cc" ]
5055     } else if (current_cpu == "arm") {
5056       sources += [ "src/heap/base/asm/arm/push_registers_asm.cc" ]
5057     } else if (current_cpu == "arm64") {
5058       sources += [ "src/heap/base/asm/arm64/push_registers_asm.cc" ]
5059     } else if (current_cpu == "ppc64") {
5060       sources += [ "src/heap/base/asm/ppc/push_registers_asm.cc" ]
5061     } else if (current_cpu == "s390x") {
5062       sources += [ "src/heap/base/asm/s390/push_registers_asm.cc" ]
5063     } else if (current_cpu == "mipsel") {
5064       sources += [ "src/heap/base/asm/mips/push_registers_asm.cc" ]
5065     } else if (current_cpu == "mips64el") {
5066       sources += [ "src/heap/base/asm/mips64/push_registers_asm.cc" ]
5067     } else if (current_cpu == "riscv64") {
5068       sources += [ "src/heap/base/asm/riscv64/push_registers_asm.cc" ]
5069     }
5070   } else if (is_win) {
5071     if (current_cpu == "x64") {
5072       sources += [ "src/heap/base/asm/x64/push_registers_masm.S" ]
5073     } else if (current_cpu == "x86") {
5074       sources += [ "src/heap/base/asm/ia32/push_registers_masm.S" ]
5075     } else if (current_cpu == "arm64") {
5076       sources += [ "src/heap/base/asm/arm64/push_registers_masm.S" ]
5077     }
5078   }
5079
5080   configs = [ ":internal_config" ]
5081
5082   public_deps = [
5083     ":cppgc_headers",
5084     ":v8_libbase",
5085   ]
5086 }
5087
5088 # This is split out to be a non-code containing target that the Chromium browser
5089 # can depend upon to get basic cppgc types.
5090 v8_header_set("cppgc_headers") {
5091   configs = [ ":internal_config" ]
5092   public_configs = [
5093     ":v8_header_features",
5094     ":cppgc_header_features",
5095   ]
5096
5097   sources = [
5098     "include/cppgc/allocation.h",
5099     "include/cppgc/common.h",
5100     "include/cppgc/custom-space.h",
5101     "include/cppgc/default-platform.h",
5102     "include/cppgc/ephemeron-pair.h",
5103     "include/cppgc/explicit-management.h",
5104     "include/cppgc/garbage-collected.h",
5105     "include/cppgc/heap-consistency.h",
5106     "include/cppgc/heap-state.h",
5107     "include/cppgc/heap-statistics.h",
5108     "include/cppgc/heap.h",
5109     "include/cppgc/internal/api-constants.h",
5110     "include/cppgc/internal/atomic-entry-flag.h",
5111     "include/cppgc/internal/compiler-specific.h",
5112     "include/cppgc/internal/finalizer-trait.h",
5113     "include/cppgc/internal/gc-info.h",
5114     "include/cppgc/internal/name-trait.h",
5115     "include/cppgc/internal/persistent-node.h",
5116     "include/cppgc/internal/pointer-policies.h",
5117     "include/cppgc/internal/prefinalizer-handler.h",
5118     "include/cppgc/internal/write-barrier.h",
5119     "include/cppgc/liveness-broker.h",
5120     "include/cppgc/macros.h",
5121     "include/cppgc/member.h",
5122     "include/cppgc/name-provider.h",
5123     "include/cppgc/object-size-trait.h",
5124     "include/cppgc/persistent.h",
5125     "include/cppgc/platform.h",
5126     "include/cppgc/prefinalizer.h",
5127     "include/cppgc/process-heap-statistics.h",
5128     "include/cppgc/sentinel-pointer.h",
5129     "include/cppgc/source-location.h",
5130
5131     # TODO(v8:11952): Remove the testing header here once depending on both,
5132     # //v8:v8 and //v8:v8_for_testing does not result in ODR violations.
5133     "include/cppgc/testing.h",
5134     "include/cppgc/trace-trait.h",
5135     "include/cppgc/type-traits.h",
5136     "include/cppgc/visitor.h",
5137   ]
5138
5139   if (cppgc_enable_caged_heap) {
5140     sources += [ "include/cppgc/internal/caged-heap-local-data.h" ]
5141   }
5142
5143   deps = [
5144     ":v8_libbase",
5145     ":v8_libplatform",
5146   ]
5147
5148   public_deps = [ ":v8_config_headers" ]
5149 }
5150
5151 v8_source_set("cppgc_base") {
5152   visibility = [ ":*" ]
5153
5154   sources = [
5155     "src/heap/cppgc/allocation.cc",
5156     "src/heap/cppgc/compaction-worklists.cc",
5157     "src/heap/cppgc/compaction-worklists.h",
5158     "src/heap/cppgc/compactor.cc",
5159     "src/heap/cppgc/compactor.h",
5160     "src/heap/cppgc/concurrent-marker.cc",
5161     "src/heap/cppgc/concurrent-marker.h",
5162     "src/heap/cppgc/default-platform.cc",
5163     "src/heap/cppgc/explicit-management.cc",
5164     "src/heap/cppgc/free-list.cc",
5165     "src/heap/cppgc/free-list.h",
5166     "src/heap/cppgc/garbage-collector.h",
5167     "src/heap/cppgc/gc-info-table.cc",
5168     "src/heap/cppgc/gc-info-table.h",
5169     "src/heap/cppgc/gc-info.cc",
5170     "src/heap/cppgc/gc-invoker.cc",
5171     "src/heap/cppgc/gc-invoker.h",
5172     "src/heap/cppgc/heap-base.cc",
5173     "src/heap/cppgc/heap-base.h",
5174     "src/heap/cppgc/heap-consistency.cc",
5175     "src/heap/cppgc/heap-growing.cc",
5176     "src/heap/cppgc/heap-growing.h",
5177     "src/heap/cppgc/heap-object-header.cc",
5178     "src/heap/cppgc/heap-object-header.h",
5179     "src/heap/cppgc/heap-page.cc",
5180     "src/heap/cppgc/heap-page.h",
5181     "src/heap/cppgc/heap-space.cc",
5182     "src/heap/cppgc/heap-space.h",
5183     "src/heap/cppgc/heap-state.cc",
5184     "src/heap/cppgc/heap-statistics-collector.cc",
5185     "src/heap/cppgc/heap-statistics-collector.h",
5186     "src/heap/cppgc/heap-visitor.h",
5187     "src/heap/cppgc/heap.cc",
5188     "src/heap/cppgc/heap.h",
5189     "src/heap/cppgc/incremental-marking-schedule.cc",
5190     "src/heap/cppgc/incremental-marking-schedule.h",
5191     "src/heap/cppgc/liveness-broker.cc",
5192     "src/heap/cppgc/liveness-broker.h",
5193     "src/heap/cppgc/logging.cc",
5194     "src/heap/cppgc/marker.cc",
5195     "src/heap/cppgc/marker.h",
5196     "src/heap/cppgc/marking-state.cc",
5197     "src/heap/cppgc/marking-state.h",
5198     "src/heap/cppgc/marking-verifier.cc",
5199     "src/heap/cppgc/marking-verifier.h",
5200     "src/heap/cppgc/marking-visitor.cc",
5201     "src/heap/cppgc/marking-visitor.h",
5202     "src/heap/cppgc/marking-worklists.cc",
5203     "src/heap/cppgc/marking-worklists.h",
5204     "src/heap/cppgc/memory.cc",
5205     "src/heap/cppgc/memory.h",
5206     "src/heap/cppgc/metric-recorder.h",
5207     "src/heap/cppgc/name-trait.cc",
5208     "src/heap/cppgc/object-allocator.cc",
5209     "src/heap/cppgc/object-allocator.h",
5210     "src/heap/cppgc/object-poisoner.h",
5211     "src/heap/cppgc/object-size-trait.cc",
5212     "src/heap/cppgc/object-start-bitmap.h",
5213     "src/heap/cppgc/object-view.h",
5214     "src/heap/cppgc/page-memory.cc",
5215     "src/heap/cppgc/page-memory.h",
5216     "src/heap/cppgc/persistent-node.cc",
5217     "src/heap/cppgc/platform.cc",
5218     "src/heap/cppgc/pointer-policies.cc",
5219     "src/heap/cppgc/prefinalizer-handler.cc",
5220     "src/heap/cppgc/prefinalizer-handler.h",
5221     "src/heap/cppgc/process-heap-statistics.cc",
5222     "src/heap/cppgc/process-heap-statistics.h",
5223     "src/heap/cppgc/process-heap.cc",
5224     "src/heap/cppgc/process-heap.h",
5225     "src/heap/cppgc/raw-heap.cc",
5226     "src/heap/cppgc/raw-heap.h",
5227     "src/heap/cppgc/source-location.cc",
5228     "src/heap/cppgc/stats-collector.cc",
5229     "src/heap/cppgc/stats-collector.h",
5230     "src/heap/cppgc/sweeper.cc",
5231     "src/heap/cppgc/sweeper.h",
5232     "src/heap/cppgc/task-handle.h",
5233
5234     # TODO(v8:11952): Remove the testing header here once depending on both,
5235     # //v8:v8 and //v8:v8_for_testing does not result in ODR violations.
5236     "src/heap/cppgc/testing.cc",
5237     "src/heap/cppgc/trace-event.h",
5238     "src/heap/cppgc/trace-trait.cc",
5239     "src/heap/cppgc/virtual-memory.cc",
5240     "src/heap/cppgc/virtual-memory.h",
5241     "src/heap/cppgc/visitor.cc",
5242     "src/heap/cppgc/visitor.h",
5243     "src/heap/cppgc/write-barrier.cc",
5244     "src/heap/cppgc/write-barrier.h",
5245   ]
5246
5247   if (cppgc_enable_caged_heap) {
5248     sources += [
5249       "src/heap/cppgc/caged-heap-local-data.cc",
5250       "src/heap/cppgc/caged-heap.cc",
5251       "src/heap/cppgc/caged-heap.h",
5252     ]
5253   }
5254
5255   configs = [
5256     ":internal_config",
5257     ":cppgc_base_config",
5258   ]
5259
5260   public_deps = [
5261     ":cppgc_headers",
5262     ":v8_cppgc_shared",
5263     ":v8_libbase",
5264     ":v8_libplatform",
5265   ]
5266
5267   if (cppgc_is_standalone && !v8_use_perfetto) {
5268     sources += [ "//base/trace_event/common/trace_event_common.h" ]
5269   } else {
5270     public_deps += [ ":v8_tracing" ]
5271   }
5272 }
5273
5274 if (v8_check_header_includes) {
5275   # This file will be generated by tools/generate-header-include-checks.py
5276   # if the "check_v8_header_includes" gclient variable is set.
5277   import("check-header-includes/sources.gni")
5278   v8_source_set("check_headers") {
5279     configs = [ ":internal_config" ]
5280     sources = check_header_includes_sources
5281
5282     # Any rules that contain headers files should be added here either directly
5283     # or indirectly by including something that has it transitively in its
5284     # public_deps.
5285     deps = [
5286       ":d8",
5287       ":mksnapshot",
5288       ":torque_base",
5289       ":torque_ls_base",
5290       ":v8_base_without_compiler",
5291       ":v8_bigint",
5292       ":v8_initializers",
5293       ":v8_internal_headers",
5294       ":v8_libbase",
5295       ":v8_maybe_icu",
5296       ":wee8",
5297       "src/inspector:inspector",
5298       "src/inspector:inspector_string_conversions",
5299     ]
5300   }
5301 }
5302
5303 ###############################################################################
5304 # Produce a single static library for embedders
5305 #
5306
5307 if (v8_monolithic) {
5308   # A component build is not monolithic.
5309   assert(!is_component_build)
5310
5311   # Using external startup data would produce separate files.
5312   assert(!v8_use_external_startup_data)
5313   v8_static_library("v8_monolith") {
5314     deps = [
5315       ":v8",
5316       ":v8_libbase",
5317       ":v8_libplatform",
5318       "//build/win:default_exe_manifest",
5319     ]
5320
5321     configs = [ ":internal_config" ]
5322   }
5323 }
5324
5325 if (v8_enable_webassembly) {
5326   v8_static_library("wee8") {
5327     deps = [
5328       ":v8_base",
5329       ":v8_libbase",
5330       ":v8_libplatform",
5331       ":v8_shared_internal_headers",
5332       ":v8_snapshot",
5333       "//build/win:default_exe_manifest",
5334     ]
5335
5336     # TODO: v8dll-main.cc equivalent for shared library builds
5337
5338     configs = [ ":internal_config" ]
5339
5340     sources = [
5341       ### gcmole(all) ###
5342       "src/wasm/c-api.cc",
5343       "src/wasm/c-api.h",
5344       "third_party/wasm-api/wasm.h",
5345       "third_party/wasm-api/wasm.hh",
5346     ]
5347   }
5348 }
5349
5350 ###############################################################################
5351 # Executables
5352 #
5353
5354 if (current_toolchain == v8_generator_toolchain) {
5355   v8_executable("bytecode_builtins_list_generator") {
5356     visibility = [ ":*" ]  # Only targets in this file can depend on this.
5357
5358     include_dirs = [ "." ]
5359
5360     sources = [
5361       "src/builtins/generate-bytecodes-builtins-list.cc",
5362       "src/interpreter/bytecode-operands.cc",
5363       "src/interpreter/bytecode-operands.h",
5364       "src/interpreter/bytecode-traits.h",
5365       "src/interpreter/bytecodes.cc",
5366       "src/interpreter/bytecodes.h",
5367     ]
5368
5369     configs = [ ":internal_config" ]
5370
5371     deps = [
5372       ":v8_libbase",
5373       ":v8_shared_internal_headers",
5374       "//build/win:default_exe_manifest",
5375     ]
5376   }
5377 }
5378
5379 if (current_toolchain == v8_snapshot_toolchain) {
5380   v8_executable("mksnapshot") {
5381     visibility = [ ":*" ]  # Only targets in this file can depend on this.
5382
5383     sources = [
5384       "src/snapshot/embedded/embedded-empty.cc",
5385       "src/snapshot/embedded/embedded-file-writer.cc",
5386       "src/snapshot/embedded/embedded-file-writer.h",
5387       "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
5388       "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
5389       "src/snapshot/embedded/platform-embedded-file-writer-base.cc",
5390       "src/snapshot/embedded/platform-embedded-file-writer-base.h",
5391       "src/snapshot/embedded/platform-embedded-file-writer-generic.cc",
5392       "src/snapshot/embedded/platform-embedded-file-writer-generic.h",
5393       "src/snapshot/embedded/platform-embedded-file-writer-mac.cc",
5394       "src/snapshot/embedded/platform-embedded-file-writer-mac.h",
5395       "src/snapshot/embedded/platform-embedded-file-writer-win.cc",
5396       "src/snapshot/embedded/platform-embedded-file-writer-win.h",
5397       "src/snapshot/mksnapshot.cc",
5398       "src/snapshot/snapshot-empty.cc",
5399     ]
5400
5401     if (v8_control_flow_integrity) {
5402       sources += [ "src/deoptimizer/deoptimizer-cfi-empty.cc" ]
5403     }
5404
5405     configs = [ ":internal_config" ]
5406
5407     deps = [
5408       ":v8_base_without_compiler",
5409       ":v8_compiler_for_mksnapshot",
5410       ":v8_init",
5411       ":v8_libbase",
5412       ":v8_libplatform",
5413       ":v8_maybe_icu",
5414       ":v8_shared_internal_headers",
5415       ":v8_tracing",
5416       "//build/win:default_exe_manifest",
5417     ]
5418   }
5419 }
5420
5421 if (current_toolchain == v8_snapshot_toolchain) {
5422   v8_executable("torque") {
5423     visibility = [ ":*" ]  # Only targets in this file can depend on this.
5424
5425     sources = [ "src/torque/torque.cc" ]
5426
5427     deps = [
5428       ":torque_base",
5429       "//build/win:default_exe_manifest",
5430     ]
5431
5432     # The use of exceptions for Torque in violation of the Chromium style-guide
5433     # is justified by the fact that it is only used from the non-essential
5434     # language server and can be removed anytime if it causes problems.
5435     configs = [
5436       ":internal_config",
5437       "//build/config/compiler:exceptions",
5438       "//build/config/compiler:rtti",
5439     ]
5440
5441     remove_configs = [
5442       "//build/config/compiler:no_exceptions",
5443       "//build/config/compiler:no_rtti",
5444     ]
5445
5446     if (is_win && is_asan) {
5447       remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
5448     }
5449   }
5450 }
5451
5452 v8_executable("torque-language-server") {
5453   visibility = [ ":*" ]  # Only targets in this file can depend on this.
5454
5455   sources = [ "src/torque/ls/torque-language-server.cc" ]
5456
5457   deps = [
5458     ":torque_base",
5459     ":torque_ls_base",
5460     "//build/win:default_exe_manifest",
5461   ]
5462
5463   # The use of exceptions for Torque in violation of the Chromium style-guide
5464   # is justified by the fact that it is only used from the non-essential
5465   # language server and can be removed anytime if it causes problems.
5466   configs = [
5467     ":internal_config",
5468     "//build/config/compiler:exceptions",
5469     "//build/config/compiler:rtti",
5470   ]
5471
5472   remove_configs = [
5473     "//build/config/compiler:no_exceptions",
5474     "//build/config/compiler:no_rtti",
5475   ]
5476
5477   if (is_win && is_asan) {
5478     remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
5479   }
5480 }
5481
5482 if (v8_enable_i18n_support) {
5483   if (current_toolchain == v8_generator_toolchain) {
5484     v8_executable("gen-regexp-special-case") {
5485       visibility = [ ":*" ]  # Only targets in this file can depend on this.
5486
5487       sources = [
5488         "src/regexp/gen-regexp-special-case.cc",
5489         "src/regexp/special-case.h",
5490       ]
5491
5492       deps = [
5493         ":v8_libbase",
5494         ":v8_shared_internal_headers",
5495         "//build/win:default_exe_manifest",
5496         "//third_party/icu",
5497       ]
5498
5499       configs = [ ":internal_config" ]
5500     }
5501   }
5502
5503   action("run_gen-regexp-special-case") {
5504     visibility = [ ":*" ]  # Only targets in this file can depend on this.
5505
5506     script = "tools/run.py"
5507
5508     deps = [ ":gen-regexp-special-case($v8_generator_toolchain)" ]
5509
5510     output_file = "$target_gen_dir/src/regexp/special-case.cc"
5511
5512     outputs = [ output_file ]
5513
5514     args = [
5515       "./" + rebase_path(
5516               get_label_info(
5517                       ":gen-regexp-special-case($v8_generator_toolchain)",
5518                       "root_out_dir") + "/gen-regexp-special-case",
5519               root_build_dir),
5520       rebase_path(output_file, root_build_dir),
5521     ]
5522   }
5523 }
5524
5525 ###############################################################################
5526 # Public targets
5527 #
5528
5529 want_v8_shell =
5530     (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
5531     (current_toolchain == v8_snapshot_toolchain &&
5532      v8_toolset_for_shell == "host") ||
5533     (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
5534
5535 group("gn_all") {
5536   testonly = true
5537
5538   deps = [
5539     ":d8",
5540     ":v8_fuzzers",
5541     ":v8_hello_world",
5542     ":v8_sample_process",
5543     "test:gn_all",
5544     "tools:gn_all",
5545   ]
5546
5547   if (v8_custom_deps != "") {
5548     # Custom dependency from directory under v8/custom_deps.
5549     deps += [ v8_custom_deps ]
5550   }
5551
5552   if (want_v8_shell) {
5553     deps += [ ":v8_shell" ]
5554   }
5555
5556   if (v8_check_header_includes) {
5557     deps += [ ":check_headers" ]
5558   }
5559 }
5560
5561 group("v8_python_base") {
5562   data = [ ".vpython" ]
5563 }
5564
5565 group("v8_clusterfuzz") {
5566   testonly = true
5567
5568   deps = [
5569     ":d8",
5570     ":v8_simple_inspector_fuzzer",
5571   ]
5572
5573   if (v8_multi_arch_build) {
5574     deps += [
5575       ":d8(//build/toolchain/linux:clang_x64)",
5576       ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
5577       ":d8(//build/toolchain/linux:clang_x86)",
5578       ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
5579       ":d8(tools/clusterfuzz/toolchain:clang_x64_pointer_compression)",
5580     ]
5581   }
5582 }
5583
5584 group("v8_archive") {
5585   testonly = true
5586
5587   deps = [ ":d8" ]
5588
5589   if (!is_win) {
5590     # On windows, cctest doesn't link with v8_static_library.
5591     deps += [ "test/cctest:cctest" ]
5592   }
5593 }
5594
5595 # TODO(dglazkov): Remove the "!build_with_chromium" condition once this clause
5596 # is removed from Chromium.
5597 if (is_fuchsia && !build_with_chromium) {
5598   import("//build/config/fuchsia/rules.gni")
5599
5600   cr_fuchsia_package("d8_fuchsia_pkg") {
5601     testonly = true
5602     binary = ":d8"
5603     manifest = "gni/v8.cmx"
5604     package_name_override = "d8"
5605   }
5606
5607   fuchsia_package_runner("d8_fuchsia") {
5608     testonly = true
5609     package = ":d8_fuchsia_pkg"
5610     package_name_override = "d8"
5611   }
5612 }
5613
5614 group("v8_fuzzers") {
5615   testonly = true
5616   data_deps = [
5617     ":v8_simple_inspector_fuzzer",
5618     ":v8_simple_json_fuzzer",
5619     ":v8_simple_parser_fuzzer",
5620     ":v8_simple_regexp_builtins_fuzzer",
5621     ":v8_simple_regexp_fuzzer",
5622   ]
5623
5624   if (v8_enable_webassembly) {
5625     data_deps += [
5626       ":v8_simple_multi_return_fuzzer",
5627       ":v8_simple_wasm_async_fuzzer",
5628       ":v8_simple_wasm_code_fuzzer",
5629       ":v8_simple_wasm_compile_fuzzer",
5630       ":v8_simple_wasm_fuzzer",
5631     ]
5632   }
5633 }
5634
5635 if (is_component_build) {
5636   v8_component("v8") {
5637     sources = [ "src/utils/v8dll-main.cc" ]
5638
5639     public_deps = [
5640       ":v8_base",
5641       ":v8_snapshot",
5642     ]
5643
5644     configs = [ ":internal_config" ]
5645
5646     public_configs = [ ":external_config" ]
5647   }
5648
5649   v8_component("v8_for_testing") {
5650     testonly = true
5651
5652     sources = [ "src/utils/v8dll-main.cc" ]
5653
5654     public_deps = [
5655       ":torque_base",
5656       ":torque_ls_base",
5657       ":v8_base",
5658       ":v8_headers",
5659       ":v8_initializers",
5660       ":v8_snapshot",
5661     ]
5662
5663     configs = [ ":internal_config" ]
5664
5665     public_configs = [ ":external_config" ]
5666   }
5667
5668   v8_component("cppgc") {
5669     public_deps = [ ":cppgc_base" ]
5670
5671     if (!cppgc_is_standalone) {
5672       deps = [ ":v8" ]
5673     }
5674
5675     configs = []
5676     public_configs = [ ":external_config" ]
5677   }
5678
5679   if (cppgc_is_standalone) {
5680     v8_component("cppgc_for_testing") {
5681       testonly = true
5682
5683       public_deps = [ ":cppgc_base" ]
5684
5685       configs = []
5686       public_configs = [ ":external_config" ]
5687     }
5688   }
5689
5690   v8_component("v8_cppgc_shared_for_testing") {
5691     testonly = true
5692
5693     public_deps = [ ":v8_cppgc_shared" ]
5694
5695     configs = []
5696     public_configs = [ ":external_config" ]
5697   }
5698 } else {
5699   group("v8") {
5700     public_deps = [
5701       ":v8_base",
5702       ":v8_snapshot",
5703     ]
5704
5705     public_configs = [ ":external_config" ]
5706   }
5707
5708   group("v8_for_testing") {
5709     testonly = true
5710
5711     public_deps = [
5712       ":torque_base",
5713       ":torque_ls_base",
5714       ":v8_base",
5715       ":v8_initializers",
5716       ":v8_snapshot",
5717     ]
5718
5719     public_configs = [ ":external_config" ]
5720   }
5721
5722   group("cppgc") {
5723     public_deps = [ ":cppgc_base" ]
5724
5725     if (!cppgc_is_standalone) {
5726       deps = [ ":v8" ]
5727     }
5728
5729     public_configs = [ ":external_config" ]
5730   }
5731
5732   if (cppgc_is_standalone) {
5733     group("cppgc_for_testing") {
5734       testonly = true
5735
5736       public_deps = [ ":cppgc_base" ]
5737
5738       public_configs = [ ":external_config" ]
5739     }
5740   }
5741
5742   group("v8_cppgc_shared_for_testing") {
5743     testonly = true
5744
5745     public_deps = [ ":v8_cppgc_shared" ]
5746
5747     public_configs = [ ":external_config" ]
5748   }
5749 }
5750
5751 v8_executable("d8") {
5752   sources = [
5753     "src/d8/async-hooks-wrapper.cc",
5754     "src/d8/async-hooks-wrapper.h",
5755     "src/d8/d8-console.cc",
5756     "src/d8/d8-console.h",
5757     "src/d8/d8-js.cc",
5758     "src/d8/d8-platforms.cc",
5759     "src/d8/d8-platforms.h",
5760     "src/d8/d8-test.cc",
5761     "src/d8/d8.cc",
5762     "src/d8/d8.h",
5763   ]
5764
5765   if (v8_fuzzilli) {
5766     sources += [
5767       "src/d8/cov.cc",
5768       "src/d8/cov.h",
5769     ]
5770   }
5771
5772   configs = [
5773     # Note: don't use :internal_config here because this target will get
5774     # the :external_config applied to it by virtue of depending on :v8, and
5775     # you can't have both applied to the same target.
5776     ":internal_config_base",
5777     ":v8_tracing_config",
5778   ]
5779
5780   deps = [
5781     ":v8",
5782     ":v8_libbase",
5783     ":v8_libplatform",
5784     ":v8_tracing",
5785     "//build/win:default_exe_manifest",
5786   ]
5787
5788   if (is_posix || is_fuchsia) {
5789     sources += [ "src/d8/d8-posix.cc" ]
5790   } else if (is_win) {
5791     sources += [ "src/d8/d8-windows.cc" ]
5792   }
5793
5794   if (v8_correctness_fuzzer) {
5795     deps += [ "tools/clusterfuzz:v8_correctness_fuzzer_resources" ]
5796   }
5797
5798   defines = []
5799
5800   if (v8_enable_vtunejit) {
5801     deps += [ "src/third_party/vtune:v8_vtune" ]
5802   }
5803 }
5804
5805 v8_executable("v8_hello_world") {
5806   sources = [ "samples/hello-world.cc" ]
5807
5808   configs = [
5809     # Note: don't use :internal_config here because this target will get
5810     # the :external_config applied to it by virtue of depending on :v8, and
5811     # you can't have both applied to the same target.
5812     ":internal_config_base",
5813   ]
5814
5815   deps = [
5816     ":v8",
5817     ":v8_libbase",
5818     ":v8_libplatform",
5819     "//build/win:default_exe_manifest",
5820   ]
5821 }
5822
5823 v8_executable("v8_sample_process") {
5824   sources = [ "samples/process.cc" ]
5825
5826   configs = [
5827     # Note: don't use :internal_config here because this target will get
5828     # the :external_config applied to it by virtue of depending on :v8, and
5829     # you can't have both applied to the same target.
5830     ":internal_config_base",
5831   ]
5832
5833   deps = [
5834     ":v8",
5835     ":v8_libbase",
5836     ":v8_libplatform",
5837     "//build/win:default_exe_manifest",
5838   ]
5839 }
5840
5841 if (want_v8_shell) {
5842   v8_executable("v8_shell") {
5843     sources = [ "samples/shell.cc" ]
5844
5845     configs = [
5846       # Note: don't use :internal_config here because this target will get
5847       # the :external_config applied to it by virtue of depending on :v8, and
5848       # you can't have both applied to the same target.
5849       ":internal_config_base",
5850     ]
5851
5852     deps = [
5853       ":v8",
5854       ":v8_libbase",
5855       ":v8_libplatform",
5856       "//build/win:default_exe_manifest",
5857     ]
5858   }
5859 }
5860
5861 v8_executable("cppgc_sample") {
5862   sources = [ "samples/cppgc/cppgc-sample.cc" ]
5863
5864   if (v8_current_cpu == "riscv64") {
5865     libs = [ "atomic" ]
5866   }
5867
5868   configs = [
5869     # Note: don't use :internal_config here because this target will get
5870     # the :external_config applied to it by virtue of depending on :cppgc, and
5871     # you can't have both applied to the same target.
5872     ":internal_config_base",
5873     ":cppgc_base_config",
5874   ]
5875
5876   deps = [ ":cppgc" ]
5877   if (!cppgc_is_standalone) {
5878     deps += [
5879       ":v8",
5880       "//build/win:default_exe_manifest",
5881     ]
5882   }
5883 }
5884
5885 template("v8_fuzzer") {
5886   name = target_name
5887   forward_variables_from(invoker, "*")
5888   v8_executable("v8_simple_" + name) {
5889     deps = [
5890       ":" + name,
5891       "//build/win:default_exe_manifest",
5892     ]
5893
5894     sources = [ "test/fuzzer/fuzzer.cc" ]
5895
5896     configs = [ ":external_config" ]
5897   }
5898 }
5899
5900 v8_source_set("json_fuzzer") {
5901   sources = [ "test/fuzzer/json.cc" ]
5902
5903   deps = [ ":fuzzer_support" ]
5904
5905   configs = [
5906     ":external_config",
5907     ":internal_config_base",
5908   ]
5909 }
5910
5911 v8_fuzzer("json_fuzzer") {
5912 }
5913
5914 v8_source_set("parser_fuzzer") {
5915   sources = [ "test/fuzzer/parser.cc" ]
5916
5917   deps = [ ":fuzzer_support" ]
5918
5919   configs = [
5920     ":external_config",
5921     ":internal_config_base",
5922   ]
5923 }
5924
5925 v8_fuzzer("parser_fuzzer") {
5926 }
5927
5928 v8_source_set("regexp_builtins_fuzzer") {
5929   sources = [
5930     "test/fuzzer/regexp-builtins.cc",
5931     "test/fuzzer/regexp_builtins/mjsunit.js.h",
5932   ]
5933
5934   deps = [ ":fuzzer_support" ]
5935
5936   configs = [
5937     ":external_config",
5938     ":internal_config_base",
5939   ]
5940 }
5941
5942 v8_fuzzer("regexp_builtins_fuzzer") {
5943 }
5944
5945 v8_source_set("regexp_fuzzer") {
5946   sources = [ "test/fuzzer/regexp.cc" ]
5947
5948   deps = [ ":fuzzer_support" ]
5949
5950   configs = [
5951     ":external_config",
5952     ":internal_config_base",
5953   ]
5954 }
5955
5956 v8_fuzzer("regexp_fuzzer") {
5957 }
5958
5959 if (v8_enable_webassembly) {
5960   v8_source_set("multi_return_fuzzer") {
5961     sources = [ "test/fuzzer/multi-return.cc" ]
5962
5963     deps = [ ":fuzzer_support" ]
5964
5965     configs = [
5966       ":external_config",
5967       ":internal_config_base",
5968     ]
5969   }
5970
5971   v8_fuzzer("multi_return_fuzzer") {
5972   }
5973
5974   v8_source_set("wasm_test_common") {
5975     sources = [
5976       "test/common/flag-utils.h",
5977       "test/common/wasm/flag-utils.h",
5978       "test/common/wasm/wasm-interpreter.cc",
5979       "test/common/wasm/wasm-interpreter.h",
5980       "test/common/wasm/wasm-module-runner.cc",
5981       "test/common/wasm/wasm-module-runner.h",
5982     ]
5983
5984     deps = [
5985       ":generate_bytecode_builtins_list",
5986       ":run_torque",
5987       ":v8_internal_headers",
5988       ":v8_libbase",
5989       ":v8_shared_internal_headers",
5990       ":v8_tracing",
5991     ]
5992
5993     public_deps = [ ":v8_maybe_icu" ]
5994
5995     configs = [
5996       ":external_config",
5997       ":internal_config_base",
5998     ]
5999   }
6000
6001   v8_source_set("wasm_fuzzer") {
6002     sources = [ "test/fuzzer/wasm.cc" ]
6003
6004     deps = [
6005       ":fuzzer_support",
6006       ":lib_wasm_fuzzer_common",
6007       ":wasm_test_common",
6008     ]
6009
6010     configs = [
6011       ":external_config",
6012       ":internal_config_base",
6013     ]
6014   }
6015
6016   v8_fuzzer("wasm_fuzzer") {
6017   }
6018
6019   v8_source_set("wasm_async_fuzzer") {
6020     sources = [ "test/fuzzer/wasm-async.cc" ]
6021
6022     deps = [
6023       ":fuzzer_support",
6024       ":lib_wasm_fuzzer_common",
6025       ":wasm_test_common",
6026     ]
6027
6028     configs = [
6029       ":external_config",
6030       ":internal_config_base",
6031     ]
6032   }
6033
6034   v8_fuzzer("wasm_async_fuzzer") {
6035   }
6036
6037   v8_source_set("wasm_code_fuzzer") {
6038     sources = [
6039       "test/common/wasm/test-signatures.h",
6040       "test/fuzzer/wasm-code.cc",
6041     ]
6042
6043     deps = [
6044       ":fuzzer_support",
6045       ":lib_wasm_fuzzer_common",
6046       ":wasm_test_common",
6047     ]
6048
6049     configs = [
6050       ":external_config",
6051       ":internal_config_base",
6052     ]
6053   }
6054
6055   v8_fuzzer("wasm_code_fuzzer") {
6056   }
6057
6058   v8_source_set("lib_wasm_fuzzer_common") {
6059     sources = [
6060       "test/fuzzer/wasm-fuzzer-common.cc",
6061       "test/fuzzer/wasm-fuzzer-common.h",
6062     ]
6063
6064     deps = [
6065       ":fuzzer_support",
6066       ":generate_bytecode_builtins_list",
6067       ":run_torque",
6068       ":v8_internal_headers",
6069       ":v8_tracing",
6070       ":wasm_test_common",
6071     ]
6072
6073     public_deps = [ ":v8_maybe_icu" ]
6074
6075     configs = [
6076       ":external_config",
6077       ":internal_config_base",
6078     ]
6079   }
6080
6081   v8_source_set("wasm_compile_fuzzer") {
6082     sources = [
6083       "test/common/wasm/test-signatures.h",
6084       "test/fuzzer/wasm-compile.cc",
6085     ]
6086
6087     deps = [
6088       ":fuzzer_support",
6089       ":lib_wasm_fuzzer_common",
6090       ":wasm_test_common",
6091     ]
6092
6093     configs = [
6094       ":external_config",
6095       ":internal_config_base",
6096     ]
6097   }
6098
6099   v8_fuzzer("wasm_compile_fuzzer") {
6100   }
6101 }
6102
6103 v8_source_set("inspector_fuzzer") {
6104   sources = [ "test/fuzzer/inspector-fuzzer.cc" ]
6105
6106   deps = [
6107     ":fuzzer_support",
6108     "test/inspector:inspector_test",
6109   ]
6110
6111   configs = [
6112     ":external_config",
6113     ":internal_config_base",
6114   ]
6115 }
6116
6117 v8_fuzzer("inspector_fuzzer") {
6118 }
6119
6120 # Target to build all generated .cc files.
6121 group("v8_generated_cc_files") {
6122   testonly = true
6123
6124   deps = [
6125     ":generate_bytecode_builtins_list",
6126     ":run_torque",
6127     "src/inspector:v8_generated_cc_files",
6128   ]
6129 }
6130
6131 # Protobuf targets, used only when building outside of chromium.
6132
6133 if (!build_with_chromium && v8_use_perfetto) {
6134   # This config is applied to the autogenerated .pb.{cc,h} files in
6135   # proto_library.gni. This config is propagated up to the source sets
6136   # that depend on generated proto headers.
6137   config("protobuf_gen_config") {
6138     defines = [
6139       "GOOGLE_PROTOBUF_NO_RTTI",
6140       "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
6141     ]
6142     cflags = [
6143       "-Wno-unknown-warning-option",
6144       "-Wno-deprecated",
6145       "-Wno-undef",
6146       "-Wno-zero-as-null-pointer-constant",
6147       "-Wno-thread-safety-attributes",
6148     ]
6149     include_dirs = [ "third_party/protobuf/src" ]
6150   }
6151
6152   # Configuration used to build libprotobuf_* and the protoc compiler.
6153   config("protobuf_config") {
6154     # Apply the lighter supressions and macro definitions from above.
6155     configs = [ ":protobuf_gen_config" ]
6156
6157     if (!is_win) {
6158       defines = [ "HAVE_PTHREAD=1" ]
6159     }
6160     if (is_clang) {
6161       cflags = [
6162         "-Wno-unused-private-field",
6163         "-Wno-unused-function",
6164         "-Wno-inconsistent-missing-override",
6165         "-Wno-unknown-warning-option",
6166         "-Wno-enum-compare-switch",
6167         "-Wno-user-defined-warnings",
6168         "-Wno-tautological-constant-compare",
6169       ]
6170     }
6171     if (is_win && is_clang) {
6172       cflags += [ "-Wno-microsoft-unqualified-friend" ]
6173     }
6174   }
6175
6176   source_set("protobuf_lite") {
6177     sources = [
6178       "third_party/protobuf/src/google/protobuf/any_lite.cc",
6179       "third_party/protobuf/src/google/protobuf/arena.cc",
6180       "third_party/protobuf/src/google/protobuf/arena.h",
6181       "third_party/protobuf/src/google/protobuf/arena_impl.h",
6182       "third_party/protobuf/src/google/protobuf/arenastring.h",
6183       "third_party/protobuf/src/google/protobuf/extension_set.cc",
6184       "third_party/protobuf/src/google/protobuf/extension_set.h",
6185       "third_party/protobuf/src/google/protobuf/generated_enum_util.cc",
6186       "third_party/protobuf/src/google/protobuf/generated_enum_util.h",
6187       "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
6188       "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.h",
6189       "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
6190       "third_party/protobuf/src/google/protobuf/generated_message_util.h",
6191       "third_party/protobuf/src/google/protobuf/has_bits.h",
6192       "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
6193       "third_party/protobuf/src/google/protobuf/implicit_weak_message.h",
6194       "third_party/protobuf/src/google/protobuf/inlined_string_field.h",
6195       "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
6196       "third_party/protobuf/src/google/protobuf/io/coded_stream.h",
6197       "third_party/protobuf/src/google/protobuf/io/coded_stream_inl.h",
6198       "third_party/protobuf/src/google/protobuf/io/io_win32.cc",
6199       "third_party/protobuf/src/google/protobuf/io/io_win32.h",
6200       "third_party/protobuf/src/google/protobuf/io/strtod.cc",
6201       "third_party/protobuf/src/google/protobuf/io/strtod.h",
6202       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc",
6203       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.h",
6204       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
6205       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h",
6206       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
6207       "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h",
6208       "third_party/protobuf/src/google/protobuf/map.h",
6209       "third_party/protobuf/src/google/protobuf/map_entry_lite.h",
6210       "third_party/protobuf/src/google/protobuf/map_field_lite.h",
6211       "third_party/protobuf/src/google/protobuf/map_type_handler.h",
6212       "third_party/protobuf/src/google/protobuf/message_lite.cc",
6213       "third_party/protobuf/src/google/protobuf/message_lite.h",
6214       "third_party/protobuf/src/google/protobuf/repeated_field.cc",
6215       "third_party/protobuf/src/google/protobuf/repeated_field.h",
6216       "third_party/protobuf/src/google/protobuf/stubs/bytestream.cc",
6217       "third_party/protobuf/src/google/protobuf/stubs/bytestream.h",
6218       "third_party/protobuf/src/google/protobuf/stubs/callback.h",
6219       "third_party/protobuf/src/google/protobuf/stubs/casts.h",
6220       "third_party/protobuf/src/google/protobuf/stubs/common.cc",
6221       "third_party/protobuf/src/google/protobuf/stubs/common.h",
6222       "third_party/protobuf/src/google/protobuf/stubs/fastmem.h",
6223       "third_party/protobuf/src/google/protobuf/stubs/hash.h",
6224       "third_party/protobuf/src/google/protobuf/stubs/int128.cc",
6225       "third_party/protobuf/src/google/protobuf/stubs/int128.h",
6226       "third_party/protobuf/src/google/protobuf/stubs/logging.h",
6227       "third_party/protobuf/src/google/protobuf/stubs/macros.h",
6228       "third_party/protobuf/src/google/protobuf/stubs/map_util.h",
6229       "third_party/protobuf/src/google/protobuf/stubs/mutex.h",
6230       "third_party/protobuf/src/google/protobuf/stubs/once.h",
6231       "third_party/protobuf/src/google/protobuf/stubs/platform_macros.h",
6232       "third_party/protobuf/src/google/protobuf/stubs/port.h",
6233       "third_party/protobuf/src/google/protobuf/stubs/status.cc",
6234       "third_party/protobuf/src/google/protobuf/stubs/status.h",
6235       "third_party/protobuf/src/google/protobuf/stubs/status_macros.h",
6236       "third_party/protobuf/src/google/protobuf/stubs/statusor.cc",
6237       "third_party/protobuf/src/google/protobuf/stubs/statusor.h",
6238       "third_party/protobuf/src/google/protobuf/stubs/stl_util.h",
6239       "third_party/protobuf/src/google/protobuf/stubs/stringpiece.cc",
6240       "third_party/protobuf/src/google/protobuf/stubs/stringpiece.h",
6241       "third_party/protobuf/src/google/protobuf/stubs/stringprintf.cc",
6242       "third_party/protobuf/src/google/protobuf/stubs/stringprintf.h",
6243       "third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc",
6244       "third_party/protobuf/src/google/protobuf/stubs/strutil.cc",
6245       "third_party/protobuf/src/google/protobuf/stubs/strutil.h",
6246       "third_party/protobuf/src/google/protobuf/stubs/template_util.h",
6247       "third_party/protobuf/src/google/protobuf/stubs/time.cc",
6248       "third_party/protobuf/src/google/protobuf/stubs/time.h",
6249       "third_party/protobuf/src/google/protobuf/wire_format_lite.cc",
6250       "third_party/protobuf/src/google/protobuf/wire_format_lite.h",
6251     ]
6252     configs -= [ "//build/config/compiler:chromium_code" ]
6253     configs += [
6254       "//build/config/compiler:no_chromium_code",
6255       ":protobuf_config",
6256     ]
6257     if (is_win) {
6258       configs -= [ "//build/config/win:lean_and_mean" ]
6259     }
6260     public_configs = [ ":protobuf_gen_config" ]
6261   }
6262
6263   # This target should be used only by the protoc compiler and by test targets.
6264   source_set("protobuf_full") {
6265     deps = [ ":protobuf_lite" ]
6266     sources = [
6267       "third_party/protobuf/src/google/protobuf/any.cc",
6268       "third_party/protobuf/src/google/protobuf/any.h",
6269       "third_party/protobuf/src/google/protobuf/any.pb.cc",
6270       "third_party/protobuf/src/google/protobuf/any.pb.h",
6271       "third_party/protobuf/src/google/protobuf/api.pb.cc",
6272       "third_party/protobuf/src/google/protobuf/api.pb.h",
6273       "third_party/protobuf/src/google/protobuf/compiler/importer.cc",
6274       "third_party/protobuf/src/google/protobuf/compiler/importer.h",
6275       "third_party/protobuf/src/google/protobuf/compiler/parser.cc",
6276       "third_party/protobuf/src/google/protobuf/compiler/parser.h",
6277       "third_party/protobuf/src/google/protobuf/descriptor.cc",
6278       "third_party/protobuf/src/google/protobuf/descriptor.h",
6279       "third_party/protobuf/src/google/protobuf/descriptor.pb.cc",
6280       "third_party/protobuf/src/google/protobuf/descriptor.pb.h",
6281       "third_party/protobuf/src/google/protobuf/descriptor_database.cc",
6282       "third_party/protobuf/src/google/protobuf/descriptor_database.h",
6283       "third_party/protobuf/src/google/protobuf/duration.pb.cc",
6284       "third_party/protobuf/src/google/protobuf/duration.pb.h",
6285       "third_party/protobuf/src/google/protobuf/dynamic_message.cc",
6286       "third_party/protobuf/src/google/protobuf/dynamic_message.h",
6287       "third_party/protobuf/src/google/protobuf/empty.pb.cc",
6288       "third_party/protobuf/src/google/protobuf/empty.pb.h",
6289       "third_party/protobuf/src/google/protobuf/extension_set_heavy.cc",
6290       "third_party/protobuf/src/google/protobuf/field_mask.pb.cc",
6291       "third_party/protobuf/src/google/protobuf/field_mask.pb.h",
6292       "third_party/protobuf/src/google/protobuf/generated_enum_reflection.h",
6293       "third_party/protobuf/src/google/protobuf/generated_message_reflection.cc",
6294       "third_party/protobuf/src/google/protobuf/generated_message_reflection.h",
6295       "third_party/protobuf/src/google/protobuf/io/gzip_stream.cc",
6296       "third_party/protobuf/src/google/protobuf/io/gzip_stream.h",
6297       "third_party/protobuf/src/google/protobuf/io/printer.cc",
6298       "third_party/protobuf/src/google/protobuf/io/printer.h",
6299       "third_party/protobuf/src/google/protobuf/io/tokenizer.cc",
6300       "third_party/protobuf/src/google/protobuf/io/tokenizer.h",
6301       "third_party/protobuf/src/google/protobuf/map_entry.h",
6302       "third_party/protobuf/src/google/protobuf/map_field.cc",
6303       "third_party/protobuf/src/google/protobuf/map_field.h",
6304       "third_party/protobuf/src/google/protobuf/map_field_inl.h",
6305       "third_party/protobuf/src/google/protobuf/message.cc",
6306       "third_party/protobuf/src/google/protobuf/message.h",
6307       "third_party/protobuf/src/google/protobuf/metadata.h",
6308       "third_party/protobuf/src/google/protobuf/reflection.h",
6309       "third_party/protobuf/src/google/protobuf/reflection_internal.h",
6310       "third_party/protobuf/src/google/protobuf/reflection_ops.cc",
6311       "third_party/protobuf/src/google/protobuf/reflection_ops.h",
6312       "third_party/protobuf/src/google/protobuf/service.cc",
6313       "third_party/protobuf/src/google/protobuf/service.h",
6314       "third_party/protobuf/src/google/protobuf/source_context.pb.cc",
6315       "third_party/protobuf/src/google/protobuf/source_context.pb.h",
6316       "third_party/protobuf/src/google/protobuf/struct.pb.cc",
6317       "third_party/protobuf/src/google/protobuf/struct.pb.h",
6318       "third_party/protobuf/src/google/protobuf/stubs/mathlimits.cc",
6319       "third_party/protobuf/src/google/protobuf/stubs/mathlimits.h",
6320       "third_party/protobuf/src/google/protobuf/stubs/mathutil.h",
6321       "third_party/protobuf/src/google/protobuf/stubs/substitute.cc",
6322       "third_party/protobuf/src/google/protobuf/stubs/substitute.h",
6323       "third_party/protobuf/src/google/protobuf/text_format.cc",
6324       "third_party/protobuf/src/google/protobuf/text_format.h",
6325       "third_party/protobuf/src/google/protobuf/timestamp.pb.cc",
6326       "third_party/protobuf/src/google/protobuf/timestamp.pb.h",
6327       "third_party/protobuf/src/google/protobuf/type.pb.cc",
6328       "third_party/protobuf/src/google/protobuf/type.pb.h",
6329       "third_party/protobuf/src/google/protobuf/unknown_field_set.cc",
6330       "third_party/protobuf/src/google/protobuf/unknown_field_set.h",
6331       "third_party/protobuf/src/google/protobuf/util/field_comparator.cc",
6332       "third_party/protobuf/src/google/protobuf/util/field_comparator.h",
6333       "third_party/protobuf/src/google/protobuf/util/field_mask_util.cc",
6334       "third_party/protobuf/src/google/protobuf/util/field_mask_util.h",
6335       "third_party/protobuf/src/google/protobuf/util/internal/constants.h",
6336       "third_party/protobuf/src/google/protobuf/util/internal/datapiece.cc",
6337       "third_party/protobuf/src/google/protobuf/util/internal/datapiece.h",
6338       "third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
6339       "third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.h",
6340       "third_party/protobuf/src/google/protobuf/util/internal/error_listener.cc",
6341       "third_party/protobuf/src/google/protobuf/util/internal/error_listener.h",
6342       "third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
6343       "third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.h",
6344       "third_party/protobuf/src/google/protobuf/util/internal/json_escaping.cc",
6345       "third_party/protobuf/src/google/protobuf/util/internal/json_escaping.h",
6346       "third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
6347       "third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.h",
6348       "third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
6349       "third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.h",
6350       "third_party/protobuf/src/google/protobuf/util/internal/location_tracker.h",
6351       "third_party/protobuf/src/google/protobuf/util/internal/object_location_tracker.h",
6352       "third_party/protobuf/src/google/protobuf/util/internal/object_source.h",
6353       "third_party/protobuf/src/google/protobuf/util/internal/object_writer.cc",
6354       "third_party/protobuf/src/google/protobuf/util/internal/object_writer.h",
6355       "third_party/protobuf/src/google/protobuf/util/internal/proto_writer.cc",
6356       "third_party/protobuf/src/google/protobuf/util/internal/proto_writer.h",
6357       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
6358       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.h",
6359       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
6360       "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.h",
6361       "third_party/protobuf/src/google/protobuf/util/internal/structured_objectwriter.h",
6362       "third_party/protobuf/src/google/protobuf/util/internal/type_info.cc",
6363       "third_party/protobuf/src/google/protobuf/util/internal/type_info.h",
6364       "third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
6365       "third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.h",
6366       "third_party/protobuf/src/google/protobuf/util/internal/utility.cc",
6367       "third_party/protobuf/src/google/protobuf/util/internal/utility.h",
6368       "third_party/protobuf/src/google/protobuf/util/json_util.cc",
6369       "third_party/protobuf/src/google/protobuf/util/json_util.h",
6370       "third_party/protobuf/src/google/protobuf/util/message_differencer.cc",
6371       "third_party/protobuf/src/google/protobuf/util/message_differencer.h",
6372       "third_party/protobuf/src/google/protobuf/util/time_util.cc",
6373       "third_party/protobuf/src/google/protobuf/util/time_util.h",
6374       "third_party/protobuf/src/google/protobuf/util/type_resolver.h",
6375       "third_party/protobuf/src/google/protobuf/util/type_resolver_util.cc",
6376       "third_party/protobuf/src/google/protobuf/util/type_resolver_util.h",
6377       "third_party/protobuf/src/google/protobuf/wire_format.cc",
6378       "third_party/protobuf/src/google/protobuf/wire_format.h",
6379       "third_party/protobuf/src/google/protobuf/wrappers.pb.cc",
6380       "third_party/protobuf/src/google/protobuf/wrappers.pb.h",
6381     ]
6382     configs -= [ "//build/config/compiler:chromium_code" ]
6383     configs += [
6384       "//build/config/compiler:no_chromium_code",
6385       ":protobuf_config",
6386     ]
6387     if (is_win) {
6388       configs -= [ "//build/config/win:lean_and_mean" ]
6389     }
6390     public_configs = [ ":protobuf_gen_config" ]
6391   }
6392
6393   if (current_toolchain == host_toolchain) {
6394     source_set("protoc_lib") {
6395       deps = [ ":protobuf_full" ]
6396       sources = [
6397         "third_party/protobuf/src/google/protobuf/compiler/code_generator.cc",
6398         "third_party/protobuf/src/google/protobuf/compiler/code_generator.h",
6399         "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc",
6400         "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.h",
6401         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
6402         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.h",
6403         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
6404         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.h",
6405         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
6406         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.h",
6407         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
6408         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.h",
6409         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
6410         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.h",
6411         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
6412         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h",
6413         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
6414         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h",
6415         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
6416         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.h",
6417         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
6418         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.h",
6419         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
6420         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h",
6421         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h",
6422         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h",
6423         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
6424         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h",
6425         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
6426         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.h",
6427         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
6428         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.h",
6429         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
6430         "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.h",
6431         "third_party/protobuf/src/google/protobuf/compiler/plugin.cc",
6432         "third_party/protobuf/src/google/protobuf/compiler/plugin.h",
6433         "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc",
6434         "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h",
6435         "third_party/protobuf/src/google/protobuf/compiler/subprocess.cc",
6436         "third_party/protobuf/src/google/protobuf/compiler/subprocess.h",
6437         "third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc",
6438         "third_party/protobuf/src/google/protobuf/compiler/zip_writer.h",
6439       ]
6440       configs -= [ "//build/config/compiler:chromium_code" ]
6441       configs += [
6442         "//build/config/compiler:no_chromium_code",
6443         ":protobuf_config",
6444       ]
6445       if (is_win) {
6446         configs -= [ "//build/config/win:lean_and_mean" ]
6447       }
6448       public_configs = [ ":protobuf_gen_config" ]
6449     }
6450
6451     executable("protoc") {
6452       deps = [
6453         ":protoc_lib",
6454         "//build/win:default_exe_manifest",
6455       ]
6456       sources = [ "src/protobuf/protobuf-compiler-main.cc" ]
6457       configs -= [ "//build/config/compiler:chromium_code" ]
6458       configs += [ "//build/config/compiler:no_chromium_code" ]
6459     }
6460   }  # host_toolchain
6461
6462   v8_component("v8_libperfetto") {
6463     configs = [ ":v8_tracing_config" ]
6464     public_configs = [ "//third_party/perfetto/gn:public_config" ]
6465     deps = [
6466       "//third_party/perfetto/src/trace_processor:storage_minimal",
6467       "//third_party/perfetto/src/tracing/core",
6468
6469       # TODO(skyostil): Support non-POSIX platforms.
6470       "//third_party/perfetto/protos/perfetto/config:cpp",
6471       "//third_party/perfetto/protos/perfetto/trace/track_event:zero",
6472       "//third_party/perfetto/src/tracing:in_process_backend",
6473       "//third_party/perfetto/src/tracing:platform_impl",
6474     ]
6475
6476     public_deps = [
6477       "//third_party/perfetto/include/perfetto/trace_processor",
6478       "//third_party/perfetto/src/trace_processor:export_json",
6479       "//third_party/perfetto/src/tracing:client_api",
6480     ]
6481   }
6482 }  # if (!build_with_chromium && v8_use_perfetto)