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
5import("//build/config/android/config.gni")
6import("//build/config/arm.gni")
7import("//build/config/dcheck_always_on.gni")
8import("//build/config/host_byteorder.gni")
9import("//build/config/jumbo.gni")
10import("//build/config/mips.gni")
11import("//build/config/sanitizers/sanitizers.gni")
12import("//build_overrides/build.gni")
13
14if (is_android) {
15  import("//build/config/android/rules.gni")
16}
17
18import("gni/snapshot_toolchain.gni")
19import("gni/v8.gni")
20
21# Specifies if the target build is a simulator build. Comparing target cpu
22# with v8 target cpu to not affect simulator builds for making cross-compile
23# snapshots.
24target_is_simulator = (target_cpu != v8_target_cpu && !v8_multi_arch_build) ||
25                      (current_cpu != v8_current_cpu && v8_multi_arch_build)
26
27# For faster Windows builds. See https://crbug.com/v8/8475.
28emit_builtins_as_inline_asm = is_win && is_clang
29
30declare_args() {
31  # Print to stdout on Android.
32  v8_android_log_stdout = false
33
34  # Dynamically set an additional dependency from v8/custom_deps.
35  v8_custom_deps = ""
36
37  # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode
38  # within a release Chrome.
39  v8_enable_debugging_features = is_debug
40
41  # Sets -DV8_ENABLE_FUTURE.
42  v8_enable_future = false
43
44  # Lite mode disables a number of performance optimizations to reduce memory
45  # at the cost of performance.
46  # Sets --DV8_LITE_MODE.
47  v8_enable_lite_mode = false
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_HANDLE_ZAPPING.
83  v8_enable_handle_zapping = is_debug
84
85  # Enable slow dchecks.
86  v8_enable_slow_dchecks = false
87
88  # Enable fast mksnapshot runs.
89  v8_enable_fast_mksnapshot = false
90
91  # Optimize code for Torque executable, even during a debug build.
92  v8_enable_fast_torque = ""
93
94  # Enable the registration of unwinding info for Windows x64 and ARM64.
95  v8_win64_unwinding_info = true
96
97  # Enable code comments for builtins in the snapshot (impacts performance).
98  v8_enable_snapshot_code_comments = false
99
100  # Enable native counters from the snapshot (impacts performance, sets
101  # -dV8_SNAPSHOT_NATIVE_CODE_COUNTERS).
102  # This option will generate extra code in the snapshot to increment counters,
103  # as per the --native-code-counters flag.
104  v8_enable_snapshot_native_code_counters = ""
105
106  # Enable code-generation-time checking of types in the CodeStubAssembler.
107  v8_enable_verify_csa = false
108
109  # Enable pointer compression (sets -dV8_COMPRESS_POINTERS).
110  v8_enable_pointer_compression = ""
111  v8_enable_31bit_smis_on_64bit_arch = false
112
113  # Sets -dOBJECT_PRINT.
114  v8_enable_object_print = ""
115
116  # Sets -dV8_TRACE_MAPS.
117  v8_enable_trace_maps = ""
118
119  # Sets -dV8_ENABLE_CHECKS.
120  v8_enable_v8_checks = ""
121
122  # Sets -dV8_TRACE_IGNITION.
123  v8_enable_trace_ignition = false
124
125  # Sets -dV8_TRACE_FEEDBACK_UPDATES.
126  v8_enable_trace_feedback_updates = false
127
128  # Sets -dV8_CONCURRENT_MARKING
129  v8_enable_concurrent_marking = true
130
131  # Sets -dV8_ARRAY_BUFFER_EXTENSION
132  v8_enable_array_buffer_extension = true
133
134  # Enables various testing features.
135  v8_enable_test_features = ""
136
137  # With post mortem support enabled, metadata is embedded into libv8 that
138  # describes various parameters of the VM for use by debuggers. See
139  # tools/gen-postmortem-metadata.py for details.
140  v8_postmortem_support = false
141
142  # Use Siphash as added protection against hash flooding attacks.
143  v8_use_siphash = false
144
145  # Switches off inlining in V8.
146  v8_no_inline = false
147
148  # Override OS page size when generating snapshot
149  v8_os_page_size = "0"
150
151  # Similar to vfp but on MIPS.
152  v8_can_use_fpu_instructions = true
153
154  # Similar to the ARM hard float ABI but on MIPS.
155  v8_use_mips_abi_hardfloat = true
156
157  # If true, doesn't compile debug symbols into v8base reducing the
158  # size of the binary and increasing the speed of gdb.
159  remove_v8base_debug_symbols = false
160
161  # Controls the threshold for on-heap/off-heap Typed Arrays.
162  v8_typed_array_max_size_in_heap = 64
163
164  v8_enable_gdbjit =
165      ((v8_current_cpu == "x86" || v8_current_cpu == "x64") &&
166       (is_linux || is_mac)) || (v8_current_cpu == "ppc64" && is_linux)
167
168  # Temporary flag to allow embedders to update their microtasks scopes
169  # while rolling in a new version of V8.
170  v8_check_microtasks_scopes_consistency = ""
171
172  # Enable mitigations for executing untrusted code.
173  # Disabled by default on ia32 due to conflicting requirements with embedded
174  # builtins. Enabled by default on Android since it doesn't support
175  # site-isolation in Chrome and on simulator builds which test code generation
176  # on these platforms.
177  v8_untrusted_code_mitigations =
178      v8_current_cpu != "x86" && (is_android || target_is_simulator)
179
180  # Enable minor mark compact.
181  v8_enable_minor_mc = true
182
183  # Check that each header can be included in isolation (requires also
184  # setting the "check_v8_header_includes" gclient variable to run a
185  # specific hook).
186  v8_check_header_includes = false
187
188  # Enable sharing read-only space across isolates.
189  # Sets -DV8_SHARED_RO_HEAP.
190  v8_enable_shared_ro_heap = ""
191
192  # Enable lazy source positions by default.
193  v8_enable_lazy_source_positions = true
194
195  # Enable third party HEAP library
196  v8_enable_third_party_heap = false
197
198  # Libaries used by third party heap
199  v8_third_party_heap_libs = []
200
201  # Source code used by third party heap
202  v8_third_party_heap_files = []
203
204  # Disable write barriers when GCs are non-incremental and
205  # heap has single generation.
206  v8_disable_write_barriers = false
207
208  # Redirect allocation in young generation so that there will be
209  # only one single generation.
210  v8_enable_single_generation = ""
211
212  # Use token threaded dispatch for the regular expression interpreter.
213  # Use switch-based dispatch if this is false
214  v8_enable_regexp_interpreter_threaded_dispatch = true
215
216  # Enable additional targets necessary for verification of torque
217  # file generation
218  v8_verify_torque_generation_invariance = false
219
220  # Disable all snapshot compression.
221  v8_enable_snapshot_compression = true
222
223  # Enable control-flow integrity features, such as pointer authentication for
224  # ARM64.
225  v8_control_flow_integrity = false
226}
227
228# Derived defaults.
229if (v8_enable_verify_heap == "") {
230  v8_enable_verify_heap = v8_enable_debugging_features
231}
232if (v8_enable_object_print == "") {
233  v8_enable_object_print = v8_enable_debugging_features
234}
235if (v8_enable_disassembler == "") {
236  v8_enable_disassembler = v8_enable_debugging_features
237}
238if (v8_enable_trace_maps == "") {
239  v8_enable_trace_maps = v8_enable_debugging_features
240}
241if (v8_enable_test_features == "") {
242  v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
243}
244if (v8_enable_v8_checks == "") {
245  v8_enable_v8_checks = v8_enable_debugging_features
246}
247if (v8_check_microtasks_scopes_consistency == "") {
248  v8_check_microtasks_scopes_consistency =
249      v8_enable_debugging_features || dcheck_always_on
250}
251if (v8_enable_snapshot_native_code_counters == "") {
252  v8_enable_snapshot_native_code_counters = v8_enable_debugging_features
253}
254if (v8_enable_pointer_compression == "") {
255  # TODO(v8:v7703): temporarily enable pointer compression on arm64 and on x64
256  v8_enable_pointer_compression =
257      v8_current_cpu == "arm64" || v8_current_cpu == "x64"
258}
259if (v8_enable_fast_torque == "") {
260  v8_enable_fast_torque = v8_enable_fast_mksnapshot
261}
262
263if (v8_enable_single_generation == "") {
264  v8_enable_single_generation = v8_disable_write_barriers
265}
266
267# Toggle pointer compression for correctness fuzzing when building the
268# clang_x64_pointer_compression toolchain. We'll correctness-compare the
269# default build with the clang_x64_pointer_compression build.
270if (v8_multi_arch_build &&
271    rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) ==
272    "clang_x64_pointer_compression") {
273  v8_enable_pointer_compression = !v8_enable_pointer_compression
274}
275if (v8_enable_shared_ro_heap == "") {
276  v8_enable_shared_ro_heap = !v8_enable_pointer_compression
277}
278
279assert(!v8_disable_write_barriers || v8_enable_single_generation,
280       "Disabling write barriers works only with single generation")
281
282assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations,
283       "Untrusted code mitigations are unsupported on ia32")
284
285assert(v8_current_cpu == "arm64" || !v8_control_flow_integrity,
286       "Control-flow integrity is only supported on arm64")
287
288assert(
289    !v8_enable_pointer_compression || !v8_enable_shared_ro_heap,
290    "Pointer compression is not supported with shared read-only heap enabled")
291
292v8_random_seed = "314159265"
293v8_toolset_for_shell = "host"
294
295###############################################################################
296# Configurations
297#
298
299config("internal_config_base") {
300  visibility = [ ":*" ]  # Only targets in this file can depend on this.
301
302  include_dirs = [
303    ".",
304    "$target_gen_dir",
305  ]
306}
307
308config("internal_config") {
309  defines = []
310  visibility = [ ":*" ]  # Only targets in this file can depend on this.
311
312  configs = [
313    "//build/config/compiler:wexit_time_destructors",
314    ":internal_config_base",
315    ":v8_header_features",
316    ":v8_tracing_config",
317  ]
318
319  if (is_component_build) {
320    defines += [ "BUILDING_V8_SHARED" ]
321  }
322}
323
324# Should be applied to all targets that write trace events.
325config("v8_tracing_config") {
326  if (v8_use_perfetto) {
327    include_dirs = [
328      "third_party/perfetto/include",
329      "$root_gen_dir/third_party/perfetto",
330      "$root_gen_dir/third_party/perfetto/build_config",
331    ]
332  }
333}
334
335# This config should be applied to code using the libplatform.
336config("libplatform_config") {
337  include_dirs = [ "include" ]
338  if (is_component_build) {
339    defines = [ "USING_V8_PLATFORM_SHARED" ]
340  }
341}
342
343# This config should be applied to code using the libbase.
344config("libbase_config") {
345  if (is_component_build) {
346    defines = [ "USING_V8_BASE_SHARED" ]
347  }
348  libs = []
349  if (is_android && current_toolchain != host_toolchain) {
350    libs += [ "log" ]
351  }
352}
353
354# This config should be applied to code using the libsampler.
355config("libsampler_config") {
356  include_dirs = [ "include" ]
357}
358
359# This config should only be applied to code using V8 and not any V8 code
360# itself.
361config("external_config") {
362  defines = []
363  configs = [ ":v8_header_features" ]
364  if (is_component_build) {
365    defines += [ "USING_V8_SHARED" ]
366  }
367  include_dirs = [
368    "include",
369    "$target_gen_dir/include",
370  ]
371}
372
373# This config should only be applied to code that needs to be explicitly
374# aware of whether we are using startup data or not.
375config("external_startup_data") {
376  if (v8_use_external_startup_data) {
377    defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
378  }
379}
380
381# Put defines that are used in public headers here; public headers are
382# defined in "v8_headers" and are included by embedders of V8.
383config("v8_header_features") {
384  visibility = [ ":*" ]
385
386  defines = []
387
388  if (v8_enable_v8_checks) {
389    defines += [ "V8_ENABLE_CHECKS" ]  # Used in "include/v8.h".
390  }
391  if (v8_enable_pointer_compression) {
392    defines += [ "V8_COMPRESS_POINTERS" ]
393  }
394  if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
395    defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
396  }
397  if (v8_deprecation_warnings) {
398    defines += [ "V8_DEPRECATION_WARNINGS" ]
399  }
400  if (v8_imminent_deprecation_warnings) {
401    defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
402  }
403}
404
405# Put defines here that are only used in our internal files and NEVER in
406# external headers that embedders (such as chromium and node) might include.
407config("features") {
408  visibility = [ ":*" ]  # Only targets in this file can depend on this.
409
410  defines = []
411
412  configs = [ ":v8_header_features" ]
413
414  if (v8_embedder_string != "") {
415    defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
416  }
417  if (v8_enable_disassembler) {
418    defines += [ "ENABLE_DISASSEMBLER" ]
419  }
420  if (v8_promise_internal_field_count != 0) {
421    defines +=
422        [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
423  }
424  defines +=
425      [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
426
427  assert(
428      !v8_enable_raw_heap_snapshots,
429      "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.")
430
431  if (v8_enable_future) {
432    defines += [ "V8_ENABLE_FUTURE" ]
433  }
434  if (v8_enable_lite_mode) {
435    defines += [ "V8_LITE_MODE" ]
436
437    # TODO(v8:7777): Remove the define once the --jitless runtime flag does
438    # everything we need.
439    defines += [ "V8_JITLESS_MODE" ]
440  }
441  if (v8_enable_gdbjit) {
442    defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
443  }
444  if (v8_enable_vtunejit) {
445    defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
446  }
447  if (v8_enable_vtunetracemark) {
448    defines += [ "ENABLE_VTUNE_TRACEMARK" ]
449  }
450  if (v8_enable_minor_mc) {
451    defines += [ "ENABLE_MINOR_MC" ]
452  }
453  if (v8_enable_object_print) {
454    defines += [ "OBJECT_PRINT" ]
455  }
456  if (v8_enable_verify_heap) {
457    defines += [ "VERIFY_HEAP" ]
458  }
459  if (v8_enable_verify_predictable) {
460    defines += [ "VERIFY_PREDICTABLE" ]
461  }
462  if (v8_enable_trace_maps) {
463    defines += [ "V8_TRACE_MAPS" ]
464  }
465  if (v8_enable_trace_ignition) {
466    defines += [ "V8_TRACE_IGNITION" ]
467  }
468  if (v8_enable_trace_feedback_updates) {
469    defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
470  }
471  if (v8_enable_test_features) {
472    defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
473    defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
474    defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
475  }
476  if (v8_enable_i18n_support) {
477    defines += [ "V8_INTL_SUPPORT" ]
478  }
479  if (v8_enable_handle_zapping) {
480    defines += [ "ENABLE_HANDLE_ZAPPING" ]
481  }
482  if (v8_enable_snapshot_native_code_counters) {
483    defines += [ "V8_SNAPSHOT_NATIVE_CODE_COUNTERS" ]
484  }
485  if (v8_enable_single_generation) {
486    defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
487  }
488  if (v8_disable_write_barriers) {
489    defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
490  }
491  if (v8_enable_third_party_heap) {
492    defines += [ "V8_ENABLE_THIRD_PARTY_HEAP" ]
493  }
494  if (v8_use_external_startup_data) {
495    defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
496  }
497  if (v8_enable_concurrent_marking) {
498    defines += [ "V8_CONCURRENT_MARKING" ]
499  }
500  if (v8_enable_array_buffer_extension) {
501    defines += [ "V8_ARRAY_BUFFER_EXTENSION" ]
502  }
503  if (v8_enable_lazy_source_positions) {
504    defines += [ "V8_ENABLE_LAZY_SOURCE_POSITIONS" ]
505  }
506  if (v8_check_microtasks_scopes_consistency) {
507    defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ]
508  }
509
510  # TODO(v8:8519): Remove the define once all use-sites in
511  #                the code are removed/fixed
512  defines += [ "V8_EMBEDDED_BUILTINS" ]
513  if (v8_use_multi_snapshots) {
514    defines += [ "V8_MULTI_SNAPSHOTS" ]
515  }
516  if (v8_use_siphash) {
517    defines += [ "V8_USE_SIPHASH" ]
518  }
519  if (v8_enable_shared_ro_heap) {
520    defines += [ "V8_SHARED_RO_HEAP" ]
521  }
522  if (v8_use_perfetto) {
523    defines += [ "V8_USE_PERFETTO" ]
524  }
525  if (v8_win64_unwinding_info) {
526    defines += [ "V8_WIN64_UNWINDING_INFO" ]
527  }
528  if (v8_enable_regexp_interpreter_threaded_dispatch) {
529    defines += [ "V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH" ]
530  }
531  if (v8_enable_snapshot_compression) {
532    defines += [ "V8_SNAPSHOT_COMPRESSION" ]
533  }
534  if (v8_control_flow_integrity) {
535    defines += [ "V8_ENABLE_CONTROL_FLOW_INTEGRITY" ]
536  }
537  if (v8_enable_wasm_gdb_remote_debugging) {
538    defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ]
539  }
540}
541
542config("toolchain") {
543  visibility = [ ":*" ]  # Only targets in this file can depend on this.
544
545  defines = []
546  cflags = []
547  ldflags = []
548
549  if (v8_current_cpu == "arm") {
550    defines += [ "V8_TARGET_ARCH_ARM" ]
551    if (arm_version >= 7) {
552      defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
553    }
554    if (arm_fpu == "vfpv3-d16") {
555      defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
556    } else if (arm_fpu == "vfpv3") {
557      defines += [
558        "CAN_USE_VFP3_INSTRUCTIONS",
559        "CAN_USE_VFP32DREGS",
560      ]
561    } else if (arm_fpu == "neon") {
562      defines += [
563        "CAN_USE_VFP3_INSTRUCTIONS",
564        "CAN_USE_VFP32DREGS",
565        "CAN_USE_NEON",
566      ]
567    }
568
569    # TODO(jochen): Add support for arm_test_noprobe.
570
571    if (current_cpu != "arm") {
572      # These defines ares used for the ARM simulator.
573      if (arm_float_abi == "hard") {
574        defines += [ "USE_EABI_HARDFLOAT=1" ]
575      } else if (arm_float_abi == "softfp") {
576        defines += [ "USE_EABI_HARDFLOAT=0" ]
577      }
578    }
579  }
580  if (v8_current_cpu == "arm64") {
581    defines += [ "V8_TARGET_ARCH_ARM64" ]
582    if (v8_control_flow_integrity) {
583      # TODO(v8:10026): Enable this in src/build.
584      if (current_cpu == "arm64") {
585        cflags += [ "-mbranch-protection=standard" ]
586      }
587    }
588  }
589
590  # Mips64el/mipsel simulators.
591  if (target_is_simulator &&
592      (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) {
593    defines += [ "_MIPS_TARGET_SIMULATOR" ]
594  }
595
596  if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") {
597    defines += [ "V8_TARGET_ARCH_MIPS" ]
598    if (v8_can_use_fpu_instructions) {
599      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
600    }
601    if (v8_use_mips_abi_hardfloat) {
602      defines += [
603        "__mips_hard_float=1",
604        "CAN_USE_FPU_INSTRUCTIONS",
605      ]
606    } else {
607      defines += [ "__mips_soft_float=1" ]
608    }
609    if (mips_arch_variant == "r6") {
610      defines += [
611        "_MIPS_ARCH_MIPS32R6",
612        "FPU_MODE_FP64",
613      ]
614      if (mips_use_msa) {
615        defines += [ "_MIPS_MSA" ]
616      }
617    } else if (mips_arch_variant == "r2") {
618      defines += [ "_MIPS_ARCH_MIPS32R2" ]
619      if (mips_fpu_mode == "fp64") {
620        defines += [ "FPU_MODE_FP64" ]
621      } else if (mips_fpu_mode == "fpxx") {
622        defines += [ "FPU_MODE_FPXX" ]
623      } else if (mips_fpu_mode == "fp32") {
624        defines += [ "FPU_MODE_FP32" ]
625      }
626    } else if (mips_arch_variant == "r1") {
627      defines += [ "FPU_MODE_FP32" ]
628    }
629
630    # TODO(jochen): Add support for mips_arch_variant rx and loongson.
631  }
632
633  if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
634    defines += [ "V8_TARGET_ARCH_MIPS64" ]
635    if (v8_can_use_fpu_instructions) {
636      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
637    }
638
639    if (host_byteorder == "little") {
640      defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
641    } else if (host_byteorder == "big") {
642      defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
643    }
644    if (v8_use_mips_abi_hardfloat) {
645      defines += [
646        "__mips_hard_float=1",
647        "CAN_USE_FPU_INSTRUCTIONS",
648      ]
649    } else {
650      defines += [ "__mips_soft_float=1" ]
651    }
652    if (mips_arch_variant == "r6") {
653      defines += [ "_MIPS_ARCH_MIPS64R6" ]
654      if (mips_use_msa) {
655        defines += [ "_MIPS_MSA" ]
656      }
657    } else if (mips_arch_variant == "r2") {
658      defines += [ "_MIPS_ARCH_MIPS64R2" ]
659    }
660  }
661  if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
662    defines += [ "V8_TARGET_ARCH_S390" ]
663    cflags += [ "-ffp-contract=off" ]
664    if (v8_current_cpu == "s390x") {
665      defines += [ "V8_TARGET_ARCH_S390X" ]
666    }
667    if (host_byteorder == "little") {
668      defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
669    } else {
670      cflags += [ "-march=z196" ]
671    }
672  }
673  if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
674    if (v8_current_cpu == "ppc") {
675      defines += [ "V8_TARGET_ARCH_PPC" ]
676    } else if (v8_current_cpu == "ppc64") {
677      defines += [ "V8_TARGET_ARCH_PPC64" ]
678    }
679    if (host_byteorder == "little") {
680      defines += [ "V8_TARGET_ARCH_PPC_LE" ]
681    } else if (host_byteorder == "big") {
682      defines += [ "V8_TARGET_ARCH_PPC_BE" ]
683      if (current_os == "aix") {
684        cflags += [
685          # Work around AIX ceil, trunc and round oddities.
686          "-mcpu=power5+",
687          "-mfprnd",
688
689          # Work around AIX assembler popcntb bug.
690          "-mno-popcntb",
691        ]
692      }
693    }
694  }
695
696  if (v8_current_cpu == "x86") {
697    defines += [ "V8_TARGET_ARCH_IA32" ]
698    if (is_win) {
699      # Ensure no surprising artifacts from 80bit double math with x86.
700      cflags += [ "/arch:SSE2" ]
701    }
702  }
703  if (v8_current_cpu == "x64") {
704    defines += [ "V8_TARGET_ARCH_X64" ]
705    if (is_win) {
706      # Increase the initial stack size. The default is 1MB, this is 2MB. This
707      # applies only to executables and shared libraries produced by V8 since
708      # ldflags are not pushed to dependants.
709      ldflags += [ "/STACK:2097152" ]
710    }
711  }
712  if (is_android && v8_android_log_stdout) {
713    defines += [ "V8_ANDROID_LOG_STDOUT" ]
714  }
715
716  # V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
717  # mksnapshot. We additionally set V8_HAVE_TARGET_OS to determine that a
718  # target OS has in fact been set; otherwise we internally assume that target
719  # OS == host OS (see v8config.h).
720  if (target_os == "android") {
721    defines += [ "V8_HAVE_TARGET_OS" ]
722    defines += [ "V8_TARGET_OS_ANDROID" ]
723  } else if (target_os == "fuchsia") {
724    defines += [ "V8_HAVE_TARGET_OS" ]
725    defines += [ "V8_TARGET_OS_FUCHSIA" ]
726  } else if (target_os == "ios") {
727    defines += [ "V8_HAVE_TARGET_OS" ]
728    defines += [ "V8_TARGET_OS_IOS" ]
729  } else if (target_os == "linux") {
730    defines += [ "V8_HAVE_TARGET_OS" ]
731    defines += [ "V8_TARGET_OS_LINUX" ]
732  } else if (target_os == "mac") {
733    defines += [ "V8_HAVE_TARGET_OS" ]
734    defines += [ "V8_TARGET_OS_MACOSX" ]
735  } else if (target_os == "win") {
736    defines += [ "V8_HAVE_TARGET_OS" ]
737    defines += [ "V8_TARGET_OS_WIN" ]
738  }
739
740  # TODO(jochen): Support v8_enable_prof on Windows.
741  # TODO(jochen): Add support for compiling with simulators.
742
743  if (v8_enable_debugging_features) {
744    if (is_linux && v8_enable_backtrace) {
745      ldflags += [ "-rdynamic" ]
746    }
747
748    defines += [ "DEBUG" ]
749    if (v8_enable_slow_dchecks) {
750      defines += [ "ENABLE_SLOW_DCHECKS" ]
751    }
752  } else if (dcheck_always_on) {
753    defines += [ "DEBUG" ]
754  }
755
756  if (v8_enable_verify_csa) {
757    defines += [ "ENABLE_VERIFY_CSA" ]
758  }
759
760  if (!v8_untrusted_code_mitigations) {
761    defines += [ "DISABLE_UNTRUSTED_CODE_MITIGATIONS" ]
762  }
763
764  if (v8_no_inline) {
765    if (is_win) {
766      cflags += [ "/Ob0" ]
767    } else {
768      cflags += [
769        "-fno-inline-functions",
770        "-fno-inline",
771      ]
772    }
773  }
774
775  if (is_clang) {
776    cflags += [ "-Wmissing-field-initializers" ]
777
778    if (v8_current_cpu != "mips" && v8_current_cpu != "mipsel") {
779      # We exclude MIPS because the IsMipsArchVariant macro causes trouble.
780      cflags += [ "-Wunreachable-code" ]
781    }
782
783    if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
784        v8_current_cpu == "mips64el") {
785      cflags += [ "-Wshorten-64-to-32" ]
786    }
787  }
788
789  if (is_win) {
790    cflags += [
791      "/wd4245",  # Conversion with signed/unsigned mismatch.
792      "/wd4267",  # Conversion with possible loss of data.
793      "/wd4324",  # Padding structure due to alignment.
794      "/wd4701",  # Potentially uninitialized local variable.
795      "/wd4702",  # Unreachable code.
796      "/wd4703",  # Potentially uninitialized local pointer variable.
797      "/wd4709",  # Comma operator within array index expr (bugged).
798      "/wd4714",  # Function marked forceinline not inlined.
799
800      # MSVC assumes that control can get past an exhaustive switch and then
801      # warns if there's no return there (see https://crbug.com/v8/7658)
802      "/wd4715",  # Not all control paths return a value.
803
804      "/wd4718",  # Recursive call has no side-effect.
805      "/wd4723",  # https://crbug.com/v8/7771
806      "/wd4724",  # https://crbug.com/v8/7771
807      "/wd4800",  # Forcing value to bool.
808    ]
809  }
810
811  if (!is_clang && is_win) {
812    cflags += [ "/wd4506" ]  # Benign "no definition for inline function"
813  }
814
815  if (!is_clang && !is_win) {
816    cflags += [
817      # Disable gcc warnings for optimizations based on the assumption that
818      # signed overflow does not occur. Generates false positives (see
819      # http://crbug.com/v8/6341).
820      "-Wno-strict-overflow",
821
822      # GCC assumes that control can get past an exhaustive switch and then
823      # warns if there's no return there (see https://crbug.com/v8/7658).
824      "-Wno-return-type",
825    ]
826  }
827
828  # Chromium uses a hand-picked subset of UBSan coverage. We want everything.
829  if (is_ubsan) {
830    cflags += [ "-fsanitize=undefined" ]
831  }
832}
833
834# For code that is hot during mksnapshot. In fast-mksnapshot builds, we
835# optimize some files even in debug builds to speed up mksnapshot times.
836config("always_optimize") {
837  configs = [ ":internal_config" ]
838
839  # TODO(crbug.com/621335) Rework this so that we don't have the confusion
840  # between "optimize_speed" and "optimize_max".
841  if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
842    configs += [ "//build/config/compiler:optimize_speed" ]
843  } else {
844    configs += [ "//build/config/compiler:optimize_max" ]
845  }
846}
847
848# Configs for code coverage with gcov. Separate configs for cflags and ldflags
849# to selectively influde cflags in non-test targets only.
850config("v8_gcov_coverage_cflags") {
851  cflags = [
852    "-fprofile-arcs",
853    "-ftest-coverage",
854  ]
855}
856
857config("v8_gcov_coverage_ldflags") {
858  ldflags = [ "-fprofile-arcs" ]
859}
860
861###############################################################################
862# Actions
863#
864
865# Only for Windows clang builds. Converts the embedded.S file produced by
866# mksnapshot into an embedded.cc file with corresponding inline assembly.
867template("asm_to_inline_asm") {
868  name = target_name
869  if (name == "default") {
870    suffix = ""
871  } else {
872    suffix = "_$name"
873  }
874
875  action("asm_to_inline_asm_" + name) {
876    visibility = [ ":*" ]  # Only targets in this file can depend on this.
877
878    assert(emit_builtins_as_inline_asm)
879
880    script = "tools/snapshot/asm_to_inline_asm.py"
881    deps = [ ":run_mksnapshot_" + name ]
882    sources = [ "$target_gen_dir/embedded${suffix}.S" ]
883    outputs = [ "$target_gen_dir/embedded${suffix}.cc" ]
884    args = invoker.args
885    args += [
886      rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
887      rebase_path("$target_gen_dir/embedded${suffix}.cc", root_build_dir),
888    ]
889  }
890}
891
892if (is_android && enable_java_templates) {
893  android_assets("v8_external_startup_data_assets") {
894    if (v8_use_external_startup_data) {
895      # We don't support side-by-side snapshots on Android within Chromium.
896      assert(!v8_use_multi_snapshots)
897      deps = [ "//v8" ]
898      renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ]
899      if (current_cpu == "arm" || current_cpu == "x86" ||
900          current_cpu == "mipsel") {
901        renaming_destinations = [ "snapshot_blob_32.bin" ]
902      } else {
903        renaming_destinations = [ "snapshot_blob_64.bin" ]
904      }
905      disable_compression = true
906    }
907  }
908}
909
910action("postmortem-metadata") {
911  # Only targets in this file and the top-level visibility target can
912  # depend on this.
913  visibility = [
914    ":*",
915    "//:gn_visibility",
916  ]
917
918  script = "tools/gen-postmortem-metadata.py"
919
920  # NOSORT
921  sources = [
922    "src/objects/objects.h",
923    "src/objects/objects-inl.h",
924    "src/objects/allocation-site-inl.h",
925    "src/objects/allocation-site.h",
926    "src/objects/cell-inl.h",
927    "src/objects/cell.h",
928    "src/objects/code-inl.h",
929    "src/objects/code.h",
930    "src/objects/data-handler.h",
931    "src/objects/data-handler-inl.h",
932    "src/objects/descriptor-array.h",
933    "src/objects/descriptor-array-inl.h",
934    "src/objects/feedback-cell.h",
935    "src/objects/feedback-cell-inl.h",
936    "src/objects/fixed-array-inl.h",
937    "src/objects/fixed-array.h",
938    "src/objects/heap-number-inl.h",
939    "src/objects/heap-number.h",
940    "src/objects/heap-object-inl.h",
941    "src/objects/heap-object.h",
942    "src/objects/instance-type.h",
943    "src/objects/js-array-inl.h",
944    "src/objects/js-array.h",
945    "src/objects/js-array-buffer-inl.h",
946    "src/objects/js-array-buffer.h",
947    "src/objects/js-objects-inl.h",
948    "src/objects/js-objects.h",
949    "src/objects/js-promise-inl.h",
950    "src/objects/js-promise.h",
951    "src/objects/js-regexp-inl.h",
952    "src/objects/js-regexp.cc",
953    "src/objects/js-regexp.h",
954    "src/objects/js-regexp-string-iterator-inl.h",
955    "src/objects/js-regexp-string-iterator.h",
956    "src/objects/map.h",
957    "src/objects/map.cc",
958    "src/objects/map-inl.h",
959    "src/objects/js-objects.cc",
960    "src/objects/name.h",
961    "src/objects/name-inl.h",
962    "src/objects/oddball-inl.h",
963    "src/objects/oddball.h",
964    "src/objects/primitive-heap-object.h",
965    "src/objects/primitive-heap-object-inl.h",
966    "src/objects/scope-info.h",
967    "src/objects/script.h",
968    "src/objects/script-inl.h",
969    "src/objects/shared-function-info.h",
970    "src/objects/shared-function-info-inl.h",
971    "src/objects/string.cc",
972    "src/objects/string.h",
973    "src/objects/string-comparator.cc",
974    "src/objects/string-comparator.h",
975    "src/objects/string-inl.h",
976    "src/objects/struct.h",
977    "src/objects/struct-inl.h",
978    "$target_gen_dir/torque-generated/instance-types-tq.h",
979  ]
980
981  outputs = [ "$target_gen_dir/debug-support.cc" ]
982
983  args = rebase_path(outputs, root_build_dir) +
984         rebase_path(sources, root_build_dir)
985
986  deps = [ ":run_torque" ]
987}
988
989torque_files = [
990  "src/builtins/array-copywithin.tq",
991  "src/builtins/array-every.tq",
992  "src/builtins/array-filter.tq",
993  "src/builtins/array-find.tq",
994  "src/builtins/array-findindex.tq",
995  "src/builtins/array-foreach.tq",
996  "src/builtins/array-from.tq",
997  "src/builtins/array-isarray.tq",
998  "src/builtins/array-join.tq",
999  "src/builtins/array-lastindexof.tq",
1000  "src/builtins/array-map.tq",
1001  "src/builtins/array-of.tq",
1002  "src/builtins/array-reduce-right.tq",
1003  "src/builtins/array-reduce.tq",
1004  "src/builtins/array-reverse.tq",
1005  "src/builtins/array-shift.tq",
1006  "src/builtins/array-slice.tq",
1007  "src/builtins/array-some.tq",
1008  "src/builtins/array-splice.tq",
1009  "src/builtins/array-unshift.tq",
1010  "src/builtins/array.tq",
1011  "src/builtins/base.tq",
1012  "src/builtins/bigint.tq",
1013  "src/builtins/boolean.tq",
1014  "src/builtins/builtins-string.tq",
1015  "src/builtins/collections.tq",
1016  "src/builtins/cast.tq",
1017  "src/builtins/convert.tq",
1018  "src/builtins/console.tq",
1019  "src/builtins/data-view.tq",
1020  "src/builtins/frames.tq",
1021  "src/builtins/frame-arguments.tq",
1022  "src/builtins/growable-fixed-array.tq",
1023  "src/builtins/internal-coverage.tq",
1024  "src/builtins/iterator.tq",
1025  "src/builtins/math.tq",
1026  "src/builtins/number.tq",
1027  "src/builtins/object-fromentries.tq",
1028  "src/builtins/object.tq",
1029  "src/builtins/promise-abstract-operations.tq",
1030  "src/builtins/promise-all.tq",
1031  "src/builtins/promise-all-element-closure.tq",
1032  "src/builtins/promise-constructor.tq",
1033  "src/builtins/promise-finally.tq",
1034  "src/builtins/promise-misc.tq",
1035  "src/builtins/promise-race.tq",
1036  "src/builtins/promise-reaction-job.tq",
1037  "src/builtins/promise-resolve.tq",
1038  "src/builtins/promise-then.tq",
1039  "src/builtins/promise-jobs.tq",
1040  "src/builtins/proxy-constructor.tq",
1041  "src/builtins/proxy-delete-property.tq",
1042  "src/builtins/proxy-get-property.tq",
1043  "src/builtins/proxy-get-prototype-of.tq",
1044  "src/builtins/proxy-has-property.tq",
1045  "src/builtins/proxy-is-extensible.tq",
1046  "src/builtins/proxy-prevent-extensions.tq",
1047  "src/builtins/proxy-revocable.tq",
1048  "src/builtins/proxy-revoke.tq",
1049  "src/builtins/proxy-set-property.tq",
1050  "src/builtins/proxy-set-prototype-of.tq",
1051  "src/builtins/proxy.tq",
1052  "src/builtins/reflect.tq",
1053  "src/builtins/regexp-exec.tq",
1054  "src/builtins/regexp-match-all.tq",
1055  "src/builtins/regexp-match.tq",
1056  "src/builtins/regexp-replace.tq",
1057  "src/builtins/regexp-search.tq",
1058  "src/builtins/regexp-source.tq",
1059  "src/builtins/regexp-split.tq",
1060  "src/builtins/regexp-test.tq",
1061  "src/builtins/regexp.tq",
1062  "src/builtins/string-endswith.tq",
1063  "src/builtins/string-html.tq",
1064  "src/builtins/string-iterator.tq",
1065  "src/builtins/string-pad.tq",
1066  "src/builtins/string-repeat.tq",
1067  "src/builtins/string-replaceall.tq",
1068  "src/builtins/string-slice.tq",
1069  "src/builtins/string-startswith.tq",
1070  "src/builtins/string-substring.tq",
1071  "src/builtins/string-substr.tq",
1072  "src/builtins/symbol.tq",
1073  "src/builtins/torque-internal.tq",
1074  "src/builtins/typed-array-createtypedarray.tq",
1075  "src/builtins/typed-array-every.tq",
1076  "src/builtins/typed-array-filter.tq",
1077  "src/builtins/typed-array-find.tq",
1078  "src/builtins/typed-array-findindex.tq",
1079  "src/builtins/typed-array-foreach.tq",
1080  "src/builtins/typed-array-from.tq",
1081  "src/builtins/typed-array-of.tq",
1082  "src/builtins/typed-array-reduce.tq",
1083  "src/builtins/typed-array-reduceright.tq",
1084  "src/builtins/typed-array-set.tq",
1085  "src/builtins/typed-array-slice.tq",
1086  "src/builtins/typed-array-some.tq",
1087  "src/builtins/typed-array-sort.tq",
1088  "src/builtins/typed-array-subarray.tq",
1089  "src/builtins/typed-array.tq",
1090  "src/ic/handler-configuration.tq",
1091  "src/objects/allocation-site.tq",
1092  "src/objects/api-callbacks.tq",
1093  "src/objects/arguments.tq",
1094  "src/objects/cell.tq",
1095  "src/objects/code.tq",
1096  "src/objects/contexts.tq",
1097  "src/objects/data-handler.tq",
1098  "src/objects/debug-objects.tq",
1099  "src/objects/descriptor-array.tq",
1100  "src/objects/embedder-data-array.tq",
1101  "src/objects/feedback-cell.tq",
1102  "src/objects/feedback-vector.tq",
1103  "src/objects/fixed-array.tq",
1104  "src/objects/foreign.tq",
1105  "src/objects/free-space.tq",
1106  "src/objects/heap-number.tq",
1107  "src/objects/heap-object.tq",
1108  "src/objects/intl-objects.tq",
1109  "src/objects/js-array-buffer.tq",
1110  "src/objects/js-array.tq",
1111  "src/objects/js-collection-iterator.tq",
1112  "src/objects/js-collection.tq",
1113  "src/objects/js-generator.tq",
1114  "src/objects/js-objects.tq",
1115  "src/objects/js-promise.tq",
1116  "src/objects/js-proxy.tq",
1117  "src/objects/js-regexp-string-iterator.tq",
1118  "src/objects/js-regexp.tq",
1119  "src/objects/js-weak-refs.tq",
1120  "src/objects/literal-objects.tq",
1121  "src/objects/map.tq",
1122  "src/objects/microtask.tq",
1123  "src/objects/module.tq",
1124  "src/objects/name.tq",
1125  "src/objects/oddball.tq",
1126  "src/objects/ordered-hash-table.tq",
1127  "src/objects/primitive-heap-object.tq",
1128  "src/objects/promise.tq",
1129  "src/objects/property-array.tq",
1130  "src/objects/property-cell.tq",
1131  "src/objects/property-descriptor-object.tq",
1132  "src/objects/prototype-info.tq",
1133  "src/objects/regexp-match-info.tq",
1134  "src/objects/scope-info.tq",
1135  "src/objects/script.tq",
1136  "src/objects/shared-function-info.tq",
1137  "src/objects/source-text-module.tq",
1138  "src/objects/stack-frame-info.tq",
1139  "src/objects/string.tq",
1140  "src/objects/struct.tq",
1141  "src/objects/synthetic-module.tq",
1142  "src/objects/template-objects.tq",
1143  "src/objects/template.tq",
1144  "src/wasm/wasm-objects.tq",
1145  "test/torque/test-torque.tq",
1146  "third_party/v8/builtins/array-sort.tq",
1147]
1148
1149if (!v8_enable_i18n_support) {
1150  torque_files -= [ "src/objects/intl-objects.tq" ]
1151}
1152
1153# Template for running torque
1154# When building with v8_verify_torque_generation_invariance=true we need
1155# to be able to run torque for both 32 and 64 bits in the same build
1156template("run_torque") {
1157  if (target_name == "") {
1158    suffix = ""
1159  } else {
1160    suffix = "_$target_name"
1161  }
1162
1163  toolchain = invoker.toolchain
1164
1165  action("run_torque" + suffix) {
1166    visibility = [
1167      ":*",
1168      "tools/debug_helper/:*",
1169      "tools/gcmole/:*",
1170      "test/cctest/:*",
1171    ]
1172
1173    deps = [ ":torque($toolchain)" ]
1174
1175    script = "tools/run.py"
1176
1177    sources = torque_files
1178
1179    destination_folder = "$target_gen_dir/torque-generated$suffix"
1180
1181    files = [
1182      "bit-fields-tq.h",
1183      "builtin-definitions-tq.h",
1184      "interface-descriptors-tq.inc",
1185      "factory-tq.cc",
1186      "factory-tq.inc",
1187      "field-offsets-tq.h",
1188      "class-verifiers-tq.cc",
1189      "class-verifiers-tq.h",
1190      "enum-verifiers-tq.cc",
1191      "objects-printer-tq.cc",
1192      "objects-body-descriptors-tq-inl.h",
1193      "class-definitions-tq.cc",
1194      "class-definitions-tq-inl.h",
1195      "class-definitions-tq.h",
1196      "class-debug-readers-tq.cc",
1197      "class-debug-readers-tq.h",
1198      "exported-macros-assembler-tq.cc",
1199      "exported-macros-assembler-tq.h",
1200      "csa-types-tq.h",
1201      "instance-types-tq.h",
1202      "internal-class-definitions-tq.h",
1203      "internal-class-definitions-tq-inl.h",
1204    ]
1205
1206    outputs = []
1207    foreach(file, files) {
1208      outputs += [ "$destination_folder/$file" ]
1209    }
1210
1211    foreach(file, torque_files) {
1212      filetq = string_replace(file, ".tq", "-tq-csa")
1213      outputs += [
1214        "$destination_folder/$filetq.cc",
1215        "$destination_folder/$filetq.h",
1216      ]
1217    }
1218
1219    args = [
1220      "./" + rebase_path(
1221              get_label_info(":torque($toolchain)", "root_out_dir") + "/torque",
1222              root_build_dir),
1223      "-o",
1224      rebase_path("$destination_folder", root_build_dir),
1225      "-v8-root",
1226      rebase_path(".", root_build_dir),
1227    ]
1228    if (defined(invoker.args)) {
1229      args += invoker.args
1230    }
1231    args += torque_files
1232  }
1233}
1234
1235# Default run_torque action
1236run_torque("") {
1237  toolchain = v8_generator_toolchain
1238}
1239
1240if (v8_verify_torque_generation_invariance) {
1241  run_torque("x86") {
1242    toolchain = "//build/toolchain/linux:clang_x86"
1243  }
1244
1245  run_torque("x64") {
1246    args = [ "-m32" ]
1247    toolchain = "//build/toolchain/linux:clang_x64"
1248  }
1249
1250  action("compare_torque_runs") {
1251    deps = [
1252      ":run_torque_x64",
1253      ":run_torque_x86",
1254    ]
1255    report_file = "$target_gen_dir/torque_comparison_results.txt"
1256    script = "tools/compare_torque_output.py"
1257    args = [
1258      rebase_path("$target_gen_dir/torque-generated_x64", root_build_dir),
1259      rebase_path("$target_gen_dir/torque-generated_x86", root_build_dir),
1260      rebase_path(report_file, root_build_dir),
1261    ]
1262    outputs = [ report_file ]
1263  }
1264}
1265
1266group("v8_maybe_icu") {
1267  if (v8_enable_i18n_support) {
1268    public_deps = [ "//third_party/icu" ]
1269  }
1270}
1271
1272v8_source_set("torque_generated_initializers") {
1273  visibility = [ ":*" ]  # Only targets in this file can depend on this.
1274
1275  deps = [
1276    ":generate_bytecode_builtins_list",
1277    ":run_torque",
1278  ]
1279
1280  public_deps = [ ":v8_maybe_icu" ]
1281
1282  sources = [
1283    "$target_gen_dir/torque-generated/csa-types-tq.h",
1284    "$target_gen_dir/torque-generated/enum-verifiers-tq.cc",
1285    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.cc",
1286    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.h",
1287    "src/torque/runtime-support.h",
1288  ]
1289  foreach(file, torque_files) {
1290    filetq = string_replace(file, ".tq", "-tq-csa")
1291    sources += [
1292      "$target_gen_dir/torque-generated/$filetq.cc",
1293      "$target_gen_dir/torque-generated/$filetq.h",
1294    ]
1295  }
1296
1297  configs = [ ":internal_config" ]
1298}
1299
1300v8_source_set("torque_generated_definitions") {
1301  visibility = [ ":*" ]  # Only targets in this file can depend on this.
1302
1303  deps = [
1304    ":generate_bytecode_builtins_list",
1305    ":run_torque",
1306  ]
1307
1308  public_deps = [ ":v8_maybe_icu" ]
1309
1310  sources = [
1311    "$target_gen_dir/torque-generated/class-definitions-tq.cc",
1312    "$target_gen_dir/torque-generated/class-verifiers-tq.cc",
1313    "$target_gen_dir/torque-generated/class-verifiers-tq.h",
1314    "$target_gen_dir/torque-generated/factory-tq.cc",
1315    "$target_gen_dir/torque-generated/objects-printer-tq.cc",
1316  ]
1317
1318  configs = [ ":internal_config" ]
1319}
1320
1321action("generate_bytecode_builtins_list") {
1322  script = "tools/run.py"
1323  outputs = [ "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h" ]
1324  deps = [ ":bytecode_builtins_list_generator($v8_generator_toolchain)" ]
1325  args = [
1326    "./" + rebase_path(
1327            get_label_info(
1328                    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1329                    "root_out_dir") + "/bytecode_builtins_list_generator",
1330            root_build_dir),
1331    rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
1332                root_build_dir),
1333  ]
1334}
1335
1336# Template to generate different V8 snapshots based on different runtime flags.
1337# Can be invoked with run_mksnapshot(<name>). The target will resolve to
1338# run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
1339# Otherwise files are suffixed, e.g. embedded_<name>.S and
1340# snapshot_blob_<name>.bin.
1341#
1342# The template exposes the variables:
1343#   args: additional flags for mksnapshots
1344#   embedded_suffix: a camel case suffix for method names in the embedded
1345#       snapshot.
1346template("run_mksnapshot") {
1347  name = target_name
1348  if (name == "default") {
1349    suffix = ""
1350  } else {
1351    suffix = "_$name"
1352  }
1353  action("run_mksnapshot_" + name) {
1354    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1355
1356    deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
1357
1358    script = "tools/run.py"
1359
1360    sources = []
1361
1362    outputs = []
1363
1364    data = []
1365
1366    args = [
1367      "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
1368                                        "root_out_dir") + "/mksnapshot",
1369                         root_build_dir),
1370      "--turbo_instruction_scheduling",
1371
1372      # In cross builds, the snapshot may be generated for both the host and
1373      # target toolchains.  The same host binary is used to generate both, so
1374      # mksnapshot needs to know which target OS to use at runtime.  It's weird,
1375      # but the target OS is really |current_os|.
1376      "--target_os=$current_os",
1377      "--target_arch=$current_cpu",
1378
1379      "--embedded_src",
1380      rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1381    ]
1382
1383    # This is needed to distinguish between generating code for the simulator
1384    # and cross-compiling. The latter may need to run code on the host with the
1385    # simulator but cannot use simulator-specific instructions.
1386    if (target_is_simulator) {
1387      args += [ "--target_is_simulator" ]
1388    }
1389
1390    args += invoker.args
1391
1392    outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
1393    if (invoker.embedded_variant != "") {
1394      args += [
1395        "--embedded_variant",
1396        invoker.embedded_variant,
1397      ]
1398    }
1399
1400    if (v8_random_seed != "0") {
1401      args += [
1402        "--random-seed",
1403        v8_random_seed,
1404      ]
1405    }
1406
1407    if (v8_os_page_size != "0") {
1408      args += [
1409        "--v8_os_page_size",
1410        v8_os_page_size,
1411      ]
1412    }
1413
1414    if (v8_use_external_startup_data) {
1415      outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1416      data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1417      args += [
1418        "--startup_blob",
1419        rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
1420      ]
1421    } else {
1422      outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
1423      args += [
1424        "--startup_src",
1425        rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
1426      ]
1427    }
1428
1429    if (v8_embed_script != "") {
1430      sources += [ v8_embed_script ]
1431      args += [ rebase_path(v8_embed_script, root_build_dir) ]
1432    }
1433
1434    if (v8_enable_snapshot_code_comments) {
1435      args += [ "--code-comments" ]
1436    }
1437
1438    if (v8_enable_snapshot_native_code_counters) {
1439      args += [ "--native-code-counters" ]
1440    } else {
1441      # --native-code-counters is the default in debug mode so make sure we can
1442      # unset it.
1443      args += [ "--no-native-code-counters" ]
1444    }
1445
1446    if (v8_enable_fast_mksnapshot) {
1447      args += [
1448        "--no-turbo-rewrite-far-jumps",
1449        "--no-turbo-verify-allocation",
1450      ]
1451
1452      if (v8_enable_debugging_features && v8_enable_slow_dchecks) {
1453        # mksnapshot only accepts this flag if ENABLE_SLOW_DCHECKS is defined.
1454        args += [ "--no-enable-slow-asserts" ]
1455      }
1456    }
1457
1458    if (v8_enable_verify_heap) {
1459      args += [ "--verify-heap" ]
1460    }
1461  }
1462}
1463
1464run_mksnapshot("default") {
1465  args = []
1466  embedded_variant = "Default"
1467}
1468if (emit_builtins_as_inline_asm) {
1469  asm_to_inline_asm("default") {
1470    args = []
1471  }
1472}
1473if (v8_use_multi_snapshots) {
1474  run_mksnapshot("trusted") {
1475    args = [ "--no-untrusted-code-mitigations" ]
1476    embedded_variant = "Trusted"
1477  }
1478  if (emit_builtins_as_inline_asm) {
1479    asm_to_inline_asm("trusted") {
1480      args = []
1481    }
1482  }
1483}
1484
1485action("v8_dump_build_config") {
1486  script = "tools/testrunner/utils/dump_build_config.py"
1487  outputs = [ "$root_out_dir/v8_build_config.json" ]
1488  is_gcov_coverage = v8_code_coverage && !is_clang
1489  is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
1490  args = [
1491    rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
1492    "current_cpu=\"$current_cpu\"",
1493    "dcheck_always_on=$dcheck_always_on",
1494    "is_android=$is_android",
1495    "is_asan=$is_asan",
1496    "is_cfi=$is_cfi",
1497    "is_clang=$is_clang",
1498    "is_component_build=$is_component_build",
1499    "is_debug=$v8_enable_debugging_features",
1500    "is_full_debug=$is_full_debug",
1501    "is_gcov_coverage=$is_gcov_coverage",
1502    "is_msan=$is_msan",
1503    "is_tsan=$is_tsan",
1504    "is_ubsan_vptr=$is_ubsan_vptr",
1505    "target_cpu=\"$target_cpu\"",
1506    "v8_current_cpu=\"$v8_current_cpu\"",
1507    "v8_enable_i18n_support=$v8_enable_i18n_support",
1508    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
1509    "v8_target_cpu=\"$v8_target_cpu\"",
1510    "v8_enable_verify_csa=$v8_enable_verify_csa",
1511    "v8_enable_lite_mode=$v8_enable_lite_mode",
1512    "v8_enable_pointer_compression=$v8_enable_pointer_compression",
1513  ]
1514
1515  if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" ||
1516      v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
1517    args += [
1518      "mips_arch_variant=\"$mips_arch_variant\"",
1519      "mips_use_msa=$mips_use_msa",
1520    ]
1521  }
1522}
1523
1524###############################################################################
1525# Source Sets (aka static libraries)
1526#
1527
1528v8_source_set("v8_snapshot") {
1529  visibility = [ ":*" ]  # Targets in this file can depend on this.
1530
1531  deps = []
1532  public_deps = [
1533    # This should be public so downstream targets can declare the snapshot
1534    # output file as their inputs.
1535    ":run_mksnapshot_default",
1536  ]
1537
1538  # Do not publicize any header to remove build dependency.
1539  public = []
1540
1541  sources = [ "src/init/setup-isolate-deserialize.cc" ]
1542  if (emit_builtins_as_inline_asm) {
1543    deps += [ ":asm_to_inline_asm_default" ]
1544    sources += [ "$target_gen_dir/embedded.cc" ]
1545  } else {
1546    sources += [ "$target_gen_dir/embedded.S" ]
1547  }
1548
1549  configs = [ ":internal_config" ]
1550
1551  if (v8_use_external_startup_data) {
1552    deps += [ ":v8_base" ]
1553
1554    sources += [ "src/snapshot/snapshot-external.cc" ]
1555
1556    if (v8_use_multi_snapshots) {
1557      public_deps += [ ":run_mksnapshot_trusted" ]
1558      if (emit_builtins_as_inline_asm) {
1559        deps += [ ":asm_to_inline_asm_trusted" ]
1560        sources += [ "$target_gen_dir/embedded_trusted.cc" ]
1561        jumbo_excluded_sources = [ "$target_gen_dir/embedded_trusted.cc" ]
1562      } else {
1563        sources += [ "$target_gen_dir/embedded_trusted.S" ]
1564        jumbo_excluded_sources = [
1565          # Duplicated symbols with embedded.S
1566          "$target_gen_dir/embedded_trusted.S",
1567        ]
1568      }
1569    }
1570  } else {
1571    # Also top-level visibility targets can depend on this.
1572    visibility += [ "//:gn_visibility" ]
1573
1574    public_deps += [ ":v8_maybe_icu" ]
1575
1576    sources += [ "$target_gen_dir/snapshot.cc" ]
1577  }
1578}
1579
1580v8_source_set("v8_initializers") {
1581  visibility = [
1582    ":*",
1583    "test/cctest:*",
1584  ]
1585
1586  deps = [ ":torque_generated_initializers" ]
1587
1588  sources = [
1589    ### gcmole(all) ###
1590    "src/builtins/builtins-array-gen.cc",
1591    "src/builtins/builtins-array-gen.h",
1592    "src/builtins/builtins-async-function-gen.cc",
1593    "src/builtins/builtins-async-gen.cc",
1594    "src/builtins/builtins-async-gen.h",
1595    "src/builtins/builtins-async-generator-gen.cc",
1596    "src/builtins/builtins-async-iterator-gen.cc",
1597    "src/builtins/builtins-bigint-gen.cc",
1598    "src/builtins/builtins-bigint-gen.h",
1599    "src/builtins/builtins-call-gen.cc",
1600    "src/builtins/builtins-call-gen.h",
1601    "src/builtins/builtins-collections-gen.cc",
1602    "src/builtins/builtins-constructor-gen.cc",
1603    "src/builtins/builtins-constructor-gen.h",
1604    "src/builtins/builtins-constructor.h",
1605    "src/builtins/builtins-conversion-gen.cc",
1606    "src/builtins/builtins-data-view-gen.h",
1607    "src/builtins/builtins-date-gen.cc",
1608    "src/builtins/builtins-debug-gen.cc",
1609    "src/builtins/builtins-function-gen.cc",
1610    "src/builtins/builtins-generator-gen.cc",
1611    "src/builtins/builtins-global-gen.cc",
1612    "src/builtins/builtins-handler-gen.cc",
1613    "src/builtins/builtins-ic-gen.cc",
1614    "src/builtins/builtins-internal-gen.cc",
1615    "src/builtins/builtins-interpreter-gen.cc",
1616    "src/builtins/builtins-intl-gen.cc",
1617    "src/builtins/builtins-iterator-gen.cc",
1618    "src/builtins/builtins-iterator-gen.h",
1619    "src/builtins/builtins-lazy-gen.cc",
1620    "src/builtins/builtins-lazy-gen.h",
1621    "src/builtins/builtins-microtask-queue-gen.cc",
1622    "src/builtins/builtins-number-gen.cc",
1623    "src/builtins/builtins-object-gen.cc",
1624    "src/builtins/builtins-promise-gen.cc",
1625    "src/builtins/builtins-promise-gen.h",
1626    "src/builtins/builtins-proxy-gen.cc",
1627    "src/builtins/builtins-proxy-gen.h",
1628    "src/builtins/builtins-regexp-gen.cc",
1629    "src/builtins/builtins-regexp-gen.h",
1630    "src/builtins/builtins-sharedarraybuffer-gen.cc",
1631    "src/builtins/builtins-string-gen.cc",
1632    "src/builtins/builtins-string-gen.h",
1633    "src/builtins/builtins-typed-array-gen.cc",
1634    "src/builtins/builtins-typed-array-gen.h",
1635    "src/builtins/builtins-utils-gen.h",
1636    "src/builtins/builtins-wasm-gen.cc",
1637    "src/builtins/growable-fixed-array-gen.cc",
1638    "src/builtins/growable-fixed-array-gen.h",
1639    "src/builtins/setup-builtins-internal.cc",
1640    "src/codegen/code-stub-assembler.cc",
1641    "src/codegen/code-stub-assembler.h",
1642    "src/heap/setup-heap-internal.cc",
1643    "src/ic/accessor-assembler.cc",
1644    "src/ic/accessor-assembler.h",
1645    "src/ic/binary-op-assembler.cc",
1646    "src/ic/binary-op-assembler.h",
1647    "src/ic/keyed-store-generic.cc",
1648    "src/ic/keyed-store-generic.h",
1649    "src/interpreter/interpreter-assembler.cc",
1650    "src/interpreter/interpreter-assembler.h",
1651    "src/interpreter/interpreter-generator.cc",
1652    "src/interpreter/interpreter-generator.h",
1653    "src/interpreter/interpreter-intrinsics-generator.cc",
1654    "src/interpreter/interpreter-intrinsics-generator.h",
1655  ]
1656
1657  jumbo_excluded_sources = [
1658    # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
1659    "src/builtins/builtins-async-iterator-gen.cc",
1660    "src/builtins/builtins-async-generator-gen.cc",
1661
1662    # These source files take an unusually large amount of time to
1663    # compile.  Build them separately to avoid bottlenecks.
1664    "src/builtins/builtins-regexp-gen.cc",
1665    "src/codegen/code-stub-assembler.cc",
1666  ]
1667
1668  if (v8_current_cpu == "x86") {
1669    sources += [
1670      ### gcmole(arch:ia32) ###
1671      "src/builtins/ia32/builtins-ia32.cc",
1672    ]
1673  } else if (v8_current_cpu == "x64") {
1674    sources += [
1675      ### gcmole(arch:x64) ###
1676      "src/builtins/x64/builtins-x64.cc",
1677    ]
1678  } else if (v8_current_cpu == "arm") {
1679    sources += [
1680      ### gcmole(arch:arm) ###
1681      "src/builtins/arm/builtins-arm.cc",
1682    ]
1683  } else if (v8_current_cpu == "arm64") {
1684    sources += [
1685      ### gcmole(arch:arm64) ###
1686      "src/builtins/arm64/builtins-arm64.cc",
1687    ]
1688  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
1689    sources += [
1690      ### gcmole(arch:mipsel) ###
1691      "src/builtins/mips/builtins-mips.cc",
1692    ]
1693  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
1694    sources += [
1695      ### gcmole(arch:mips64el) ###
1696      "src/builtins/mips64/builtins-mips64.cc",
1697    ]
1698  } else if (v8_current_cpu == "ppc") {
1699    sources += [
1700      ### gcmole(arch:ppc) ###
1701      "src/builtins/ppc/builtins-ppc.cc",
1702    ]
1703  } else if (v8_current_cpu == "ppc64") {
1704    sources += [
1705      ### gcmole(arch:ppc64) ###
1706      "src/builtins/ppc/builtins-ppc.cc",
1707    ]
1708  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
1709    sources += [
1710      ### gcmole(arch:s390) ###
1711      "src/builtins/s390/builtins-s390.cc",
1712    ]
1713  }
1714
1715  if (!v8_enable_i18n_support) {
1716    sources -= [ "src/builtins/builtins-intl-gen.cc" ]
1717  }
1718
1719  configs = [ ":internal_config" ]
1720}
1721
1722v8_source_set("v8_init") {
1723  visibility = [ ":*" ]  # Only targets in this file can depend on this.
1724
1725  deps = [ ":v8_initializers" ]
1726
1727  sources = [
1728    ### gcmole(all) ###
1729    "src/init/setup-isolate-full.cc",
1730  ]
1731
1732  public_deps = [ ":v8_maybe_icu" ]
1733
1734  configs = [ ":internal_config" ]
1735}
1736
1737# This is split out to be a non-code containing target that the Chromium browser
1738# DLL can depend upon to get only a version string.
1739v8_header_set("v8_version") {
1740  configs = [ ":internal_config" ]
1741
1742  sources = [
1743    "include/v8-value-serializer-version.h",
1744    "include/v8-version-string.h",
1745    "include/v8-version.h",
1746  ]
1747}
1748
1749# This is split out to be a non-code containing target that the Chromium browser
1750# can depend upon to get basic v8 types.
1751v8_header_set("v8_headers") {
1752  configs = [ ":internal_config" ]
1753  public_configs = [ ":v8_header_features" ]
1754
1755  sources = [
1756    "include/v8-fast-api-calls.h",
1757    "include/v8-internal.h",
1758    "include/v8.h",
1759    "include/v8config.h",
1760  ]
1761
1762  sources += [
1763    # The following headers cannot be platform-specific. The include validation
1764    # of `gn gen $dir --check` requires all header files to be available on all
1765    # platforms.
1766    "include/v8-wasm-trap-handler-posix.h",
1767    "include/v8-wasm-trap-handler-win.h",
1768  ]
1769
1770  deps = [ ":v8_version" ]
1771}
1772
1773# This is split out to share basic headers with Torque.
1774v8_header_set("v8_shared_internal_headers") {
1775  visibility = [ ":*" ]  # Only targets in this file can depend on this.
1776  configs = [ ":internal_config" ]
1777
1778  sources = [ "src/common/globals.h" ]
1779
1780  deps = [ ":v8_headers" ]
1781}
1782
1783v8_compiler_sources = [
1784  ### gcmole(all) ###
1785  "src/compiler/access-builder.cc",
1786  "src/compiler/access-builder.h",
1787  "src/compiler/access-info.cc",
1788  "src/compiler/access-info.h",
1789  "src/compiler/add-type-assertions-reducer.cc",
1790  "src/compiler/add-type-assertions-reducer.h",
1791  "src/compiler/all-nodes.cc",
1792  "src/compiler/all-nodes.h",
1793  "src/compiler/allocation-builder-inl.h",
1794  "src/compiler/allocation-builder.h",
1795  "src/compiler/backend/code-generator-impl.h",
1796  "src/compiler/backend/code-generator.cc",
1797  "src/compiler/backend/code-generator.h",
1798  "src/compiler/backend/frame-elider.cc",
1799  "src/compiler/backend/frame-elider.h",
1800  "src/compiler/backend/gap-resolver.cc",
1801  "src/compiler/backend/gap-resolver.h",
1802  "src/compiler/backend/instruction-codes.h",
1803  "src/compiler/backend/instruction-scheduler.cc",
1804  "src/compiler/backend/instruction-scheduler.h",
1805  "src/compiler/backend/instruction-selector-impl.h",
1806  "src/compiler/backend/instruction-selector.cc",
1807  "src/compiler/backend/instruction-selector.h",
1808  "src/compiler/backend/instruction.cc",
1809  "src/compiler/backend/instruction.h",
1810  "src/compiler/backend/jump-threading.cc",
1811  "src/compiler/backend/jump-threading.h",
1812  "src/compiler/backend/live-range-separator.cc",
1813  "src/compiler/backend/live-range-separator.h",
1814  "src/compiler/backend/move-optimizer.cc",
1815  "src/compiler/backend/move-optimizer.h",
1816  "src/compiler/backend/register-allocator-verifier.cc",
1817  "src/compiler/backend/register-allocator-verifier.h",
1818  "src/compiler/backend/register-allocator.cc",
1819  "src/compiler/backend/register-allocator.h",
1820  "src/compiler/backend/unwinding-info-writer.h",
1821  "src/compiler/basic-block-instrumentor.cc",
1822  "src/compiler/basic-block-instrumentor.h",
1823  "src/compiler/branch-elimination.cc",
1824  "src/compiler/branch-elimination.h",
1825  "src/compiler/bytecode-analysis.cc",
1826  "src/compiler/bytecode-analysis.h",
1827  "src/compiler/bytecode-graph-builder.cc",
1828  "src/compiler/bytecode-graph-builder.h",
1829  "src/compiler/bytecode-liveness-map.cc",
1830  "src/compiler/bytecode-liveness-map.h",
1831  "src/compiler/c-linkage.cc",
1832  "src/compiler/checkpoint-elimination.cc",
1833  "src/compiler/checkpoint-elimination.h",
1834  "src/compiler/code-assembler.cc",
1835  "src/compiler/code-assembler.h",
1836  "src/compiler/common-node-cache.cc",
1837  "src/compiler/common-node-cache.h",
1838  "src/compiler/common-operator-reducer.cc",
1839  "src/compiler/common-operator-reducer.h",
1840  "src/compiler/common-operator.cc",
1841  "src/compiler/common-operator.h",
1842  "src/compiler/compilation-dependencies.cc",
1843  "src/compiler/compilation-dependencies.h",
1844  "src/compiler/compiler-source-position-table.cc",
1845  "src/compiler/compiler-source-position-table.h",
1846  "src/compiler/constant-folding-reducer.cc",
1847  "src/compiler/constant-folding-reducer.h",
1848  "src/compiler/control-equivalence.cc",
1849  "src/compiler/control-equivalence.h",
1850  "src/compiler/control-flow-optimizer.cc",
1851  "src/compiler/control-flow-optimizer.h",
1852  "src/compiler/csa-load-elimination.cc",
1853  "src/compiler/csa-load-elimination.h",
1854  "src/compiler/dead-code-elimination.cc",
1855  "src/compiler/dead-code-elimination.h",
1856  "src/compiler/decompression-optimizer.cc",
1857  "src/compiler/decompression-optimizer.h",
1858  "src/compiler/diamond.h",
1859  "src/compiler/effect-control-linearizer.cc",
1860  "src/compiler/effect-control-linearizer.h",
1861  "src/compiler/escape-analysis-reducer.cc",
1862  "src/compiler/escape-analysis-reducer.h",
1863  "src/compiler/escape-analysis.cc",
1864  "src/compiler/escape-analysis.h",
1865  "src/compiler/feedback-source.cc",
1866  "src/compiler/feedback-source.h",
1867  "src/compiler/frame-states.cc",
1868  "src/compiler/frame-states.h",
1869  "src/compiler/frame.cc",
1870  "src/compiler/frame.h",
1871  "src/compiler/functional-list.h",
1872  "src/compiler/globals.h",
1873  "src/compiler/graph-assembler.cc",
1874  "src/compiler/graph-assembler.h",
1875  "src/compiler/graph-reducer.cc",
1876  "src/compiler/graph-reducer.h",
1877  "src/compiler/graph-trimmer.cc",
1878  "src/compiler/graph-trimmer.h",
1879  "src/compiler/graph-visualizer.cc",
1880  "src/compiler/graph-visualizer.h",
1881  "src/compiler/graph.cc",
1882  "src/compiler/graph.h",
1883  "src/compiler/int64-lowering.cc",
1884  "src/compiler/int64-lowering.h",
1885  "src/compiler/js-call-reducer.cc",
1886  "src/compiler/js-call-reducer.h",
1887  "src/compiler/js-context-specialization.cc",
1888  "src/compiler/js-context-specialization.h",
1889  "src/compiler/js-create-lowering.cc",
1890  "src/compiler/js-create-lowering.h",
1891  "src/compiler/js-generic-lowering.cc",
1892  "src/compiler/js-generic-lowering.h",
1893  "src/compiler/js-graph.cc",
1894  "src/compiler/js-graph.h",
1895  "src/compiler/js-heap-broker.cc",
1896  "src/compiler/js-heap-broker.h",
1897  "src/compiler/js-heap-copy-reducer.cc",
1898  "src/compiler/js-heap-copy-reducer.h",
1899  "src/compiler/js-inlining-heuristic.cc",
1900  "src/compiler/js-inlining-heuristic.h",
1901  "src/compiler/js-inlining.cc",
1902  "src/compiler/js-inlining.h",
1903  "src/compiler/js-intrinsic-lowering.cc",
1904  "src/compiler/js-intrinsic-lowering.h",
1905  "src/compiler/js-native-context-specialization.cc",
1906  "src/compiler/js-native-context-specialization.h",
1907  "src/compiler/js-operator.cc",
1908  "src/compiler/js-operator.h",
1909  "src/compiler/js-type-hint-lowering.cc",
1910  "src/compiler/js-type-hint-lowering.h",
1911  "src/compiler/js-typed-lowering.cc",
1912  "src/compiler/js-typed-lowering.h",
1913  "src/compiler/linkage.cc",
1914  "src/compiler/linkage.h",
1915  "src/compiler/load-elimination.cc",
1916  "src/compiler/load-elimination.h",
1917  "src/compiler/loop-analysis.cc",
1918  "src/compiler/loop-analysis.h",
1919  "src/compiler/loop-peeling.cc",
1920  "src/compiler/loop-peeling.h",
1921  "src/compiler/loop-variable-optimizer.cc",
1922  "src/compiler/loop-variable-optimizer.h",
1923  "src/compiler/machine-graph-verifier.cc",
1924  "src/compiler/machine-graph-verifier.h",
1925  "src/compiler/machine-graph.cc",
1926  "src/compiler/machine-graph.h",
1927  "src/compiler/machine-operator-reducer.cc",
1928  "src/compiler/machine-operator-reducer.h",
1929  "src/compiler/machine-operator.cc",
1930  "src/compiler/machine-operator.h",
1931  "src/compiler/map-inference.cc",
1932  "src/compiler/map-inference.h",
1933  "src/compiler/memory-lowering.cc",
1934  "src/compiler/memory-lowering.h",
1935  "src/compiler/memory-optimizer.cc",
1936  "src/compiler/memory-optimizer.h",
1937  "src/compiler/node-aux-data.h",
1938  "src/compiler/node-cache.h",
1939  "src/compiler/node-marker.cc",
1940  "src/compiler/node-marker.h",
1941  "src/compiler/node-matchers.cc",
1942  "src/compiler/node-matchers.h",
1943  "src/compiler/node-origin-table.cc",
1944  "src/compiler/node-origin-table.h",
1945  "src/compiler/node-properties.cc",
1946  "src/compiler/node-properties.h",
1947  "src/compiler/node.cc",
1948  "src/compiler/node.h",
1949  "src/compiler/opcodes.cc",
1950  "src/compiler/opcodes.h",
1951  "src/compiler/operation-typer.cc",
1952  "src/compiler/operation-typer.h",
1953  "src/compiler/operator-properties.cc",
1954  "src/compiler/operator-properties.h",
1955  "src/compiler/operator.cc",
1956  "src/compiler/operator.h",
1957  "src/compiler/osr.cc",
1958  "src/compiler/osr.h",
1959  "src/compiler/per-isolate-compiler-cache.h",
1960  "src/compiler/persistent-map.h",
1961  "src/compiler/pipeline-statistics.cc",
1962  "src/compiler/pipeline-statistics.h",
1963  "src/compiler/pipeline.cc",
1964  "src/compiler/pipeline.h",
1965  "src/compiler/property-access-builder.cc",
1966  "src/compiler/property-access-builder.h",
1967  "src/compiler/raw-machine-assembler.cc",
1968  "src/compiler/raw-machine-assembler.h",
1969  "src/compiler/redundancy-elimination.cc",
1970  "src/compiler/redundancy-elimination.h",
1971  "src/compiler/refs-map.cc",
1972  "src/compiler/refs-map.h",
1973  "src/compiler/representation-change.cc",
1974  "src/compiler/representation-change.h",
1975  "src/compiler/schedule.cc",
1976  "src/compiler/schedule.h",
1977  "src/compiler/scheduled-machine-lowering.cc",
1978  "src/compiler/scheduled-machine-lowering.h",
1979  "src/compiler/scheduler.cc",
1980  "src/compiler/scheduler.h",
1981  "src/compiler/select-lowering.cc",
1982  "src/compiler/select-lowering.h",
1983  "src/compiler/serializer-for-background-compilation.cc",
1984  "src/compiler/serializer-for-background-compilation.h",
1985  "src/compiler/serializer-hints.h",
1986  "src/compiler/simd-scalar-lowering.cc",
1987  "src/compiler/simd-scalar-lowering.h",
1988  "src/compiler/simplified-lowering.cc",
1989  "src/compiler/simplified-lowering.h",
1990  "src/compiler/simplified-operator-reducer.cc",
1991  "src/compiler/simplified-operator-reducer.h",
1992  "src/compiler/simplified-operator.cc",
1993  "src/compiler/simplified-operator.h",
1994  "src/compiler/state-values-utils.cc",
1995  "src/compiler/state-values-utils.h",
1996  "src/compiler/store-store-elimination.cc",
1997  "src/compiler/store-store-elimination.h",
1998  "src/compiler/type-cache.cc",
1999  "src/compiler/type-cache.h",
2000  "src/compiler/type-narrowing-reducer.cc",
2001  "src/compiler/type-narrowing-reducer.h",
2002  "src/compiler/typed-optimization.cc",
2003  "src/compiler/typed-optimization.h",
2004  "src/compiler/typer.cc",
2005  "src/compiler/typer.h",
2006  "src/compiler/types.cc",
2007  "src/compiler/types.h",
2008  "src/compiler/value-numbering-reducer.cc",
2009  "src/compiler/value-numbering-reducer.h",
2010  "src/compiler/verifier.cc",
2011  "src/compiler/verifier.h",
2012  "src/compiler/wasm-compiler.cc",
2013  "src/compiler/wasm-compiler.h",
2014  "src/compiler/write-barrier-kind.h",
2015  "src/compiler/zone-stats.cc",
2016  "src/compiler/zone-stats.h",
2017]
2018
2019# The src/compiler files with optimizations.
2020v8_source_set("v8_compiler_opt") {
2021  visibility = [ ":*" ]  # Only targets in this file can depend on this.
2022
2023  sources = v8_compiler_sources
2024
2025  public_deps = [
2026    ":generate_bytecode_builtins_list",
2027    ":run_torque",
2028    ":v8_maybe_icu",
2029  ]
2030
2031  if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
2032    # The :no_optimize config is added to v8_add_configs in v8.gni.
2033    remove_configs = [ "//build/config/compiler:no_optimize" ]
2034    configs = [ ":always_optimize" ]
2035  } else {
2036    # Without this else branch, gn fails to generate build files for non-debug
2037    # builds (because we try to remove a config that is not present).
2038    # So we include it, even if this config is not used outside of debug builds.
2039    configs = [ ":internal_config" ]
2040  }
2041}
2042
2043# The src/compiler files with default optimization behavior.
2044v8_source_set("v8_compiler") {
2045  visibility = [ ":*" ]  # Only targets in this file can depend on this.
2046
2047  sources = v8_compiler_sources
2048
2049  public_deps = [
2050    ":generate_bytecode_builtins_list",
2051    ":run_torque",
2052    ":v8_maybe_icu",
2053  ]
2054
2055  configs = [ ":internal_config" ]
2056}
2057
2058group("v8_compiler_for_mksnapshot") {
2059  if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
2060    deps = [ ":v8_compiler_opt" ]
2061  } else {
2062    deps = [ ":v8_compiler" ]
2063  }
2064}
2065
2066v8_source_set("v8_base_without_compiler") {
2067  visibility = [ ":*" ]  # Only targets in this file can depend on this.
2068
2069  # Split static libraries on windows into two.
2070  split_count = 2
2071
2072  sources = [
2073    "//base/trace_event/common/trace_event_common.h",
2074
2075    ### gcmole(all) ###
2076    "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
2077    "include/v8-fast-api-calls.h",
2078    "include/v8-inspector-protocol.h",
2079    "include/v8-inspector.h",
2080    "include/v8-internal.h",
2081    "include/v8-platform.h",
2082    "include/v8-profiler.h",
2083    "include/v8-util.h",
2084    "include/v8-wasm-trap-handler-posix.h",
2085    "include/v8.h",
2086    "include/v8config.h",
2087    "src/api/api-arguments-inl.h",
2088    "src/api/api-arguments.cc",
2089    "src/api/api-arguments.h",
2090    "src/api/api-natives.cc",
2091    "src/api/api-natives.h",
2092    "src/api/api.cc",
2093    "src/api/api.h",
2094    "src/asmjs/asm-js.cc",
2095    "src/asmjs/asm-js.h",
2096    "src/asmjs/asm-names.h",
2097    "src/asmjs/asm-parser.cc",
2098    "src/asmjs/asm-parser.h",
2099    "src/asmjs/asm-scanner.cc",
2100    "src/asmjs/asm-scanner.h",
2101    "src/asmjs/asm-types.cc",
2102    "src/asmjs/asm-types.h",
2103    "src/ast/ast-function-literal-id-reindexer.cc",
2104    "src/ast/ast-function-literal-id-reindexer.h",
2105    "src/ast/ast-source-ranges.h",
2106    "src/ast/ast-traversal-visitor.h",
2107    "src/ast/ast-value-factory.cc",
2108    "src/ast/ast-value-factory.h",
2109    "src/ast/ast.cc",
2110    "src/ast/ast.h",
2111    "src/ast/modules.cc",
2112    "src/ast/modules.h",
2113    "src/ast/prettyprinter.cc",
2114    "src/ast/prettyprinter.h",
2115    "src/ast/scopes.cc",
2116    "src/ast/scopes.h",
2117    "src/ast/source-range-ast-visitor.cc",
2118    "src/ast/source-range-ast-visitor.h",
2119    "src/ast/variables.cc",
2120    "src/ast/variables.h",
2121    "src/builtins/accessors.cc",
2122    "src/builtins/accessors.h",
2123    "src/builtins/builtins-api.cc",
2124    "src/builtins/builtins-array.cc",
2125    "src/builtins/builtins-arraybuffer.cc",
2126    "src/builtins/builtins-async-module.cc",
2127    "src/builtins/builtins-bigint.cc",
2128    "src/builtins/builtins-call.cc",
2129    "src/builtins/builtins-callsite.cc",
2130    "src/builtins/builtins-collections.cc",
2131    "src/builtins/builtins-console.cc",
2132    "src/builtins/builtins-constructor.h",
2133    "src/builtins/builtins-dataview.cc",
2134    "src/builtins/builtins-date.cc",
2135    "src/builtins/builtins-definitions.h",
2136    "src/builtins/builtins-descriptors.h",
2137    "src/builtins/builtins-error.cc",
2138    "src/builtins/builtins-function.cc",
2139    "src/builtins/builtins-global.cc",
2140    "src/builtins/builtins-internal.cc",
2141    "src/builtins/builtins-intl.cc",
2142    "src/builtins/builtins-json.cc",
2143    "src/builtins/builtins-number.cc",
2144    "src/builtins/builtins-object.cc",
2145    "src/builtins/builtins-promise.cc",
2146    "src/builtins/builtins-promise.h",
2147    "src/builtins/builtins-reflect.cc",
2148    "src/builtins/builtins-regexp.cc",
2149    "src/builtins/builtins-sharedarraybuffer.cc",
2150    "src/builtins/builtins-string.cc",
2151    "src/builtins/builtins-symbol.cc",
2152    "src/builtins/builtins-trace.cc",
2153    "src/builtins/builtins-typed-array.cc",
2154    "src/builtins/builtins-utils-inl.h",
2155    "src/builtins/builtins-utils.h",
2156    "src/builtins/builtins-weak-refs.cc",
2157    "src/builtins/builtins.cc",
2158    "src/builtins/builtins.h",
2159    "src/builtins/constants-table-builder.cc",
2160    "src/builtins/constants-table-builder.h",
2161    "src/codegen/assembler-arch.h",
2162    "src/codegen/assembler-inl.h",
2163    "src/codegen/assembler.cc",
2164    "src/codegen/assembler.h",
2165    "src/codegen/bailout-reason.cc",
2166    "src/codegen/bailout-reason.h",
2167    "src/codegen/callable.h",
2168    "src/codegen/code-comments.cc",
2169    "src/codegen/code-comments.h",
2170    "src/codegen/code-desc.cc",
2171    "src/codegen/code-desc.h",
2172    "src/codegen/code-factory.cc",
2173    "src/codegen/code-factory.h",
2174    "src/codegen/code-reference.cc",
2175    "src/codegen/code-reference.h",
2176    "src/codegen/compilation-cache.cc",
2177    "src/codegen/compilation-cache.h",
2178    "src/codegen/compiler.cc",
2179    "src/codegen/compiler.h",
2180    "src/codegen/constant-pool.cc",
2181    "src/codegen/constant-pool.h",
2182    "src/codegen/constants-arch.h",
2183    "src/codegen/cpu-features.h",
2184    "src/codegen/external-reference-table.cc",
2185    "src/codegen/external-reference-table.h",
2186    "src/codegen/external-reference.cc",
2187    "src/codegen/external-reference.h",
2188    "src/codegen/flush-instruction-cache.cc",
2189    "src/codegen/flush-instruction-cache.h",
2190    "src/codegen/handler-table.cc",
2191    "src/codegen/handler-table.h",
2192    "src/codegen/interface-descriptors.cc",
2193    "src/codegen/interface-descriptors.h",
2194    "src/codegen/label.h",
2195    "src/codegen/machine-type.cc",
2196    "src/codegen/machine-type.h",
2197    "src/codegen/macro-assembler-inl.h",
2198    "src/codegen/macro-assembler.h",
2199    "src/codegen/optimized-compilation-info.cc",
2200    "src/codegen/optimized-compilation-info.h",
2201    "src/codegen/pending-optimization-table.cc",
2202    "src/codegen/pending-optimization-table.h",
2203    "src/codegen/register-arch.h",
2204    "src/codegen/register-configuration.cc",
2205    "src/codegen/register-configuration.h",
2206    "src/codegen/register.cc",
2207    "src/codegen/register.h",
2208    "src/codegen/reglist.h",
2209    "src/codegen/reloc-info.cc",
2210    "src/codegen/reloc-info.h",
2211    "src/codegen/safepoint-table.cc",
2212    "src/codegen/safepoint-table.h",
2213    "src/codegen/signature.h",
2214    "src/codegen/source-position-table.cc",
2215    "src/codegen/source-position-table.h",
2216    "src/codegen/source-position.cc",
2217    "src/codegen/source-position.h",
2218    "src/codegen/string-constants.cc",
2219    "src/codegen/string-constants.h",
2220    "src/codegen/tick-counter.cc",
2221    "src/codegen/tick-counter.h",
2222    "src/codegen/tnode.cc",
2223    "src/codegen/tnode.h",
2224    "src/codegen/turbo-assembler.cc",
2225    "src/codegen/turbo-assembler.h",
2226    "src/codegen/unoptimized-compilation-info.cc",
2227    "src/codegen/unoptimized-compilation-info.h",
2228    "src/common/assert-scope.cc",
2229    "src/common/assert-scope.h",
2230    "src/common/checks.h",
2231    "src/common/message-template.h",
2232    "src/common/ptr-compr-inl.h",
2233    "src/common/ptr-compr.h",
2234    "src/compiler-dispatcher/compiler-dispatcher.cc",
2235    "src/compiler-dispatcher/compiler-dispatcher.h",
2236    "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
2237    "src/compiler-dispatcher/optimizing-compile-dispatcher.h",
2238    "src/date/date.cc",
2239    "src/date/date.h",
2240    "src/date/dateparser-inl.h",
2241    "src/date/dateparser.cc",
2242    "src/date/dateparser.h",
2243    "src/debug/debug-coverage.cc",
2244    "src/debug/debug-coverage.h",
2245    "src/debug/debug-evaluate.cc",
2246    "src/debug/debug-evaluate.h",
2247    "src/debug/debug-frames.cc",
2248    "src/debug/debug-frames.h",
2249    "src/debug/debug-interface.h",
2250    "src/debug/debug-property-iterator.cc",
2251    "src/debug/debug-property-iterator.h",
2252    "src/debug/debug-scope-iterator.cc",
2253    "src/debug/debug-scope-iterator.h",
2254    "src/debug/debug-scopes.cc",
2255    "src/debug/debug-scopes.h",
2256    "src/debug/debug-stack-trace-iterator.cc",
2257    "src/debug/debug-stack-trace-iterator.h",
2258    "src/debug/debug-type-profile.cc",
2259    "src/debug/debug-type-profile.h",
2260    "src/debug/debug.cc",
2261    "src/debug/debug.h",
2262    "src/debug/interface-types.h",
2263    "src/debug/liveedit.cc",
2264    "src/debug/liveedit.h",
2265    "src/deoptimizer/deoptimize-reason.cc",
2266    "src/deoptimizer/deoptimize-reason.h",
2267    "src/deoptimizer/deoptimizer.cc",
2268    "src/deoptimizer/deoptimizer.h",
2269    "src/diagnostics/basic-block-profiler.cc",
2270    "src/diagnostics/basic-block-profiler.h",
2271    "src/diagnostics/code-tracer.h",
2272    "src/diagnostics/compilation-statistics.cc",
2273    "src/diagnostics/compilation-statistics.h",
2274    "src/diagnostics/disasm.h",
2275    "src/diagnostics/disassembler.cc",
2276    "src/diagnostics/disassembler.h",
2277    "src/diagnostics/eh-frame.cc",
2278    "src/diagnostics/eh-frame.h",
2279    "src/diagnostics/gdb-jit.cc",
2280    "src/diagnostics/gdb-jit.h",
2281    "src/diagnostics/objects-debug.cc",
2282    "src/diagnostics/objects-printer.cc",
2283    "src/diagnostics/perf-jit.cc",
2284    "src/diagnostics/perf-jit.h",
2285    "src/diagnostics/unwinder.cc",
2286    "src/execution/arguments-inl.h",
2287    "src/execution/arguments.cc",
2288    "src/execution/arguments.h",
2289    "src/execution/execution.cc",
2290    "src/execution/execution.h",
2291    "src/execution/frame-constants.h",
2292    "src/execution/frames-inl.h",
2293    "src/execution/frames.cc",
2294    "src/execution/frames.h",
2295    "src/execution/futex-emulation.cc",
2296    "src/execution/futex-emulation.h",
2297    "src/execution/interrupts-scope.cc",
2298    "src/execution/interrupts-scope.h",
2299    "src/execution/isolate-data.h",
2300    "src/execution/isolate-inl.h",
2301    "src/execution/isolate-utils.h",
2302    "src/execution/isolate.cc",
2303    "src/execution/isolate.h",
2304    "src/execution/messages.cc",
2305    "src/execution/messages.h",
2306    "src/execution/microtask-queue.cc",
2307    "src/execution/microtask-queue.h",
2308    "src/execution/off-thread-isolate.cc",
2309    "src/execution/off-thread-isolate.h",
2310    "src/execution/pointer-authentication.h",
2311    "src/execution/protectors-inl.h",
2312    "src/execution/protectors.cc",
2313    "src/execution/protectors.h",
2314    "src/execution/runtime-profiler.cc",
2315    "src/execution/runtime-profiler.h",
2316    "src/execution/simulator-base.cc",
2317    "src/execution/simulator-base.h",
2318    "src/execution/simulator.h",
2319    "src/execution/stack-guard.cc",
2320    "src/execution/stack-guard.h",
2321    "src/execution/thread-id.cc",
2322    "src/execution/thread-id.h",
2323    "src/execution/thread-local-top.cc",
2324    "src/execution/thread-local-top.h",
2325    "src/execution/v8threads.cc",
2326    "src/execution/v8threads.h",
2327    "src/execution/vm-state-inl.h",
2328    "src/execution/vm-state.h",
2329    "src/extensions/cputracemark-extension.cc",
2330    "src/extensions/cputracemark-extension.h",
2331    "src/extensions/externalize-string-extension.cc",
2332    "src/extensions/externalize-string-extension.h",
2333    "src/extensions/gc-extension.cc",
2334    "src/extensions/gc-extension.h",
2335    "src/extensions/ignition-statistics-extension.cc",
2336    "src/extensions/ignition-statistics-extension.h",
2337    "src/extensions/statistics-extension.cc",
2338    "src/extensions/statistics-extension.h",
2339    "src/extensions/trigger-failure-extension.cc",
2340    "src/extensions/trigger-failure-extension.h",
2341    "src/flags/flag-definitions.h",
2342    "src/flags/flags.cc",
2343    "src/flags/flags.h",
2344    "src/handles/global-handles.cc",
2345    "src/handles/global-handles.h",
2346    "src/handles/handles-inl.h",
2347    "src/handles/handles.cc",
2348    "src/handles/handles.h",
2349    "src/handles/local-handles-inl.h",
2350    "src/handles/local-handles.cc",
2351    "src/handles/local-handles.h",
2352    "src/handles/maybe-handles-inl.h",
2353    "src/handles/maybe-handles.h",
2354    "src/heap/array-buffer-collector.cc",
2355    "src/heap/array-buffer-collector.h",
2356    "src/heap/array-buffer-sweeper.cc",
2357    "src/heap/array-buffer-sweeper.h",
2358    "src/heap/array-buffer-tracker-inl.h",
2359    "src/heap/array-buffer-tracker.cc",
2360    "src/heap/array-buffer-tracker.h",
2361    "src/heap/barrier.h",
2362    "src/heap/basic-memory-chunk.cc",
2363    "src/heap/basic-memory-chunk.h",
2364    "src/heap/code-stats.cc",
2365    "src/heap/code-stats.h",
2366    "src/heap/combined-heap.cc",
2367    "src/heap/combined-heap.h",
2368    "src/heap/concurrent-marking.cc",
2369    "src/heap/concurrent-marking.h",
2370    "src/heap/embedder-tracing.cc",
2371    "src/heap/embedder-tracing.h",
2372    "src/heap/factory-base.cc",
2373    "src/heap/factory-base.h",
2374    "src/heap/factory-inl.h",
2375    "src/heap/factory.cc",
2376    "src/heap/factory.h",
2377    "src/heap/finalization-registry-cleanup-task.cc",
2378    "src/heap/finalization-registry-cleanup-task.h",
2379    "src/heap/gc-idle-time-handler.cc",
2380    "src/heap/gc-idle-time-handler.h",
2381    "src/heap/gc-tracer.cc",
2382    "src/heap/gc-tracer.h",
2383    "src/heap/heap-controller.cc",
2384    "src/heap/heap-controller.h",
2385    "src/heap/heap-inl.h",
2386    "src/heap/heap-write-barrier-inl.h",
2387    "src/heap/heap-write-barrier.h",
2388    "src/heap/heap.cc",
2389    "src/heap/heap.h",
2390    "src/heap/incremental-marking-inl.h",
2391    "src/heap/incremental-marking-job.cc",
2392    "src/heap/incremental-marking-job.h",
2393    "src/heap/incremental-marking.cc",
2394    "src/heap/incremental-marking.h",
2395    "src/heap/invalidated-slots-inl.h",
2396    "src/heap/invalidated-slots.cc",
2397    "src/heap/invalidated-slots.h",
2398    "src/heap/item-parallel-job.cc",
2399    "src/heap/item-parallel-job.h",
2400    "src/heap/local-allocator-inl.h",
2401    "src/heap/local-allocator.h",
2402    "src/heap/local-heap.cc",
2403    "src/heap/local-heap.h",
2404    "src/heap/mark-compact-inl.h",
2405    "src/heap/mark-compact.cc",
2406    "src/heap/mark-compact.h",
2407    "src/heap/marking-visitor-inl.h",
2408    "src/heap/marking-visitor.h",
2409    "src/heap/marking-worklist.cc",
2410    "src/heap/marking-worklist.h",
2411    "src/heap/marking.cc",
2412    "src/heap/marking.h",
2413    "src/heap/memory-measurement-inl.h",
2414    "src/heap/memory-measurement.cc",
2415    "src/heap/memory-measurement.h",
2416    "src/heap/memory-reducer.cc",
2417    "src/heap/memory-reducer.h",
2418    "src/heap/object-stats.cc",
2419    "src/heap/object-stats.h",
2420    "src/heap/objects-visiting-inl.h",
2421    "src/heap/objects-visiting.cc",
2422    "src/heap/objects-visiting.h",
2423    "src/heap/off-thread-factory.cc",
2424    "src/heap/off-thread-factory.h",
2425    "src/heap/read-only-heap-inl.h",
2426    "src/heap/read-only-heap.cc",
2427    "src/heap/read-only-heap.h",
2428    "src/heap/remembered-set.h",
2429    "src/heap/safepoint.cc",
2430    "src/heap/safepoint.h",
2431    "src/heap/scavenge-job.cc",
2432    "src/heap/scavenge-job.h",
2433    "src/heap/scavenger-inl.h",
2434    "src/heap/scavenger.cc",
2435    "src/heap/scavenger.h",
2436    "src/heap/slot-set.cc",
2437    "src/heap/slot-set.h",
2438    "src/heap/spaces-inl.h",
2439    "src/heap/spaces.cc",
2440    "src/heap/spaces.h",
2441    "src/heap/stress-marking-observer.cc",
2442    "src/heap/stress-marking-observer.h",
2443    "src/heap/stress-scavenge-observer.cc",
2444    "src/heap/stress-scavenge-observer.h",
2445    "src/heap/sweeper.cc",
2446    "src/heap/sweeper.h",
2447    "src/heap/worklist.h",
2448    "src/ic/call-optimization.cc",
2449    "src/ic/call-optimization.h",
2450    "src/ic/handler-configuration-inl.h",
2451    "src/ic/handler-configuration.cc",
2452    "src/ic/handler-configuration.h",
2453    "src/ic/ic-inl.h",
2454    "src/ic/ic-stats.cc",
2455    "src/ic/ic-stats.h",
2456    "src/ic/ic.cc",
2457    "src/ic/ic.h",
2458    "src/ic/stub-cache.cc",
2459    "src/ic/stub-cache.h",
2460    "src/init/bootstrapper.cc",
2461    "src/init/bootstrapper.h",
2462    "src/init/heap-symbols.h",
2463    "src/init/icu_util.cc",
2464    "src/init/icu_util.h",
2465    "src/init/isolate-allocator.cc",
2466    "src/init/isolate-allocator.h",
2467    "src/init/setup-isolate.h",
2468    "src/init/startup-data-util.cc",
2469    "src/init/startup-data-util.h",
2470    "src/init/v8.cc",
2471    "src/init/v8.h",
2472    "src/interpreter/block-coverage-builder.h",
2473    "src/interpreter/bytecode-array-accessor.cc",
2474    "src/interpreter/bytecode-array-accessor.h",
2475    "src/interpreter/bytecode-array-builder.cc",
2476    "src/interpreter/bytecode-array-builder.h",
2477    "src/interpreter/bytecode-array-iterator.cc",
2478    "src/interpreter/bytecode-array-iterator.h",
2479    "src/interpreter/bytecode-array-random-iterator.cc",
2480    "src/interpreter/bytecode-array-random-iterator.h",
2481    "src/interpreter/bytecode-array-writer.cc",
2482    "src/interpreter/bytecode-array-writer.h",
2483    "src/interpreter/bytecode-decoder.cc",
2484    "src/interpreter/bytecode-decoder.h",
2485    "src/interpreter/bytecode-flags.cc",
2486    "src/interpreter/bytecode-flags.h",
2487    "src/interpreter/bytecode-generator.cc",
2488    "src/interpreter/bytecode-generator.h",
2489    "src/interpreter/bytecode-jump-table.h",
2490    "src/interpreter/bytecode-label.cc",
2491    "src/interpreter/bytecode-label.h",
2492    "src/interpreter/bytecode-node.cc",
2493    "src/interpreter/bytecode-node.h",
2494    "src/interpreter/bytecode-operands.cc",
2495    "src/interpreter/bytecode-operands.h",
2496    "src/interpreter/bytecode-register-allocator.h",
2497    "src/interpreter/bytecode-register-optimizer.cc",
2498    "src/interpreter/bytecode-register-optimizer.h",
2499    "src/interpreter/bytecode-register.cc",
2500    "src/interpreter/bytecode-register.h",
2501    "src/interpreter/bytecode-source-info.cc",
2502    "src/interpreter/bytecode-source-info.h",
2503    "src/interpreter/bytecode-traits.h",
2504    "src/interpreter/bytecodes.cc",
2505    "src/interpreter/bytecodes.h",
2506    "src/interpreter/constant-array-builder.cc",
2507    "src/interpreter/constant-array-builder.h",
2508    "src/interpreter/control-flow-builders.cc",
2509    "src/interpreter/control-flow-builders.h",
2510    "src/interpreter/handler-table-builder.cc",
2511    "src/interpreter/handler-table-builder.h",
2512    "src/interpreter/interpreter-generator.h",
2513    "src/interpreter/interpreter-intrinsics.cc",
2514    "src/interpreter/interpreter-intrinsics.h",
2515    "src/interpreter/interpreter.cc",
2516    "src/interpreter/interpreter.h",
2517    "src/json/json-parser.cc",
2518    "src/json/json-parser.h",
2519    "src/json/json-stringifier.cc",
2520    "src/json/json-stringifier.h",
2521    "src/logging/code-events.h",
2522    "src/logging/counters-definitions.h",
2523    "src/logging/counters-inl.h",
2524    "src/logging/counters.cc",
2525    "src/logging/counters.h",
2526    "src/logging/log-inl.h",
2527    "src/logging/log-utils.cc",
2528    "src/logging/log-utils.h",
2529    "src/logging/log.cc",
2530    "src/logging/log.h",
2531    "src/logging/off-thread-logger.h",
2532    "src/numbers/bignum-dtoa.cc",
2533    "src/numbers/bignum-dtoa.h",
2534    "src/numbers/bignum.cc",
2535    "src/numbers/bignum.h",
2536    "src/numbers/cached-powers.cc",
2537    "src/numbers/cached-powers.h",
2538    "src/numbers/conversions-inl.h",
2539    "src/numbers/conversions.cc",
2540    "src/numbers/conversions.h",
2541    "src/numbers/diy-fp.cc",
2542    "src/numbers/diy-fp.h",
2543    "src/numbers/double.h",
2544    "src/numbers/dtoa.cc",
2545    "src/numbers/dtoa.h",
2546    "src/numbers/fast-dtoa.cc",
2547    "src/numbers/fast-dtoa.h",
2548    "src/numbers/fixed-dtoa.cc",
2549    "src/numbers/fixed-dtoa.h",
2550    "src/numbers/hash-seed-inl.h",
2551    "src/numbers/math-random.cc",
2552    "src/numbers/math-random.h",
2553    "src/numbers/strtod.cc",
2554    "src/numbers/strtod.h",
2555    "src/objects/allocation-site-inl.h",
2556    "src/objects/allocation-site-scopes-inl.h",
2557    "src/objects/allocation-site-scopes.h",
2558    "src/objects/allocation-site.h",
2559    "src/objects/api-callbacks-inl.h",
2560    "src/objects/api-callbacks.h",
2561    "src/objects/arguments-inl.h",
2562    "src/objects/arguments.h",
2563    "src/objects/backing-store.cc",
2564    "src/objects/backing-store.h",
2565    "src/objects/bigint.cc",
2566    "src/objects/bigint.h",
2567    "src/objects/cell-inl.h",
2568    "src/objects/cell.h",
2569    "src/objects/code-inl.h",
2570    "src/objects/code.cc",
2571    "src/objects/code.h",
2572    "src/objects/compilation-cache-inl.h",
2573    "src/objects/compilation-cache.h",
2574    "src/objects/compressed-slots-inl.h",
2575    "src/objects/compressed-slots.h",
2576    "src/objects/contexts-inl.h",
2577    "src/objects/contexts.cc",
2578    "src/objects/contexts.h",
2579    "src/objects/data-handler.h",
2580    "src/objects/debug-objects-inl.h",
2581    "src/objects/debug-objects.cc",
2582    "src/objects/debug-objects.h",
2583    "src/objects/descriptor-array-inl.h",
2584    "src/objects/descriptor-array.h",
2585    "src/objects/dictionary-inl.h",
2586    "src/objects/dictionary.h",
2587    "src/objects/elements-inl.h",
2588    "src/objects/elements-kind.cc",
2589    "src/objects/elements-kind.h",
2590    "src/objects/elements.cc",
2591    "src/objects/elements.h",
2592    "src/objects/embedder-data-array-inl.h",
2593    "src/objects/embedder-data-array.cc",
2594    "src/objects/embedder-data-array.h",
2595    "src/objects/embedder-data-slot-inl.h",
2596    "src/objects/embedder-data-slot.h",
2597    "src/objects/feedback-cell-inl.h",
2598    "src/objects/feedback-cell.h",
2599    "src/objects/feedback-vector-inl.h",
2600    "src/objects/feedback-vector.cc",
2601    "src/objects/feedback-vector.h",
2602    "src/objects/field-index-inl.h",
2603    "src/objects/field-index.h",
2604    "src/objects/field-type.cc",
2605    "src/objects/field-type.h",
2606    "src/objects/fixed-array-inl.h",
2607    "src/objects/fixed-array.h",
2608    "src/objects/frame-array-inl.h",
2609    "src/objects/frame-array.h",
2610    "src/objects/function-kind.h",
2611    "src/objects/hash-table-inl.h",
2612    "src/objects/hash-table.h",
2613    "src/objects/heap-number-inl.h",
2614    "src/objects/heap-number.h",
2615    "src/objects/heap-object-inl.h",
2616    "src/objects/heap-object.h",
2617    "src/objects/instance-type-inl.h",
2618    "src/objects/instance-type.h",
2619    "src/objects/internal-index.h",
2620    "src/objects/intl-objects.cc",
2621    "src/objects/intl-objects.h",
2622    "src/objects/js-array-buffer-inl.h",
2623    "src/objects/js-array-buffer.cc",
2624    "src/objects/js-array-buffer.h",
2625    "src/objects/js-array-inl.h",
2626    "src/objects/js-array.h",
2627    "src/objects/js-break-iterator-inl.h",
2628    "src/objects/js-break-iterator.cc",
2629    "src/objects/js-break-iterator.h",
2630    "src/objects/js-collator-inl.h",
2631    "src/objects/js-collator.cc",
2632    "src/objects/js-collator.h",
2633    "src/objects/js-collection-inl.h",
2634    "src/objects/js-collection-iterator.h",
2635    "src/objects/js-collection.h",
2636    "src/objects/js-date-time-format-inl.h",
2637    "src/objects/js-date-time-format.cc",
2638    "src/objects/js-date-time-format.h",
2639    "src/objects/js-display-names-inl.h",
2640    "src/objects/js-display-names.cc",
2641    "src/objects/js-display-names.h",
2642    "src/objects/js-generator-inl.h",
2643    "src/objects/js-generator.h",
2644    "src/objects/js-list-format-inl.h",
2645    "src/objects/js-list-format.cc",
2646    "src/objects/js-list-format.h",
2647    "src/objects/js-locale-inl.h",
2648    "src/objects/js-locale.cc",
2649    "src/objects/js-locale.h",
2650    "src/objects/js-number-format-inl.h",
2651    "src/objects/js-number-format.cc",
2652    "src/objects/js-number-format.h",
2653    "src/objects/js-objects-inl.h",
2654    "src/objects/js-objects.cc",
2655    "src/objects/js-objects.h",
2656    "src/objects/js-plural-rules-inl.h",
2657    "src/objects/js-plural-rules.cc",
2658    "src/objects/js-plural-rules.h",
2659    "src/objects/js-promise-inl.h",
2660    "src/objects/js-promise.h",
2661    "src/objects/js-proxy-inl.h",
2662    "src/objects/js-proxy.h",
2663    "src/objects/js-regexp-inl.h",
2664    "src/objects/js-regexp-string-iterator-inl.h",
2665    "src/objects/js-regexp-string-iterator.h",
2666    "src/objects/js-regexp.cc",
2667    "src/objects/js-regexp.h",
2668    "src/objects/js-relative-time-format-inl.h",
2669    "src/objects/js-relative-time-format.cc",
2670    "src/objects/js-relative-time-format.h",
2671    "src/objects/js-segment-iterator-inl.h",
2672    "src/objects/js-segment-iterator.cc",
2673    "src/objects/js-segment-iterator.h",
2674    "src/objects/js-segmenter-inl.h",
2675    "src/objects/js-segmenter.cc",
2676    "src/objects/js-segmenter.h",
2677    "src/objects/js-weak-refs-inl.h",
2678    "src/objects/js-weak-refs.h",
2679    "src/objects/keys.cc",
2680    "src/objects/keys.h",
2681    "src/objects/layout-descriptor-inl.h",
2682    "src/objects/layout-descriptor.cc",
2683    "src/objects/layout-descriptor.h",
2684    "src/objects/literal-objects-inl.h",
2685    "src/objects/literal-objects.cc",
2686    "src/objects/literal-objects.h",
2687    "src/objects/lookup-cache-inl.h",
2688    "src/objects/lookup-cache.cc",
2689    "src/objects/lookup-cache.h",
2690    "src/objects/lookup-inl.h",
2691    "src/objects/lookup.cc",
2692    "src/objects/lookup.h",
2693    "src/objects/managed.cc",
2694    "src/objects/managed.h",
2695    "src/objects/map-inl.h",
2696    "src/objects/map-updater.cc",
2697    "src/objects/map-updater.h",
2698    "src/objects/map.cc",
2699    "src/objects/map.h",
2700    "src/objects/maybe-object-inl.h",
2701    "src/objects/maybe-object.h",
2702    "src/objects/microtask-inl.h",
2703    "src/objects/microtask.h",
2704    "src/objects/module-inl.h",
2705    "src/objects/module.cc",
2706    "src/objects/module.h",
2707    "src/objects/name-inl.h",
2708    "src/objects/name.h",
2709    "src/objects/object-list-macros.h",
2710    "src/objects/object-macros-undef.h",
2711    "src/objects/object-macros.h",
2712    "src/objects/objects-body-descriptors-inl.h",
2713    "src/objects/objects-body-descriptors.h",
2714    "src/objects/objects-inl.h",
2715    "src/objects/objects.cc",
2716    "src/objects/objects.h",
2717    "src/objects/oddball-inl.h",
2718    "src/objects/oddball.h",
2719    "src/objects/ordered-hash-table-inl.h",
2720    "src/objects/ordered-hash-table.cc",
2721    "src/objects/ordered-hash-table.h",
2722    "src/objects/osr-optimized-code-cache-inl.h",
2723    "src/objects/osr-optimized-code-cache.cc",
2724    "src/objects/osr-optimized-code-cache.h",
2725    "src/objects/primitive-heap-object-inl.h",
2726    "src/objects/primitive-heap-object.h",
2727    "src/objects/promise-inl.h",
2728    "src/objects/promise.h",
2729    "src/objects/property-array-inl.h",
2730    "src/objects/property-array.h",
2731    "src/objects/property-cell-inl.h",
2732    "src/objects/property-cell.h",
2733    "src/objects/property-descriptor-object-inl.h",
2734    "src/objects/property-descriptor-object.h",
2735    "src/objects/property-descriptor.cc",
2736    "src/objects/property-descriptor.h",
2737    "src/objects/property-details.h",
2738    "src/objects/property.cc",
2739    "src/objects/property.h",
2740    "src/objects/prototype-info-inl.h",
2741    "src/objects/prototype-info.h",
2742    "src/objects/prototype.h",
2743    "src/objects/regexp-match-info.h",
2744    "src/objects/scope-info.cc",
2745    "src/objects/scope-info.h",
2746    "src/objects/script-inl.h",
2747    "src/objects/script.h",
2748    "src/objects/shared-function-info-inl.h",
2749    "src/objects/shared-function-info.h",
2750    "src/objects/slots-atomic-inl.h",
2751    "src/objects/slots-inl.h",
2752    "src/objects/slots.h",
2753    "src/objects/source-text-module.cc",
2754    "src/objects/source-text-module.h",
2755    "src/objects/stack-frame-info-inl.h",
2756    "src/objects/stack-frame-info.cc",
2757    "src/objects/stack-frame-info.h",
2758    "src/objects/string-comparator.cc",
2759    "src/objects/string-comparator.h",
2760    "src/objects/string-inl.h",
2761    "src/objects/string-table-inl.h",
2762    "src/objects/string-table.h",
2763    "src/objects/string.cc",
2764    "src/objects/string.h",
2765    "src/objects/struct-inl.h",
2766    "src/objects/struct.h",
2767    "src/objects/synthetic-module.cc",
2768    "src/objects/synthetic-module.h",
2769    "src/objects/tagged-field-inl.h",
2770    "src/objects/tagged-field.h",
2771    "src/objects/tagged-impl-inl.h",
2772    "src/objects/tagged-impl.cc",
2773    "src/objects/tagged-impl.h",
2774    "src/objects/tagged-index.h",
2775    "src/objects/tagged-value-inl.h",
2776    "src/objects/tagged-value.h",
2777    "src/objects/template-objects-inl.h",
2778    "src/objects/template-objects.cc",
2779    "src/objects/template-objects.h",
2780    "src/objects/templates-inl.h",
2781    "src/objects/templates.h",
2782    "src/objects/transitions-inl.h",
2783    "src/objects/transitions.cc",
2784    "src/objects/transitions.h",
2785    "src/objects/type-hints.cc",
2786    "src/objects/type-hints.h",
2787    "src/objects/value-serializer.cc",
2788    "src/objects/value-serializer.h",
2789    "src/objects/visitors.cc",
2790    "src/objects/visitors.h",
2791    "src/parsing/expression-scope.h",
2792    "src/parsing/func-name-inferrer.cc",
2793    "src/parsing/func-name-inferrer.h",
2794    "src/parsing/literal-buffer.cc",
2795    "src/parsing/literal-buffer.h",
2796    "src/parsing/parse-info.cc",
2797    "src/parsing/parse-info.h",
2798    "src/parsing/parser-base.h",
2799    "src/parsing/parser.cc",
2800    "src/parsing/parser.h",
2801    "src/parsing/parsing.cc",
2802    "src/parsing/parsing.h",
2803    "src/parsing/pending-compilation-error-handler.cc",
2804    "src/parsing/pending-compilation-error-handler.h",
2805    "src/parsing/preparse-data-impl.h",
2806    "src/parsing/preparse-data.cc",
2807    "src/parsing/preparse-data.h",
2808    "src/parsing/preparser-logger.h",
2809    "src/parsing/preparser.cc",
2810    "src/parsing/preparser.h",
2811    "src/parsing/rewriter.cc",
2812    "src/parsing/rewriter.h",
2813    "src/parsing/scanner-character-streams.cc",
2814    "src/parsing/scanner-character-streams.h",
2815    "src/parsing/scanner.cc",
2816    "src/parsing/scanner.h",
2817    "src/parsing/token.cc",
2818    "src/parsing/token.h",
2819    "src/profiler/allocation-tracker.cc",
2820    "src/profiler/allocation-tracker.h",
2821    "src/profiler/circular-queue-inl.h",
2822    "src/profiler/circular-queue.h",
2823    "src/profiler/cpu-profiler-inl.h",
2824    "src/profiler/cpu-profiler.cc",
2825    "src/profiler/cpu-profiler.h",
2826    "src/profiler/heap-profiler.cc",
2827    "src/profiler/heap-profiler.h",
2828    "src/profiler/heap-snapshot-generator-inl.h",
2829    "src/profiler/heap-snapshot-generator.cc",
2830    "src/profiler/heap-snapshot-generator.h",
2831    "src/profiler/profile-generator-inl.h",
2832    "src/profiler/profile-generator.cc",
2833    "src/profiler/profile-generator.h",
2834    "src/profiler/profiler-listener.cc",
2835    "src/profiler/profiler-listener.h",
2836    "src/profiler/sampling-heap-profiler.cc",
2837    "src/profiler/sampling-heap-profiler.h",
2838    "src/profiler/strings-storage.cc",
2839    "src/profiler/strings-storage.h",
2840    "src/profiler/tick-sample.cc",
2841    "src/profiler/tick-sample.h",
2842    "src/profiler/tracing-cpu-profiler.cc",
2843    "src/profiler/tracing-cpu-profiler.h",
2844    "src/regexp/property-sequences.cc",
2845    "src/regexp/property-sequences.h",
2846    "src/regexp/regexp-ast.cc",
2847    "src/regexp/regexp-ast.h",
2848    "src/regexp/regexp-bytecode-generator-inl.h",
2849    "src/regexp/regexp-bytecode-generator.cc",
2850    "src/regexp/regexp-bytecode-generator.h",
2851    "src/regexp/regexp-bytecode-peephole.cc",
2852    "src/regexp/regexp-bytecode-peephole.h",
2853    "src/regexp/regexp-bytecodes.cc",
2854    "src/regexp/regexp-bytecodes.h",
2855    "src/regexp/regexp-compiler-tonode.cc",
2856    "src/regexp/regexp-compiler.cc",
2857    "src/regexp/regexp-compiler.h",
2858    "src/regexp/regexp-dotprinter.cc",
2859    "src/regexp/regexp-dotprinter.h",
2860    "src/regexp/regexp-error.cc",
2861    "src/regexp/regexp-error.h",
2862    "src/regexp/regexp-interpreter.cc",
2863    "src/regexp/regexp-interpreter.h",
2864    "src/regexp/regexp-macro-assembler-arch.h",
2865    "src/regexp/regexp-macro-assembler-tracer.cc",
2866    "src/regexp/regexp-macro-assembler-tracer.h",
2867    "src/regexp/regexp-macro-assembler.cc",
2868    "src/regexp/regexp-macro-assembler.h",
2869    "src/regexp/regexp-nodes.h",
2870    "src/regexp/regexp-parser.cc",
2871    "src/regexp/regexp-parser.h",
2872    "src/regexp/regexp-stack.cc",
2873    "src/regexp/regexp-stack.h",
2874    "src/regexp/regexp-utils.cc",
2875    "src/regexp/regexp-utils.h",
2876    "src/regexp/regexp.cc",
2877    "src/regexp/regexp.h",
2878    "src/regexp/special-case.h",
2879    "src/roots/roots-inl.h",
2880    "src/roots/roots.cc",
2881    "src/roots/roots.h",
2882    "src/runtime/runtime-array.cc",
2883    "src/runtime/runtime-atomics.cc",
2884    "src/runtime/runtime-bigint.cc",
2885    "src/runtime/runtime-classes.cc",
2886    "src/runtime/runtime-collections.cc",
2887    "src/runtime/runtime-compiler.cc",
2888    "src/runtime/runtime-date.cc",
2889    "src/runtime/runtime-debug.cc",
2890    "src/runtime/runtime-forin.cc",
2891    "src/runtime/runtime-function.cc",
2892    "src/runtime/runtime-futex.cc",
2893    "src/runtime/runtime-generator.cc",
2894    "src/runtime/runtime-internal.cc",
2895    "src/runtime/runtime-interpreter.cc",
2896    "src/runtime/runtime-intl.cc",
2897    "src/runtime/runtime-literals.cc",
2898    "src/runtime/runtime-module.cc",
2899    "src/runtime/runtime-numbers.cc",
2900    "src/runtime/runtime-object.cc",
2901    "src/runtime/runtime-operators.cc",
2902    "src/runtime/runtime-promise.cc",
2903    "src/runtime/runtime-proxy.cc",
2904    "src/runtime/runtime-regexp.cc",
2905    "src/runtime/runtime-scopes.cc",
2906    "src/runtime/runtime-strings.cc",
2907    "src/runtime/runtime-symbol.cc",
2908    "src/runtime/runtime-test.cc",
2909    "src/runtime/runtime-typedarray.cc",
2910    "src/runtime/runtime-utils.h",
2911    "src/runtime/runtime-wasm.cc",
2912    "src/runtime/runtime.cc",
2913    "src/runtime/runtime.h",
2914    "src/sanitizer/asan.h",
2915    "src/sanitizer/lsan-page-allocator.cc",
2916    "src/sanitizer/lsan-page-allocator.h",
2917    "src/sanitizer/msan.h",
2918    "src/sanitizer/tsan.h",
2919    "src/snapshot/code-serializer.cc",
2920    "src/snapshot/code-serializer.h",
2921    "src/snapshot/deserializer-allocator.cc",
2922    "src/snapshot/deserializer-allocator.h",
2923    "src/snapshot/deserializer.cc",
2924    "src/snapshot/deserializer.h",
2925    "src/snapshot/embedded/embedded-data.cc",
2926    "src/snapshot/embedded/embedded-data.h",
2927    "src/snapshot/object-deserializer.cc",
2928    "src/snapshot/object-deserializer.h",
2929    "src/snapshot/partial-deserializer.cc",
2930    "src/snapshot/partial-deserializer.h",
2931    "src/snapshot/partial-serializer.cc",
2932    "src/snapshot/partial-serializer.h",
2933    "src/snapshot/read-only-deserializer.cc",
2934    "src/snapshot/read-only-deserializer.h",
2935    "src/snapshot/read-only-serializer.cc",
2936    "src/snapshot/read-only-serializer.h",
2937    "src/snapshot/references.h",
2938    "src/snapshot/roots-serializer.cc",
2939    "src/snapshot/roots-serializer.h",
2940    "src/snapshot/serializer-allocator.cc",
2941    "src/snapshot/serializer-allocator.h",
2942    "src/snapshot/serializer-common.cc",
2943    "src/snapshot/serializer-common.h",
2944    "src/snapshot/serializer.cc",
2945    "src/snapshot/serializer.h",
2946    "src/snapshot/snapshot-common.cc",
2947    "src/snapshot/snapshot-compression.cc",
2948    "src/snapshot/snapshot-compression.h",
2949    "src/snapshot/snapshot-source-sink.cc",
2950    "src/snapshot/snapshot-source-sink.h",
2951    "src/snapshot/snapshot.h",
2952    "src/snapshot/startup-deserializer.cc",
2953    "src/snapshot/startup-deserializer.h",
2954    "src/snapshot/startup-serializer.cc",
2955    "src/snapshot/startup-serializer.h",
2956    "src/strings/char-predicates-inl.h",
2957    "src/strings/char-predicates.cc",
2958    "src/strings/char-predicates.h",
2959    "src/strings/string-builder-inl.h",
2960    "src/strings/string-builder.cc",
2961    "src/strings/string-case.cc",
2962    "src/strings/string-case.h",
2963    "src/strings/string-hasher-inl.h",
2964    "src/strings/string-hasher.h",
2965    "src/strings/string-search.h",
2966    "src/strings/string-stream.cc",
2967    "src/strings/string-stream.h",
2968    "src/strings/unicode-decoder.cc",
2969    "src/strings/unicode-decoder.h",
2970    "src/strings/unicode-inl.h",
2971    "src/strings/unicode.cc",
2972    "src/strings/unicode.h",
2973    "src/strings/uri.cc",
2974    "src/strings/uri.h",
2975    "src/tasks/cancelable-task.cc",
2976    "src/tasks/cancelable-task.h",
2977    "src/tasks/task-utils.cc",
2978    "src/tasks/task-utils.h",
2979    "src/third_party/siphash/halfsiphash.cc",
2980    "src/third_party/siphash/halfsiphash.h",
2981    "src/third_party/utf8-decoder/utf8-decoder.h",
2982    "src/tracing/trace-event.cc",
2983    "src/tracing/trace-event.h",
2984    "src/tracing/traced-value.cc",
2985    "src/tracing/traced-value.h",
2986    "src/tracing/tracing-category-observer.cc",
2987    "src/tracing/tracing-category-observer.h",
2988    "src/trap-handler/handler-inside.cc",
2989    "src/trap-handler/handler-outside.cc",
2990    "src/trap-handler/handler-shared.cc",
2991    "src/trap-handler/trap-handler-internal.h",
2992    "src/trap-handler/trap-handler.h",
2993    "src/utils/address-map.cc",
2994    "src/utils/address-map.h",
2995    "src/utils/allocation.cc",
2996    "src/utils/allocation.h",
2997    "src/utils/bit-vector.cc",
2998    "src/utils/bit-vector.h",
2999    "src/utils/boxed-float.h",
3000    "src/utils/detachable-vector.cc",
3001    "src/utils/detachable-vector.h",
3002    "src/utils/identity-map.cc",
3003    "src/utils/identity-map.h",
3004    "src/utils/locked-queue-inl.h",
3005    "src/utils/locked-queue.h",
3006    "src/utils/memcopy.cc",
3007    "src/utils/memcopy.h",
3008    "src/utils/ostreams.cc",
3009    "src/utils/ostreams.h",
3010    "src/utils/pointer-with-payload.h",
3011    "src/utils/utils-inl.h",
3012    "src/utils/utils.cc",
3013    "src/utils/utils.h",
3014    "src/utils/vector.h",
3015    "src/utils/version.cc",
3016    "src/utils/version.h",
3017    "src/wasm/baseline/liftoff-assembler-defs.h",
3018    "src/wasm/baseline/liftoff-assembler.cc",
3019    "src/wasm/baseline/liftoff-assembler.h",
3020    "src/wasm/baseline/liftoff-compiler.cc",
3021    "src/wasm/baseline/liftoff-compiler.h",
3022    "src/wasm/baseline/liftoff-register.h",
3023    "src/wasm/compilation-environment.h",
3024    "src/wasm/decoder.h",
3025    "src/wasm/function-body-decoder-impl.h",
3026    "src/wasm/function-body-decoder.cc",
3027    "src/wasm/function-body-decoder.h",
3028    "src/wasm/function-compiler.cc",
3029    "src/wasm/function-compiler.h",
3030    "src/wasm/graph-builder-interface.cc",
3031    "src/wasm/graph-builder-interface.h",
3032    "src/wasm/jump-table-assembler.cc",
3033    "src/wasm/jump-table-assembler.h",
3034    "src/wasm/leb-helper.h",
3035    "src/wasm/local-decl-encoder.cc",
3036    "src/wasm/local-decl-encoder.h",
3037    "src/wasm/memory-tracing.cc",
3038    "src/wasm/memory-tracing.h",
3039    "src/wasm/module-compiler.cc",
3040    "src/wasm/module-compiler.h",
3041    "src/wasm/module-decoder.cc",
3042    "src/wasm/module-decoder.h",
3043    "src/wasm/module-instantiate.cc",
3044    "src/wasm/module-instantiate.h",
3045    "src/wasm/object-access.h",
3046    "src/wasm/signature-map.cc",
3047    "src/wasm/signature-map.h",
3048    "src/wasm/streaming-decoder.cc",
3049    "src/wasm/streaming-decoder.h",
3050    "src/wasm/value-type.h",
3051    "src/wasm/wasm-arguments.h",
3052    "src/wasm/wasm-code-manager.cc",
3053    "src/wasm/wasm-code-manager.h",
3054    "src/wasm/wasm-constants.h",
3055    "src/wasm/wasm-debug-evaluate.cc",
3056    "src/wasm/wasm-debug-evaluate.h",
3057    "src/wasm/wasm-debug.cc",
3058    "src/wasm/wasm-engine.cc",
3059    "src/wasm/wasm-engine.h",
3060    "src/wasm/wasm-external-refs.cc",
3061    "src/wasm/wasm-external-refs.h",
3062    "src/wasm/wasm-feature-flags.h",
3063    "src/wasm/wasm-features.cc",
3064    "src/wasm/wasm-features.h",
3065    "src/wasm/wasm-import-wrapper-cache.cc",
3066    "src/wasm/wasm-import-wrapper-cache.h",
3067    "src/wasm/wasm-interpreter.cc",
3068    "src/wasm/wasm-interpreter.h",
3069    "src/wasm/wasm-js.cc",
3070    "src/wasm/wasm-js.h",
3071    "src/wasm/wasm-limits.h",
3072    "src/wasm/wasm-linkage.h",
3073    "src/wasm/wasm-module-builder.cc",
3074    "src/wasm/wasm-module-builder.h",
3075    "src/wasm/wasm-module-sourcemap.cc",
3076    "src/wasm/wasm-module-sourcemap.h",
3077    "src/wasm/wasm-module.cc",
3078    "src/wasm/wasm-module.h",
3079    "src/wasm/wasm-objects-inl.h",
3080    "src/wasm/wasm-objects.cc",
3081    "src/wasm/wasm-objects.h",
3082    "src/wasm/wasm-opcodes.cc",
3083    "src/wasm/wasm-opcodes.h",
3084    "src/wasm/wasm-result.cc",
3085    "src/wasm/wasm-result.h",
3086    "src/wasm/wasm-serialization.cc",
3087    "src/wasm/wasm-serialization.h",
3088    "src/wasm/wasm-tier.h",
3089    "src/wasm/wasm-value.h",
3090    "src/zone/accounting-allocator.cc",
3091    "src/zone/accounting-allocator.h",
3092    "src/zone/zone-allocator.h",
3093    "src/zone/zone-chunk-list.h",
3094    "src/zone/zone-containers.h",
3095    "src/zone/zone-handle-set.h",
3096    "src/zone/zone-list-inl.h",
3097    "src/zone/zone-segment.cc",
3098    "src/zone/zone-segment.h",
3099    "src/zone/zone.cc",
3100    "src/zone/zone.h",
3101  ]
3102
3103  if (!v8_control_flow_integrity) {
3104    sources += [ "src/execution/pointer-authentication-dummy.h" ]
3105  }
3106
3107  if (v8_enable_third_party_heap) {
3108    sources += v8_third_party_heap_files
3109  }
3110
3111  if (v8_enable_wasm_gdb_remote_debugging) {
3112    sources += [
3113      "src/debug/wasm/gdb-server/gdb-server-thread.cc",
3114      "src/debug/wasm/gdb-server/gdb-server-thread.h",
3115      "src/debug/wasm/gdb-server/gdb-server.cc",
3116      "src/debug/wasm/gdb-server/gdb-server.h",
3117      "src/debug/wasm/gdb-server/session.cc",
3118      "src/debug/wasm/gdb-server/session.h",
3119      "src/debug/wasm/gdb-server/target.cc",
3120      "src/debug/wasm/gdb-server/target.h",
3121      "src/debug/wasm/gdb-server/transport.cc",
3122      "src/debug/wasm/gdb-server/transport.h",
3123      "src/debug/wasm/gdb-server/util.h",
3124    ]
3125  }
3126
3127  if (v8_check_header_includes) {
3128    # This file will be generated by tools/generate-header-include-checks.py
3129    # if the "check_v8_header_includes" gclient variable is set.
3130    import("check-header-includes/sources.gni")
3131    sources += check_header_includes_sources
3132  }
3133
3134  jumbo_excluded_sources = [
3135    # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
3136    "src/profiler/heap-snapshot-generator.cc",  # Macro clash in mman-linux.h
3137    "src/heap/local-heap.cc",
3138    "src/heap/safepoint.cc",
3139    "src/objects/js-display-names.cc",
3140    "src/objects/js-relative-time-format.cc",
3141
3142    # These source files take an unusually large amount of time to
3143    # compile.  Build them separately to avoid bottlenecks.
3144    "src/api/api.cc",
3145    "src/heap/heap.cc",
3146    "src/objects/elements.cc",
3147    "src/objects/objects.cc",
3148    "src/parsing/parser.cc",
3149  ]
3150
3151  if (v8_current_cpu == "x86") {
3152    sources += [  ### gcmole(arch:ia32) ###
3153      "src/codegen/ia32/assembler-ia32-inl.h",
3154      "src/codegen/ia32/assembler-ia32.cc",
3155      "src/codegen/ia32/assembler-ia32.h",
3156      "src/codegen/ia32/constants-ia32.h",
3157      "src/codegen/ia32/cpu-ia32.cc",
3158      "src/codegen/ia32/interface-descriptors-ia32.cc",
3159      "src/codegen/ia32/macro-assembler-ia32.cc",
3160      "src/codegen/ia32/macro-assembler-ia32.h",
3161      "src/codegen/ia32/register-ia32.h",
3162      "src/codegen/ia32/sse-instr.h",
3163      "src/compiler/backend/ia32/code-generator-ia32.cc",
3164      "src/compiler/backend/ia32/instruction-codes-ia32.h",
3165      "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
3166      "src/compiler/backend/ia32/instruction-selector-ia32.cc",
3167      "src/debug/ia32/debug-ia32.cc",
3168      "src/deoptimizer/ia32/deoptimizer-ia32.cc",
3169      "src/diagnostics/ia32/disasm-ia32.cc",
3170      "src/execution/ia32/frame-constants-ia32.cc",
3171      "src/execution/ia32/frame-constants-ia32.h",
3172      "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
3173      "src/regexp/ia32/regexp-macro-assembler-ia32.h",
3174      "src/wasm/baseline/ia32/liftoff-assembler-ia32.h",
3175    ]
3176  } else if (v8_current_cpu == "x64") {
3177    sources += [  ### gcmole(arch:x64) ###
3178      "src/codegen/x64/assembler-x64-inl.h",
3179      "src/codegen/x64/assembler-x64.cc",
3180      "src/codegen/x64/assembler-x64.h",
3181      "src/codegen/x64/constants-x64.h",
3182      "src/codegen/x64/cpu-x64.cc",
3183      "src/codegen/x64/fma-instr.h",
3184      "src/codegen/x64/interface-descriptors-x64.cc",
3185      "src/codegen/x64/macro-assembler-x64.cc",
3186      "src/codegen/x64/macro-assembler-x64.h",
3187      "src/codegen/x64/register-x64.h",
3188      "src/codegen/x64/sse-instr.h",
3189      "src/compiler/backend/x64/code-generator-x64.cc",
3190      "src/compiler/backend/x64/instruction-codes-x64.h",
3191      "src/compiler/backend/x64/instruction-scheduler-x64.cc",
3192      "src/compiler/backend/x64/instruction-selector-x64.cc",
3193      "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
3194      "src/compiler/backend/x64/unwinding-info-writer-x64.h",
3195      "src/debug/x64/debug-x64.cc",
3196      "src/deoptimizer/x64/deoptimizer-x64.cc",
3197      "src/diagnostics/x64/disasm-x64.cc",
3198      "src/diagnostics/x64/eh-frame-x64.cc",
3199      "src/execution/x64/frame-constants-x64.cc",
3200      "src/execution/x64/frame-constants-x64.h",
3201      "src/regexp/x64/regexp-macro-assembler-x64.cc",
3202      "src/regexp/x64/regexp-macro-assembler-x64.h",
3203      "src/third_party/valgrind/valgrind.h",
3204      "src/wasm/baseline/x64/liftoff-assembler-x64.h",
3205    ]
3206
3207    # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
3208    # based on Darwin and thus POSIX-compliant to a similar degree.
3209    if (is_linux || is_mac || is_ios || target_os == "freebsd") {
3210      sources += [
3211        "src/trap-handler/handler-inside-posix.cc",
3212        "src/trap-handler/handler-inside-posix.h",
3213        "src/trap-handler/handler-outside-posix.cc",
3214      ]
3215    }
3216    if (is_win) {
3217      sources += [
3218        "src/diagnostics/unwinding-info-win64.cc",
3219        "src/diagnostics/unwinding-info-win64.h",
3220        "src/trap-handler/handler-inside-win.cc",
3221        "src/trap-handler/handler-inside-win.h",
3222        "src/trap-handler/handler-outside-win.cc",
3223      ]
3224    }
3225  } else if (v8_current_cpu == "arm") {
3226    sources += [  ### gcmole(arch:arm) ###
3227      "src/codegen/arm/assembler-arm-inl.h",
3228      "src/codegen/arm/assembler-arm.cc",
3229      "src/codegen/arm/assembler-arm.h",
3230      "src/codegen/arm/constants-arm.cc",
3231      "src/codegen/arm/constants-arm.h",
3232      "src/codegen/arm/cpu-arm.cc",
3233      "src/codegen/arm/interface-descriptors-arm.cc",
3234      "src/codegen/arm/macro-assembler-arm.cc",
3235      "src/codegen/arm/macro-assembler-arm.h",
3236      "src/codegen/arm/register-arm.h",
3237      "src/compiler/backend/arm/code-generator-arm.cc",
3238      "src/compiler/backend/arm/instruction-codes-arm.h",
3239      "src/compiler/backend/arm/instruction-scheduler-arm.cc",
3240      "src/compiler/backend/arm/instruction-selector-arm.cc",
3241      "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
3242      "src/compiler/backend/arm/unwinding-info-writer-arm.h",
3243      "src/debug/arm/debug-arm.cc",
3244      "src/deoptimizer/arm/deoptimizer-arm.cc",
3245      "src/diagnostics/arm/disasm-arm.cc",
3246      "src/diagnostics/arm/eh-frame-arm.cc",
3247      "src/execution/arm/frame-constants-arm.cc",
3248      "src/execution/arm/frame-constants-arm.h",
3249      "src/execution/arm/simulator-arm.cc",
3250      "src/execution/arm/simulator-arm.h",
3251      "src/regexp/arm/regexp-macro-assembler-arm.cc",
3252      "src/regexp/arm/regexp-macro-assembler-arm.h",
3253      "src/wasm/baseline/arm/liftoff-assembler-arm.h",
3254    ]
3255  } else if (v8_current_cpu == "arm64") {
3256    sources += [  ### gcmole(arch:arm64) ###
3257      "src/codegen/arm64/assembler-arm64-inl.h",
3258      "src/codegen/arm64/assembler-arm64.cc",
3259      "src/codegen/arm64/assembler-arm64.h",
3260      "src/codegen/arm64/constants-arm64.h",
3261      "src/codegen/arm64/cpu-arm64.cc",
3262      "src/codegen/arm64/decoder-arm64-inl.h",
3263      "src/codegen/arm64/decoder-arm64.cc",
3264      "src/codegen/arm64/decoder-arm64.h",
3265      "src/codegen/arm64/instructions-arm64-constants.cc",
3266      "src/codegen/arm64/instructions-arm64.cc",
3267      "src/codegen/arm64/instructions-arm64.h",
3268      "src/codegen/arm64/interface-descriptors-arm64.cc",
3269      "src/codegen/arm64/macro-assembler-arm64-inl.h",
3270      "src/codegen/arm64/macro-assembler-arm64.cc",
3271      "src/codegen/arm64/macro-assembler-arm64.h",
3272      "src/codegen/arm64/register-arm64.cc",
3273      "src/codegen/arm64/register-arm64.h",
3274      "src/codegen/arm64/utils-arm64.cc",
3275      "src/codegen/arm64/utils-arm64.h",
3276      "src/compiler/backend/arm64/code-generator-arm64.cc",
3277      "src/compiler/backend/arm64/instruction-codes-arm64.h",
3278      "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
3279      "src/compiler/backend/arm64/instruction-selector-arm64.cc",
3280      "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
3281      "src/compiler/backend/arm64/unwinding-info-writer-arm64.h",
3282      "src/debug/arm64/debug-arm64.cc",
3283      "src/deoptimizer/arm64/deoptimizer-arm64.cc",
3284      "src/diagnostics/arm64/disasm-arm64.cc",
3285      "src/diagnostics/arm64/disasm-arm64.h",
3286      "src/diagnostics/arm64/eh-frame-arm64.cc",
3287      "src/execution/arm64/frame-constants-arm64.cc",
3288      "src/execution/arm64/frame-constants-arm64.h",
3289      "src/execution/arm64/pointer-auth-arm64.cc",
3290      "src/execution/arm64/simulator-arm64.cc",
3291      "src/execution/arm64/simulator-arm64.h",
3292      "src/execution/arm64/simulator-logic-arm64.cc",
3293      "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
3294      "src/regexp/arm64/regexp-macro-assembler-arm64.h",
3295      "src/wasm/baseline/arm64/liftoff-assembler-arm64.h",
3296    ]
3297    if (v8_control_flow_integrity) {
3298      sources += [ "src/execution/arm64/pointer-authentication-arm64.h" ]
3299    }
3300    if (is_win) {
3301      sources += [
3302        "src/diagnostics/unwinding-info-win64.cc",
3303        "src/diagnostics/unwinding-info-win64.h",
3304      ]
3305    }
3306    jumbo_excluded_sources += [
3307      # TODO(mostynb@vewd.com): fix this code so it doesn't need
3308      # to be excluded, see the comments inside.
3309      "src/codegen/arm64/instructions-arm64-constants.cc",
3310    ]
3311  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
3312    sources += [  ### gcmole(arch:mipsel) ###
3313      "src/codegen/mips/assembler-mips-inl.h",
3314      "src/codegen/mips/assembler-mips.cc",
3315      "src/codegen/mips/assembler-mips.h",
3316      "src/codegen/mips/constants-mips.cc",
3317      "src/codegen/mips/constants-mips.h",
3318      "src/codegen/mips/cpu-mips.cc",
3319      "src/codegen/mips/interface-descriptors-mips.cc",
3320      "src/codegen/mips/macro-assembler-mips.cc",
3321      "src/codegen/mips/macro-assembler-mips.h",
3322      "src/codegen/mips/register-mips.h",
3323      "src/compiler/backend/mips/code-generator-mips.cc",
3324      "src/compiler/backend/mips/instruction-codes-mips.h",
3325      "src/compiler/backend/mips/instruction-scheduler-mips.cc",
3326      "src/compiler/backend/mips/instruction-selector-mips.cc",
3327      "src/debug/mips/debug-mips.cc",
3328      "src/deoptimizer/mips/deoptimizer-mips.cc",
3329      "src/diagnostics/mips/disasm-mips.cc",
3330      "src/execution/mips/frame-constants-mips.cc",
3331      "src/execution/mips/frame-constants-mips.h",
3332      "src/execution/mips/simulator-mips.cc",
3333      "src/execution/mips/simulator-mips.h",
3334      "src/regexp/mips/regexp-macro-assembler-mips.cc",
3335      "src/regexp/mips/regexp-macro-assembler-mips.h",
3336      "src/wasm/baseline/mips/liftoff-assembler-mips.h",
3337    ]
3338  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
3339    sources += [  ### gcmole(arch:mips64el) ###
3340      "src/codegen/mips64/assembler-mips64-inl.h",
3341      "src/codegen/mips64/assembler-mips64.cc",
3342      "src/codegen/mips64/assembler-mips64.h",
3343      "src/codegen/mips64/constants-mips64.cc",
3344      "src/codegen/mips64/constants-mips64.h",
3345      "src/codegen/mips64/cpu-mips64.cc",
3346      "src/codegen/mips64/interface-descriptors-mips64.cc",
3347      "src/codegen/mips64/macro-assembler-mips64.cc",
3348      "src/codegen/mips64/macro-assembler-mips64.h",
3349      "src/codegen/mips64/register-mips64.h",
3350      "src/compiler/backend/mips64/code-generator-mips64.cc",
3351      "src/compiler/backend/mips64/instruction-codes-mips64.h",
3352      "src/compiler/backend/mips64/instruction-scheduler-mips64.cc",
3353      "src/compiler/backend/mips64/instruction-selector-mips64.cc",
3354      "src/debug/mips64/debug-mips64.cc",
3355      "src/deoptimizer/mips64/deoptimizer-mips64.cc",
3356      "src/diagnostics/mips64/disasm-mips64.cc",
3357      "src/execution/mips64/frame-constants-mips64.cc",
3358      "src/execution/mips64/frame-constants-mips64.h",
3359      "src/execution/mips64/simulator-mips64.cc",
3360      "src/execution/mips64/simulator-mips64.h",
3361      "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
3362      "src/regexp/mips64/regexp-macro-assembler-mips64.h",
3363      "src/wasm/baseline/mips64/liftoff-assembler-mips64.h",
3364    ]
3365  } else if (v8_current_cpu == "ppc") {
3366    sources += [  ### gcmole(arch:ppc) ###
3367      "src/codegen/ppc/assembler-ppc-inl.h",
3368      "src/codegen/ppc/assembler-ppc.cc",
3369      "src/codegen/ppc/assembler-ppc.h",
3370      "src/codegen/ppc/constants-ppc.cc",
3371      "src/codegen/ppc/constants-ppc.h",
3372      "src/codegen/ppc/cpu-ppc.cc",
3373      "src/codegen/ppc/interface-descriptors-ppc.cc",
3374      "src/codegen/ppc/macro-assembler-ppc.cc",
3375      "src/codegen/ppc/macro-assembler-ppc.h",
3376      "src/codegen/ppc/register-ppc.h",
3377      "src/compiler/backend/ppc/code-generator-ppc.cc",
3378      "src/compiler/backend/ppc/instruction-codes-ppc.h",
3379      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
3380      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
3381      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
3382      "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
3383      "src/debug/ppc/debug-ppc.cc",
3384      "src/deoptimizer/ppc/deoptimizer-ppc.cc",
3385      "src/diagnostics/ppc/disasm-ppc.cc",
3386      "src/diagnostics/ppc/eh-frame-ppc.cc",
3387      "src/execution/ppc/frame-constants-ppc.cc",
3388      "src/execution/ppc/frame-constants-ppc.h",
3389      "src/execution/ppc/simulator-ppc.cc",
3390      "src/execution/ppc/simulator-ppc.h",
3391      "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
3392      "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3393      "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3394    ]
3395  } else if (v8_current_cpu == "ppc64") {
3396    sources += [  ### gcmole(arch:ppc64) ###
3397      "src/codegen/ppc/assembler-ppc-inl.h",
3398      "src/codegen/ppc/assembler-ppc.cc",
3399      "src/codegen/ppc/assembler-ppc.h",
3400      "src/codegen/ppc/constants-ppc.cc",
3401      "src/codegen/ppc/constants-ppc.h",
3402      "src/codegen/ppc/cpu-ppc.cc",
3403      "src/codegen/ppc/interface-descriptors-ppc.cc",
3404      "src/codegen/ppc/macro-assembler-ppc.cc",
3405      "src/codegen/ppc/macro-assembler-ppc.h",
3406      "src/codegen/ppc/register-ppc.h",
3407      "src/compiler/backend/ppc/code-generator-ppc.cc",
3408      "src/compiler/backend/ppc/instruction-codes-ppc.h",
3409      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
3410      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
3411      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
3412      "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
3413      "src/debug/ppc/debug-ppc.cc",
3414      "src/deoptimizer/ppc/deoptimizer-ppc.cc",
3415      "src/diagnostics/ppc/disasm-ppc.cc",
3416      "src/diagnostics/ppc/eh-frame-ppc.cc",
3417      "src/execution/ppc/frame-constants-ppc.cc",
3418      "src/execution/ppc/frame-constants-ppc.h",
3419      "src/execution/ppc/simulator-ppc.cc",
3420      "src/execution/ppc/simulator-ppc.h",
3421      "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
3422      "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3423      "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3424    ]
3425  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3426    sources += [  ### gcmole(arch:s390) ###
3427      "src/codegen/s390/assembler-s390-inl.h",
3428      "src/codegen/s390/assembler-s390.cc",
3429      "src/codegen/s390/assembler-s390.h",
3430      "src/codegen/s390/constants-s390.cc",
3431      "src/codegen/s390/constants-s390.h",
3432      "src/codegen/s390/cpu-s390.cc",
3433      "src/codegen/s390/interface-descriptors-s390.cc",
3434      "src/codegen/s390/macro-assembler-s390.cc",
3435      "src/codegen/s390/macro-assembler-s390.h",
3436      "src/codegen/s390/register-s390.h",
3437      "src/compiler/backend/s390/code-generator-s390.cc",
3438      "src/compiler/backend/s390/instruction-codes-s390.h",
3439      "src/compiler/backend/s390/instruction-scheduler-s390.cc",
3440      "src/compiler/backend/s390/instruction-selector-s390.cc",
3441      "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
3442      "src/compiler/backend/s390/unwinding-info-writer-s390.h",
3443      "src/debug/s390/debug-s390.cc",
3444      "src/deoptimizer/s390/deoptimizer-s390.cc",
3445      "src/diagnostics/s390/disasm-s390.cc",
3446      "src/diagnostics/s390/eh-frame-s390.cc",
3447      "src/execution/s390/frame-constants-s390.cc",
3448      "src/execution/s390/frame-constants-s390.h",
3449      "src/execution/s390/simulator-s390.cc",
3450      "src/execution/s390/simulator-s390.h",
3451      "src/regexp/s390/regexp-macro-assembler-s390.cc",
3452      "src/regexp/s390/regexp-macro-assembler-s390.h",
3453      "src/wasm/baseline/s390/liftoff-assembler-s390.h",
3454    ]
3455  }
3456
3457  configs = [ ":internal_config" ]
3458
3459  defines = []
3460  deps = [
3461    ":torque_generated_definitions",
3462    ":v8_headers",
3463    ":v8_libbase",
3464    ":v8_libsampler",
3465    ":v8_shared_internal_headers",
3466    ":v8_version",
3467    "src/inspector:inspector",
3468  ]
3469
3470  public_deps = [
3471    ":generate_bytecode_builtins_list",
3472    ":run_torque",
3473    ":v8_maybe_icu",
3474  ]
3475
3476  if (v8_enable_i18n_support) {
3477    deps += [ ":run_gen-regexp-special-case" ]
3478    sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
3479    if (is_win) {
3480      deps += [ "//third_party/icu:icudata" ]
3481    }
3482  } else {
3483    sources -= [
3484      "src/builtins/builtins-intl.cc",
3485      "src/objects/intl-objects.cc",
3486      "src/objects/intl-objects.h",
3487      "src/objects/js-break-iterator-inl.h",
3488      "src/objects/js-break-iterator.cc",
3489      "src/objects/js-break-iterator.h",
3490      "src/objects/js-collator-inl.h",
3491      "src/objects/js-collator.cc",
3492      "src/objects/js-collator.h",
3493      "src/objects/js-date-time-format-inl.h",
3494      "src/objects/js-date-time-format.cc",
3495      "src/objects/js-date-time-format.h",
3496      "src/objects/js-display-names-inl.h",
3497      "src/objects/js-display-names.cc",
3498      "src/objects/js-display-names.h",
3499      "src/objects/js-list-format-inl.h",
3500      "src/objects/js-list-format.cc",
3501      "src/objects/js-list-format.h",
3502      "src/objects/js-locale-inl.h",
3503      "src/objects/js-locale.cc",
3504      "src/objects/js-locale.h",
3505      "src/objects/js-number-format-inl.h",
3506      "src/objects/js-number-format.cc",
3507      "src/objects/js-number-format.h",
3508      "src/objects/js-plural-rules-inl.h",
3509      "src/objects/js-plural-rules.cc",
3510      "src/objects/js-plural-rules.h",
3511      "src/objects/js-relative-time-format-inl.h",
3512      "src/objects/js-relative-time-format.cc",
3513      "src/objects/js-relative-time-format.h",
3514      "src/objects/js-segment-iterator-inl.h",
3515      "src/objects/js-segment-iterator.cc",
3516      "src/objects/js-segment-iterator.h",
3517      "src/objects/js-segmenter-inl.h",
3518      "src/objects/js-segmenter.cc",
3519      "src/objects/js-segmenter.h",
3520      "src/runtime/runtime-intl.cc",
3521      "src/strings/char-predicates.cc",
3522    ]
3523  }
3524
3525  deps += [
3526    "//third_party/zlib",
3527    "//third_party/zlib/google:compression_utils_portable",
3528  ]
3529
3530  if (v8_postmortem_support) {
3531    sources += [ "$target_gen_dir/debug-support.cc" ]
3532    deps += [ ":postmortem-metadata" ]
3533  }
3534
3535  libs = []
3536
3537  if (v8_enable_third_party_heap) {
3538    libs += v8_third_party_heap_libs
3539  }
3540
3541  # Platforms that don't have CAS support need to link atomic library
3542  # to implement atomic memory access
3543  if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" ||
3544      v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" ||
3545      v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3546    libs += [ "atomic" ]
3547  }
3548
3549  if (remove_v8base_debug_symbols) {
3550    v8_remove_configs += [ "//build/config/compiler:default_symbols" ]
3551    v8_add_configs += [ "//build/config/compiler:no_symbols" ]
3552  }
3553
3554  if (v8_enable_vtunetracemark && (is_linux || is_win)) {
3555    sources += [
3556      "src/extensions/vtunedomain-support-extension.cc",
3557      "src/extensions/vtunedomain-support-extension.h",
3558    ]
3559    deps += [ "src/third_party/vtune:v8_vtune_trace_mark" ]
3560  }
3561}
3562
3563group("v8_base") {
3564  public_deps = [
3565    ":v8_base_without_compiler",
3566    ":v8_compiler",
3567  ]
3568}
3569
3570v8_source_set("torque_base") {
3571  visibility = [ ":*" ]  # Only targets in this file can depend on this.
3572
3573  sources = [
3574    "src/torque/ast.h",
3575    "src/torque/cfg.cc",
3576    "src/torque/cfg.h",
3577    "src/torque/class-debug-reader-generator.cc",
3578    "src/torque/constants.h",
3579    "src/torque/contextual.h",
3580    "src/torque/csa-generator.cc",
3581    "src/torque/csa-generator.h",
3582    "src/torque/declarable.cc",
3583    "src/torque/declarable.h",
3584    "src/torque/declaration-visitor.cc",
3585    "src/torque/declaration-visitor.h",
3586    "src/torque/declarations.cc",
3587    "src/torque/declarations.h",
3588    "src/torque/earley-parser.cc",
3589    "src/torque/earley-parser.h",
3590    "src/torque/global-context.cc",
3591    "src/torque/global-context.h",
3592    "src/torque/implementation-visitor.cc",
3593    "src/torque/implementation-visitor.h",
3594    "src/torque/instance-type-generator.cc",
3595    "src/torque/instructions.cc",
3596    "src/torque/instructions.h",
3597    "src/torque/parameter-difference.h",
3598    "src/torque/server-data.cc",
3599    "src/torque/server-data.h",
3600    "src/torque/source-positions.cc",
3601    "src/torque/source-positions.h",
3602    "src/torque/torque-compiler.cc",
3603    "src/torque/torque-compiler.h",
3604    "src/torque/torque-parser.cc",
3605    "src/torque/torque-parser.h",
3606    "src/torque/type-inference.cc",
3607    "src/torque/type-inference.h",
3608    "src/torque/type-oracle.cc",
3609    "src/torque/type-oracle.h",
3610    "src/torque/type-visitor.cc",
3611    "src/torque/type-visitor.h",
3612    "src/torque/types.cc",
3613    "src/torque/types.h",
3614    "src/torque/utils.cc",
3615    "src/torque/utils.h",
3616  ]
3617
3618  deps = [ ":v8_shared_internal_headers" ]
3619
3620  public_deps = [ ":v8_libbase" ]
3621
3622  # The use of exceptions for Torque in violation of the Chromium style-guide
3623  # is justified by the fact that it is only used from the non-essential
3624  # language server and can be removed anytime if it causes problems.
3625  configs = [
3626    ":internal_config",
3627    "//build/config/compiler:exceptions",
3628    "//build/config/compiler:rtti",
3629  ]
3630
3631  remove_configs = [
3632    "//build/config/compiler:no_exceptions",
3633    "//build/config/compiler:no_rtti",
3634  ]
3635
3636  if (is_win && is_asan) {
3637    # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
3638    # Torque on Windows.
3639    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3640  }
3641
3642  if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
3643    # The :no_optimize config is added to v8_add_configs in v8.gni.
3644    remove_configs += [ "//build/config/compiler:no_optimize" ]
3645    configs += [ ":always_optimize" ]
3646  }
3647}
3648
3649v8_source_set("torque_ls_base") {
3650  sources = [
3651    "src/torque/ls/globals.h",
3652    "src/torque/ls/json-parser.cc",
3653    "src/torque/ls/json-parser.h",
3654    "src/torque/ls/json.cc",
3655    "src/torque/ls/json.h",
3656    "src/torque/ls/message-handler.cc",
3657    "src/torque/ls/message-handler.h",
3658    "src/torque/ls/message-macros.h",
3659    "src/torque/ls/message-pipe.h",
3660    "src/torque/ls/message.h",
3661  ]
3662
3663  public_deps = [ ":torque_base" ]
3664
3665  # The use of exceptions for Torque in violation of the Chromium style-guide
3666  # is justified by the fact that it is only used from the non-essential
3667  # language server and can be removed anytime if it causes problems.
3668  configs = [
3669    ":internal_config",
3670    "//build/config/compiler:exceptions",
3671    "//build/config/compiler:rtti",
3672  ]
3673
3674  remove_configs = [
3675    "//build/config/compiler:no_exceptions",
3676    "//build/config/compiler:no_rtti",
3677  ]
3678
3679  if (is_win && is_asan) {
3680    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3681  }
3682}
3683
3684v8_component("v8_libbase") {
3685  sources = [
3686    "src/base/address-region.h",
3687    "src/base/atomic-utils.h",
3688    "src/base/atomicops.h",
3689    "src/base/atomicops_internals_atomicword_compat.h",
3690    "src/base/atomicops_internals_portable.h",
3691    "src/base/atomicops_internals_std.h",
3692    "src/base/base-export.h",
3693    "src/base/bit-field.h",
3694    "src/base/bits-iterator.h",
3695    "src/base/bits.cc",
3696    "src/base/bits.h",
3697    "src/base/bounded-page-allocator.cc",
3698    "src/base/bounded-page-allocator.h",
3699    "src/base/bounds.h",
3700    "src/base/build_config.h",
3701    "src/base/compiler-specific.h",
3702    "src/base/cpu.cc",
3703    "src/base/cpu.h",
3704    "src/base/debug/stack_trace.cc",
3705    "src/base/debug/stack_trace.h",
3706    "src/base/division-by-constant.cc",
3707    "src/base/division-by-constant.h",
3708    "src/base/enum-set.h",
3709    "src/base/export-template.h",
3710    "src/base/file-utils.cc",
3711    "src/base/file-utils.h",
3712    "src/base/flags.h",
3713    "src/base/free_deleter.h",
3714    "src/base/functional.cc",
3715    "src/base/functional.h",
3716    "src/base/hashmap-entry.h",
3717    "src/base/hashmap.h",
3718    "src/base/ieee754.cc",
3719    "src/base/ieee754.h",
3720    "src/base/iterator.h",
3721    "src/base/lazy-instance.h",
3722    "src/base/list.h",
3723    "src/base/logging.cc",
3724    "src/base/logging.h",
3725    "src/base/lsan.h",
3726    "src/base/macros.h",
3727    "src/base/memory.h",
3728    "src/base/once.cc",
3729    "src/base/once.h",
3730    "src/base/optional.h",
3731    "src/base/overflowing-math.h",
3732    "src/base/page-allocator.cc",
3733    "src/base/page-allocator.h",
3734    "src/base/platform/condition-variable.cc",
3735    "src/base/platform/condition-variable.h",
3736    "src/base/platform/elapsed-timer.h",
3737    "src/base/platform/mutex.cc",
3738    "src/base/platform/mutex.h",
3739    "src/base/platform/platform.h",
3740    "src/base/platform/semaphore.cc",
3741    "src/base/platform/semaphore.h",
3742    "src/base/platform/time.cc",
3743    "src/base/platform/time.h",
3744    "src/base/region-allocator.cc",
3745    "src/base/region-allocator.h",
3746    "src/base/ring-buffer.h",
3747    "src/base/safe_conversions.h",
3748    "src/base/safe_conversions_impl.h",
3749    "src/base/small-vector.h",
3750    "src/base/sys-info.cc",
3751    "src/base/sys-info.h",
3752    "src/base/template-utils.h",
3753    "src/base/timezone-cache.h",
3754    "src/base/type-traits.h",
3755    "src/base/utils/random-number-generator.cc",
3756    "src/base/utils/random-number-generator.h",
3757    "src/base/vlq-base64.cc",
3758    "src/base/vlq-base64.h",
3759  ]
3760
3761  configs = [ ":internal_config_base" ]
3762
3763  public_configs = [ ":libbase_config" ]
3764
3765  deps = [ ":v8_headers" ]
3766
3767  public_deps = []
3768
3769  data = []
3770
3771  data_deps = []
3772
3773  defines = []
3774
3775  if (is_component_build) {
3776    defines = [ "BUILDING_V8_BASE_SHARED" ]
3777  }
3778
3779  if (is_posix || is_fuchsia) {
3780    sources += [
3781      "src/base/platform/platform-posix.cc",
3782      "src/base/platform/platform-posix.h",
3783    ]
3784    if (current_os != "aix") {
3785      sources += [
3786        "src/base/platform/platform-posix-time.cc",
3787        "src/base/platform/platform-posix-time.h",
3788      ]
3789    }
3790  }
3791
3792  if (is_linux && !is_bsd) {
3793    sources += [
3794      "src/base/debug/stack_trace_posix.cc",
3795      "src/base/platform/platform-linux.cc",
3796    ]
3797
3798    libs = [
3799      "dl",
3800      "rt",
3801    ]
3802  } else if (current_os == "aix") {
3803    sources += [
3804      "src/base/debug/stack_trace_posix.cc",
3805      "src/base/platform/platform-aix.cc",
3806    ]
3807
3808    libs = [
3809      "dl",
3810      "rt",
3811    ]
3812  } else if (is_bsd) {
3813    sources += [
3814      "src/base/debug/stack_trace_posix.cc",
3815      "src/base/platform/platform-freebsd.cc",
3816    ]
3817    libs = [ "rt", "execinfo" ]
3818  } else if (is_android) {
3819    if (current_toolchain == host_toolchain) {
3820      libs = [
3821        "dl",
3822        "rt",
3823      ]
3824      if (host_os == "mac") {
3825        sources += [
3826          "src/base/debug/stack_trace_posix.cc",
3827          "src/base/platform/platform-macos.cc",
3828        ]
3829      } else {
3830        sources += [
3831          "src/base/debug/stack_trace_posix.cc",
3832          "src/base/platform/platform-linux.cc",
3833        ]
3834      }
3835    } else {
3836      sources += [
3837        "src/base/debug/stack_trace_android.cc",
3838        "src/base/platform/platform-linux.cc",
3839      ]
3840    }
3841  } else if (is_fuchsia) {
3842    sources += [
3843      "src/base/debug/stack_trace_fuchsia.cc",
3844      "src/base/platform/platform-fuchsia.cc",
3845    ]
3846  } else if (is_mac || is_ios) {
3847    sources += [
3848      "src/base/debug/stack_trace_posix.cc",
3849      "src/base/platform/platform-macos.cc",
3850    ]
3851  } else if (is_win) {
3852    # TODO(jochen): Add support for cygwin.
3853    sources += [
3854      "src/base/debug/stack_trace_win.cc",
3855      "src/base/platform/platform-win32.cc",
3856      "src/base/win32-headers.h",
3857    ]
3858
3859    defines += [ "_CRT_RAND_S" ]  # for rand_s()
3860
3861    libs = [
3862      "dbghelp.lib",
3863      "winmm.lib",
3864      "ws2_32.lib",
3865    ]
3866    libs = ["execinfo"]
3867
3868    data_deps += [ "//build/win:runtime_libs" ]
3869  }
3870
3871  if (v8_current_cpu == "mips" || v8_current_cpu == "mips64") {
3872    # Add runtime libs for mips.
3873    data += [
3874      "tools/mips_toolchain/sysroot/usr/lib/",
3875      "tools/mips_toolchain/mips-mti-linux-gnu/lib",
3876    ]
3877  }
3878
3879  if (is_ubsan && (v8_current_cpu == "x86" || v8_current_cpu == "arm" ||
3880                   v8_current_cpu == "mips")) {
3881    # Special UBSan 32-bit requirement.
3882    sources += [ "src/base/ubsan.cc" ]
3883  }
3884
3885  if (is_tsan && !build_with_chromium) {
3886    data += [ "tools/sanitizers/tsan_suppressions.txt" ]
3887  }
3888
3889  # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
3890}
3891
3892v8_component("v8_libplatform") {
3893  sources = [
3894    "//base/trace_event/common/trace_event_common.h",
3895    "include/libplatform/libplatform-export.h",
3896    "include/libplatform/libplatform.h",
3897    "include/libplatform/v8-tracing.h",
3898    "src/libplatform/default-foreground-task-runner.cc",
3899    "src/libplatform/default-foreground-task-runner.h",
3900    "src/libplatform/default-platform.cc",
3901    "src/libplatform/default-platform.h",
3902    "src/libplatform/default-worker-threads-task-runner.cc",
3903    "src/libplatform/default-worker-threads-task-runner.h",
3904    "src/libplatform/delayed-task-queue.cc",
3905    "src/libplatform/delayed-task-queue.h",
3906    "src/libplatform/task-queue.cc",
3907    "src/libplatform/task-queue.h",
3908    "src/libplatform/tracing/trace-buffer.cc",
3909    "src/libplatform/tracing/trace-buffer.h",
3910    "src/libplatform/tracing/trace-config.cc",
3911    "src/libplatform/tracing/trace-object.cc",
3912    "src/libplatform/tracing/trace-writer.cc",
3913    "src/libplatform/tracing/trace-writer.h",
3914    "src/libplatform/tracing/tracing-controller.cc",
3915    "src/libplatform/worker-thread.cc",
3916    "src/libplatform/worker-thread.h",
3917  ]
3918
3919  configs = [ ":internal_config_base" ]
3920
3921  if (is_component_build) {
3922    defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
3923  }
3924
3925  public_configs = [ ":libplatform_config" ]
3926
3927  deps = [
3928    ":v8_headers",
3929    ":v8_libbase",
3930  ]
3931  if (v8_use_perfetto) {
3932    sources += [
3933      "src/libplatform/tracing/json-trace-event-listener.cc",
3934      "src/libplatform/tracing/json-trace-event-listener.h",
3935      "src/libplatform/tracing/trace-event-listener.cc",
3936      "src/libplatform/tracing/trace-event-listener.h",
3937    ]
3938    deps += [
3939      "//third_party/perfetto/protos/perfetto/trace:lite",
3940      "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
3941      "//third_party/perfetto/protos/perfetto/trace/chrome:zero",
3942      "//third_party/perfetto/src/tracing:client_api",
3943      "//third_party/perfetto/src/tracing:platform_posix",
3944    ]
3945  }
3946}
3947
3948v8_source_set("v8_libsampler") {
3949  sources = [
3950    "src/libsampler/sampler.cc",
3951    "src/libsampler/sampler.h",
3952  ]
3953
3954  configs = [ ":internal_config" ]
3955
3956  public_configs = [ ":libsampler_config" ]
3957
3958  deps = [ ":v8_libbase" ]
3959}
3960
3961v8_source_set("fuzzer_support") {
3962  visibility = [ ":*" ]  # Only targets in this file can depend on this.
3963
3964  sources = [
3965    "test/fuzzer/fuzzer-support.cc",
3966    "test/fuzzer/fuzzer-support.h",
3967  ]
3968
3969  configs = [ ":internal_config_base" ]
3970
3971  deps = [ ":v8" ]
3972
3973  public_deps = [
3974    ":v8_libbase",
3975    ":v8_libplatform",
3976    ":v8_maybe_icu",
3977  ]
3978}
3979
3980v8_source_set("cppgc_base") {
3981  visibility = [ ":*" ]
3982
3983  sources = [
3984    "include/cppgc/allocation.h",
3985    "include/cppgc/api-constants.h",
3986    "include/cppgc/finalizer-trait.h",
3987    "include/cppgc/garbage-collected.h",
3988    "include/cppgc/gc-info.h",
3989    "include/cppgc/heap.h",
3990    "include/cppgc/platform.h",
3991    "include/v8config.h",
3992    "src/heap/cppgc/allocation.cc",
3993    "src/heap/cppgc/gc-info-table.cc",
3994    "src/heap/cppgc/gc-info-table.h",
3995    "src/heap/cppgc/gc-info.cc",
3996    "src/heap/cppgc/heap-inl.h",
3997    "src/heap/cppgc/heap-object-header-inl.h",
3998    "src/heap/cppgc/heap-object-header.cc",
3999    "src/heap/cppgc/heap-object-header.h",
4000    "src/heap/cppgc/heap.cc",
4001    "src/heap/cppgc/heap.h",
4002    "src/heap/cppgc/platform.cc",
4003    "src/heap/cppgc/sanitizers.h",
4004    "src/heap/cppgc/stack.cc",
4005    "src/heap/cppgc/stack.h",
4006  ]
4007
4008  if (target_cpu == "x64") {
4009    if (is_win) {
4010      sources += [ "src/heap/cppgc/asm/x64/push_registers_win.S" ]
4011    } else {
4012      sources += [ "src/heap/cppgc/asm/x64/push_registers.S" ]
4013    }
4014  }
4015
4016  configs = [ ":internal_config" ]
4017
4018  public_deps = [ ":v8_libbase" ]
4019}
4020
4021###############################################################################
4022# Produce a single static library for embedders
4023#
4024
4025if (v8_monolithic) {
4026  # A component build is not monolithic.
4027  assert(!is_component_build)
4028
4029  # Using external startup data would produce separate files.
4030  assert(!v8_use_external_startup_data)
4031  v8_static_library("v8_monolith") {
4032    deps = [
4033      ":v8",
4034      ":v8_libbase",
4035      ":v8_libplatform",
4036      ":v8_libsampler",
4037      "//build/win:default_exe_manifest",
4038    ]
4039
4040    configs = [ ":internal_config" ]
4041  }
4042}
4043
4044v8_static_library("wee8") {
4045  deps = [
4046    ":v8_base",
4047    ":v8_libbase",
4048    ":v8_libplatform",
4049    ":v8_libsampler",
4050    ":v8_snapshot",
4051    "//build/win:default_exe_manifest",
4052  ]
4053
4054  # TODO: v8dll-main.cc equivalent for shared library builds
4055
4056  configs = [ ":internal_config" ]
4057
4058  sources = [
4059    ### gcmole(all) ###
4060    "src/wasm/c-api.cc",
4061    "src/wasm/c-api.h",
4062    "third_party/wasm-api/wasm.h",
4063    "third_party/wasm-api/wasm.hh",
4064  ]
4065}
4066
4067v8_static_library("cppgc") {
4068  deps = [ ":cppgc_base" ]
4069
4070  configs = [ ":internal_config" ]
4071}
4072
4073###############################################################################
4074# Executables
4075#
4076
4077if (current_toolchain == v8_generator_toolchain) {
4078  v8_executable("bytecode_builtins_list_generator") {
4079    visibility = [ ":*" ]  # Only targets in this file can depend on this.
4080
4081    include_dirs = [ "." ]
4082
4083    sources = [
4084      "src/builtins/generate-bytecodes-builtins-list.cc",
4085      "src/interpreter/bytecode-operands.cc",
4086      "src/interpreter/bytecode-operands.h",
4087      "src/interpreter/bytecodes.cc",
4088      "src/interpreter/bytecodes.h",
4089    ]
4090
4091    configs = [ ":internal_config" ]
4092
4093    deps = [
4094      ":v8_libbase",
4095      "//build/win:default_exe_manifest",
4096    ]
4097  }
4098}
4099
4100if (current_toolchain == v8_snapshot_toolchain) {
4101  v8_executable("mksnapshot") {
4102    visibility = [ ":*" ]  # Only targets in this file can depend on this.
4103
4104    sources = [
4105      "src/snapshot/embedded/embedded-empty.cc",
4106      "src/snapshot/embedded/embedded-file-writer.cc",
4107      "src/snapshot/embedded/embedded-file-writer.h",
4108      "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
4109      "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
4110      "src/snapshot/embedded/platform-embedded-file-writer-base.cc",
4111      "src/snapshot/embedded/platform-embedded-file-writer-base.h",
4112      "src/snapshot/embedded/platform-embedded-file-writer-generic.cc",
4113      "src/snapshot/embedded/platform-embedded-file-writer-generic.h",
4114      "src/snapshot/embedded/platform-embedded-file-writer-mac.cc",
4115      "src/snapshot/embedded/platform-embedded-file-writer-mac.h",
4116      "src/snapshot/embedded/platform-embedded-file-writer-win.cc",
4117      "src/snapshot/embedded/platform-embedded-file-writer-win.h",
4118      "src/snapshot/mksnapshot.cc",
4119      "src/snapshot/snapshot-empty.cc",
4120    ]
4121
4122    configs = [ ":internal_config" ]
4123
4124    deps = [
4125      ":v8_base_without_compiler",
4126      ":v8_compiler_for_mksnapshot",
4127      ":v8_init",
4128      ":v8_libbase",
4129      ":v8_libplatform",
4130      ":v8_maybe_icu",
4131      "//build/win:default_exe_manifest",
4132    ]
4133  }
4134}
4135
4136if (current_toolchain == v8_snapshot_toolchain) {
4137  v8_executable("torque") {
4138    visibility = [ ":*" ]  # Only targets in this file can depend on this.
4139
4140    sources = [ "src/torque/torque.cc" ]
4141
4142    deps = [
4143      ":torque_base",
4144      "//build/win:default_exe_manifest",
4145    ]
4146
4147    # The use of exceptions for Torque in violation of the Chromium style-guide
4148    # is justified by the fact that it is only used from the non-essential
4149    # language server and can be removed anytime if it causes problems.
4150    configs = [
4151      ":internal_config",
4152      "//build/config/compiler:exceptions",
4153      "//build/config/compiler:rtti",
4154    ]
4155
4156    remove_configs = [
4157      "//build/config/compiler:no_exceptions",
4158      "//build/config/compiler:no_rtti",
4159    ]
4160
4161    if (is_win && is_asan) {
4162      remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
4163    }
4164  }
4165}
4166
4167v8_executable("torque-language-server") {
4168  visibility = [ ":*" ]  # Only targets in this file can depend on this.
4169
4170  sources = [ "src/torque/ls/torque-language-server.cc" ]
4171
4172  deps = [
4173    ":torque_base",
4174    ":torque_ls_base",
4175    "//build/win:default_exe_manifest",
4176  ]
4177
4178  # The use of exceptions for Torque in violation of the Chromium style-guide
4179  # is justified by the fact that it is only used from the non-essential
4180  # language server and can be removed anytime if it causes problems.
4181  configs = [
4182    ":internal_config",
4183    "//build/config/compiler:exceptions",
4184    "//build/config/compiler:rtti",
4185  ]
4186
4187  remove_configs = [
4188    "//build/config/compiler:no_exceptions",
4189    "//build/config/compiler:no_rtti",
4190  ]
4191
4192  if (is_win && is_asan) {
4193    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
4194  }
4195}
4196
4197if (v8_enable_i18n_support) {
4198  if (current_toolchain == v8_generator_toolchain) {
4199    v8_executable("gen-regexp-special-case") {
4200      visibility = [ ":*" ]  # Only targets in this file can depend on this.
4201
4202      sources = [ "src/regexp/gen-regexp-special-case.cc" ]
4203
4204      deps = [
4205        ":v8_libbase",
4206        "//build/win:default_exe_manifest",
4207        "//third_party/icu",
4208      ]
4209
4210      configs = [ ":internal_config" ]
4211    }
4212  }
4213
4214  action("run_gen-regexp-special-case") {
4215    visibility = [ ":*" ]  # Only targets in this file can depend on this.
4216
4217    script = "tools/run.py"
4218
4219    deps = [ ":gen-regexp-special-case($v8_generator_toolchain)" ]
4220
4221    output_file = "$target_gen_dir/src/regexp/special-case.cc"
4222
4223    outputs = [ output_file ]
4224
4225    args = [
4226      "./" + rebase_path(
4227              get_label_info(
4228                      ":gen-regexp-special-case($v8_generator_toolchain)",
4229                      "root_out_dir") + "/gen-regexp-special-case",
4230              root_build_dir),
4231      rebase_path(output_file, root_build_dir),
4232    ]
4233  }
4234}
4235
4236###############################################################################
4237# Public targets
4238#
4239
4240want_v8_shell =
4241    (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
4242    (current_toolchain == v8_snapshot_toolchain &&
4243     v8_toolset_for_shell == "host") ||
4244    (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
4245
4246group("gn_all") {
4247  testonly = true
4248
4249  deps = [
4250    ":d8",
4251    ":v8_fuzzers",
4252    ":v8_hello_world",
4253    ":v8_sample_process",
4254    "test:gn_all",
4255    "tools:gn_all",
4256  ]
4257
4258  if (v8_custom_deps != "") {
4259    # Custom dependency from directory under v8/custom_deps.
4260    deps += [ v8_custom_deps ]
4261  }
4262
4263  if (want_v8_shell) {
4264    deps += [ ":v8_shell" ]
4265  }
4266}
4267
4268group("v8_python_base") {
4269  data = [ ".vpython" ]
4270}
4271
4272group("v8_clusterfuzz") {
4273  testonly = true
4274
4275  deps = [ ":d8" ]
4276
4277  if (v8_multi_arch_build) {
4278    deps += [
4279      ":d8(//build/toolchain/linux:clang_x64)",
4280      ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
4281      ":d8(//build/toolchain/linux:clang_x86)",
4282      ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
4283      ":d8(tools/clusterfuzz/toolchain:clang_x64_pointer_compression)",
4284    ]
4285  }
4286}
4287
4288group("v8_archive") {
4289  testonly = true
4290
4291  deps = [ ":d8" ]
4292
4293  if (!is_win) {
4294    # On windows, cctest doesn't link with v8_static_library.
4295    deps += [ "test/cctest:cctest" ]
4296  }
4297}
4298
4299# TODO(dglazkov): Remove the "!build_with_chromium" condition once this clause
4300# is removed from Chromium.
4301if (is_fuchsia && !build_with_chromium) {
4302  import("//build/config/fuchsia/rules.gni")
4303
4304  cr_fuchsia_package("d8_fuchsia_pkg") {
4305    testonly = true
4306    binary = ":d8"
4307    package_name_override = "d8"
4308  }
4309
4310  fuchsia_package_runner("d8_fuchsia") {
4311    testonly = true
4312    package = ":d8_fuchsia_pkg"
4313    package_name_override = "d8"
4314  }
4315}
4316
4317group("v8_fuzzers") {
4318  testonly = true
4319  data_deps = [
4320    ":v8_simple_json_fuzzer",
4321    ":v8_simple_multi_return_fuzzer",
4322    ":v8_simple_parser_fuzzer",
4323    ":v8_simple_regexp_builtins_fuzzer",
4324    ":v8_simple_regexp_fuzzer",
4325    ":v8_simple_wasm_async_fuzzer",
4326    ":v8_simple_wasm_code_fuzzer",
4327    ":v8_simple_wasm_compile_fuzzer",
4328    ":v8_simple_wasm_fuzzer",
4329  ]
4330}
4331
4332if (is_component_build) {
4333  v8_component("v8") {
4334    sources = [ "src/utils/v8dll-main.cc" ]
4335
4336    public_deps = [
4337      ":v8_base",
4338      ":v8_snapshot",
4339    ]
4340
4341    configs = [ ":internal_config" ]
4342
4343    public_configs = [ ":external_config" ]
4344  }
4345
4346  v8_component("v8_for_testing") {
4347    testonly = true
4348
4349    sources = [ "src/utils/v8dll-main.cc" ]
4350
4351    public_deps = [
4352      ":torque_base",
4353      ":torque_ls_base",
4354      ":v8_base",
4355      ":v8_headers",
4356      ":v8_initializers",
4357      ":v8_snapshot",
4358    ]
4359
4360    configs = [ ":internal_config" ]
4361
4362    public_configs = [ ":external_config" ]
4363  }
4364
4365  v8_component("cppgc_for_testing") {
4366    testonly = true
4367
4368    public_deps = [ ":cppgc_base" ]
4369
4370    configs = [ ":internal_config" ]
4371    public_configs = [ ":external_config" ]
4372  }
4373} else {
4374  group("v8") {
4375    public_deps = [
4376      ":v8_base",
4377      ":v8_snapshot",
4378    ]
4379
4380    public_configs = [ ":external_config" ]
4381  }
4382
4383  group("v8_for_testing") {
4384    testonly = true
4385
4386    public_deps = [
4387      ":torque_base",
4388      ":torque_ls_base",
4389      ":v8_base",
4390      ":v8_initializers",
4391      ":v8_snapshot",
4392    ]
4393
4394    public_configs = [ ":external_config" ]
4395  }
4396
4397  group("cppgc_for_testing") {
4398    testonly = true
4399
4400    public_deps = [ ":cppgc_base" ]
4401
4402    public_configs = [ ":external_config" ]
4403  }
4404}
4405
4406v8_executable("d8") {
4407  sources = [
4408    "src/d8/async-hooks-wrapper.cc",
4409    "src/d8/async-hooks-wrapper.h",
4410    "src/d8/d8-console.cc",
4411    "src/d8/d8-console.h",
4412    "src/d8/d8-js.cc",
4413    "src/d8/d8-platforms.cc",
4414    "src/d8/d8-platforms.h",
4415    "src/d8/d8.cc",
4416    "src/d8/d8.h",
4417  ]
4418
4419  configs = [
4420    # Note: don't use :internal_config here because this target will get
4421    # the :external_config applied to it by virtue of depending on :v8, and
4422    # you can't have both applied to the same target.
4423    ":internal_config_base",
4424    ":v8_tracing_config",
4425  ]
4426
4427  deps = [
4428    ":v8",
4429    ":v8_libbase",
4430    ":v8_libplatform",
4431    "//build/win:default_exe_manifest",
4432  ]
4433
4434  if (is_posix || is_fuchsia) {
4435    sources += [ "src/d8/d8-posix.cc" ]
4436  } else if (is_win) {
4437    sources += [ "src/d8/d8-windows.cc" ]
4438  }
4439
4440  if (v8_correctness_fuzzer) {
4441    deps += [ "tools/clusterfuzz:v8_correctness_fuzzer_resources" ]
4442  }
4443
4444  defines = []
4445
4446  if (v8_enable_vtunejit) {
4447    deps += [ "src/third_party/vtune:v8_vtune" ]
4448  }
4449
4450  if (v8_use_perfetto) {
4451    deps += [ "//third_party/perfetto/src/tracing:in_process_backend" ]
4452  }
4453}
4454
4455v8_executable("v8_hello_world") {
4456  sources = [ "samples/hello-world.cc" ]
4457
4458  configs = [
4459    # Note: don't use :internal_config here because this target will get
4460    # the :external_config applied to it by virtue of depending on :v8, and
4461    # you can't have both applied to the same target.
4462    ":internal_config_base",
4463  ]
4464
4465  deps = [
4466    ":v8",
4467    ":v8_libbase",
4468    ":v8_libplatform",
4469    "//build/win:default_exe_manifest",
4470  ]
4471}
4472
4473v8_executable("v8_sample_process") {
4474  sources = [ "samples/process.cc" ]
4475
4476  configs = [
4477    # Note: don't use :internal_config here because this target will get
4478    # the :external_config applied to it by virtue of depending on :v8, and
4479    # you can't have both applied to the same target.
4480    ":internal_config_base",
4481  ]
4482
4483  deps = [
4484    ":v8",
4485    ":v8_libbase",
4486    ":v8_libplatform",
4487    "//build/win:default_exe_manifest",
4488  ]
4489}
4490
4491if (want_v8_shell) {
4492  v8_executable("v8_shell") {
4493    sources = [ "samples/shell.cc" ]
4494
4495    configs = [
4496      # Note: don't use :internal_config here because this target will get
4497      # the :external_config applied to it by virtue of depending on :v8, and
4498      # you can't have both applied to the same target.
4499      ":internal_config_base",
4500    ]
4501
4502    deps = [
4503      ":v8",
4504      ":v8_libbase",
4505      ":v8_libplatform",
4506      "//build/win:default_exe_manifest",
4507    ]
4508  }
4509}
4510
4511template("v8_fuzzer") {
4512  name = target_name
4513  forward_variables_from(invoker, "*")
4514  v8_executable("v8_simple_" + name) {
4515    deps = [
4516      ":" + name,
4517      "//build/win:default_exe_manifest",
4518    ]
4519
4520    sources = [ "test/fuzzer/fuzzer.cc" ]
4521
4522    configs = [ ":external_config" ]
4523  }
4524}
4525
4526v8_source_set("json_fuzzer") {
4527  sources = [ "test/fuzzer/json.cc" ]
4528
4529  deps = [ ":fuzzer_support" ]
4530
4531  configs = [
4532    ":external_config",
4533    ":internal_config_base",
4534  ]
4535}
4536
4537v8_fuzzer("json_fuzzer") {
4538}
4539
4540v8_source_set("multi_return_fuzzer") {
4541  sources = [ "test/fuzzer/multi-return.cc" ]
4542
4543  deps = [ ":fuzzer_support" ]
4544
4545  configs = [
4546    ":external_config",
4547    ":internal_config_base",
4548  ]
4549}
4550
4551v8_fuzzer("multi_return_fuzzer") {
4552}
4553
4554v8_source_set("parser_fuzzer") {
4555  sources = [ "test/fuzzer/parser.cc" ]
4556
4557  deps = [ ":fuzzer_support" ]
4558
4559  configs = [
4560    ":external_config",
4561    ":internal_config_base",
4562  ]
4563}
4564
4565v8_fuzzer("parser_fuzzer") {
4566}
4567
4568v8_source_set("regexp_builtins_fuzzer") {
4569  sources = [
4570    "test/fuzzer/regexp-builtins.cc",
4571    "test/fuzzer/regexp_builtins/mjsunit.js.h",
4572  ]
4573
4574  deps = [ ":fuzzer_support" ]
4575
4576  configs = [
4577    ":external_config",
4578    ":internal_config_base",
4579  ]
4580}
4581
4582v8_fuzzer("regexp_builtins_fuzzer") {
4583}
4584
4585v8_source_set("regexp_fuzzer") {
4586  sources = [ "test/fuzzer/regexp.cc" ]
4587
4588  deps = [ ":fuzzer_support" ]
4589
4590  configs = [
4591    ":external_config",
4592    ":internal_config_base",
4593  ]
4594}
4595
4596v8_fuzzer("regexp_fuzzer") {
4597}
4598
4599v8_source_set("wasm_module_runner") {
4600  sources = [
4601    "test/common/wasm/wasm-module-runner.cc",
4602    "test/common/wasm/wasm-module-runner.h",
4603  ]
4604
4605  deps = [
4606    ":generate_bytecode_builtins_list",
4607    ":run_torque",
4608  ]
4609
4610  public_deps = [ ":v8_maybe_icu" ]
4611
4612  configs = [
4613    ":external_config",
4614    ":internal_config_base",
4615  ]
4616}
4617
4618v8_source_set("wasm_fuzzer") {
4619  sources = [ "test/fuzzer/wasm.cc" ]
4620
4621  deps = [
4622    ":fuzzer_support",
4623    ":lib_wasm_fuzzer_common",
4624    ":wasm_module_runner",
4625  ]
4626
4627  configs = [
4628    ":external_config",
4629    ":internal_config_base",
4630  ]
4631}
4632
4633v8_fuzzer("wasm_fuzzer") {
4634}
4635
4636v8_source_set("wasm_async_fuzzer") {
4637  sources = [ "test/fuzzer/wasm-async.cc" ]
4638
4639  deps = [
4640    ":fuzzer_support",
4641    ":lib_wasm_fuzzer_common",
4642    ":wasm_module_runner",
4643  ]
4644
4645  configs = [
4646    ":external_config",
4647    ":internal_config_base",
4648  ]
4649}
4650
4651v8_fuzzer("wasm_async_fuzzer") {
4652}
4653
4654v8_source_set("wasm_code_fuzzer") {
4655  sources = [
4656    "test/common/wasm/test-signatures.h",
4657    "test/fuzzer/wasm-code.cc",
4658  ]
4659
4660  deps = [
4661    ":fuzzer_support",
4662    ":lib_wasm_fuzzer_common",
4663    ":wasm_module_runner",
4664  ]
4665
4666  configs = [
4667    ":external_config",
4668    ":internal_config_base",
4669  ]
4670}
4671
4672v8_fuzzer("wasm_code_fuzzer") {
4673}
4674
4675v8_source_set("lib_wasm_fuzzer_common") {
4676  sources = [
4677    "test/fuzzer/wasm-fuzzer-common.cc",
4678    "test/fuzzer/wasm-fuzzer-common.h",
4679  ]
4680
4681  deps = [
4682    ":generate_bytecode_builtins_list",
4683    ":run_torque",
4684  ]
4685
4686  public_deps = [ ":v8_maybe_icu" ]
4687
4688  configs = [
4689    ":external_config",
4690    ":internal_config_base",
4691  ]
4692}
4693
4694v8_source_set("wasm_compile_fuzzer") {
4695  sources = [
4696    "test/common/wasm/test-signatures.h",
4697    "test/fuzzer/wasm-compile.cc",
4698  ]
4699
4700  deps = [
4701    ":fuzzer_support",
4702    ":lib_wasm_fuzzer_common",
4703    ":wasm_module_runner",
4704  ]
4705
4706  configs = [
4707    ":external_config",
4708    ":internal_config_base",
4709  ]
4710}
4711
4712v8_fuzzer("wasm_compile_fuzzer") {
4713}
4714
4715# Target to build all generated .cc files.
4716group("v8_generated_cc_files") {
4717  testonly = true
4718
4719  deps = [
4720    ":generate_bytecode_builtins_list",
4721    ":run_torque",
4722    "src/inspector:v8_generated_cc_files",
4723  ]
4724}
4725
4726# Protobuf targets, used only when building outside of chromium.
4727
4728if (!build_with_chromium && v8_use_perfetto) {
4729  # This config is applied to the autogenerated .pb.{cc,h} files in
4730  # proto_library.gni. This config is propagated up to the source sets
4731  # that depend on generated proto headers.
4732  config("protobuf_gen_config") {
4733    defines = [
4734      "GOOGLE_PROTOBUF_NO_RTTI",
4735      "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
4736    ]
4737    cflags = [
4738      "-Wno-unknown-warning-option",
4739      "-Wno-deprecated",
4740      "-Wno-undef",
4741      "-Wno-zero-as-null-pointer-constant",
4742      "-Wno-thread-safety-attributes",
4743    ]
4744    include_dirs = [ "third_party/protobuf/src" ]
4745  }
4746
4747  # Configuration used to build libprotobuf_* and the protoc compiler.
4748  config("protobuf_config") {
4749    # Apply the lighter supressions and macro definitions from above.
4750    configs = [ ":protobuf_gen_config" ]
4751
4752    if (!is_win) {
4753      defines = [ "HAVE_PTHREAD=1" ]
4754    }
4755    if (is_clang) {
4756      cflags = [
4757        "-Wno-unused-private-field",
4758        "-Wno-unused-function",
4759        "-Wno-inconsistent-missing-override",
4760        "-Wno-unknown-warning-option",
4761        "-Wno-enum-compare-switch",
4762        "-Wno-user-defined-warnings",
4763        "-Wno-tautological-constant-compare",
4764      ]
4765    }
4766    if (is_win) {
4767      cflags += [ "-Wno-microsoft-unqualified-friend" ]
4768    }
4769  }
4770
4771  source_set("protobuf_lite") {
4772    sources = [
4773      "third_party/protobuf/src/google/protobuf/any_lite.cc",
4774      "third_party/protobuf/src/google/protobuf/arena.cc",
4775      "third_party/protobuf/src/google/protobuf/extension_set.cc",
4776      "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
4777      "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
4778      "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
4779      "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
4780      "third_party/protobuf/src/google/protobuf/io/strtod.cc",
4781      "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc",
4782      "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
4783      "third_party/protobuf/src/google/protobuf/message_lite.cc",
4784      "third_party/protobuf/src/google/protobuf/repeated_field.cc",
4785      "third_party/protobuf/src/google/protobuf/stubs/bytestream.cc",
4786      "third_party/protobuf/src/google/protobuf/stubs/common.cc",
4787      "third_party/protobuf/src/google/protobuf/stubs/int128.cc",
4788      "third_party/protobuf/src/google/protobuf/stubs/io_win32.cc",
4789      "third_party/protobuf/src/google/protobuf/stubs/status.cc",
4790      "third_party/protobuf/src/google/protobuf/stubs/statusor.cc",
4791      "third_party/protobuf/src/google/protobuf/stubs/stringpiece.cc",
4792      "third_party/protobuf/src/google/protobuf/stubs/stringprintf.cc",
4793      "third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc",
4794      "third_party/protobuf/src/google/protobuf/stubs/strutil.cc",
4795      "third_party/protobuf/src/google/protobuf/stubs/time.cc",
4796      "third_party/protobuf/src/google/protobuf/wire_format_lite.cc",
4797    ]
4798    configs -= [ "//build/config/compiler:chromium_code" ]
4799    configs += [
4800      "//build/config/compiler:no_chromium_code",
4801      ":protobuf_config",
4802    ]
4803    if (is_win) {
4804      configs -= [ "//build/config/win:lean_and_mean" ]
4805    }
4806    public_configs = [ ":protobuf_gen_config" ]
4807  }
4808
4809  # This target should be used only by the protoc compiler and by test targets.
4810  source_set("protobuf_full") {
4811    deps = [ ":protobuf_lite" ]
4812    sources = [
4813      "third_party/protobuf/src/google/protobuf/any.cc",
4814      "third_party/protobuf/src/google/protobuf/any.pb.cc",
4815      "third_party/protobuf/src/google/protobuf/api.pb.cc",
4816      "third_party/protobuf/src/google/protobuf/compiler/importer.cc",
4817      "third_party/protobuf/src/google/protobuf/compiler/parser.cc",
4818      "third_party/protobuf/src/google/protobuf/descriptor.cc",
4819      "third_party/protobuf/src/google/protobuf/descriptor.pb.cc",
4820      "third_party/protobuf/src/google/protobuf/descriptor_database.cc",
4821      "third_party/protobuf/src/google/protobuf/duration.pb.cc",
4822      "third_party/protobuf/src/google/protobuf/dynamic_message.cc",
4823      "third_party/protobuf/src/google/protobuf/empty.pb.cc",
4824      "third_party/protobuf/src/google/protobuf/extension_set_heavy.cc",
4825      "third_party/protobuf/src/google/protobuf/field_mask.pb.cc",
4826      "third_party/protobuf/src/google/protobuf/generated_message_reflection.cc",
4827      "third_party/protobuf/src/google/protobuf/generated_message_table_driven.cc",
4828      "third_party/protobuf/src/google/protobuf/io/gzip_stream.cc",
4829      "third_party/protobuf/src/google/protobuf/io/printer.cc",
4830      "third_party/protobuf/src/google/protobuf/io/tokenizer.cc",
4831      "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
4832      "third_party/protobuf/src/google/protobuf/map_field.cc",
4833      "third_party/protobuf/src/google/protobuf/message.cc",
4834      "third_party/protobuf/src/google/protobuf/reflection_ops.cc",
4835      "third_party/protobuf/src/google/protobuf/service.cc",
4836      "third_party/protobuf/src/google/protobuf/source_context.pb.cc",
4837      "third_party/protobuf/src/google/protobuf/struct.pb.cc",
4838      "third_party/protobuf/src/google/protobuf/stubs/mathlimits.cc",
4839      "third_party/protobuf/src/google/protobuf/stubs/substitute.cc",
4840      "third_party/protobuf/src/google/protobuf/text_format.cc",
4841      "third_party/protobuf/src/google/protobuf/timestamp.pb.cc",
4842      "third_party/protobuf/src/google/protobuf/type.pb.cc",
4843      "third_party/protobuf/src/google/protobuf/unknown_field_set.cc",
4844      "third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc",
4845      "third_party/protobuf/src/google/protobuf/util/field_comparator.cc",
4846      "third_party/protobuf/src/google/protobuf/util/field_mask_util.cc",
4847      "third_party/protobuf/src/google/protobuf/util/internal/datapiece.cc",
4848      "third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
4849      "third_party/protobuf/src/google/protobuf/util/internal/error_listener.cc",
4850      "third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
4851      "third_party/protobuf/src/google/protobuf/util/internal/json_escaping.cc",
4852      "third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
4853      "third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
4854      "third_party/protobuf/src/google/protobuf/util/internal/object_writer.cc",
4855      "third_party/protobuf/src/google/protobuf/util/internal/proto_writer.cc",
4856      "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
4857      "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
4858      "third_party/protobuf/src/google/protobuf/util/internal/type_info.cc",
4859      "third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
4860      "third_party/protobuf/src/google/protobuf/util/internal/utility.cc",
4861      "third_party/protobuf/src/google/protobuf/util/json_util.cc",
4862      "third_party/protobuf/src/google/protobuf/util/message_differencer.cc",
4863      "third_party/protobuf/src/google/protobuf/util/time_util.cc",
4864      "third_party/protobuf/src/google/protobuf/util/type_resolver_util.cc",
4865      "third_party/protobuf/src/google/protobuf/wire_format.cc",
4866      "third_party/protobuf/src/google/protobuf/wrappers.pb.cc",
4867    ]
4868    configs -= [ "//build/config/compiler:chromium_code" ]
4869    configs += [
4870      "//build/config/compiler:no_chromium_code",
4871      ":protobuf_config",
4872    ]
4873    if (is_win) {
4874      configs -= [ "//build/config/win:lean_and_mean" ]
4875    }
4876    public_configs = [ ":protobuf_gen_config" ]
4877  }
4878
4879  if (current_toolchain == host_toolchain) {
4880    source_set("protoc_lib") {
4881      deps = [ ":protobuf_full" ]
4882      sources = [
4883        "third_party/protobuf/src/google/protobuf/compiler/code_generator.cc",
4884        "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc",
4885        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
4886        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
4887        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
4888        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
4889        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
4890        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
4891        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
4892        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
4893        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
4894        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
4895        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
4896        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
4897        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
4898        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
4899        "third_party/protobuf/src/google/protobuf/compiler/plugin.cc",
4900        "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc",
4901        "third_party/protobuf/src/google/protobuf/compiler/subprocess.cc",
4902        "third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc",
4903      ]
4904      configs -= [ "//build/config/compiler:chromium_code" ]
4905      configs += [
4906        "//build/config/compiler:no_chromium_code",
4907        ":protobuf_config",
4908      ]
4909      if (is_win) {
4910        configs -= [ "//build/config/win:lean_and_mean" ]
4911      }
4912      public_configs = [ ":protobuf_gen_config" ]
4913    }
4914
4915    executable("protoc") {
4916      deps = [
4917        ":protoc_lib",
4918        "//build/win:default_exe_manifest",
4919      ]
4920      sources = [ "src/protobuf/protobuf-compiler-main.cc" ]
4921      configs -= [ "//build/config/compiler:chromium_code" ]
4922      configs += [ "//build/config/compiler:no_chromium_code" ]
4923    }
4924  }  # host_toolchain
4925}  # if (!build_with_chromium && v8_use_perfetto)
4926