BUILD.gn 162 KB
Newer Older
1 2 3 4
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

5 6
import("//build/config/android/config.gni")
import("//build/config/arm.gni")
7
import("//build/config/dcheck_always_on.gni")
8
import("//build/config/host_byteorder.gni")
9
import("//build/config/mips.gni")
10
import("//build/config/sanitizers/sanitizers.gni")
11
import("//build_overrides/build.gni")
12

13 14 15 16
if (is_android) {
  import("//build/config/android/rules.gni")
}

17
import("gni/snapshot_toolchain.gni")
18
import("gni/v8.gni")
19

20 21 22
# Specifies if the target build is a simulator build. Comparing target cpu
# with v8 target cpu to not affect simulator builds for making cross-compile
# snapshots.
23
target_is_simulator = (target_cpu != v8_target_cpu && !v8_multi_arch_build) ||
24 25
                      (current_cpu != v8_current_cpu && v8_multi_arch_build)

26 27 28
# For faster Windows builds. See https://crbug.com/v8/8475.
emit_builtins_as_inline_asm = is_win && is_clang

29
declare_args() {
30 31 32
  # Print to stdout on Android.
  v8_android_log_stdout = false

33 34 35
  # Dynamically set an additional dependency from v8/custom_deps.
  v8_custom_deps = ""

36 37 38 39
  # Turns on all V8 debug features. Enables running V8 in a pseudo debug mode
  # within a release Chrome.
  v8_enable_debugging_features = is_debug

40 41 42
  # Sets -DV8_ENABLE_FUTURE.
  v8_enable_future = false

43 44 45 46 47
  # Lite mode disables a number of performance optimizations to reduce memory
  # at the cost of performance.
  # Sets --DV8_LITE_MODE.
  v8_enable_lite_mode = false

48
  # Sets -DVERIFY_HEAP.
49
  v8_enable_verify_heap = ""
50

51 52 53
  # Sets -DVERIFY_PREDICTABLE
  v8_enable_verify_predictable = false

54
  # Enable compiler warnings when using V8_DEPRECATED apis.
55
  v8_deprecation_warnings = true
56 57

  # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
58
  v8_imminent_deprecation_warnings = true
59

60 61 62
  # Embeds the given script into the snapshot.
  v8_embed_script = ""

63 64 65
  # Allows the embedder to add a custom suffix to the version string.
  v8_embedder_string = ""

66
  # Sets -dENABLE_DISASSEMBLER.
67
  v8_enable_disassembler = ""
68

69 70 71
  # Sets the number of internal fields on promise objects.
  v8_promise_internal_field_count = 0

72
  # Sets -dENABLE_GDB_JIT_INTERFACE.
73
  v8_enable_gdbjit = ""
74

75 76 77
  # Sets -dENABLE_VTUNE_JIT_INTERFACE.
  v8_enable_vtunejit = false

78 79 80
  # Sets -dENABLE_VTUNE_TRACEMARK.
  v8_enable_vtunetracemark = false

81 82 83
  # Sets -dENABLE_HANDLE_ZAPPING.
  v8_enable_handle_zapping = true

84 85 86
  # Enable slow dchecks.
  v8_enable_slow_dchecks = false

87 88 89
  # Enable fast mksnapshot runs.
  v8_enable_fast_mksnapshot = false

90 91 92
  # Optimize code for Torque executable, even during a debug build.
  v8_enable_fast_torque = ""

93
  # Enable the registration of unwinding info for Windows x64 and ARM64.
94
  v8_win64_unwinding_info = true
95

96 97 98
  # Enable code comments for builtins in the snapshot (impacts performance).
  v8_enable_snapshot_code_comments = false

99 100 101 102 103 104
  # Enable native counters from the snapshot (impacts performance, sets
  # -dV8_SNAPSHOT_NATIVE_CODE_COUNTERS).
  # This option will generate extra code in the snapshot to increment counters,
  # as per the --native-code-counters flag.
  v8_enable_snapshot_native_code_counters = ""

105 106 107
  # Enable code-generation-time checking of types in the CodeStubAssembler.
  v8_enable_verify_csa = false

108
  # Enable pointer compression (sets -dV8_COMPRESS_POINTERS).
109
  v8_enable_pointer_compression = ""
110
  v8_enable_31bit_smis_on_64bit_arch = false
111

112
  # Sets -dOBJECT_PRINT.
113 114
  v8_enable_object_print = ""

115
  # Sets -dV8_TRACE_MAPS.
116 117 118 119
  v8_enable_trace_maps = ""

  # Sets -dV8_ENABLE_CHECKS.
  v8_enable_v8_checks = ""
120

121 122
  # Sets -dV8_TRACE_IGNITION.
  v8_enable_trace_ignition = false
123

124 125 126
  # Sets -dV8_TRACE_FEEDBACK_UPDATES.
  v8_enable_trace_feedback_updates = false

127
  # Sets -dV8_CONCURRENT_MARKING
128
  v8_enable_concurrent_marking = true
129

130
  # Sets -dV8_ARRAY_BUFFER_EXTENSION
131
  v8_enable_array_buffer_extension = true
132

133 134
  # Enables various testing features.
  v8_enable_test_features = ""
135

136 137 138 139
  # With post mortem support enabled, metadata is embedded into libv8 that
  # describes various parameters of the VM for use by debuggers. See
  # tools/gen-postmortem-metadata.py for details.
  v8_postmortem_support = false
140

141 142 143
  # Use Siphash as added protection against hash flooding attacks.
  v8_use_siphash = false

144 145 146
  # Switches off inlining in V8.
  v8_no_inline = false

147 148 149
  # Override OS page size when generating snapshot
  v8_os_page_size = "0"

150 151 152 153 154
  # Similar to vfp but on MIPS.
  v8_can_use_fpu_instructions = true

  # Similar to the ARM hard float ABI but on MIPS.
  v8_use_mips_abi_hardfloat = true
155

156 157 158
  # Controls the threshold for on-heap/off-heap Typed Arrays.
  v8_typed_array_max_size_in_heap = 64

Jakob Kummerow's avatar
Jakob Kummerow committed
159 160 161
  v8_enable_gdbjit =
      ((v8_current_cpu == "x86" || v8_current_cpu == "x64") &&
       (is_linux || is_mac)) || (v8_current_cpu == "ppc64" && is_linux)
162 163 164 165

  # Temporary flag to allow embedders to update their microtasks scopes
  # while rolling in a new version of V8.
  v8_check_microtasks_scopes_consistency = ""
166

167
  # Enable mitigations for executing untrusted code.
168 169 170 171 172
  # Disabled by default on ia32 due to conflicting requirements with embedded
  # builtins. Enabled by default on Android since it doesn't support
  # site-isolation in Chrome and on simulator builds which test code generation
  # on these platforms.
  v8_untrusted_code_mitigations =
173
      v8_current_cpu != "x86" && (is_android || target_is_simulator)
174 175 176

  # Enable minor mark compact.
  v8_enable_minor_mc = true
177 178 179 180 181

  # Check that each header can be included in isolation (requires also
  # setting the "check_v8_header_includes" gclient variable to run a
  # specific hook).
  v8_check_header_includes = false
182 183

  # Enable sharing read-only space across isolates.
184 185
  # Sets -DV8_SHARED_RO_HEAP.
  v8_enable_shared_ro_heap = ""
186

187 188
  # Enable lazy source positions by default.
  v8_enable_lazy_source_positions = true
189

190 191 192 193 194 195 196 197 198
  # Enable third party HEAP library
  v8_enable_third_party_heap = false

  # Libaries used by third party heap
  v8_third_party_heap_libs = []

  # Source code used by third party heap
  v8_third_party_heap_files = []

199 200 201 202 203 204 205
  # Disable write barriers when GCs are non-incremental and
  # heap has single generation.
  v8_disable_write_barriers = false

  # Redirect allocation in young generation so that there will be
  # only one single generation.
  v8_enable_single_generation = ""
206 207 208 209

  # Use token threaded dispatch for the regular expression interpreter.
  # Use switch-based dispatch if this is false
  v8_enable_regexp_interpreter_threaded_dispatch = true
210 211 212 213

  # Enable additional targets necessary for verification of torque
  # file generation
  v8_verify_torque_generation_invariance = false
214 215 216

  # Disable all snapshot compression.
  v8_enable_snapshot_compression = true
217 218 219 220

  # Enable control-flow integrity features, such as pointer authentication for
  # ARM64.
  v8_control_flow_integrity = false
221 222 223

  # Enable object names in cppgc for debug purposes.
  cppgc_enable_object_names = false
224 225 226 227

  # Enable V8 heap sandbox experimental feature.
  # Sets -DV8_HEAP_SANDBOX.
  v8_enable_heap_sandbox = ""
228 229 230 231

  # Experimental support for native context independent code.
  # https://crbug.com/v8/8888
  v8_enable_nci_code = false
232 233
}

234
# Derived defaults.
235
if (v8_enable_verify_heap == "") {
236
  v8_enable_verify_heap = v8_enable_debugging_features
237 238
}
if (v8_enable_object_print == "") {
239
  v8_enable_object_print = v8_enable_debugging_features
240 241
}
if (v8_enable_disassembler == "") {
242
  v8_enable_disassembler = v8_enable_debugging_features
243 244
}
if (v8_enable_trace_maps == "") {
245
  v8_enable_trace_maps = v8_enable_debugging_features
246
}
247
if (v8_enable_test_features == "") {
248
  v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
249
}
250
if (v8_enable_v8_checks == "") {
251
  v8_enable_v8_checks = v8_enable_debugging_features
252
}
253
if (v8_check_microtasks_scopes_consistency == "") {
254 255
  v8_check_microtasks_scopes_consistency =
      v8_enable_debugging_features || dcheck_always_on
256
}
257 258 259
if (v8_enable_snapshot_native_code_counters == "") {
  v8_enable_snapshot_native_code_counters = v8_enable_debugging_features
}
260
if (v8_enable_pointer_compression == "") {
261 262 263
  # TODO(v8:v7703): temporarily enable pointer compression on arm64 and on x64
  v8_enable_pointer_compression =
      v8_current_cpu == "arm64" || v8_current_cpu == "x64"
264
}
265 266 267
if (v8_enable_fast_torque == "") {
  v8_enable_fast_torque = v8_enable_fast_mksnapshot
}
268 269 270
if (v8_enable_heap_sandbox == "") {
  v8_enable_heap_sandbox = false
}
271 272 273 274
if (v8_enable_single_generation == "") {
  v8_enable_single_generation = v8_disable_write_barriers
}

275 276 277 278 279 280 281 282
# Toggle pointer compression for correctness fuzzing when building the
# clang_x64_pointer_compression toolchain. We'll correctness-compare the
# default build with the clang_x64_pointer_compression build.
if (v8_multi_arch_build &&
    rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) ==
    "clang_x64_pointer_compression") {
  v8_enable_pointer_compression = !v8_enable_pointer_compression
}
283 284 285
if (v8_enable_shared_ro_heap == "") {
  v8_enable_shared_ro_heap = !v8_enable_pointer_compression
}
286

287 288 289
assert(!v8_disable_write_barriers || v8_enable_single_generation,
       "Disabling write barriers works only with single generation")

290 291 292
assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations,
       "Untrusted code mitigations are unsupported on ia32")

293 294 295
assert(v8_current_cpu == "arm64" || !v8_control_flow_integrity,
       "Control-flow integrity is only supported on arm64")

296 297 298 299
assert(
    !v8_enable_pointer_compression || !v8_enable_shared_ro_heap,
    "Pointer compression is not supported with shared read-only heap enabled")

300 301 302
assert(!v8_enable_heap_sandbox || v8_enable_pointer_compression,
       "V8 Heap Sandbox requires pointer compression")

303
v8_random_seed = "314159265"
304
v8_toolset_for_shell = "host"
305 306 307 308

###############################################################################
# Configurations
#
309 310

config("internal_config_base") {
311
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
312

313 314
  configs = [ ":v8_tracing_config" ]

315 316
  include_dirs = [
    ".",
317
    "include",
318 319
    "$target_gen_dir",
  ]
320 321
}

322 323
config("internal_config") {
  defines = []
324
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
325

326 327 328 329
  configs = [
    "//build/config/compiler:wexit_time_destructors",
    ":internal_config_base",
    ":v8_header_features",
330
  ]
331 332 333 334

  if (is_component_build) {
    defines += [ "BUILDING_V8_SHARED" ]
  }
335 336
}

337 338 339 340 341 342 343 344 345 346 347
# Should be applied to all targets that write trace events.
config("v8_tracing_config") {
  if (v8_use_perfetto) {
    include_dirs = [
      "third_party/perfetto/include",
      "$root_gen_dir/third_party/perfetto",
      "$root_gen_dir/third_party/perfetto/build_config",
    ]
  }
}

348 349 350
# This config should be applied to code using the libplatform.
config("libplatform_config") {
  include_dirs = [ "include" ]
351 352 353
  if (is_component_build) {
    defines = [ "USING_V8_PLATFORM_SHARED" ]
  }
354 355
}

356 357 358 359 360 361 362 363 364 365 366
# This config should be applied to code using the libbase.
config("libbase_config") {
  if (is_component_build) {
    defines = [ "USING_V8_BASE_SHARED" ]
  }
  libs = []
  if (is_android && current_toolchain != host_toolchain) {
    libs += [ "log" ]
  }
}

367 368
# This config should be applied to code using the cppgc_base.
config("cppgc_base_config") {
369 370 371
  defines = []
  if (cppgc_enable_object_names) {
    defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ]
372 373 374
  }
}

375 376 377 378 379
# This config should be applied to code using the libsampler.
config("libsampler_config") {
  include_dirs = [ "include" ]
}

380 381 382
# This config should only be applied to code using V8 and not any V8 code
# itself.
config("external_config") {
383
  defines = []
384
  configs = [ ":v8_header_features" ]
385
  if (is_component_build) {
386 387
    defines += [ "USING_V8_SHARED" ]
  }
388 389 390 391
  include_dirs = [
    "include",
    "$target_gen_dir/include",
  ]
392 393
}

394 395 396 397 398 399 400 401
# This config should only be applied to code that needs to be explicitly
# aware of whether we are using startup data or not.
config("external_startup_data") {
  if (v8_use_external_startup_data) {
    defines = [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
  }
}

402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
# Put defines that are used in public headers here; public headers are
# defined in "v8_headers" and are included by embedders of V8.
config("v8_header_features") {
  visibility = [ ":*" ]

  defines = []

  if (v8_enable_v8_checks) {
    defines += [ "V8_ENABLE_CHECKS" ]  # Used in "include/v8.h".
  }
  if (v8_enable_pointer_compression) {
    defines += [ "V8_COMPRESS_POINTERS" ]
  }
  if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
    defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
  }
418 419 420
  if (v8_enable_heap_sandbox) {
    defines += [ "V8_HEAP_SANDBOX" ]
  }
421 422 423 424 425 426 427 428 429 430
  if (v8_deprecation_warnings) {
    defines += [ "V8_DEPRECATION_WARNINGS" ]
  }
  if (v8_imminent_deprecation_warnings) {
    defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ]
  }
}

# Put defines here that are only used in our internal files and NEVER in
# external headers that embedders (such as chromium and node) might include.
431
config("features") {
432
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
433 434 435

  defines = []

436 437
  configs = [ ":v8_header_features" ]

438 439 440
  if (v8_embedder_string != "") {
    defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
  }
441
  if (v8_enable_disassembler) {
442
    defines += [ "ENABLE_DISASSEMBLER" ]
443
  }
444 445 446 447
  if (v8_promise_internal_field_count != 0) {
    defines +=
        [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
  }
448 449
  defines +=
      [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
450 451 452 453 454

  assert(
      !v8_enable_raw_heap_snapshots,
      "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.")

455 456 457
  if (v8_enable_future) {
    defines += [ "V8_ENABLE_FUTURE" ]
  }
458 459 460
  if (v8_enable_lite_mode) {
    defines += [ "V8_LITE_MODE" ]
  }
461
  if (v8_enable_gdbjit) {
462
    defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
463
  }
464 465 466
  if (v8_enable_vtunejit) {
    defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
  }
467 468 469
  if (v8_enable_vtunetracemark) {
    defines += [ "ENABLE_VTUNE_TRACEMARK" ]
  }
470 471 472
  if (v8_enable_minor_mc) {
    defines += [ "ENABLE_MINOR_MC" ]
  }
473
  if (v8_enable_object_print) {
474
    defines += [ "OBJECT_PRINT" ]
475
  }
476
  if (v8_enable_verify_heap) {
477
    defines += [ "VERIFY_HEAP" ]
478
  }
479 480 481
  if (v8_enable_verify_predictable) {
    defines += [ "VERIFY_PREDICTABLE" ]
  }
482
  if (v8_enable_trace_maps) {
483 484 485 486
    defines += [ "V8_TRACE_MAPS" ]
  }
  if (v8_enable_trace_ignition) {
    defines += [ "V8_TRACE_IGNITION" ]
487
  }
488 489 490
  if (v8_enable_trace_feedback_updates) {
    defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
  }
491 492
  if (v8_enable_test_features) {
    defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
493
    defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
494
    defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
495
  }
496
  if (v8_enable_i18n_support) {
497
    defines += [ "V8_INTL_SUPPORT" ]
498
  }
499
  if (v8_enable_handle_zapping) {
500
    defines += [ "ENABLE_HANDLE_ZAPPING" ]
501
  }
502 503
  if (v8_enable_snapshot_native_code_counters) {
    defines += [ "V8_SNAPSHOT_NATIVE_CODE_COUNTERS" ]
504
  }
505 506 507
  if (v8_enable_single_generation) {
    defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
  }
508 509 510
  if (v8_disable_write_barriers) {
    defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
  }
511 512 513
  if (v8_enable_third_party_heap) {
    defines += [ "V8_ENABLE_THIRD_PARTY_HEAP" ]
  }
514
  if (v8_use_external_startup_data) {
515
    defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
516
  }
517 518 519
  if (v8_enable_concurrent_marking) {
    defines += [ "V8_CONCURRENT_MARKING" ]
  }
520 521 522
  if (v8_enable_array_buffer_extension) {
    defines += [ "V8_ARRAY_BUFFER_EXTENSION" ]
  }
523 524 525
  if (v8_enable_lazy_source_positions) {
    defines += [ "V8_ENABLE_LAZY_SOURCE_POSITIONS" ]
  }
526 527 528
  if (v8_check_microtasks_scopes_consistency) {
    defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ]
  }
529 530 531
  if (v8_use_multi_snapshots) {
    defines += [ "V8_MULTI_SNAPSHOTS" ]
  }
532 533 534
  if (v8_use_siphash) {
    defines += [ "V8_USE_SIPHASH" ]
  }
535 536 537
  if (v8_enable_shared_ro_heap) {
    defines += [ "V8_SHARED_RO_HEAP" ]
  }
538 539 540
  if (v8_use_perfetto) {
    defines += [ "V8_USE_PERFETTO" ]
  }
541 542 543
  if (v8_win64_unwinding_info) {
    defines += [ "V8_WIN64_UNWINDING_INFO" ]
  }
544 545 546
  if (v8_enable_regexp_interpreter_threaded_dispatch) {
    defines += [ "V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH" ]
  }
547 548 549
  if (v8_enable_snapshot_compression) {
    defines += [ "V8_SNAPSHOT_COMPRESSION" ]
  }
550 551 552
  if (v8_control_flow_integrity) {
    defines += [ "V8_ENABLE_CONTROL_FLOW_INTEGRITY" ]
  }
553 554 555
  if (v8_enable_wasm_gdb_remote_debugging) {
    defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ]
  }
556 557 558
  if (v8_enable_nci_code) {
    defines += [ "V8_ENABLE_NCI_CODE" ]
  }
559 560
}

561
config("toolchain") {
562
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
563 564 565

  defines = []
  cflags = []
brettw's avatar
brettw committed
566
  ldflags = []
567

568
  if (v8_current_cpu == "arm") {
569
    defines += [ "V8_TARGET_ARCH_ARM" ]
570
    if (arm_version >= 7) {
571 572 573 574 575
      defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
    }
    if (arm_fpu == "vfpv3-d16") {
      defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
    } else if (arm_fpu == "vfpv3") {
576 577 578
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
579 580 581 582 583 584
      ]
    } else if (arm_fpu == "neon") {
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
        "CAN_USE_NEON",
585 586
      ]
    }
587

588
    # TODO(jochen): Add support for arm_test_noprobe.
589 590 591 592 593 594 595 596 597

    if (current_cpu != "arm") {
      # These defines ares used for the ARM simulator.
      if (arm_float_abi == "hard") {
        defines += [ "USE_EABI_HARDFLOAT=1" ]
      } else if (arm_float_abi == "softfp") {
        defines += [ "USE_EABI_HARDFLOAT=0" ]
      }
    }
598
  }
599
  if (v8_current_cpu == "arm64") {
600
    defines += [ "V8_TARGET_ARCH_ARM64" ]
601 602 603
    if (v8_control_flow_integrity) {
      # TODO(v8:10026): Enable this in src/build.
      if (current_cpu == "arm64") {
604
        cflags += [ "-mbranch-protection=standard" ]
605 606
      }
    }
607
  }
608

609
  # Mips64el/mipsel simulators.
610
  if (target_is_simulator &&
611 612 613 614
      (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) {
    defines += [ "_MIPS_TARGET_SIMULATOR" ]
  }

615
  if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") {
wtc's avatar
wtc committed
616
    defines += [ "V8_TARGET_ARCH_MIPS" ]
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
    if (v8_can_use_fpu_instructions) {
      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
    }
    if (v8_use_mips_abi_hardfloat) {
      defines += [
        "__mips_hard_float=1",
        "CAN_USE_FPU_INSTRUCTIONS",
      ]
    } else {
      defines += [ "__mips_soft_float=1" ]
    }
    if (mips_arch_variant == "r6") {
      defines += [
        "_MIPS_ARCH_MIPS32R6",
        "FPU_MODE_FP64",
      ]
633 634 635
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
636 637 638 639 640 641 642 643 644 645 646 647
    } else if (mips_arch_variant == "r2") {
      defines += [ "_MIPS_ARCH_MIPS32R2" ]
      if (mips_fpu_mode == "fp64") {
        defines += [ "FPU_MODE_FP64" ]
      } else if (mips_fpu_mode == "fpxx") {
        defines += [ "FPU_MODE_FPXX" ]
      } else if (mips_fpu_mode == "fp32") {
        defines += [ "FPU_MODE_FP32" ]
      }
    } else if (mips_arch_variant == "r1") {
      defines += [ "FPU_MODE_FP32" ]
    }
648

649
    # TODO(jochen): Add support for mips_arch_variant rx and loongson.
wtc's avatar
wtc committed
650
  }
651

652
  if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
wtc's avatar
wtc committed
653
    defines += [ "V8_TARGET_ARCH_MIPS64" ]
654 655 656
    if (v8_can_use_fpu_instructions) {
      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
    }
657 658 659
    if (mips_use_msa) {
      defines += [ "_MIPS_MSA" ]
    }
660 661 662 663 664
    if (host_byteorder == "little") {
      defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
    } else if (host_byteorder == "big") {
      defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
    }
665 666 667 668 669 670 671 672 673 674 675 676 677
    if (v8_use_mips_abi_hardfloat) {
      defines += [
        "__mips_hard_float=1",
        "CAN_USE_FPU_INSTRUCTIONS",
      ]
    } else {
      defines += [ "__mips_soft_float=1" ]
    }
    if (mips_arch_variant == "r6") {
      defines += [ "_MIPS_ARCH_MIPS64R6" ]
    } else if (mips_arch_variant == "r2") {
      defines += [ "_MIPS_ARCH_MIPS64R2" ]
    }
wtc's avatar
wtc committed
678
  }
679
  if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
680
    defines += [ "V8_TARGET_ARCH_S390" ]
681
    cflags += [ "-ffp-contract=off" ]
682
    if (v8_current_cpu == "s390x") {
683 684
      defines += [ "V8_TARGET_ARCH_S390X" ]
    }
685
    if (host_byteorder == "little") {
686
      defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
687 688 689 690 691
    } else {
      cflags += [ "-march=z196" ]
    }
  }
  if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
692 693 694
    if (v8_current_cpu == "ppc") {
      defines += [ "V8_TARGET_ARCH_PPC" ]
    } else if (v8_current_cpu == "ppc64") {
695 696
      defines += [ "V8_TARGET_ARCH_PPC64" ]
    }
697
    if (host_byteorder == "little") {
698
      defines += [ "V8_TARGET_ARCH_PPC_LE" ]
699
    } else if (host_byteorder == "big") {
700 701 702 703 704 705 706 707 708 709 710
      defines += [ "V8_TARGET_ARCH_PPC_BE" ]
      if (current_os == "aix") {
        cflags += [
          # Work around AIX ceil, trunc and round oddities.
          "-mcpu=power5+",
          "-mfprnd",

          # Work around AIX assembler popcntb bug.
          "-mno-popcntb",
        ]
      }
711
    }
712
  }
713

714
  if (v8_current_cpu == "x86") {
715
    defines += [ "V8_TARGET_ARCH_IA32" ]
brettw's avatar
brettw committed
716 717 718 719
    if (is_win) {
      # Ensure no surprising artifacts from 80bit double math with x86.
      cflags += [ "/arch:SSE2" ]
    }
720
  }
721
  if (v8_current_cpu == "x64") {
722
    defines += [ "V8_TARGET_ARCH_X64" ]
brettw's avatar
brettw committed
723 724 725 726 727 728
    if (is_win) {
      # Increase the initial stack size. The default is 1MB, this is 2MB. This
      # applies only to executables and shared libraries produced by V8 since
      # ldflags are not pushed to dependants.
      ldflags += [ "/STACK:2097152" ]
    }
729
  }
730 731 732
  if (is_android && v8_android_log_stdout) {
    defines += [ "V8_ANDROID_LOG_STDOUT" ]
  }
733

734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757
  # V8_TARGET_OS_ defines. The target OS may differ from host OS e.g. in
  # mksnapshot. We additionally set V8_HAVE_TARGET_OS to determine that a
  # target OS has in fact been set; otherwise we internally assume that target
  # OS == host OS (see v8config.h).
  if (target_os == "android") {
    defines += [ "V8_HAVE_TARGET_OS" ]
    defines += [ "V8_TARGET_OS_ANDROID" ]
  } else if (target_os == "fuchsia") {
    defines += [ "V8_HAVE_TARGET_OS" ]
    defines += [ "V8_TARGET_OS_FUCHSIA" ]
  } else if (target_os == "ios") {
    defines += [ "V8_HAVE_TARGET_OS" ]
    defines += [ "V8_TARGET_OS_IOS" ]
  } else if (target_os == "linux") {
    defines += [ "V8_HAVE_TARGET_OS" ]
    defines += [ "V8_TARGET_OS_LINUX" ]
  } else if (target_os == "mac") {
    defines += [ "V8_HAVE_TARGET_OS" ]
    defines += [ "V8_TARGET_OS_MACOSX" ]
  } else if (target_os == "win") {
    defines += [ "V8_HAVE_TARGET_OS" ]
    defines += [ "V8_TARGET_OS_WIN" ]
  }

brettw's avatar
brettw committed
758
  # TODO(jochen): Support v8_enable_prof on Windows.
759 760
  # TODO(jochen): Add support for compiling with simulators.

761
  if (v8_enable_debugging_features) {
762 763 764 765
    if (is_linux && v8_enable_backtrace) {
      ldflags += [ "-rdynamic" ]
    }

766
    defines += [ "DEBUG" ]
767
    if (v8_enable_slow_dchecks) {
768 769
      defines += [ "ENABLE_SLOW_DCHECKS" ]
    }
770 771
  } else if (dcheck_always_on) {
    defines += [ "DEBUG" ]
772
  }
773

774 775 776 777
  if (v8_enable_verify_csa) {
    defines += [ "ENABLE_VERIFY_CSA" ]
  }

778 779 780 781
  if (!v8_untrusted_code_mitigations) {
    defines += [ "DISABLE_UNTRUSTED_CODE_MITIGATIONS" ]
  }

782
  if (v8_no_inline) {
783 784 785 786 787 788 789 790
    if (is_win) {
      cflags += [ "/Ob0" ]
    } else {
      cflags += [
        "-fno-inline-functions",
        "-fno-inline",
      ]
    }
791
  }
792 793

  if (is_clang) {
794
    cflags += [ "-Wmissing-field-initializers" ]
795 796 797 798 799 800

    if (v8_current_cpu != "mips" && v8_current_cpu != "mipsel") {
      # We exclude MIPS because the IsMipsArchVariant macro causes trouble.
      cflags += [ "-Wunreachable-code" ]
    }

801 802 803 804
    if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
        v8_current_cpu == "mips64el") {
      cflags += [ "-Wshorten-64-to-32" ]
    }
805
  }
806 807 808 809 810 811 812 813 814 815

  if (is_win) {
    cflags += [
      "/wd4245",  # Conversion with signed/unsigned mismatch.
      "/wd4267",  # Conversion with possible loss of data.
      "/wd4324",  # Padding structure due to alignment.
      "/wd4701",  # Potentially uninitialized local variable.
      "/wd4702",  # Unreachable code.
      "/wd4703",  # Potentially uninitialized local pointer variable.
      "/wd4709",  # Comma operator within array index expr (bugged).
816
      "/wd4714",  # Function marked forceinline not inlined.
817 818 819 820 821

      # MSVC assumes that control can get past an exhaustive switch and then
      # warns if there's no return there (see https://crbug.com/v8/7658)
      "/wd4715",  # Not all control paths return a value.

822
      "/wd4718",  # Recursive call has no side-effect.
823 824
      "/wd4723",  # https://crbug.com/v8/7771
      "/wd4724",  # https://crbug.com/v8/7771
825 826 827
      "/wd4800",  # Forcing value to bool.
    ]
  }
828

829 830 831 832
  if (!is_clang && is_win) {
    cflags += [ "/wd4506" ]  # Benign "no definition for inline function"
  }

833 834 835 836 837 838
  if (!is_clang && !is_win) {
    cflags += [
      # Disable gcc warnings for optimizations based on the assumption that
      # signed overflow does not occur. Generates false positives (see
      # http://crbug.com/v8/6341).
      "-Wno-strict-overflow",
839 840 841 842

      # GCC assumes that control can get past an exhaustive switch and then
      # warns if there's no return there (see https://crbug.com/v8/7658).
      "-Wno-return-type",
843 844
    ]
  }
845 846 847 848 849

  # Chromium uses a hand-picked subset of UBSan coverage. We want everything.
  if (is_ubsan) {
    cflags += [ "-fsanitize=undefined" ]
  }
850 851
}

852 853 854 855 856 857 858 859 860 861 862 863 864 865
# For code that is hot during mksnapshot. In fast-mksnapshot builds, we
# optimize some files even in debug builds to speed up mksnapshot times.
config("always_optimize") {
  configs = [ ":internal_config" ]

  # TODO(crbug.com/621335) Rework this so that we don't have the confusion
  # between "optimize_speed" and "optimize_max".
  if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
    configs += [ "//build/config/compiler:optimize_speed" ]
  } else {
    configs += [ "//build/config/compiler:optimize_max" ]
  }
}

866 867
# Configs for code coverage with gcov. Separate configs for cflags and ldflags
# to selectively influde cflags in non-test targets only.
868 869 870 871 872
config("v8_gcov_coverage_cflags") {
  cflags = [
    "-fprofile-arcs",
    "-ftest-coverage",
  ]
873 874
}

875 876
config("v8_gcov_coverage_ldflags") {
  ldflags = [ "-fprofile-arcs" ]
877 878
}

879 880 881 882
###############################################################################
# Actions
#

883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898
# Only for Windows clang builds. Converts the embedded.S file produced by
# mksnapshot into an embedded.cc file with corresponding inline assembly.
template("asm_to_inline_asm") {
  name = target_name
  if (name == "default") {
    suffix = ""
  } else {
    suffix = "_$name"
  }

  action("asm_to_inline_asm_" + name) {
    visibility = [ ":*" ]  # Only targets in this file can depend on this.

    assert(emit_builtins_as_inline_asm)

    script = "tools/snapshot/asm_to_inline_asm.py"
899 900 901
    deps = [ ":run_mksnapshot_" + name ]
    sources = [ "$target_gen_dir/embedded${suffix}.S" ]
    outputs = [ "$target_gen_dir/embedded${suffix}.cc" ]
902 903 904 905 906 907 908 909
    args = invoker.args
    args += [
      rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
      rebase_path("$target_gen_dir/embedded${suffix}.cc", root_build_dir),
    ]
  }
}

910
if (is_android && enable_java_templates) {
911 912
  android_assets("v8_external_startup_data_assets") {
    if (v8_use_external_startup_data) {
913 914
      # We don't support side-by-side snapshots on Android within Chromium.
      assert(!v8_use_multi_snapshots)
915
      deps = [ "//v8" ]
916 917 918 919 920 921 922
      renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ]
      if (current_cpu == "arm" || current_cpu == "x86" ||
          current_cpu == "mipsel") {
        renaming_destinations = [ "snapshot_blob_32.bin" ]
      } else {
        renaming_destinations = [ "snapshot_blob_64.bin" ]
      }
923 924 925 926 927
      disable_compression = true
    }
  }
}

928
action("postmortem-metadata") {
929 930 931 932 933 934
  # Only targets in this file and the top-level visibility target can
  # depend on this.
  visibility = [
    ":*",
    "//:gn_visibility",
  ]
935

936 937
  script = "tools/gen-postmortem-metadata.py"

938
  # NOSORT
939
  sources = [
940 941
    "src/objects/objects.h",
    "src/objects/objects-inl.h",
942 943
    "src/objects/allocation-site-inl.h",
    "src/objects/allocation-site.h",
944 945
    "src/objects/cell-inl.h",
    "src/objects/cell.h",
946 947
    "src/objects/code-inl.h",
    "src/objects/code.h",
948 949
    "src/objects/data-handler.h",
    "src/objects/data-handler-inl.h",
950 951
    "src/objects/descriptor-array.h",
    "src/objects/descriptor-array-inl.h",
952 953
    "src/objects/feedback-cell.h",
    "src/objects/feedback-cell-inl.h",
954 955
    "src/objects/fixed-array-inl.h",
    "src/objects/fixed-array.h",
956 957
    "src/objects/heap-number-inl.h",
    "src/objects/heap-number.h",
958 959
    "src/objects/heap-object-inl.h",
    "src/objects/heap-object.h",
960
    "src/objects/instance-type.h",
961 962
    "src/objects/js-array-inl.h",
    "src/objects/js-array.h",
963 964
    "src/objects/js-array-buffer-inl.h",
    "src/objects/js-array-buffer.h",
965 966
    "src/objects/js-objects-inl.h",
    "src/objects/js-objects.h",
967 968
    "src/objects/js-promise-inl.h",
    "src/objects/js-promise.h",
969
    "src/objects/js-regexp-inl.h",
970
    "src/objects/js-regexp.cc",
971
    "src/objects/js-regexp.h",
972 973
    "src/objects/js-regexp-string-iterator-inl.h",
    "src/objects/js-regexp-string-iterator.h",
974
    "src/objects/map.h",
975
    "src/objects/map.cc",
976
    "src/objects/map-inl.h",
977
    "src/objects/js-objects.cc",
978 979
    "src/objects/name.h",
    "src/objects/name-inl.h",
980 981
    "src/objects/oddball-inl.h",
    "src/objects/oddball.h",
982 983
    "src/objects/primitive-heap-object.h",
    "src/objects/primitive-heap-object-inl.h",
984
    "src/objects/scope-info.h",
985 986
    "src/objects/script.h",
    "src/objects/script-inl.h",
987 988
    "src/objects/shared-function-info.h",
    "src/objects/shared-function-info-inl.h",
989
    "src/objects/string.cc",
990
    "src/objects/string.h",
991 992
    "src/objects/string-comparator.cc",
    "src/objects/string-comparator.h",
993
    "src/objects/string-inl.h",
994 995
    "src/objects/struct.h",
    "src/objects/struct-inl.h",
996
    "$target_gen_dir/torque-generated/instance-types-tq.h",
997 998
  ]

999
  outputs = [ "$target_gen_dir/debug-support.cc" ]
1000

1001 1002
  args = rebase_path(outputs, root_build_dir) +
         rebase_path(sources, root_build_dir)
1003

1004
  deps = [ ":run_torque" ]
1005 1006
}

1007
torque_files = [
1008
  "src/builtins/array-copywithin.tq",
1009
  "src/builtins/array-every.tq",
1010
  "src/builtins/array-filter.tq",
1011 1012
  "src/builtins/array-find.tq",
  "src/builtins/array-findindex.tq",
1013
  "src/builtins/array-foreach.tq",
1014
  "src/builtins/array-from.tq",
1015
  "src/builtins/array-isarray.tq",
1016
  "src/builtins/array-join.tq",
1017
  "src/builtins/array-lastindexof.tq",
1018
  "src/builtins/array-map.tq",
1019
  "src/builtins/array-of.tq",
1020
  "src/builtins/array-reduce-right.tq",
1021
  "src/builtins/array-reduce.tq",
1022
  "src/builtins/array-reverse.tq",
1023
  "src/builtins/array-shift.tq",
1024
  "src/builtins/array-slice.tq",
1025
  "src/builtins/array-some.tq",
1026
  "src/builtins/array-splice.tq",
1027
  "src/builtins/array-unshift.tq",
1028 1029
  "src/builtins/array.tq",
  "src/builtins/base.tq",
1030
  "src/builtins/bigint.tq",
1031
  "src/builtins/boolean.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1032 1033
  "src/builtins/builtins-string.tq",
  "src/builtins/cast.tq",
1034 1035
  "src/builtins/collections.tq",
  "src/builtins/conversion.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1036
  "src/builtins/convert.tq",
1037
  "src/builtins/console.tq",
1038
  "src/builtins/data-view.tq",
1039
  "src/builtins/finalization-registry.tq",
1040
  "src/builtins/frames.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1041
  "src/builtins/frame-arguments.tq",
1042
  "src/builtins/function.tq",
1043
  "src/builtins/growable-fixed-array.tq",
1044 1045
  "src/builtins/ic-callable.tq",
  "src/builtins/ic.tq",
1046
  "src/builtins/internal-coverage.tq",
1047
  "src/builtins/iterator.tq",
1048
  "src/builtins/math.tq",
1049
  "src/builtins/number.tq",
1050
  "src/builtins/object-fromentries.tq",
1051
  "src/builtins/object.tq",
1052
  "src/builtins/promise-abstract-operations.tq",
1053
  "src/builtins/promise-all.tq",
1054
  "src/builtins/promise-all-element-closure.tq",
1055
  "src/builtins/promise-any.tq",
1056
  "src/builtins/promise-constructor.tq",
1057
  "src/builtins/promise-finally.tq",
1058
  "src/builtins/promise-misc.tq",
1059
  "src/builtins/promise-race.tq",
1060
  "src/builtins/promise-reaction-job.tq",
1061
  "src/builtins/promise-resolve.tq",
1062
  "src/builtins/promise-then.tq",
1063
  "src/builtins/promise-jobs.tq",
1064
  "src/builtins/proxy-constructor.tq",
1065
  "src/builtins/proxy-delete-property.tq",
1066
  "src/builtins/proxy-get-property.tq",
1067
  "src/builtins/proxy-get-prototype-of.tq",
1068
  "src/builtins/proxy-has-property.tq",
1069
  "src/builtins/proxy-is-extensible.tq",
1070
  "src/builtins/proxy-prevent-extensions.tq",
1071
  "src/builtins/proxy-revocable.tq",
1072
  "src/builtins/proxy-revoke.tq",
1073
  "src/builtins/proxy-set-property.tq",
1074
  "src/builtins/proxy-set-prototype-of.tq",
1075
  "src/builtins/proxy.tq",
1076
  "src/builtins/reflect.tq",
1077
  "src/builtins/regexp-exec.tq",
1078
  "src/builtins/regexp-match-all.tq",
1079
  "src/builtins/regexp-match.tq",
1080
  "src/builtins/regexp-replace.tq",
1081
  "src/builtins/regexp-search.tq",
1082
  "src/builtins/regexp-source.tq",
1083
  "src/builtins/regexp-split.tq",
1084
  "src/builtins/regexp-test.tq",
1085
  "src/builtins/regexp.tq",
1086
  "src/builtins/string-endswith.tq",
1087
  "src/builtins/string-html.tq",
1088
  "src/builtins/string-iterator.tq",
1089
  "src/builtins/string-pad.tq",
1090
  "src/builtins/string-repeat.tq",
1091
  "src/builtins/string-replaceall.tq",
1092
  "src/builtins/string-slice.tq",
1093
  "src/builtins/string-startswith.tq",
1094
  "src/builtins/string-substring.tq",
1095
  "src/builtins/string-substr.tq",
1096
  "src/builtins/symbol.tq",
1097
  "src/builtins/torque-internal.tq",
1098
  "src/builtins/typed-array-createtypedarray.tq",
1099
  "src/builtins/typed-array-every.tq",
1100
  "src/builtins/typed-array-filter.tq",
1101 1102
  "src/builtins/typed-array-find.tq",
  "src/builtins/typed-array-findindex.tq",
1103
  "src/builtins/typed-array-foreach.tq",
1104
  "src/builtins/typed-array-from.tq",
1105
  "src/builtins/typed-array-of.tq",
1106 1107
  "src/builtins/typed-array-reduce.tq",
  "src/builtins/typed-array-reduceright.tq",
1108
  "src/builtins/typed-array-set.tq",
1109
  "src/builtins/typed-array-slice.tq",
1110
  "src/builtins/typed-array-some.tq",
1111
  "src/builtins/typed-array-sort.tq",
1112
  "src/builtins/typed-array-subarray.tq",
1113
  "src/builtins/typed-array.tq",
1114
  "src/builtins/wasm.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132
  "src/ic/handler-configuration.tq",
  "src/objects/allocation-site.tq",
  "src/objects/api-callbacks.tq",
  "src/objects/arguments.tq",
  "src/objects/cell.tq",
  "src/objects/code.tq",
  "src/objects/contexts.tq",
  "src/objects/data-handler.tq",
  "src/objects/debug-objects.tq",
  "src/objects/descriptor-array.tq",
  "src/objects/embedder-data-array.tq",
  "src/objects/feedback-cell.tq",
  "src/objects/feedback-vector.tq",
  "src/objects/fixed-array.tq",
  "src/objects/foreign.tq",
  "src/objects/free-space.tq",
  "src/objects/heap-number.tq",
  "src/objects/heap-object.tq",
1133
  "src/objects/intl-objects.tq",
1134
  "src/objects/js-aggregate-error.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
  "src/objects/js-array-buffer.tq",
  "src/objects/js-array.tq",
  "src/objects/js-collection-iterator.tq",
  "src/objects/js-collection.tq",
  "src/objects/js-generator.tq",
  "src/objects/js-objects.tq",
  "src/objects/js-promise.tq",
  "src/objects/js-proxy.tq",
  "src/objects/js-regexp-string-iterator.tq",
  "src/objects/js-regexp.tq",
  "src/objects/js-weak-refs.tq",
  "src/objects/literal-objects.tq",
  "src/objects/map.tq",
  "src/objects/microtask.tq",
  "src/objects/module.tq",
  "src/objects/name.tq",
  "src/objects/oddball.tq",
  "src/objects/ordered-hash-table.tq",
  "src/objects/primitive-heap-object.tq",
  "src/objects/promise.tq",
  "src/objects/property-array.tq",
  "src/objects/property-cell.tq",
1157
  "src/objects/property-descriptor-object.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1158 1159
  "src/objects/prototype-info.tq",
  "src/objects/regexp-match-info.tq",
1160
  "src/objects/scope-info.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170
  "src/objects/script.tq",
  "src/objects/shared-function-info.tq",
  "src/objects/source-text-module.tq",
  "src/objects/stack-frame-info.tq",
  "src/objects/string.tq",
  "src/objects/struct.tq",
  "src/objects/synthetic-module.tq",
  "src/objects/template-objects.tq",
  "src/objects/template.tq",
  "src/wasm/wasm-objects.tq",
1171
  "test/torque/test-torque.tq",
1172
  "third_party/v8/builtins/array-sort.tq",
1173 1174
]

1175 1176 1177 1178
if (!v8_enable_i18n_support) {
  torque_files -= [ "src/objects/intl-objects.tq" ]
}

1179 1180 1181 1182 1183 1184 1185 1186 1187
# Template for running torque
# When building with v8_verify_torque_generation_invariance=true we need
# to be able to run torque for both 32 and 64 bits in the same build
template("run_torque") {
  if (target_name == "") {
    suffix = ""
  } else {
    suffix = "_$target_name"
  }
1188

1189 1190 1191 1192 1193 1194 1195 1196 1197 1198
  toolchain = invoker.toolchain

  action("run_torque" + suffix) {
    visibility = [
      ":*",
      "tools/debug_helper/:*",
      "tools/gcmole/:*",
      "test/cctest/:*",
    ]

1199
    deps = [ ":torque($toolchain)" ]
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210

    script = "tools/run.py"

    sources = torque_files

    destination_folder = "$target_gen_dir/torque-generated$suffix"

    files = [
      "bit-fields-tq.h",
      "builtin-definitions-tq.h",
      "interface-descriptors-tq.inc",
1211 1212
      "factory-tq.cc",
      "factory-tq.inc",
1213 1214 1215 1216 1217
      "field-offsets-tq.h",
      "class-verifiers-tq.cc",
      "class-verifiers-tq.h",
      "enum-verifiers-tq.cc",
      "objects-printer-tq.cc",
1218
      "objects-body-descriptors-tq-inl.inc",
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229
      "class-definitions-tq.cc",
      "class-definitions-tq-inl.h",
      "class-definitions-tq.h",
      "class-debug-readers-tq.cc",
      "class-debug-readers-tq.h",
      "exported-macros-assembler-tq.cc",
      "exported-macros-assembler-tq.h",
      "csa-types-tq.h",
      "instance-types-tq.h",
      "internal-class-definitions-tq.h",
      "internal-class-definitions-tq-inl.h",
1230 1231
      "exported-class-definitions-tq.h",
      "exported-class-definitions-tq-inl.h",
1232
    ]
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259

    outputs = []
    foreach(file, files) {
      outputs += [ "$destination_folder/$file" ]
    }

    foreach(file, torque_files) {
      filetq = string_replace(file, ".tq", "-tq-csa")
      outputs += [
        "$destination_folder/$filetq.cc",
        "$destination_folder/$filetq.h",
      ]
    }

    args = [
      "./" + rebase_path(
              get_label_info(":torque($toolchain)", "root_out_dir") + "/torque",
              root_build_dir),
      "-o",
      rebase_path("$destination_folder", root_build_dir),
      "-v8-root",
      rebase_path(".", root_build_dir),
    ]
    if (defined(invoker.args)) {
      args += invoker.args
    }
    args += torque_files
1260
  }
1261
}
1262

1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
# Default run_torque action
run_torque("") {
  toolchain = v8_generator_toolchain
}

if (v8_verify_torque_generation_invariance) {
  run_torque("x86") {
    toolchain = "//build/toolchain/linux:clang_x86"
  }

  run_torque("x64") {
    args = [ "-m32" ]
    toolchain = "//build/toolchain/linux:clang_x64"
  }

  action("compare_torque_runs") {
    deps = [
      ":run_torque_x64",
      ":run_torque_x86",
    ]
    report_file = "$target_gen_dir/torque_comparison_results.txt"
    script = "tools/compare_torque_output.py"
    args = [
      rebase_path("$target_gen_dir/torque-generated_x64", root_build_dir),
      rebase_path("$target_gen_dir/torque-generated_x86", root_build_dir),
      rebase_path(report_file, root_build_dir),
    ]
1290
    outputs = [ report_file ]
1291
  }
1292 1293
}

1294 1295
group("v8_maybe_icu") {
  if (v8_enable_i18n_support) {
1296
    public_deps = [ "//third_party/icu" ]
1297 1298 1299
  }
}

1300 1301 1302 1303
v8_source_set("torque_generated_initializers") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1304
    ":generate_bytecode_builtins_list",
1305
    ":run_torque",
1306
    ":v8_tracing",
1307 1308
  ]

1309
  public_deps = [ ":v8_maybe_icu" ]
1310

1311 1312
  sources = [
    "$target_gen_dir/torque-generated/csa-types-tq.h",
1313
    "$target_gen_dir/torque-generated/enum-verifiers-tq.cc",
1314 1315
    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.cc",
    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.h",
1316
    "src/torque/runtime-support.h",
1317
  ]
1318 1319
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1320
    sources += [
1321 1322
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1323 1324 1325
    ]
  }

1326
  configs = [ ":internal_config" ]
1327 1328
}

1329 1330 1331 1332
v8_source_set("torque_generated_definitions") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
John Budorick's avatar
John Budorick committed
1333
    ":generate_bytecode_builtins_list",
1334
    ":run_torque",
1335
    ":v8_tracing",
1336 1337
  ]

1338
  public_deps = [ ":v8_maybe_icu" ]
1339 1340

  sources = [
1341
    "$target_gen_dir/torque-generated/class-definitions-tq.cc",
1342 1343
    "$target_gen_dir/torque-generated/class-verifiers-tq.cc",
    "$target_gen_dir/torque-generated/class-verifiers-tq.h",
1344
    "$target_gen_dir/torque-generated/factory-tq.cc",
1345
    "$target_gen_dir/torque-generated/objects-printer-tq.cc",
1346 1347 1348 1349 1350
  ]

  configs = [ ":internal_config" ]
}

1351 1352
action("generate_bytecode_builtins_list") {
  script = "tools/run.py"
1353 1354
  outputs = [ "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h" ]
  deps = [ ":bytecode_builtins_list_generator($v8_generator_toolchain)" ]
1355 1356
  args = [
    "./" + rebase_path(
1357
            get_label_info(
1358
                    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1359
                    "root_out_dir") + "/bytecode_builtins_list_generator",
1360
            root_build_dir),
1361 1362
    rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
                root_build_dir),
1363 1364 1365
  ]
}

1366 1367 1368
# Template to generate different V8 snapshots based on different runtime flags.
# Can be invoked with run_mksnapshot(<name>). The target will resolve to
# run_mksnapshot_<name>. If <name> is "default", no file suffixes will be used.
1369
# Otherwise files are suffixed, e.g. embedded_<name>.S and
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
# snapshot_blob_<name>.bin.
#
# The template exposes the variables:
#   args: additional flags for mksnapshots
#   embedded_suffix: a camel case suffix for method names in the embedded
#       snapshot.
template("run_mksnapshot") {
  name = target_name
  if (name == "default") {
    suffix = ""
  } else {
    suffix = "_$name"
  }
  action("run_mksnapshot_" + name) {
1384
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1385

1386
    deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
1387

1388
    script = "tools/run.py"
1389

1390
    sources = []
1391

1392
    outputs = []
1393

1394 1395
    data = []

1396 1397 1398 1399
    args = [
      "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
                                        "root_out_dir") + "/mksnapshot",
                         root_build_dir),
1400
      "--turbo_instruction_scheduling",
1401 1402 1403 1404 1405

      # In cross builds, the snapshot may be generated for both the host and
      # target toolchains.  The same host binary is used to generate both, so
      # mksnapshot needs to know which target OS to use at runtime.  It's weird,
      # but the target OS is really |current_os|.
1406
      "--target_os=$current_os",
1407
      "--target_arch=$current_cpu",
1408 1409 1410

      "--embedded_src",
      rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1411 1412
    ]

1413 1414 1415 1416 1417 1418 1419
    # This is needed to distinguish between generating code for the simulator
    # and cross-compiling. The latter may need to run code on the host with the
    # simulator but cannot use simulator-specific instructions.
    if (target_is_simulator) {
      args += [ "--target_is_simulator" ]
    }

1420 1421
    args += invoker.args

1422 1423
    outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
    if (invoker.embedded_variant != "") {
1424
      args += [
1425 1426
        "--embedded_variant",
        invoker.embedded_variant,
1427 1428 1429
      ]
    }

1430 1431 1432 1433 1434 1435
    if (v8_random_seed != "0") {
      args += [
        "--random-seed",
        v8_random_seed,
      ]
    }
1436

1437 1438 1439 1440 1441 1442
    if (v8_os_page_size != "0") {
      args += [
        "--v8_os_page_size",
        v8_os_page_size,
      ]
    }
1443

1444
    if (v8_use_external_startup_data) {
1445
      outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1446
      data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1447 1448
      args += [
        "--startup_blob",
1449
        rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
1450
      ]
1451
    } else {
1452
      outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
1453 1454
      args += [
        "--startup_src",
1455
        rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
1456
      ]
1457 1458 1459 1460 1461 1462 1463
    }

    if (v8_embed_script != "") {
      sources += [ v8_embed_script ]
      args += [ rebase_path(v8_embed_script, root_build_dir) ]
    }

1464 1465 1466 1467
    if (v8_enable_snapshot_code_comments) {
      args += [ "--code-comments" ]
    }

1468 1469 1470 1471 1472 1473 1474 1475
    if (v8_enable_snapshot_native_code_counters) {
      args += [ "--native-code-counters" ]
    } else {
      # --native-code-counters is the default in debug mode so make sure we can
      # unset it.
      args += [ "--no-native-code-counters" ]
    }

1476 1477 1478 1479 1480
    if (v8_enable_fast_mksnapshot) {
      args += [
        "--no-turbo-rewrite-far-jumps",
        "--no-turbo-verify-allocation",
      ]
1481 1482 1483 1484 1485

      if (v8_enable_debugging_features && v8_enable_slow_dchecks) {
        # mksnapshot only accepts this flag if ENABLE_SLOW_DCHECKS is defined.
        args += [ "--no-enable-slow-asserts" ]
      }
1486
    }
1487 1488 1489 1490

    if (v8_enable_verify_heap) {
      args += [ "--verify-heap" ]
    }
1491
  }
1492 1493
}

1494 1495
run_mksnapshot("default") {
  args = []
1496
  embedded_variant = "Default"
1497 1498 1499
}
if (emit_builtins_as_inline_asm) {
  asm_to_inline_asm("default") {
1500
    args = []
1501 1502 1503 1504 1505
  }
}
if (v8_use_multi_snapshots) {
  run_mksnapshot("trusted") {
    args = [ "--no-untrusted-code-mitigations" ]
1506
    embedded_variant = "Trusted"
1507
  }
1508
  if (emit_builtins_as_inline_asm) {
1509
    asm_to_inline_asm("trusted") {
1510 1511 1512
      args = []
    }
  }
1513 1514
}

1515 1516
action("v8_dump_build_config") {
  script = "tools/testrunner/utils/dump_build_config.py"
1517
  outputs = [ "$root_out_dir/v8_build_config.json" ]
1518
  is_gcov_coverage = v8_code_coverage && !is_clang
1519
  is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
1520 1521
  args = [
    rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
1522
    "current_cpu=\"$current_cpu\"",
1523
    "dcheck_always_on=$dcheck_always_on",
1524
    "is_android=$is_android",
1525 1526
    "is_asan=$is_asan",
    "is_cfi=$is_cfi",
1527
    "is_clang=$is_clang",
1528
    "is_component_build=$is_component_build",
1529
    "is_debug=$v8_enable_debugging_features",
1530
    "is_full_debug=$is_full_debug",
1531
    "is_gcov_coverage=$is_gcov_coverage",
1532 1533
    "is_msan=$is_msan",
    "is_tsan=$is_tsan",
1534
    "is_ubsan_vptr=$is_ubsan_vptr",
1535
    "target_cpu=\"$target_cpu\"",
1536
    "v8_current_cpu=\"$v8_current_cpu\"",
1537
    "v8_enable_i18n_support=$v8_enable_i18n_support",
1538
    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
1539
    "v8_target_cpu=\"$v8_target_cpu\"",
1540
    "v8_enable_verify_csa=$v8_enable_verify_csa",
1541
    "v8_enable_lite_mode=$v8_enable_lite_mode",
1542
    "v8_enable_pointer_compression=$v8_enable_pointer_compression",
1543
  ]
1544 1545 1546 1547 1548 1549 1550 1551

  if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" ||
      v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    args += [
      "mips_arch_variant=\"$mips_arch_variant\"",
      "mips_use_msa=$mips_use_msa",
    ]
  }
1552 1553
}

1554 1555 1556 1557
###############################################################################
# Source Sets (aka static libraries)
#

1558 1559
v8_source_set("v8_snapshot") {
  visibility = [ ":*" ]  # Targets in this file can depend on this.
1560

1561
  deps = []
1562 1563 1564 1565 1566
  public_deps = [
    # This should be public so downstream targets can declare the snapshot
    # output file as their inputs.
    ":run_mksnapshot_default",
  ]
1567

1568 1569
  # Do not publicize any header to remove build dependency.
  public = []
1570

1571
  sources = [ "src/init/setup-isolate-deserialize.cc" ]
1572 1573 1574 1575 1576
  if (emit_builtins_as_inline_asm) {
    deps += [ ":asm_to_inline_asm_default" ]
    sources += [ "$target_gen_dir/embedded.cc" ]
  } else {
    sources += [ "$target_gen_dir/embedded.S" ]
1577
  }
1578

1579
  configs = [ ":internal_config" ]
1580

1581
  if (v8_use_external_startup_data) {
1582 1583
    deps += [ ":v8_base" ]

1584
    sources += [ "src/snapshot/snapshot-external.cc" ]
1585

1586 1587
    if (v8_use_multi_snapshots) {
      public_deps += [ ":run_mksnapshot_trusted" ]
1588
      if (emit_builtins_as_inline_asm) {
1589 1590
        deps += [ ":asm_to_inline_asm_trusted" ]
        sources += [ "$target_gen_dir/embedded_trusted.cc" ]
1591
      } else {
1592
        sources += [ "$target_gen_dir/embedded_trusted.S" ]
1593
      }
1594
    }
1595
  } else {
1596 1597 1598 1599 1600
    # Also top-level visibility targets can depend on this.
    visibility += [ "//:gn_visibility" ]

    public_deps += [ ":v8_maybe_icu" ]

1601
    sources += [ "$target_gen_dir/snapshot.cc" ]
1602 1603 1604
  }
}

1605
v8_source_set("v8_initializers") {
1606 1607 1608 1609
  visibility = [
    ":*",
    "test/cctest:*",
  ]
1610

1611 1612 1613 1614
  deps = [
    ":torque_generated_initializers",
    ":v8_tracing",
  ]
Takuto Ikuta's avatar
Takuto Ikuta committed
1615

1616 1617 1618
  sources = [
    ### gcmole(all) ###
    "src/builtins/builtins-array-gen.cc",
1619
    "src/builtins/builtins-array-gen.h",
1620 1621
    "src/builtins/builtins-async-function-gen.cc",
    "src/builtins/builtins-async-gen.cc",
1622
    "src/builtins/builtins-async-gen.h",
1623
    "src/builtins/builtins-async-generator-gen.cc",
1624
    "src/builtins/builtins-async-iterator-gen.cc",
1625
    "src/builtins/builtins-bigint-gen.cc",
1626
    "src/builtins/builtins-bigint-gen.h",
1627
    "src/builtins/builtins-call-gen.cc",
1628
    "src/builtins/builtins-call-gen.h",
1629
    "src/builtins/builtins-collections-gen.cc",
1630
    "src/builtins/builtins-constructor-gen.cc",
1631
    "src/builtins/builtins-constructor-gen.h",
1632 1633
    "src/builtins/builtins-constructor.h",
    "src/builtins/builtins-conversion-gen.cc",
1634
    "src/builtins/builtins-data-view-gen.h",
1635
    "src/builtins/builtins-date-gen.cc",
1636
    "src/builtins/builtins-debug-gen.cc",
1637 1638 1639 1640 1641
    "src/builtins/builtins-generator-gen.cc",
    "src/builtins/builtins-global-gen.cc",
    "src/builtins/builtins-handler-gen.cc",
    "src/builtins/builtins-ic-gen.cc",
    "src/builtins/builtins-internal-gen.cc",
1642
    "src/builtins/builtins-interpreter-gen.cc",
1643
    "src/builtins/builtins-intl-gen.cc",
1644 1645
    "src/builtins/builtins-iterator-gen.cc",
    "src/builtins/builtins-iterator-gen.h",
1646 1647
    "src/builtins/builtins-lazy-gen.cc",
    "src/builtins/builtins-lazy-gen.h",
1648
    "src/builtins/builtins-microtask-queue-gen.cc",
1649 1650 1651
    "src/builtins/builtins-number-gen.cc",
    "src/builtins/builtins-object-gen.cc",
    "src/builtins/builtins-promise-gen.cc",
1652
    "src/builtins/builtins-promise-gen.h",
1653
    "src/builtins/builtins-proxy-gen.cc",
1654
    "src/builtins/builtins-proxy-gen.h",
1655 1656 1657 1658
    "src/builtins/builtins-regexp-gen.cc",
    "src/builtins/builtins-regexp-gen.h",
    "src/builtins/builtins-sharedarraybuffer-gen.cc",
    "src/builtins/builtins-string-gen.cc",
1659
    "src/builtins/builtins-string-gen.h",
1660 1661
    "src/builtins/builtins-typed-array-gen.cc",
    "src/builtins/builtins-typed-array-gen.h",
1662 1663
    "src/builtins/builtins-utils-gen.h",
    "src/builtins/builtins-wasm-gen.cc",
1664
    "src/builtins/builtins-wasm-gen.h",
1665 1666
    "src/builtins/growable-fixed-array-gen.cc",
    "src/builtins/growable-fixed-array-gen.h",
1667
    "src/builtins/setup-builtins-internal.cc",
1668 1669
    "src/codegen/code-stub-assembler.cc",
    "src/codegen/code-stub-assembler.h",
1670
    "src/heap/setup-heap-internal.cc",
1671 1672
    "src/ic/accessor-assembler.cc",
    "src/ic/accessor-assembler.h",
1673 1674
    "src/ic/binary-op-assembler.cc",
    "src/ic/binary-op-assembler.h",
1675 1676
    "src/ic/keyed-store-generic.cc",
    "src/ic/keyed-store-generic.h",
1677 1678
    "src/interpreter/interpreter-assembler.cc",
    "src/interpreter/interpreter-assembler.h",
1679 1680
    "src/interpreter/interpreter-generator.cc",
    "src/interpreter/interpreter-generator.h",
1681 1682
    "src/interpreter/interpreter-intrinsics-generator.cc",
    "src/interpreter/interpreter-intrinsics-generator.h",
1683 1684
  ]

1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714
  if (v8_current_cpu == "x86") {
    sources += [
      ### gcmole(arch:ia32) ###
      "src/builtins/ia32/builtins-ia32.cc",
    ]
  } else if (v8_current_cpu == "x64") {
    sources += [
      ### gcmole(arch:x64) ###
      "src/builtins/x64/builtins-x64.cc",
    ]
  } else if (v8_current_cpu == "arm") {
    sources += [
      ### gcmole(arch:arm) ###
      "src/builtins/arm/builtins-arm.cc",
    ]
  } else if (v8_current_cpu == "arm64") {
    sources += [
      ### gcmole(arch:arm64) ###
      "src/builtins/arm64/builtins-arm64.cc",
    ]
  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
    sources += [
      ### gcmole(arch:mipsel) ###
      "src/builtins/mips/builtins-mips.cc",
    ]
  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    sources += [
      ### gcmole(arch:mips64el) ###
      "src/builtins/mips64/builtins-mips64.cc",
    ]
1715
  } else if (v8_current_cpu == "ppc") {
1716 1717 1718 1719
    sources += [
      ### gcmole(arch:ppc) ###
      "src/builtins/ppc/builtins-ppc.cc",
    ]
1720 1721 1722 1723 1724
  } else if (v8_current_cpu == "ppc64") {
    sources += [
      ### gcmole(arch:ppc64) ###
      "src/builtins/ppc/builtins-ppc.cc",
    ]
1725 1726 1727 1728 1729 1730 1731
  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
    sources += [
      ### gcmole(arch:s390) ###
      "src/builtins/s390/builtins-s390.cc",
    ]
  }

1732 1733 1734 1735
  if (!v8_enable_i18n_support) {
    sources -= [ "src/builtins/builtins-intl-gen.cc" ]
  }

1736
  configs = [ ":internal_config" ]
1737 1738
}

1739
v8_source_set("v8_init") {
1740 1741
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

1742 1743 1744 1745
  deps = [
    ":v8_initializers",
    ":v8_tracing",
  ]
1746 1747 1748

  sources = [
    ### gcmole(all) ###
1749
    "src/init/setup-isolate-full.cc",
1750
  ]
1751

1752
  public_deps = [ ":v8_maybe_icu" ]
1753 1754 1755 1756

  configs = [ ":internal_config" ]
}

1757 1758
# This is split out to be a non-code containing target that the Chromium browser
# DLL can depend upon to get only a version string.
1759
v8_header_set("v8_version") {
1760 1761 1762
  configs = [ ":internal_config" ]

  sources = [
1763
    "include/v8-value-serializer-version.h",
1764 1765 1766 1767 1768
    "include/v8-version-string.h",
    "include/v8-version.h",
  ]
}

1769 1770 1771 1772
# This is split out to be a non-code containing target that the Chromium browser
# can depend upon to get basic v8 types.
v8_header_set("v8_headers") {
  configs = [ ":internal_config" ]
1773
  public_configs = [ ":v8_header_features" ]
1774 1775

  sources = [
1776
    "include/v8-fast-api-calls.h",
1777
    "include/v8-internal.h",
1778 1779 1780 1781
    "include/v8.h",
    "include/v8config.h",
  ]

1782 1783 1784 1785 1786 1787 1788
  sources += [
    # The following headers cannot be platform-specific. The include validation
    # of `gn gen $dir --check` requires all header files to be available on all
    # platforms.
    "include/v8-wasm-trap-handler-posix.h",
    "include/v8-wasm-trap-handler-win.h",
  ]
1789

1790
  deps = [ ":v8_version" ]
1791 1792
}

1793 1794 1795 1796 1797
# This is split out to share basic headers with Torque.
v8_header_set("v8_shared_internal_headers") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
  configs = [ ":internal_config" ]

1798
  sources = [ "src/common/globals.h" ]
1799

1800
  deps = [ ":v8_headers" ]
1801 1802
}

1803
v8_compiler_sources = [
1804
  ### gcmole(all) ###
1805 1806 1807 1808
  "src/compiler/access-builder.cc",
  "src/compiler/access-builder.h",
  "src/compiler/access-info.cc",
  "src/compiler/access-info.h",
1809 1810
  "src/compiler/add-type-assertions-reducer.cc",
  "src/compiler/add-type-assertions-reducer.h",
1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871
  "src/compiler/all-nodes.cc",
  "src/compiler/all-nodes.h",
  "src/compiler/allocation-builder-inl.h",
  "src/compiler/allocation-builder.h",
  "src/compiler/backend/code-generator-impl.h",
  "src/compiler/backend/code-generator.cc",
  "src/compiler/backend/code-generator.h",
  "src/compiler/backend/frame-elider.cc",
  "src/compiler/backend/frame-elider.h",
  "src/compiler/backend/gap-resolver.cc",
  "src/compiler/backend/gap-resolver.h",
  "src/compiler/backend/instruction-codes.h",
  "src/compiler/backend/instruction-scheduler.cc",
  "src/compiler/backend/instruction-scheduler.h",
  "src/compiler/backend/instruction-selector-impl.h",
  "src/compiler/backend/instruction-selector.cc",
  "src/compiler/backend/instruction-selector.h",
  "src/compiler/backend/instruction.cc",
  "src/compiler/backend/instruction.h",
  "src/compiler/backend/jump-threading.cc",
  "src/compiler/backend/jump-threading.h",
  "src/compiler/backend/live-range-separator.cc",
  "src/compiler/backend/live-range-separator.h",
  "src/compiler/backend/move-optimizer.cc",
  "src/compiler/backend/move-optimizer.h",
  "src/compiler/backend/register-allocator-verifier.cc",
  "src/compiler/backend/register-allocator-verifier.h",
  "src/compiler/backend/register-allocator.cc",
  "src/compiler/backend/register-allocator.h",
  "src/compiler/backend/unwinding-info-writer.h",
  "src/compiler/basic-block-instrumentor.cc",
  "src/compiler/basic-block-instrumentor.h",
  "src/compiler/branch-elimination.cc",
  "src/compiler/branch-elimination.h",
  "src/compiler/bytecode-analysis.cc",
  "src/compiler/bytecode-analysis.h",
  "src/compiler/bytecode-graph-builder.cc",
  "src/compiler/bytecode-graph-builder.h",
  "src/compiler/bytecode-liveness-map.cc",
  "src/compiler/bytecode-liveness-map.h",
  "src/compiler/c-linkage.cc",
  "src/compiler/checkpoint-elimination.cc",
  "src/compiler/checkpoint-elimination.h",
  "src/compiler/code-assembler.cc",
  "src/compiler/code-assembler.h",
  "src/compiler/common-node-cache.cc",
  "src/compiler/common-node-cache.h",
  "src/compiler/common-operator-reducer.cc",
  "src/compiler/common-operator-reducer.h",
  "src/compiler/common-operator.cc",
  "src/compiler/common-operator.h",
  "src/compiler/compilation-dependencies.cc",
  "src/compiler/compilation-dependencies.h",
  "src/compiler/compiler-source-position-table.cc",
  "src/compiler/compiler-source-position-table.h",
  "src/compiler/constant-folding-reducer.cc",
  "src/compiler/constant-folding-reducer.h",
  "src/compiler/control-equivalence.cc",
  "src/compiler/control-equivalence.h",
  "src/compiler/control-flow-optimizer.cc",
  "src/compiler/control-flow-optimizer.h",
1872 1873
  "src/compiler/csa-load-elimination.cc",
  "src/compiler/csa-load-elimination.h",
1874 1875
  "src/compiler/dead-code-elimination.cc",
  "src/compiler/dead-code-elimination.h",
1876 1877
  "src/compiler/decompression-optimizer.cc",
  "src/compiler/decompression-optimizer.h",
1878 1879 1880 1881 1882 1883 1884
  "src/compiler/diamond.h",
  "src/compiler/effect-control-linearizer.cc",
  "src/compiler/effect-control-linearizer.h",
  "src/compiler/escape-analysis-reducer.cc",
  "src/compiler/escape-analysis-reducer.h",
  "src/compiler/escape-analysis.cc",
  "src/compiler/escape-analysis.h",
1885 1886
  "src/compiler/feedback-source.cc",
  "src/compiler/feedback-source.h",
1887 1888 1889 1890 1891
  "src/compiler/frame-states.cc",
  "src/compiler/frame-states.h",
  "src/compiler/frame.cc",
  "src/compiler/frame.h",
  "src/compiler/functional-list.h",
1892
  "src/compiler/globals.h",
1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950
  "src/compiler/graph-assembler.cc",
  "src/compiler/graph-assembler.h",
  "src/compiler/graph-reducer.cc",
  "src/compiler/graph-reducer.h",
  "src/compiler/graph-trimmer.cc",
  "src/compiler/graph-trimmer.h",
  "src/compiler/graph-visualizer.cc",
  "src/compiler/graph-visualizer.h",
  "src/compiler/graph.cc",
  "src/compiler/graph.h",
  "src/compiler/int64-lowering.cc",
  "src/compiler/int64-lowering.h",
  "src/compiler/js-call-reducer.cc",
  "src/compiler/js-call-reducer.h",
  "src/compiler/js-context-specialization.cc",
  "src/compiler/js-context-specialization.h",
  "src/compiler/js-create-lowering.cc",
  "src/compiler/js-create-lowering.h",
  "src/compiler/js-generic-lowering.cc",
  "src/compiler/js-generic-lowering.h",
  "src/compiler/js-graph.cc",
  "src/compiler/js-graph.h",
  "src/compiler/js-heap-broker.cc",
  "src/compiler/js-heap-broker.h",
  "src/compiler/js-heap-copy-reducer.cc",
  "src/compiler/js-heap-copy-reducer.h",
  "src/compiler/js-inlining-heuristic.cc",
  "src/compiler/js-inlining-heuristic.h",
  "src/compiler/js-inlining.cc",
  "src/compiler/js-inlining.h",
  "src/compiler/js-intrinsic-lowering.cc",
  "src/compiler/js-intrinsic-lowering.h",
  "src/compiler/js-native-context-specialization.cc",
  "src/compiler/js-native-context-specialization.h",
  "src/compiler/js-operator.cc",
  "src/compiler/js-operator.h",
  "src/compiler/js-type-hint-lowering.cc",
  "src/compiler/js-type-hint-lowering.h",
  "src/compiler/js-typed-lowering.cc",
  "src/compiler/js-typed-lowering.h",
  "src/compiler/linkage.cc",
  "src/compiler/linkage.h",
  "src/compiler/load-elimination.cc",
  "src/compiler/load-elimination.h",
  "src/compiler/loop-analysis.cc",
  "src/compiler/loop-analysis.h",
  "src/compiler/loop-peeling.cc",
  "src/compiler/loop-peeling.h",
  "src/compiler/loop-variable-optimizer.cc",
  "src/compiler/loop-variable-optimizer.h",
  "src/compiler/machine-graph-verifier.cc",
  "src/compiler/machine-graph-verifier.h",
  "src/compiler/machine-graph.cc",
  "src/compiler/machine-graph.h",
  "src/compiler/machine-operator-reducer.cc",
  "src/compiler/machine-operator-reducer.h",
  "src/compiler/machine-operator.cc",
  "src/compiler/machine-operator.h",
1951 1952
  "src/compiler/map-inference.cc",
  "src/compiler/map-inference.h",
1953 1954
  "src/compiler/memory-lowering.cc",
  "src/compiler/memory-lowering.h",
1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
  "src/compiler/memory-optimizer.cc",
  "src/compiler/memory-optimizer.h",
  "src/compiler/node-aux-data.h",
  "src/compiler/node-cache.h",
  "src/compiler/node-marker.cc",
  "src/compiler/node-marker.h",
  "src/compiler/node-matchers.cc",
  "src/compiler/node-matchers.h",
  "src/compiler/node-origin-table.cc",
  "src/compiler/node-origin-table.h",
  "src/compiler/node-properties.cc",
  "src/compiler/node-properties.h",
  "src/compiler/node.cc",
  "src/compiler/node.h",
  "src/compiler/opcodes.cc",
  "src/compiler/opcodes.h",
  "src/compiler/operation-typer.cc",
  "src/compiler/operation-typer.h",
  "src/compiler/operator-properties.cc",
  "src/compiler/operator-properties.h",
  "src/compiler/operator.cc",
  "src/compiler/operator.h",
  "src/compiler/osr.cc",
  "src/compiler/osr.h",
  "src/compiler/per-isolate-compiler-cache.h",
  "src/compiler/persistent-map.h",
  "src/compiler/pipeline-statistics.cc",
  "src/compiler/pipeline-statistics.h",
  "src/compiler/pipeline.cc",
  "src/compiler/pipeline.h",
  "src/compiler/property-access-builder.cc",
  "src/compiler/property-access-builder.h",
  "src/compiler/raw-machine-assembler.cc",
  "src/compiler/raw-machine-assembler.h",
  "src/compiler/redundancy-elimination.cc",
  "src/compiler/redundancy-elimination.h",
  "src/compiler/refs-map.cc",
  "src/compiler/refs-map.h",
  "src/compiler/representation-change.cc",
  "src/compiler/representation-change.h",
  "src/compiler/schedule.cc",
  "src/compiler/schedule.h",
1997 1998
  "src/compiler/scheduled-machine-lowering.cc",
  "src/compiler/scheduled-machine-lowering.h",
1999 2000 2001 2002 2003 2004
  "src/compiler/scheduler.cc",
  "src/compiler/scheduler.h",
  "src/compiler/select-lowering.cc",
  "src/compiler/select-lowering.h",
  "src/compiler/serializer-for-background-compilation.cc",
  "src/compiler/serializer-for-background-compilation.h",
2005
  "src/compiler/serializer-hints.h",
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033
  "src/compiler/simd-scalar-lowering.cc",
  "src/compiler/simd-scalar-lowering.h",
  "src/compiler/simplified-lowering.cc",
  "src/compiler/simplified-lowering.h",
  "src/compiler/simplified-operator-reducer.cc",
  "src/compiler/simplified-operator-reducer.h",
  "src/compiler/simplified-operator.cc",
  "src/compiler/simplified-operator.h",
  "src/compiler/state-values-utils.cc",
  "src/compiler/state-values-utils.h",
  "src/compiler/store-store-elimination.cc",
  "src/compiler/store-store-elimination.h",
  "src/compiler/type-cache.cc",
  "src/compiler/type-cache.h",
  "src/compiler/type-narrowing-reducer.cc",
  "src/compiler/type-narrowing-reducer.h",
  "src/compiler/typed-optimization.cc",
  "src/compiler/typed-optimization.h",
  "src/compiler/typer.cc",
  "src/compiler/typer.h",
  "src/compiler/types.cc",
  "src/compiler/types.h",
  "src/compiler/value-numbering-reducer.cc",
  "src/compiler/value-numbering-reducer.h",
  "src/compiler/verifier.cc",
  "src/compiler/verifier.h",
  "src/compiler/wasm-compiler.cc",
  "src/compiler/wasm-compiler.h",
2034
  "src/compiler/write-barrier-kind.h",
2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047
  "src/compiler/zone-stats.cc",
  "src/compiler/zone-stats.h",
]

# The src/compiler files with optimizations.
v8_source_set("v8_compiler_opt") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = v8_compiler_sources

  public_deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
2048
    ":v8_maybe_icu",
2049
    ":v8_tracing",
2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072
  ]

  if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
    # The :no_optimize config is added to v8_add_configs in v8.gni.
    remove_configs = [ "//build/config/compiler:no_optimize" ]
    configs = [ ":always_optimize" ]
  } else {
    # Without this else branch, gn fails to generate build files for non-debug
    # builds (because we try to remove a config that is not present).
    # So we include it, even if this config is not used outside of debug builds.
    configs = [ ":internal_config" ]
  }
}

# The src/compiler files with default optimization behavior.
v8_source_set("v8_compiler") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = v8_compiler_sources

  public_deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
2073
    ":v8_maybe_icu",
2074
    ":v8_tracing",
2075 2076 2077 2078 2079 2080 2081
  ]

  configs = [ ":internal_config" ]
}

group("v8_compiler_for_mksnapshot") {
  if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
2082
    deps = [ ":v8_compiler_opt" ]
2083
  } else {
2084
    deps = [ ":v8_compiler" ]
2085 2086 2087
  }
}

2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099
# Any target using trace events must directly or indirectly depend on
# v8_tracing.
group("v8_tracing") {
  if (v8_use_perfetto) {
    if (build_with_chromium) {
      public_deps = [ "//third_party/perfetto:libperfetto" ]
    } else {
      public_deps = [ ":v8_libperfetto" ]
    }
  }
}

2100
v8_source_set("v8_base_without_compiler") {
2101
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
2102

2103 2104 2105
  # Split static libraries on windows into two.
  split_count = 2

2106
  sources = [
2107
    "//base/trace_event/common/trace_event_common.h",
2108 2109

    ### gcmole(all) ###
2110
    "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
2111
    "include/cppgc/common.h",
2112
    "include/v8-fast-api-calls.h",
2113 2114
    "include/v8-inspector-protocol.h",
    "include/v8-inspector.h",
2115
    "include/v8-internal.h",
machenbach's avatar
machenbach committed
2116 2117 2118
    "include/v8-platform.h",
    "include/v8-profiler.h",
    "include/v8-util.h",
2119
    "include/v8-wasm-trap-handler-posix.h",
machenbach's avatar
machenbach committed
2120 2121
    "include/v8.h",
    "include/v8config.h",
2122 2123 2124 2125 2126 2127 2128
    "src/api/api-arguments-inl.h",
    "src/api/api-arguments.cc",
    "src/api/api-arguments.h",
    "src/api/api-natives.cc",
    "src/api/api-natives.h",
    "src/api/api.cc",
    "src/api/api.h",
2129 2130
    "src/asmjs/asm-js.cc",
    "src/asmjs/asm-js.h",
2131
    "src/asmjs/asm-names.h",
2132 2133
    "src/asmjs/asm-parser.cc",
    "src/asmjs/asm-parser.h",
2134 2135
    "src/asmjs/asm-scanner.cc",
    "src/asmjs/asm-scanner.h",
2136 2137
    "src/asmjs/asm-types.cc",
    "src/asmjs/asm-types.h",
2138 2139
    "src/ast/ast-function-literal-id-reindexer.cc",
    "src/ast/ast-function-literal-id-reindexer.h",
2140
    "src/ast/ast-source-ranges.h",
2141
    "src/ast/ast-traversal-visitor.h",
2142 2143 2144 2145 2146 2147 2148 2149 2150 2151
    "src/ast/ast-value-factory.cc",
    "src/ast/ast-value-factory.h",
    "src/ast/ast.cc",
    "src/ast/ast.h",
    "src/ast/modules.cc",
    "src/ast/modules.h",
    "src/ast/prettyprinter.cc",
    "src/ast/prettyprinter.h",
    "src/ast/scopes.cc",
    "src/ast/scopes.h",
2152 2153
    "src/ast/source-range-ast-visitor.cc",
    "src/ast/source-range-ast-visitor.h",
2154 2155
    "src/ast/variables.cc",
    "src/ast/variables.h",
2156 2157
    "src/builtins/accessors.cc",
    "src/builtins/accessors.h",
2158
    "src/builtins/builtins-api.cc",
2159
    "src/builtins/builtins-array.cc",
2160
    "src/builtins/builtins-arraybuffer.cc",
2161
    "src/builtins/builtins-async-module.cc",
2162
    "src/builtins/builtins-bigint.cc",
2163
    "src/builtins/builtins-call.cc",
2164
    "src/builtins/builtins-callsite.cc",
2165
    "src/builtins/builtins-collections.cc",
2166
    "src/builtins/builtins-console.cc",
2167
    "src/builtins/builtins-constructor.h",
2168 2169
    "src/builtins/builtins-dataview.cc",
    "src/builtins/builtins-date.cc",
2170
    "src/builtins/builtins-definitions.h",
2171
    "src/builtins/builtins-descriptors.h",
jgruber's avatar
jgruber committed
2172
    "src/builtins/builtins-error.cc",
2173 2174 2175
    "src/builtins/builtins-function.cc",
    "src/builtins/builtins-global.cc",
    "src/builtins/builtins-internal.cc",
2176
    "src/builtins/builtins-intl.cc",
2177 2178 2179
    "src/builtins/builtins-json.cc",
    "src/builtins/builtins-number.cc",
    "src/builtins/builtins-object.cc",
2180
    "src/builtins/builtins-promise.h",
2181
    "src/builtins/builtins-reflect.cc",
2182
    "src/builtins/builtins-regexp.cc",
2183 2184 2185
    "src/builtins/builtins-sharedarraybuffer.cc",
    "src/builtins/builtins-string.cc",
    "src/builtins/builtins-symbol.cc",
2186
    "src/builtins/builtins-trace.cc",
2187
    "src/builtins/builtins-typed-array.cc",
2188
    "src/builtins/builtins-utils-inl.h",
2189
    "src/builtins/builtins-utils.h",
2190
    "src/builtins/builtins-weak-refs.cc",
2191 2192
    "src/builtins/builtins.cc",
    "src/builtins/builtins.h",
2193 2194
    "src/builtins/constants-table-builder.cc",
    "src/builtins/constants-table-builder.h",
2195 2196 2197 2198 2199 2200
    "src/codegen/assembler-arch.h",
    "src/codegen/assembler-inl.h",
    "src/codegen/assembler.cc",
    "src/codegen/assembler.h",
    "src/codegen/bailout-reason.cc",
    "src/codegen/bailout-reason.h",
2201
    "src/codegen/callable.h",
2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217
    "src/codegen/code-comments.cc",
    "src/codegen/code-comments.h",
    "src/codegen/code-desc.cc",
    "src/codegen/code-desc.h",
    "src/codegen/code-factory.cc",
    "src/codegen/code-factory.h",
    "src/codegen/code-reference.cc",
    "src/codegen/code-reference.h",
    "src/codegen/compilation-cache.cc",
    "src/codegen/compilation-cache.h",
    "src/codegen/compiler.cc",
    "src/codegen/compiler.h",
    "src/codegen/constant-pool.cc",
    "src/codegen/constant-pool.h",
    "src/codegen/constants-arch.h",
    "src/codegen/cpu-features.h",
2218 2219
    "src/codegen/external-reference-encoder.cc",
    "src/codegen/external-reference-encoder.h",
2220 2221 2222 2223
    "src/codegen/external-reference-table.cc",
    "src/codegen/external-reference-table.h",
    "src/codegen/external-reference.cc",
    "src/codegen/external-reference.h",
2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236
    "src/codegen/flush-instruction-cache.cc",
    "src/codegen/flush-instruction-cache.h",
    "src/codegen/handler-table.cc",
    "src/codegen/handler-table.h",
    "src/codegen/interface-descriptors.cc",
    "src/codegen/interface-descriptors.h",
    "src/codegen/label.h",
    "src/codegen/machine-type.cc",
    "src/codegen/machine-type.h",
    "src/codegen/macro-assembler-inl.h",
    "src/codegen/macro-assembler.h",
    "src/codegen/optimized-compilation-info.cc",
    "src/codegen/optimized-compilation-info.h",
2237 2238
    "src/codegen/pending-optimization-table.cc",
    "src/codegen/pending-optimization-table.h",
2239 2240 2241
    "src/codegen/register-arch.h",
    "src/codegen/register-configuration.cc",
    "src/codegen/register-configuration.h",
2242
    "src/codegen/register.cc",
2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255
    "src/codegen/register.h",
    "src/codegen/reglist.h",
    "src/codegen/reloc-info.cc",
    "src/codegen/reloc-info.h",
    "src/codegen/safepoint-table.cc",
    "src/codegen/safepoint-table.h",
    "src/codegen/signature.h",
    "src/codegen/source-position-table.cc",
    "src/codegen/source-position-table.h",
    "src/codegen/source-position.cc",
    "src/codegen/source-position.h",
    "src/codegen/string-constants.cc",
    "src/codegen/string-constants.h",
2256 2257
    "src/codegen/tick-counter.cc",
    "src/codegen/tick-counter.h",
2258
    "src/codegen/tnode.cc",
2259
    "src/codegen/tnode.h",
2260 2261 2262 2263
    "src/codegen/turbo-assembler.cc",
    "src/codegen/turbo-assembler.h",
    "src/codegen/unoptimized-compilation-info.cc",
    "src/codegen/unoptimized-compilation-info.h",
2264 2265 2266
    "src/common/assert-scope.cc",
    "src/common/assert-scope.h",
    "src/common/checks.h",
2267 2268
    "src/common/external-pointer-inl.h",
    "src/common/external-pointer.h",
2269
    "src/common/message-template.h",
2270 2271
    "src/common/ptr-compr-inl.h",
    "src/common/ptr-compr.h",
2272 2273
    "src/compiler-dispatcher/compiler-dispatcher.cc",
    "src/compiler-dispatcher/compiler-dispatcher.h",
2274 2275
    "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
    "src/compiler-dispatcher/optimizing-compile-dispatcher.h",
Yang Guo's avatar
Yang Guo committed
2276 2277 2278 2279 2280
    "src/date/date.cc",
    "src/date/date.h",
    "src/date/dateparser-inl.h",
    "src/date/dateparser.cc",
    "src/date/dateparser.h",
2281 2282
    "src/debug/debug-coverage.cc",
    "src/debug/debug-coverage.h",
2283 2284 2285 2286
    "src/debug/debug-evaluate.cc",
    "src/debug/debug-evaluate.h",
    "src/debug/debug-frames.cc",
    "src/debug/debug-frames.h",
2287
    "src/debug/debug-interface.h",
2288 2289
    "src/debug/debug-property-iterator.cc",
    "src/debug/debug-property-iterator.h",
2290 2291
    "src/debug/debug-scope-iterator.cc",
    "src/debug/debug-scope-iterator.h",
2292 2293
    "src/debug/debug-scopes.cc",
    "src/debug/debug-scopes.h",
2294 2295
    "src/debug/debug-stack-trace-iterator.cc",
    "src/debug/debug-stack-trace-iterator.h",
2296 2297
    "src/debug/debug-type-profile.cc",
    "src/debug/debug-type-profile.h",
2298 2299
    "src/debug/debug.cc",
    "src/debug/debug.h",
2300
    "src/debug/interface-types.h",
2301 2302
    "src/debug/liveedit.cc",
    "src/debug/liveedit.h",
2303 2304 2305 2306
    "src/deoptimizer/deoptimize-reason.cc",
    "src/deoptimizer/deoptimize-reason.h",
    "src/deoptimizer/deoptimizer.cc",
    "src/deoptimizer/deoptimizer.h",
2307 2308
    "src/diagnostics/basic-block-profiler.cc",
    "src/diagnostics/basic-block-profiler.h",
2309
    "src/diagnostics/code-tracer.h",
2310 2311
    "src/diagnostics/compilation-statistics.cc",
    "src/diagnostics/compilation-statistics.h",
2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323
    "src/diagnostics/disasm.h",
    "src/diagnostics/disassembler.cc",
    "src/diagnostics/disassembler.h",
    "src/diagnostics/eh-frame.cc",
    "src/diagnostics/eh-frame.h",
    "src/diagnostics/gdb-jit.cc",
    "src/diagnostics/gdb-jit.h",
    "src/diagnostics/objects-debug.cc",
    "src/diagnostics/objects-printer.cc",
    "src/diagnostics/perf-jit.cc",
    "src/diagnostics/perf-jit.h",
    "src/diagnostics/unwinder.cc",
2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334
    "src/execution/arguments-inl.h",
    "src/execution/arguments.cc",
    "src/execution/arguments.h",
    "src/execution/execution.cc",
    "src/execution/execution.h",
    "src/execution/frame-constants.h",
    "src/execution/frames-inl.h",
    "src/execution/frames.cc",
    "src/execution/frames.h",
    "src/execution/futex-emulation.cc",
    "src/execution/futex-emulation.h",
2335 2336
    "src/execution/interrupts-scope.cc",
    "src/execution/interrupts-scope.h",
2337 2338
    "src/execution/isolate-data.h",
    "src/execution/isolate-inl.h",
2339
    "src/execution/isolate-utils.h",
2340 2341 2342 2343 2344 2345
    "src/execution/isolate.cc",
    "src/execution/isolate.h",
    "src/execution/messages.cc",
    "src/execution/messages.h",
    "src/execution/microtask-queue.cc",
    "src/execution/microtask-queue.h",
2346
    "src/execution/off-thread-isolate-inl.h",
2347
    "src/execution/off-thread-isolate.cc",
2348
    "src/execution/off-thread-isolate.h",
2349
    "src/execution/pointer-authentication.h",
2350 2351 2352
    "src/execution/protectors-inl.h",
    "src/execution/protectors.cc",
    "src/execution/protectors.h",
2353 2354 2355 2356 2357
    "src/execution/runtime-profiler.cc",
    "src/execution/runtime-profiler.h",
    "src/execution/simulator-base.cc",
    "src/execution/simulator-base.h",
    "src/execution/simulator.h",
2358 2359
    "src/execution/stack-guard.cc",
    "src/execution/stack-guard.h",
2360 2361 2362 2363
    "src/execution/thread-id.cc",
    "src/execution/thread-id.h",
    "src/execution/thread-local-top.cc",
    "src/execution/thread-local-top.h",
2364 2365
    "src/execution/v8threads.cc",
    "src/execution/v8threads.h",
2366 2367
    "src/execution/vm-state-inl.h",
    "src/execution/vm-state.h",
Tianyou Li's avatar
Tianyou Li committed
2368 2369
    "src/extensions/cputracemark-extension.cc",
    "src/extensions/cputracemark-extension.h",
2370 2371 2372 2373
    "src/extensions/externalize-string-extension.cc",
    "src/extensions/externalize-string-extension.h",
    "src/extensions/gc-extension.cc",
    "src/extensions/gc-extension.h",
2374 2375
    "src/extensions/ignition-statistics-extension.cc",
    "src/extensions/ignition-statistics-extension.h",
2376 2377 2378 2379
    "src/extensions/statistics-extension.cc",
    "src/extensions/statistics-extension.h",
    "src/extensions/trigger-failure-extension.cc",
    "src/extensions/trigger-failure-extension.h",
2380 2381 2382
    "src/flags/flag-definitions.h",
    "src/flags/flags.cc",
    "src/flags/flags.h",
2383 2384 2385 2386 2387
    "src/handles/global-handles.cc",
    "src/handles/global-handles.h",
    "src/handles/handles-inl.h",
    "src/handles/handles.cc",
    "src/handles/handles.h",
2388 2389 2390
    "src/handles/local-handles-inl.h",
    "src/handles/local-handles.cc",
    "src/handles/local-handles.h",
2391 2392
    "src/handles/maybe-handles-inl.h",
    "src/handles/maybe-handles.h",
2393 2394
    "src/handles/persistent-handles.cc",
    "src/handles/persistent-handles.h",
2395 2396
    "src/heap/array-buffer-collector.cc",
    "src/heap/array-buffer-collector.h",
2397 2398
    "src/heap/array-buffer-sweeper.cc",
    "src/heap/array-buffer-sweeper.h",
2399
    "src/heap/array-buffer-tracker-inl.h",
2400 2401
    "src/heap/array-buffer-tracker.cc",
    "src/heap/array-buffer-tracker.h",
2402
    "src/heap/barrier.h",
2403 2404
    "src/heap/basic-memory-chunk.cc",
    "src/heap/basic-memory-chunk.h",
2405 2406
    "src/heap/code-object-registry.cc",
    "src/heap/code-object-registry.h",
2407 2408
    "src/heap/code-stats.cc",
    "src/heap/code-stats.h",
2409 2410
    "src/heap/combined-heap.cc",
    "src/heap/combined-heap.h",
2411
    "src/heap/concurrent-allocator-inl.h",
2412
    "src/heap/concurrent-allocator.cc",
2413
    "src/heap/concurrent-allocator.h",
2414 2415
    "src/heap/concurrent-marking.cc",
    "src/heap/concurrent-marking.h",
2416 2417
    "src/heap/embedder-tracing.cc",
    "src/heap/embedder-tracing.h",
2418 2419
    "src/heap/factory-base.cc",
    "src/heap/factory-base.h",
2420 2421 2422
    "src/heap/factory-inl.h",
    "src/heap/factory.cc",
    "src/heap/factory.h",
2423 2424
    "src/heap/finalization-registry-cleanup-task.cc",
    "src/heap/finalization-registry-cleanup-task.h",
2425 2426
    "src/heap/gc-idle-time-handler.cc",
    "src/heap/gc-idle-time-handler.h",
2427 2428
    "src/heap/gc-tracer.cc",
    "src/heap/gc-tracer.h",
2429 2430
    "src/heap/heap-controller.cc",
    "src/heap/heap-controller.h",
2431
    "src/heap/heap-inl.h",
2432 2433
    "src/heap/heap-write-barrier-inl.h",
    "src/heap/heap-write-barrier.h",
2434 2435
    "src/heap/heap.cc",
    "src/heap/heap.h",
2436
    "src/heap/incremental-marking-inl.h",
2437 2438
    "src/heap/incremental-marking-job.cc",
    "src/heap/incremental-marking-job.h",
2439 2440
    "src/heap/incremental-marking.cc",
    "src/heap/incremental-marking.h",
2441 2442 2443
    "src/heap/invalidated-slots-inl.h",
    "src/heap/invalidated-slots.cc",
    "src/heap/invalidated-slots.h",
2444
    "src/heap/item-parallel-job.cc",
2445
    "src/heap/item-parallel-job.h",
2446 2447
    "src/heap/large-spaces.cc",
    "src/heap/large-spaces.h",
2448
    "src/heap/list.h",
2449
    "src/heap/local-allocator-inl.h",
2450
    "src/heap/local-allocator.h",
2451 2452
    "src/heap/local-heap.cc",
    "src/heap/local-heap.h",
2453 2454 2455
    "src/heap/mark-compact-inl.h",
    "src/heap/mark-compact.cc",
    "src/heap/mark-compact.h",
2456 2457
    "src/heap/marking-visitor-inl.h",
    "src/heap/marking-visitor.h",
2458 2459
    "src/heap/marking-worklist.cc",
    "src/heap/marking-worklist.h",
2460
    "src/heap/marking.cc",
2461
    "src/heap/marking.h",
2462 2463
    "src/heap/memory-allocator.cc",
    "src/heap/memory-allocator.h",
2464 2465 2466
    "src/heap/memory-chunk-inl.h",
    "src/heap/memory-chunk.cc",
    "src/heap/memory-chunk.h",
2467
    "src/heap/memory-measurement-inl.h",
2468 2469
    "src/heap/memory-measurement.cc",
    "src/heap/memory-measurement.h",
2470 2471
    "src/heap/memory-reducer.cc",
    "src/heap/memory-reducer.h",
2472 2473 2474
    "src/heap/new-spaces-inl.h",
    "src/heap/new-spaces.cc",
    "src/heap/new-spaces.h",
2475 2476
    "src/heap/object-stats.cc",
    "src/heap/object-stats.h",
2477 2478 2479
    "src/heap/objects-visiting-inl.h",
    "src/heap/objects-visiting.cc",
    "src/heap/objects-visiting.h",
2480 2481
    "src/heap/off-thread-factory.cc",
    "src/heap/off-thread-factory.h",
2482 2483
    "src/heap/off-thread-heap.cc",
    "src/heap/off-thread-heap.h",
2484 2485 2486
    "src/heap/paged-spaces-inl.h",
    "src/heap/paged-spaces.cc",
    "src/heap/paged-spaces.h",
2487
    "src/heap/read-only-heap-inl.h",
2488 2489
    "src/heap/read-only-heap.cc",
    "src/heap/read-only-heap.h",
2490 2491
    "src/heap/read-only-spaces.cc",
    "src/heap/read-only-spaces.h",
2492
    "src/heap/remembered-set.h",
2493 2494
    "src/heap/safepoint.cc",
    "src/heap/safepoint.h",
ulan's avatar
ulan committed
2495
    "src/heap/scavenge-job.cc",
jochen's avatar
jochen committed
2496
    "src/heap/scavenge-job.h",
2497 2498 2499
    "src/heap/scavenger-inl.h",
    "src/heap/scavenger.cc",
    "src/heap/scavenger.h",
2500
    "src/heap/slot-set.cc",
ulan's avatar
ulan committed
2501
    "src/heap/slot-set.h",
2502 2503 2504
    "src/heap/spaces-inl.h",
    "src/heap/spaces.cc",
    "src/heap/spaces.h",
2505 2506
    "src/heap/stress-marking-observer.cc",
    "src/heap/stress-marking-observer.h",
2507 2508
    "src/heap/stress-scavenge-observer.cc",
    "src/heap/stress-scavenge-observer.h",
2509 2510
    "src/heap/sweeper.cc",
    "src/heap/sweeper.h",
2511
    "src/heap/worklist.h",
2512 2513
    "src/ic/call-optimization.cc",
    "src/ic/call-optimization.h",
2514
    "src/ic/handler-configuration-inl.h",
2515
    "src/ic/handler-configuration.cc",
2516
    "src/ic/handler-configuration.h",
2517
    "src/ic/ic-inl.h",
2518 2519
    "src/ic/ic-stats.cc",
    "src/ic/ic-stats.h",
2520 2521 2522 2523
    "src/ic/ic.cc",
    "src/ic/ic.h",
    "src/ic/stub-cache.cc",
    "src/ic/stub-cache.h",
2524 2525
    "src/init/bootstrapper.cc",
    "src/init/bootstrapper.h",
2526
    "src/init/heap-symbols.h",
2527 2528 2529 2530 2531 2532 2533
    "src/init/icu_util.cc",
    "src/init/icu_util.h",
    "src/init/isolate-allocator.cc",
    "src/init/isolate-allocator.h",
    "src/init/setup-isolate.h",
    "src/init/startup-data-util.cc",
    "src/init/startup-data-util.h",
2534 2535
    "src/init/v8.cc",
    "src/init/v8.h",
2536
    "src/interpreter/block-coverage-builder.h",
2537 2538
    "src/interpreter/bytecode-array-accessor.cc",
    "src/interpreter/bytecode-array-accessor.h",
2539 2540
    "src/interpreter/bytecode-array-builder.cc",
    "src/interpreter/bytecode-array-builder.h",
2541 2542
    "src/interpreter/bytecode-array-iterator.cc",
    "src/interpreter/bytecode-array-iterator.h",
2543 2544
    "src/interpreter/bytecode-array-random-iterator.cc",
    "src/interpreter/bytecode-array-random-iterator.h",
2545 2546
    "src/interpreter/bytecode-array-writer.cc",
    "src/interpreter/bytecode-array-writer.h",
2547 2548 2549 2550
    "src/interpreter/bytecode-decoder.cc",
    "src/interpreter/bytecode-decoder.h",
    "src/interpreter/bytecode-flags.cc",
    "src/interpreter/bytecode-flags.h",
2551 2552
    "src/interpreter/bytecode-generator.cc",
    "src/interpreter/bytecode-generator.h",
2553
    "src/interpreter/bytecode-jump-table.h",
2554
    "src/interpreter/bytecode-label.cc",
2555
    "src/interpreter/bytecode-label.h",
2556 2557
    "src/interpreter/bytecode-node.cc",
    "src/interpreter/bytecode-node.h",
2558 2559
    "src/interpreter/bytecode-operands.cc",
    "src/interpreter/bytecode-operands.h",
2560
    "src/interpreter/bytecode-register-allocator.h",
2561 2562
    "src/interpreter/bytecode-register-optimizer.cc",
    "src/interpreter/bytecode-register-optimizer.h",
2563 2564
    "src/interpreter/bytecode-register.cc",
    "src/interpreter/bytecode-register.h",
2565 2566
    "src/interpreter/bytecode-source-info.cc",
    "src/interpreter/bytecode-source-info.h",
2567
    "src/interpreter/bytecode-traits.h",
jochen's avatar
jochen committed
2568 2569
    "src/interpreter/bytecodes.cc",
    "src/interpreter/bytecodes.h",
2570 2571
    "src/interpreter/constant-array-builder.cc",
    "src/interpreter/constant-array-builder.h",
2572 2573
    "src/interpreter/control-flow-builders.cc",
    "src/interpreter/control-flow-builders.h",
2574 2575
    "src/interpreter/handler-table-builder.cc",
    "src/interpreter/handler-table-builder.h",
2576
    "src/interpreter/interpreter-generator.h",
2577 2578
    "src/interpreter/interpreter-intrinsics.cc",
    "src/interpreter/interpreter-intrinsics.h",
jochen's avatar
jochen committed
2579 2580
    "src/interpreter/interpreter.cc",
    "src/interpreter/interpreter.h",
Yang Guo's avatar
Yang Guo committed
2581 2582 2583 2584
    "src/json/json-parser.cc",
    "src/json/json-parser.h",
    "src/json/json-stringifier.cc",
    "src/json/json-stringifier.h",
2585
    "src/logging/code-events.h",
2586 2587 2588 2589 2590 2591 2592 2593 2594
    "src/logging/counters-definitions.h",
    "src/logging/counters-inl.h",
    "src/logging/counters.cc",
    "src/logging/counters.h",
    "src/logging/log-inl.h",
    "src/logging/log-utils.cc",
    "src/logging/log-utils.h",
    "src/logging/log.cc",
    "src/logging/log.h",
2595
    "src/logging/off-thread-logger.h",
2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613
    "src/numbers/bignum-dtoa.cc",
    "src/numbers/bignum-dtoa.h",
    "src/numbers/bignum.cc",
    "src/numbers/bignum.h",
    "src/numbers/cached-powers.cc",
    "src/numbers/cached-powers.h",
    "src/numbers/conversions-inl.h",
    "src/numbers/conversions.cc",
    "src/numbers/conversions.h",
    "src/numbers/diy-fp.cc",
    "src/numbers/diy-fp.h",
    "src/numbers/double.h",
    "src/numbers/dtoa.cc",
    "src/numbers/dtoa.h",
    "src/numbers/fast-dtoa.cc",
    "src/numbers/fast-dtoa.h",
    "src/numbers/fixed-dtoa.cc",
    "src/numbers/fixed-dtoa.h",
2614
    "src/numbers/hash-seed-inl.h",
2615 2616 2617 2618
    "src/numbers/math-random.cc",
    "src/numbers/math-random.h",
    "src/numbers/strtod.cc",
    "src/numbers/strtod.h",
2619
    "src/objects/allocation-site-inl.h",
2620 2621
    "src/objects/allocation-site-scopes-inl.h",
    "src/objects/allocation-site-scopes.h",
2622
    "src/objects/allocation-site.h",
2623 2624
    "src/objects/api-callbacks-inl.h",
    "src/objects/api-callbacks.h",
2625 2626
    "src/objects/arguments-inl.h",
    "src/objects/arguments.h",
2627 2628
    "src/objects/backing-store.cc",
    "src/objects/backing-store.h",
2629 2630
    "src/objects/bigint.cc",
    "src/objects/bigint.h",
2631 2632
    "src/objects/cell-inl.h",
    "src/objects/cell.h",
2633
    "src/objects/code-inl.h",
2634
    "src/objects/code.cc",
2635
    "src/objects/code.h",
2636 2637
    "src/objects/compilation-cache-inl.h",
    "src/objects/compilation-cache.h",
2638 2639
    "src/objects/compressed-slots-inl.h",
    "src/objects/compressed-slots.h",
2640 2641 2642
    "src/objects/contexts-inl.h",
    "src/objects/contexts.cc",
    "src/objects/contexts.h",
2643
    "src/objects/data-handler.h",
2644 2645 2646
    "src/objects/debug-objects-inl.h",
    "src/objects/debug-objects.cc",
    "src/objects/debug-objects.h",
2647
    "src/objects/descriptor-array-inl.h",
2648
    "src/objects/descriptor-array.h",
2649
    "src/objects/dictionary-inl.h",
2650
    "src/objects/dictionary.h",
2651 2652 2653 2654 2655
    "src/objects/elements-inl.h",
    "src/objects/elements-kind.cc",
    "src/objects/elements-kind.h",
    "src/objects/elements.cc",
    "src/objects/elements.h",
2656 2657 2658
    "src/objects/embedder-data-array-inl.h",
    "src/objects/embedder-data-array.cc",
    "src/objects/embedder-data-array.h",
2659 2660
    "src/objects/embedder-data-slot-inl.h",
    "src/objects/embedder-data-slot.h",
2661 2662
    "src/objects/feedback-cell-inl.h",
    "src/objects/feedback-cell.h",
2663 2664 2665
    "src/objects/feedback-vector-inl.h",
    "src/objects/feedback-vector.cc",
    "src/objects/feedback-vector.h",
2666 2667 2668 2669
    "src/objects/field-index-inl.h",
    "src/objects/field-index.h",
    "src/objects/field-type.cc",
    "src/objects/field-type.h",
2670 2671
    "src/objects/fixed-array-inl.h",
    "src/objects/fixed-array.h",
2672 2673
    "src/objects/frame-array-inl.h",
    "src/objects/frame-array.h",
2674
    "src/objects/function-kind.h",
2675
    "src/objects/hash-table-inl.h",
2676
    "src/objects/hash-table.h",
2677 2678
    "src/objects/heap-number-inl.h",
    "src/objects/heap-number.h",
2679 2680
    "src/objects/heap-object-inl.h",
    "src/objects/heap-object.h",
2681 2682
    "src/objects/instance-type-inl.h",
    "src/objects/instance-type.h",
2683
    "src/objects/internal-index.h",
2684 2685
    "src/objects/intl-objects.cc",
    "src/objects/intl-objects.h",
2686 2687
    "src/objects/js-aggregate-error-inl.h",
    "src/objects/js-aggregate-error.h",
2688
    "src/objects/js-array-buffer-inl.h",
2689
    "src/objects/js-array-buffer.cc",
2690
    "src/objects/js-array-buffer.h",
2691 2692
    "src/objects/js-array-inl.h",
    "src/objects/js-array.h",
2693 2694 2695
    "src/objects/js-break-iterator-inl.h",
    "src/objects/js-break-iterator.cc",
    "src/objects/js-break-iterator.h",
2696 2697 2698
    "src/objects/js-collator-inl.h",
    "src/objects/js-collator.cc",
    "src/objects/js-collator.h",
2699
    "src/objects/js-collection-inl.h",
2700
    "src/objects/js-collection-iterator.h",
2701
    "src/objects/js-collection.h",
2702 2703 2704
    "src/objects/js-date-time-format-inl.h",
    "src/objects/js-date-time-format.cc",
    "src/objects/js-date-time-format.h",
2705 2706 2707
    "src/objects/js-display-names-inl.h",
    "src/objects/js-display-names.cc",
    "src/objects/js-display-names.h",
2708 2709
    "src/objects/js-generator-inl.h",
    "src/objects/js-generator.h",
2710 2711 2712
    "src/objects/js-list-format-inl.h",
    "src/objects/js-list-format.cc",
    "src/objects/js-list-format.h",
2713 2714 2715
    "src/objects/js-locale-inl.h",
    "src/objects/js-locale.cc",
    "src/objects/js-locale.h",
2716 2717 2718
    "src/objects/js-number-format-inl.h",
    "src/objects/js-number-format.cc",
    "src/objects/js-number-format.h",
2719
    "src/objects/js-objects-inl.h",
2720
    "src/objects/js-objects.cc",
2721
    "src/objects/js-objects.h",
2722 2723 2724
    "src/objects/js-plural-rules-inl.h",
    "src/objects/js-plural-rules.cc",
    "src/objects/js-plural-rules.h",
2725 2726
    "src/objects/js-promise-inl.h",
    "src/objects/js-promise.h",
2727 2728
    "src/objects/js-proxy-inl.h",
    "src/objects/js-proxy.h",
2729
    "src/objects/js-regexp-inl.h",
2730 2731
    "src/objects/js-regexp-string-iterator-inl.h",
    "src/objects/js-regexp-string-iterator.h",
2732
    "src/objects/js-regexp.cc",
2733
    "src/objects/js-regexp.h",
2734 2735 2736
    "src/objects/js-relative-time-format-inl.h",
    "src/objects/js-relative-time-format.cc",
    "src/objects/js-relative-time-format.h",
2737 2738 2739
    "src/objects/js-segment-iterator-inl.h",
    "src/objects/js-segment-iterator.cc",
    "src/objects/js-segment-iterator.h",
2740 2741 2742
    "src/objects/js-segmenter-inl.h",
    "src/objects/js-segmenter.cc",
    "src/objects/js-segmenter.h",
2743 2744
    "src/objects/js-weak-refs-inl.h",
    "src/objects/js-weak-refs.h",
2745 2746
    "src/objects/keys.cc",
    "src/objects/keys.h",
2747 2748 2749
    "src/objects/layout-descriptor-inl.h",
    "src/objects/layout-descriptor.cc",
    "src/objects/layout-descriptor.h",
2750
    "src/objects/literal-objects-inl.h",
2751 2752
    "src/objects/literal-objects.cc",
    "src/objects/literal-objects.h",
2753 2754 2755 2756 2757 2758
    "src/objects/lookup-cache-inl.h",
    "src/objects/lookup-cache.cc",
    "src/objects/lookup-cache.h",
    "src/objects/lookup-inl.h",
    "src/objects/lookup.cc",
    "src/objects/lookup.h",
2759 2760
    "src/objects/managed.cc",
    "src/objects/managed.h",
2761
    "src/objects/map-inl.h",
2762 2763
    "src/objects/map-updater.cc",
    "src/objects/map-updater.h",
2764
    "src/objects/map.cc",
2765
    "src/objects/map.h",
2766 2767
    "src/objects/maybe-object-inl.h",
    "src/objects/maybe-object.h",
2768 2769
    "src/objects/microtask-inl.h",
    "src/objects/microtask.h",
2770 2771 2772
    "src/objects/module-inl.h",
    "src/objects/module.cc",
    "src/objects/module.h",
2773 2774
    "src/objects/name-inl.h",
    "src/objects/name.h",
2775
    "src/objects/object-list-macros.h",
2776 2777
    "src/objects/object-macros-undef.h",
    "src/objects/object-macros.h",
2778 2779
    "src/objects/objects-body-descriptors-inl.h",
    "src/objects/objects-body-descriptors.h",
2780 2781 2782
    "src/objects/objects-inl.h",
    "src/objects/objects.cc",
    "src/objects/objects.h",
2783 2784
    "src/objects/oddball-inl.h",
    "src/objects/oddball.h",
2785 2786 2787
    "src/objects/ordered-hash-table-inl.h",
    "src/objects/ordered-hash-table.cc",
    "src/objects/ordered-hash-table.h",
2788 2789 2790
    "src/objects/osr-optimized-code-cache-inl.h",
    "src/objects/osr-optimized-code-cache.cc",
    "src/objects/osr-optimized-code-cache.h",
2791 2792
    "src/objects/primitive-heap-object-inl.h",
    "src/objects/primitive-heap-object.h",
2793 2794
    "src/objects/promise-inl.h",
    "src/objects/promise.h",
2795 2796
    "src/objects/property-array-inl.h",
    "src/objects/property-array.h",
2797 2798
    "src/objects/property-cell-inl.h",
    "src/objects/property-cell.h",
2799 2800
    "src/objects/property-descriptor-object-inl.h",
    "src/objects/property-descriptor-object.h",
2801 2802 2803 2804 2805
    "src/objects/property-descriptor.cc",
    "src/objects/property-descriptor.h",
    "src/objects/property-details.h",
    "src/objects/property.cc",
    "src/objects/property.h",
2806 2807
    "src/objects/prototype-info-inl.h",
    "src/objects/prototype-info.h",
2808
    "src/objects/prototype.h",
2809
    "src/objects/regexp-match-info.h",
2810
    "src/objects/scope-info.cc",
2811
    "src/objects/scope-info.h",
2812 2813
    "src/objects/script-inl.h",
    "src/objects/script.h",
2814 2815
    "src/objects/shared-function-info-inl.h",
    "src/objects/shared-function-info.h",
2816
    "src/objects/slots-atomic-inl.h",
2817 2818
    "src/objects/slots-inl.h",
    "src/objects/slots.h",
2819 2820
    "src/objects/source-text-module.cc",
    "src/objects/source-text-module.h",
2821
    "src/objects/stack-frame-info-inl.h",
2822
    "src/objects/stack-frame-info.cc",
2823
    "src/objects/stack-frame-info.h",
2824 2825
    "src/objects/string-comparator.cc",
    "src/objects/string-comparator.h",
2826
    "src/objects/string-inl.h",
2827
    "src/objects/string-table-inl.h",
2828
    "src/objects/string-table.h",
2829
    "src/objects/string.cc",
2830
    "src/objects/string.h",
2831 2832
    "src/objects/struct-inl.h",
    "src/objects/struct.h",
2833 2834
    "src/objects/synthetic-module.cc",
    "src/objects/synthetic-module.h",
2835 2836
    "src/objects/tagged-field-inl.h",
    "src/objects/tagged-field.h",
2837 2838 2839
    "src/objects/tagged-impl-inl.h",
    "src/objects/tagged-impl.cc",
    "src/objects/tagged-impl.h",
2840
    "src/objects/tagged-index.h",
2841 2842
    "src/objects/tagged-value-inl.h",
    "src/objects/tagged-value.h",
2843
    "src/objects/template-objects-inl.h",
2844 2845
    "src/objects/template-objects.cc",
    "src/objects/template-objects.h",
2846 2847
    "src/objects/templates-inl.h",
    "src/objects/templates.h",
2848 2849 2850
    "src/objects/transitions-inl.h",
    "src/objects/transitions.cc",
    "src/objects/transitions.h",
2851 2852 2853 2854 2855 2856
    "src/objects/type-hints.cc",
    "src/objects/type-hints.h",
    "src/objects/value-serializer.cc",
    "src/objects/value-serializer.h",
    "src/objects/visitors.cc",
    "src/objects/visitors.h",
2857
    "src/parsing/expression-scope.h",
2858 2859
    "src/parsing/func-name-inferrer.cc",
    "src/parsing/func-name-inferrer.h",
2860 2861
    "src/parsing/literal-buffer.cc",
    "src/parsing/literal-buffer.h",
2862 2863
    "src/parsing/parse-info.cc",
    "src/parsing/parse-info.h",
2864
    "src/parsing/parser-base.h",
2865 2866
    "src/parsing/parser.cc",
    "src/parsing/parser.h",
2867 2868
    "src/parsing/parsing.cc",
    "src/parsing/parsing.h",
2869 2870
    "src/parsing/pending-compilation-error-handler.cc",
    "src/parsing/pending-compilation-error-handler.h",
2871 2872 2873
    "src/parsing/preparse-data-impl.h",
    "src/parsing/preparse-data.cc",
    "src/parsing/preparse-data.h",
2874
    "src/parsing/preparser-logger.h",
2875 2876 2877 2878 2879 2880 2881 2882 2883 2884
    "src/parsing/preparser.cc",
    "src/parsing/preparser.h",
    "src/parsing/rewriter.cc",
    "src/parsing/rewriter.h",
    "src/parsing/scanner-character-streams.cc",
    "src/parsing/scanner-character-streams.h",
    "src/parsing/scanner.cc",
    "src/parsing/scanner.h",
    "src/parsing/token.cc",
    "src/parsing/token.h",
2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899
    "src/profiler/allocation-tracker.cc",
    "src/profiler/allocation-tracker.h",
    "src/profiler/circular-queue-inl.h",
    "src/profiler/circular-queue.h",
    "src/profiler/cpu-profiler-inl.h",
    "src/profiler/cpu-profiler.cc",
    "src/profiler/cpu-profiler.h",
    "src/profiler/heap-profiler.cc",
    "src/profiler/heap-profiler.h",
    "src/profiler/heap-snapshot-generator-inl.h",
    "src/profiler/heap-snapshot-generator.cc",
    "src/profiler/heap-snapshot-generator.h",
    "src/profiler/profile-generator-inl.h",
    "src/profiler/profile-generator.cc",
    "src/profiler/profile-generator.h",
lpy's avatar
lpy committed
2900 2901
    "src/profiler/profiler-listener.cc",
    "src/profiler/profiler-listener.h",
2902 2903
    "src/profiler/sampling-heap-profiler.cc",
    "src/profiler/sampling-heap-profiler.h",
2904 2905
    "src/profiler/strings-storage.cc",
    "src/profiler/strings-storage.h",
lpy's avatar
lpy committed
2906 2907
    "src/profiler/tick-sample.cc",
    "src/profiler/tick-sample.h",
2908 2909
    "src/profiler/tracing-cpu-profiler.cc",
    "src/profiler/tracing-cpu-profiler.h",
2910 2911
    "src/regexp/property-sequences.cc",
    "src/regexp/property-sequences.h",
2912 2913
    "src/regexp/regexp-ast.cc",
    "src/regexp/regexp-ast.h",
2914 2915 2916
    "src/regexp/regexp-bytecode-generator-inl.h",
    "src/regexp/regexp-bytecode-generator.cc",
    "src/regexp/regexp-bytecode-generator.h",
2917 2918 2919
    "src/regexp/regexp-bytecode-peephole.cc",
    "src/regexp/regexp-bytecode-peephole.h",
    "src/regexp/regexp-bytecodes.cc",
2920
    "src/regexp/regexp-bytecodes.h",
2921
    "src/regexp/regexp-compiler-tonode.cc",
2922
    "src/regexp/regexp-compiler.cc",
2923
    "src/regexp/regexp-compiler.h",
2924 2925
    "src/regexp/regexp-dotprinter.cc",
    "src/regexp/regexp-dotprinter.h",
2926 2927
    "src/regexp/regexp-error.cc",
    "src/regexp/regexp-error.h",
2928 2929
    "src/regexp/regexp-interpreter.cc",
    "src/regexp/regexp-interpreter.h",
2930
    "src/regexp/regexp-macro-assembler-arch.h",
2931 2932 2933 2934
    "src/regexp/regexp-macro-assembler-tracer.cc",
    "src/regexp/regexp-macro-assembler-tracer.h",
    "src/regexp/regexp-macro-assembler.cc",
    "src/regexp/regexp-macro-assembler.h",
2935
    "src/regexp/regexp-nodes.h",
2936 2937
    "src/regexp/regexp-parser.cc",
    "src/regexp/regexp-parser.h",
2938 2939
    "src/regexp/regexp-stack.cc",
    "src/regexp/regexp-stack.h",
2940 2941
    "src/regexp/regexp-utils.cc",
    "src/regexp/regexp-utils.h",
2942 2943
    "src/regexp/regexp.cc",
    "src/regexp/regexp.h",
2944
    "src/regexp/special-case.h",
2945 2946 2947
    "src/roots/roots-inl.h",
    "src/roots/roots.cc",
    "src/roots/roots.h",
2948
    "src/runtime/runtime-array.cc",
binji's avatar
binji committed
2949
    "src/runtime/runtime-atomics.cc",
2950
    "src/runtime/runtime-bigint.cc",
2951
    "src/runtime/runtime-classes.cc",
2952 2953
    "src/runtime/runtime-collections.cc",
    "src/runtime/runtime-compiler.cc",
2954 2955
    "src/runtime/runtime-date.cc",
    "src/runtime/runtime-debug.cc",
2956
    "src/runtime/runtime-forin.cc",
2957
    "src/runtime/runtime-function.cc",
binji's avatar
binji committed
2958
    "src/runtime/runtime-futex.cc",
2959
    "src/runtime/runtime-generator.cc",
2960
    "src/runtime/runtime-internal.cc",
2961
    "src/runtime/runtime-interpreter.cc",
2962
    "src/runtime/runtime-intl.cc",
2963
    "src/runtime/runtime-literals.cc",
2964
    "src/runtime/runtime-module.cc",
2965
    "src/runtime/runtime-numbers.cc",
2966
    "src/runtime/runtime-object.cc",
2967
    "src/runtime/runtime-operators.cc",
2968
    "src/runtime/runtime-promise.cc",
2969
    "src/runtime/runtime-proxy.cc",
2970
    "src/runtime/runtime-regexp.cc",
2971
    "src/runtime/runtime-scopes.cc",
2972
    "src/runtime/runtime-strings.cc",
2973
    "src/runtime/runtime-symbol.cc",
2974 2975
    "src/runtime/runtime-test.cc",
    "src/runtime/runtime-typedarray.cc",
2976
    "src/runtime/runtime-utils.h",
2977
    "src/runtime/runtime-wasm.cc",
2978
    "src/runtime/runtime-weak-refs.cc",
2979 2980
    "src/runtime/runtime.cc",
    "src/runtime/runtime.h",
2981
    "src/sanitizer/asan.h",
2982 2983
    "src/sanitizer/lsan-page-allocator.cc",
    "src/sanitizer/lsan-page-allocator.h",
2984
    "src/sanitizer/msan.h",
2985
    "src/sanitizer/tsan.h",
2986 2987
    "src/snapshot/code-serializer.cc",
    "src/snapshot/code-serializer.h",
2988 2989 2990 2991
    "src/snapshot/context-deserializer.cc",
    "src/snapshot/context-deserializer.h",
    "src/snapshot/context-serializer.cc",
    "src/snapshot/context-serializer.h",
2992 2993
    "src/snapshot/deserializer-allocator.cc",
    "src/snapshot/deserializer-allocator.h",
2994 2995
    "src/snapshot/deserializer.cc",
    "src/snapshot/deserializer.h",
2996 2997
    "src/snapshot/embedded/embedded-data.cc",
    "src/snapshot/embedded/embedded-data.h",
2998 2999
    "src/snapshot/object-deserializer.cc",
    "src/snapshot/object-deserializer.h",
3000 3001 3002 3003
    "src/snapshot/read-only-deserializer.cc",
    "src/snapshot/read-only-deserializer.h",
    "src/snapshot/read-only-serializer.cc",
    "src/snapshot/read-only-serializer.h",
3004
    "src/snapshot/references.h",
3005 3006
    "src/snapshot/roots-serializer.cc",
    "src/snapshot/roots-serializer.h",
3007 3008
    "src/snapshot/serializer-allocator.cc",
    "src/snapshot/serializer-allocator.h",
3009 3010
    "src/snapshot/serializer-deserializer.cc",
    "src/snapshot/serializer-deserializer.h",
jochen's avatar
jochen committed
3011 3012
    "src/snapshot/serializer.cc",
    "src/snapshot/serializer.h",
3013 3014
    "src/snapshot/snapshot-compression.cc",
    "src/snapshot/snapshot-compression.h",
3015 3016
    "src/snapshot/snapshot-data.cc",
    "src/snapshot/snapshot-data.h",
3017 3018
    "src/snapshot/snapshot-source-sink.cc",
    "src/snapshot/snapshot-source-sink.h",
3019 3020
    "src/snapshot/snapshot-utils.cc",
    "src/snapshot/snapshot-utils.h",
3021
    "src/snapshot/snapshot.cc",
jochen's avatar
jochen committed
3022
    "src/snapshot/snapshot.h",
3023 3024
    "src/snapshot/startup-deserializer.cc",
    "src/snapshot/startup-deserializer.h",
3025 3026
    "src/snapshot/startup-serializer.cc",
    "src/snapshot/startup-serializer.h",
3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045
    "src/strings/char-predicates-inl.h",
    "src/strings/char-predicates.cc",
    "src/strings/char-predicates.h",
    "src/strings/string-builder-inl.h",
    "src/strings/string-builder.cc",
    "src/strings/string-case.cc",
    "src/strings/string-case.h",
    "src/strings/string-hasher-inl.h",
    "src/strings/string-hasher.h",
    "src/strings/string-search.h",
    "src/strings/string-stream.cc",
    "src/strings/string-stream.h",
    "src/strings/unicode-decoder.cc",
    "src/strings/unicode-decoder.h",
    "src/strings/unicode-inl.h",
    "src/strings/unicode.cc",
    "src/strings/unicode.h",
    "src/strings/uri.cc",
    "src/strings/uri.h",
3046 3047 3048 3049
    "src/tasks/cancelable-task.cc",
    "src/tasks/cancelable-task.h",
    "src/tasks/task-utils.cc",
    "src/tasks/task-utils.h",
3050 3051
    "src/third_party/siphash/halfsiphash.cc",
    "src/third_party/siphash/halfsiphash.h",
3052
    "src/third_party/utf8-decoder/utf8-decoder.h",
3053 3054
    "src/tracing/trace-event.cc",
    "src/tracing/trace-event.h",
3055 3056
    "src/tracing/traced-value.cc",
    "src/tracing/traced-value.h",
3057 3058
    "src/tracing/tracing-category-observer.cc",
    "src/tracing/tracing-category-observer.h",
3059
    "src/trap-handler/handler-inside.cc",
eholk's avatar
eholk committed
3060 3061 3062
    "src/trap-handler/handler-outside.cc",
    "src/trap-handler/handler-shared.cc",
    "src/trap-handler/trap-handler-internal.h",
3063
    "src/trap-handler/trap-handler.h",
3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087
    "src/utils/address-map.cc",
    "src/utils/address-map.h",
    "src/utils/allocation.cc",
    "src/utils/allocation.h",
    "src/utils/bit-vector.cc",
    "src/utils/bit-vector.h",
    "src/utils/boxed-float.h",
    "src/utils/detachable-vector.cc",
    "src/utils/detachable-vector.h",
    "src/utils/identity-map.cc",
    "src/utils/identity-map.h",
    "src/utils/locked-queue-inl.h",
    "src/utils/locked-queue.h",
    "src/utils/memcopy.cc",
    "src/utils/memcopy.h",
    "src/utils/ostreams.cc",
    "src/utils/ostreams.h",
    "src/utils/pointer-with-payload.h",
    "src/utils/utils-inl.h",
    "src/utils/utils.cc",
    "src/utils/utils.h",
    "src/utils/vector.h",
    "src/utils/version.cc",
    "src/utils/version.h",
3088
    "src/wasm/baseline/liftoff-assembler-defs.h",
3089
    "src/wasm/baseline/liftoff-assembler.cc",
3090
    "src/wasm/baseline/liftoff-assembler.h",
3091
    "src/wasm/baseline/liftoff-compiler.cc",
3092
    "src/wasm/baseline/liftoff-compiler.h",
3093
    "src/wasm/baseline/liftoff-register.h",
3094
    "src/wasm/compilation-environment.h",
3095
    "src/wasm/decoder.h",
3096
    "src/wasm/function-body-decoder-impl.h",
3097
    "src/wasm/function-body-decoder.cc",
3098
    "src/wasm/function-body-decoder.h",
3099 3100
    "src/wasm/function-compiler.cc",
    "src/wasm/function-compiler.h",
3101 3102
    "src/wasm/graph-builder-interface.cc",
    "src/wasm/graph-builder-interface.h",
3103 3104
    "src/wasm/jump-table-assembler.cc",
    "src/wasm/jump-table-assembler.h",
3105
    "src/wasm/leb-helper.h",
3106 3107
    "src/wasm/local-decl-encoder.cc",
    "src/wasm/local-decl-encoder.h",
3108 3109
    "src/wasm/memory-tracing.cc",
    "src/wasm/memory-tracing.h",
3110 3111
    "src/wasm/module-compiler.cc",
    "src/wasm/module-compiler.h",
3112 3113
    "src/wasm/module-decoder.cc",
    "src/wasm/module-decoder.h",
3114 3115
    "src/wasm/module-instantiate.cc",
    "src/wasm/module-instantiate.h",
3116
    "src/wasm/object-access.h",
3117 3118
    "src/wasm/signature-map.cc",
    "src/wasm/signature-map.h",
3119 3120
    "src/wasm/streaming-decoder.cc",
    "src/wasm/streaming-decoder.h",
3121
    "src/wasm/struct-types.h",
3122
    "src/wasm/value-type.h",
3123
    "src/wasm/wasm-arguments.h",
3124 3125
    "src/wasm/wasm-code-manager.cc",
    "src/wasm/wasm-code-manager.h",
3126
    "src/wasm/wasm-constants.h",
3127 3128
    "src/wasm/wasm-debug-evaluate.cc",
    "src/wasm/wasm-debug-evaluate.h",
3129
    "src/wasm/wasm-debug.cc",
3130
    "src/wasm/wasm-engine.cc",
3131
    "src/wasm/wasm-engine.h",
3132
    "src/wasm/wasm-external-refs.cc",
3133
    "src/wasm/wasm-external-refs.h",
3134 3135 3136
    "src/wasm/wasm-feature-flags.h",
    "src/wasm/wasm-features.cc",
    "src/wasm/wasm-features.h",
3137
    "src/wasm/wasm-import-wrapper-cache.cc",
3138
    "src/wasm/wasm-import-wrapper-cache.h",
3139 3140
    "src/wasm/wasm-interpreter.cc",
    "src/wasm/wasm-interpreter.h",
3141 3142
    "src/wasm/wasm-js.cc",
    "src/wasm/wasm-js.h",
3143
    "src/wasm/wasm-limits.h",
3144
    "src/wasm/wasm-linkage.h",
3145 3146
    "src/wasm/wasm-module-builder.cc",
    "src/wasm/wasm-module-builder.h",
3147 3148
    "src/wasm/wasm-module-sourcemap.cc",
    "src/wasm/wasm-module-sourcemap.h",
3149 3150
    "src/wasm/wasm-module.cc",
    "src/wasm/wasm-module.h",
3151
    "src/wasm/wasm-objects-inl.h",
3152 3153
    "src/wasm/wasm-objects.cc",
    "src/wasm/wasm-objects.h",
3154 3155 3156 3157
    "src/wasm/wasm-opcodes.cc",
    "src/wasm/wasm-opcodes.h",
    "src/wasm/wasm-result.cc",
    "src/wasm/wasm-result.h",
3158 3159
    "src/wasm/wasm-serialization.cc",
    "src/wasm/wasm-serialization.h",
3160
    "src/wasm/wasm-tier.h",
3161
    "src/wasm/wasm-value.h",
3162 3163 3164
    "src/zone/accounting-allocator.cc",
    "src/zone/accounting-allocator.h",
    "src/zone/zone-allocator.h",
3165
    "src/zone/zone-chunk-list.h",
3166
    "src/zone/zone-containers.h",
3167
    "src/zone/zone-handle-set.h",
3168
    "src/zone/zone-list-inl.h",
heimbuef's avatar
heimbuef committed
3169
    "src/zone/zone-segment.cc",
3170 3171 3172
    "src/zone/zone-segment.h",
    "src/zone/zone.cc",
    "src/zone/zone.h",
3173 3174
  ]

3175 3176 3177 3178
  if (!v8_control_flow_integrity) {
    sources += [ "src/execution/pointer-authentication-dummy.h" ]
  }

3179 3180
  if (v8_enable_third_party_heap) {
    sources += v8_third_party_heap_files
3181 3182
  } else {
    sources += [ "src/heap/third-party/heap-api-stub.cc" ]
3183 3184
  }

3185 3186
  if (v8_enable_wasm_gdb_remote_debugging) {
    sources += [
3187 3188
      "src/debug/wasm/gdb-server/gdb-remote-util.cc",
      "src/debug/wasm/gdb-server/gdb-remote-util.h",
3189 3190 3191 3192
      "src/debug/wasm/gdb-server/gdb-server-thread.cc",
      "src/debug/wasm/gdb-server/gdb-server-thread.h",
      "src/debug/wasm/gdb-server/gdb-server.cc",
      "src/debug/wasm/gdb-server/gdb-server.h",
3193 3194
      "src/debug/wasm/gdb-server/packet.cc",
      "src/debug/wasm/gdb-server/packet.h",
3195 3196 3197 3198 3199 3200
      "src/debug/wasm/gdb-server/session.cc",
      "src/debug/wasm/gdb-server/session.h",
      "src/debug/wasm/gdb-server/target.cc",
      "src/debug/wasm/gdb-server/target.h",
      "src/debug/wasm/gdb-server/transport.cc",
      "src/debug/wasm/gdb-server/transport.h",
3201 3202
      "src/debug/wasm/gdb-server/wasm-module-debug.cc",
      "src/debug/wasm/gdb-server/wasm-module-debug.h",
3203 3204 3205
    ]
  }

3206 3207 3208 3209 3210 3211 3212
  if (v8_check_header_includes) {
    # This file will be generated by tools/generate-header-include-checks.py
    # if the "check_v8_header_includes" gclient variable is set.
    import("check-header-includes/sources.gni")
    sources += check_header_includes_sources
  }

3213
  if (v8_current_cpu == "x86") {
3214
    sources += [  ### gcmole(arch:ia32) ###
3215 3216 3217 3218 3219 3220 3221 3222 3223 3224
      "src/codegen/ia32/assembler-ia32-inl.h",
      "src/codegen/ia32/assembler-ia32.cc",
      "src/codegen/ia32/assembler-ia32.h",
      "src/codegen/ia32/constants-ia32.h",
      "src/codegen/ia32/cpu-ia32.cc",
      "src/codegen/ia32/interface-descriptors-ia32.cc",
      "src/codegen/ia32/macro-assembler-ia32.cc",
      "src/codegen/ia32/macro-assembler-ia32.h",
      "src/codegen/ia32/register-ia32.h",
      "src/codegen/ia32/sse-instr.h",
3225 3226 3227 3228
      "src/compiler/backend/ia32/code-generator-ia32.cc",
      "src/compiler/backend/ia32/instruction-codes-ia32.h",
      "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
      "src/compiler/backend/ia32/instruction-selector-ia32.cc",
3229
      "src/debug/ia32/debug-ia32.cc",
3230 3231 3232 3233
      "src/deoptimizer/ia32/deoptimizer-ia32.cc",
      "src/diagnostics/ia32/disasm-ia32.cc",
      "src/execution/ia32/frame-constants-ia32.cc",
      "src/execution/ia32/frame-constants-ia32.h",
3234 3235
      "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
      "src/regexp/ia32/regexp-macro-assembler-ia32.h",
3236
      "src/wasm/baseline/ia32/liftoff-assembler-ia32.h",
3237
    ]
3238
  } else if (v8_current_cpu == "x64") {
3239
    sources += [  ### gcmole(arch:x64) ###
3240 3241 3242 3243 3244
      "src/codegen/x64/assembler-x64-inl.h",
      "src/codegen/x64/assembler-x64.cc",
      "src/codegen/x64/assembler-x64.h",
      "src/codegen/x64/constants-x64.h",
      "src/codegen/x64/cpu-x64.cc",
3245
      "src/codegen/x64/fma-instr.h",
3246 3247 3248 3249 3250
      "src/codegen/x64/interface-descriptors-x64.cc",
      "src/codegen/x64/macro-assembler-x64.cc",
      "src/codegen/x64/macro-assembler-x64.h",
      "src/codegen/x64/register-x64.h",
      "src/codegen/x64/sse-instr.h",
3251 3252 3253 3254 3255 3256
      "src/compiler/backend/x64/code-generator-x64.cc",
      "src/compiler/backend/x64/instruction-codes-x64.h",
      "src/compiler/backend/x64/instruction-scheduler-x64.cc",
      "src/compiler/backend/x64/instruction-selector-x64.cc",
      "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
      "src/compiler/backend/x64/unwinding-info-writer-x64.h",
3257
      "src/debug/x64/debug-x64.cc",
3258 3259 3260 3261 3262
      "src/deoptimizer/x64/deoptimizer-x64.cc",
      "src/diagnostics/x64/disasm-x64.cc",
      "src/diagnostics/x64/eh-frame-x64.cc",
      "src/execution/x64/frame-constants-x64.cc",
      "src/execution/x64/frame-constants-x64.h",
3263 3264
      "src/regexp/x64/regexp-macro-assembler-x64.cc",
      "src/regexp/x64/regexp-macro-assembler-x64.h",
3265
      "src/third_party/valgrind/valgrind.h",
3266
      "src/wasm/baseline/x64/liftoff-assembler-x64.h",
3267
    ]
3268

3269 3270
    # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
    # based on Darwin and thus POSIX-compliant to a similar degree.
3271
    if (is_linux || is_mac || is_ios || target_os == "freebsd") {
3272
      sources += [
3273 3274 3275
        "src/trap-handler/handler-inside-posix.cc",
        "src/trap-handler/handler-inside-posix.h",
        "src/trap-handler/handler-outside-posix.cc",
3276 3277 3278
      ]
    }
    if (is_win) {
3279
      sources += [
3280 3281
        "src/diagnostics/unwinding-info-win64.cc",
        "src/diagnostics/unwinding-info-win64.h",
3282 3283 3284 3285
        "src/trap-handler/handler-inside-win.cc",
        "src/trap-handler/handler-inside-win.h",
        "src/trap-handler/handler-outside-win.cc",
      ]
eholk's avatar
eholk committed
3286
    }
3287
  } else if (v8_current_cpu == "arm") {
3288
    sources += [  ### gcmole(arch:arm) ###
3289 3290 3291 3292 3293 3294 3295 3296 3297 3298
      "src/codegen/arm/assembler-arm-inl.h",
      "src/codegen/arm/assembler-arm.cc",
      "src/codegen/arm/assembler-arm.h",
      "src/codegen/arm/constants-arm.cc",
      "src/codegen/arm/constants-arm.h",
      "src/codegen/arm/cpu-arm.cc",
      "src/codegen/arm/interface-descriptors-arm.cc",
      "src/codegen/arm/macro-assembler-arm.cc",
      "src/codegen/arm/macro-assembler-arm.h",
      "src/codegen/arm/register-arm.h",
3299 3300 3301 3302 3303 3304
      "src/compiler/backend/arm/code-generator-arm.cc",
      "src/compiler/backend/arm/instruction-codes-arm.h",
      "src/compiler/backend/arm/instruction-scheduler-arm.cc",
      "src/compiler/backend/arm/instruction-selector-arm.cc",
      "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
      "src/compiler/backend/arm/unwinding-info-writer-arm.h",
3305
      "src/debug/arm/debug-arm.cc",
3306 3307 3308 3309 3310 3311 3312
      "src/deoptimizer/arm/deoptimizer-arm.cc",
      "src/diagnostics/arm/disasm-arm.cc",
      "src/diagnostics/arm/eh-frame-arm.cc",
      "src/execution/arm/frame-constants-arm.cc",
      "src/execution/arm/frame-constants-arm.h",
      "src/execution/arm/simulator-arm.cc",
      "src/execution/arm/simulator-arm.h",
3313 3314
      "src/regexp/arm/regexp-macro-assembler-arm.cc",
      "src/regexp/arm/regexp-macro-assembler-arm.h",
3315
      "src/wasm/baseline/arm/liftoff-assembler-arm.h",
3316
    ]
3317
  } else if (v8_current_cpu == "arm64") {
3318
    sources += [  ### gcmole(arch:arm64) ###
3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337
      "src/codegen/arm64/assembler-arm64-inl.h",
      "src/codegen/arm64/assembler-arm64.cc",
      "src/codegen/arm64/assembler-arm64.h",
      "src/codegen/arm64/constants-arm64.h",
      "src/codegen/arm64/cpu-arm64.cc",
      "src/codegen/arm64/decoder-arm64-inl.h",
      "src/codegen/arm64/decoder-arm64.cc",
      "src/codegen/arm64/decoder-arm64.h",
      "src/codegen/arm64/instructions-arm64-constants.cc",
      "src/codegen/arm64/instructions-arm64.cc",
      "src/codegen/arm64/instructions-arm64.h",
      "src/codegen/arm64/interface-descriptors-arm64.cc",
      "src/codegen/arm64/macro-assembler-arm64-inl.h",
      "src/codegen/arm64/macro-assembler-arm64.cc",
      "src/codegen/arm64/macro-assembler-arm64.h",
      "src/codegen/arm64/register-arm64.cc",
      "src/codegen/arm64/register-arm64.h",
      "src/codegen/arm64/utils-arm64.cc",
      "src/codegen/arm64/utils-arm64.h",
3338 3339 3340 3341 3342 3343
      "src/compiler/backend/arm64/code-generator-arm64.cc",
      "src/compiler/backend/arm64/instruction-codes-arm64.h",
      "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
      "src/compiler/backend/arm64/instruction-selector-arm64.cc",
      "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
      "src/compiler/backend/arm64/unwinding-info-writer-arm64.h",
3344
      "src/debug/arm64/debug-arm64.cc",
3345 3346 3347 3348 3349 3350
      "src/deoptimizer/arm64/deoptimizer-arm64.cc",
      "src/diagnostics/arm64/disasm-arm64.cc",
      "src/diagnostics/arm64/disasm-arm64.h",
      "src/diagnostics/arm64/eh-frame-arm64.cc",
      "src/execution/arm64/frame-constants-arm64.cc",
      "src/execution/arm64/frame-constants-arm64.h",
3351
      "src/execution/arm64/pointer-auth-arm64.cc",
3352 3353 3354
      "src/execution/arm64/simulator-arm64.cc",
      "src/execution/arm64/simulator-arm64.h",
      "src/execution/arm64/simulator-logic-arm64.cc",
3355 3356
      "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
      "src/regexp/arm64/regexp-macro-assembler-arm64.h",
3357
      "src/wasm/baseline/arm64/liftoff-assembler-arm64.h",
3358
    ]
3359 3360 3361
    if (v8_control_flow_integrity) {
      sources += [ "src/execution/arm64/pointer-authentication-arm64.h" ]
    }
3362 3363 3364 3365 3366 3367
    if (is_win) {
      sources += [
        "src/diagnostics/unwinding-info-win64.cc",
        "src/diagnostics/unwinding-info-win64.h",
      ]
    }
3368 3369
  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
    sources += [  ### gcmole(arch:mipsel) ###
3370 3371 3372 3373 3374 3375 3376 3377 3378 3379
      "src/codegen/mips/assembler-mips-inl.h",
      "src/codegen/mips/assembler-mips.cc",
      "src/codegen/mips/assembler-mips.h",
      "src/codegen/mips/constants-mips.cc",
      "src/codegen/mips/constants-mips.h",
      "src/codegen/mips/cpu-mips.cc",
      "src/codegen/mips/interface-descriptors-mips.cc",
      "src/codegen/mips/macro-assembler-mips.cc",
      "src/codegen/mips/macro-assembler-mips.h",
      "src/codegen/mips/register-mips.h",
3380 3381 3382 3383
      "src/compiler/backend/mips/code-generator-mips.cc",
      "src/compiler/backend/mips/instruction-codes-mips.h",
      "src/compiler/backend/mips/instruction-scheduler-mips.cc",
      "src/compiler/backend/mips/instruction-selector-mips.cc",
3384
      "src/debug/mips/debug-mips.cc",
3385 3386 3387 3388 3389 3390
      "src/deoptimizer/mips/deoptimizer-mips.cc",
      "src/diagnostics/mips/disasm-mips.cc",
      "src/execution/mips/frame-constants-mips.cc",
      "src/execution/mips/frame-constants-mips.h",
      "src/execution/mips/simulator-mips.cc",
      "src/execution/mips/simulator-mips.h",
3391 3392
      "src/regexp/mips/regexp-macro-assembler-mips.cc",
      "src/regexp/mips/regexp-macro-assembler-mips.h",
3393
      "src/wasm/baseline/mips/liftoff-assembler-mips.h",
3394
    ]
3395 3396
  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    sources += [  ### gcmole(arch:mips64el) ###
3397 3398 3399 3400 3401 3402 3403 3404 3405 3406
      "src/codegen/mips64/assembler-mips64-inl.h",
      "src/codegen/mips64/assembler-mips64.cc",
      "src/codegen/mips64/assembler-mips64.h",
      "src/codegen/mips64/constants-mips64.cc",
      "src/codegen/mips64/constants-mips64.h",
      "src/codegen/mips64/cpu-mips64.cc",
      "src/codegen/mips64/interface-descriptors-mips64.cc",
      "src/codegen/mips64/macro-assembler-mips64.cc",
      "src/codegen/mips64/macro-assembler-mips64.h",
      "src/codegen/mips64/register-mips64.h",
3407 3408 3409 3410
      "src/compiler/backend/mips64/code-generator-mips64.cc",
      "src/compiler/backend/mips64/instruction-codes-mips64.h",
      "src/compiler/backend/mips64/instruction-scheduler-mips64.cc",
      "src/compiler/backend/mips64/instruction-selector-mips64.cc",
3411
      "src/debug/mips64/debug-mips64.cc",
3412 3413 3414 3415 3416 3417
      "src/deoptimizer/mips64/deoptimizer-mips64.cc",
      "src/diagnostics/mips64/disasm-mips64.cc",
      "src/execution/mips64/frame-constants-mips64.cc",
      "src/execution/mips64/frame-constants-mips64.h",
      "src/execution/mips64/simulator-mips64.cc",
      "src/execution/mips64/simulator-mips64.h",
3418 3419
      "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
      "src/regexp/mips64/regexp-macro-assembler-mips64.h",
3420
      "src/wasm/baseline/mips64/liftoff-assembler-mips64.h",
3421
    ]
3422
  } else if (v8_current_cpu == "ppc") {
3423
    sources += [  ### gcmole(arch:ppc) ###
3424 3425 3426 3427 3428 3429 3430 3431 3432 3433
      "src/codegen/ppc/assembler-ppc-inl.h",
      "src/codegen/ppc/assembler-ppc.cc",
      "src/codegen/ppc/assembler-ppc.h",
      "src/codegen/ppc/constants-ppc.cc",
      "src/codegen/ppc/constants-ppc.h",
      "src/codegen/ppc/cpu-ppc.cc",
      "src/codegen/ppc/interface-descriptors-ppc.cc",
      "src/codegen/ppc/macro-assembler-ppc.cc",
      "src/codegen/ppc/macro-assembler-ppc.h",
      "src/codegen/ppc/register-ppc.h",
3434 3435
      "src/compiler/backend/ppc/code-generator-ppc.cc",
      "src/compiler/backend/ppc/instruction-codes-ppc.h",
3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465
      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
      "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
      "src/debug/ppc/debug-ppc.cc",
      "src/deoptimizer/ppc/deoptimizer-ppc.cc",
      "src/diagnostics/ppc/disasm-ppc.cc",
      "src/diagnostics/ppc/eh-frame-ppc.cc",
      "src/execution/ppc/frame-constants-ppc.cc",
      "src/execution/ppc/frame-constants-ppc.h",
      "src/execution/ppc/simulator-ppc.cc",
      "src/execution/ppc/simulator-ppc.h",
      "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
      "src/regexp/ppc/regexp-macro-assembler-ppc.h",
      "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
    ]
  } else if (v8_current_cpu == "ppc64") {
    sources += [  ### gcmole(arch:ppc64) ###
      "src/codegen/ppc/assembler-ppc-inl.h",
      "src/codegen/ppc/assembler-ppc.cc",
      "src/codegen/ppc/assembler-ppc.h",
      "src/codegen/ppc/constants-ppc.cc",
      "src/codegen/ppc/constants-ppc.h",
      "src/codegen/ppc/cpu-ppc.cc",
      "src/codegen/ppc/interface-descriptors-ppc.cc",
      "src/codegen/ppc/macro-assembler-ppc.cc",
      "src/codegen/ppc/macro-assembler-ppc.h",
      "src/codegen/ppc/register-ppc.h",
      "src/compiler/backend/ppc/code-generator-ppc.cc",
      "src/compiler/backend/ppc/instruction-codes-ppc.h",
3466 3467
      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
3468 3469
      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
      "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
3470
      "src/debug/ppc/debug-ppc.cc",
3471 3472
      "src/deoptimizer/ppc/deoptimizer-ppc.cc",
      "src/diagnostics/ppc/disasm-ppc.cc",
3473
      "src/diagnostics/ppc/eh-frame-ppc.cc",
3474 3475 3476 3477
      "src/execution/ppc/frame-constants-ppc.cc",
      "src/execution/ppc/frame-constants-ppc.h",
      "src/execution/ppc/simulator-ppc.cc",
      "src/execution/ppc/simulator-ppc.h",
3478 3479
      "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
      "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3480
      "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3481
    ]
3482
  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3483
    sources += [  ### gcmole(arch:s390) ###
3484 3485 3486 3487 3488 3489 3490 3491 3492 3493
      "src/codegen/s390/assembler-s390-inl.h",
      "src/codegen/s390/assembler-s390.cc",
      "src/codegen/s390/assembler-s390.h",
      "src/codegen/s390/constants-s390.cc",
      "src/codegen/s390/constants-s390.h",
      "src/codegen/s390/cpu-s390.cc",
      "src/codegen/s390/interface-descriptors-s390.cc",
      "src/codegen/s390/macro-assembler-s390.cc",
      "src/codegen/s390/macro-assembler-s390.h",
      "src/codegen/s390/register-s390.h",
3494 3495 3496 3497
      "src/compiler/backend/s390/code-generator-s390.cc",
      "src/compiler/backend/s390/instruction-codes-s390.h",
      "src/compiler/backend/s390/instruction-scheduler-s390.cc",
      "src/compiler/backend/s390/instruction-selector-s390.cc",
3498 3499
      "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
      "src/compiler/backend/s390/unwinding-info-writer-s390.h",
3500
      "src/debug/s390/debug-s390.cc",
3501 3502
      "src/deoptimizer/s390/deoptimizer-s390.cc",
      "src/diagnostics/s390/disasm-s390.cc",
3503
      "src/diagnostics/s390/eh-frame-s390.cc",
3504 3505 3506 3507
      "src/execution/s390/frame-constants-s390.cc",
      "src/execution/s390/frame-constants-s390.h",
      "src/execution/s390/simulator-s390.cc",
      "src/execution/s390/simulator-s390.h",
jyan's avatar
jyan committed
3508 3509
      "src/regexp/s390/regexp-macro-assembler-s390.cc",
      "src/regexp/s390/regexp-macro-assembler-s390.h",
3510
      "src/wasm/baseline/s390/liftoff-assembler-s390.h",
3511
    ]
3512 3513
  }

3514
  configs = [ ":internal_config" ]
3515 3516

  defines = []
3517
  deps = [
3518
    ":torque_generated_definitions",
3519
    ":v8_headers",
3520
    ":v8_libbase",
3521
    ":v8_libsampler",
3522
    ":v8_shared_internal_headers",
3523
    ":v8_tracing",
3524
    ":v8_version",
3525
    "src/inspector:inspector",
3526
  ]
3527

Takuto Ikuta's avatar
Takuto Ikuta committed
3528 3529 3530
  public_deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
3531
    ":v8_maybe_icu",
Takuto Ikuta's avatar
Takuto Ikuta committed
3532 3533
  ]

3534
  if (v8_enable_i18n_support) {
3535 3536
    deps += [ ":run_gen-regexp-special-case" ]
    sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
3537 3538 3539 3540 3541
    if (is_win) {
      deps += [ "//third_party/icu:icudata" ]
    }
  } else {
    sources -= [
3542 3543 3544
      "src/builtins/builtins-intl.cc",
      "src/objects/intl-objects.cc",
      "src/objects/intl-objects.h",
3545 3546 3547
      "src/objects/js-break-iterator-inl.h",
      "src/objects/js-break-iterator.cc",
      "src/objects/js-break-iterator.h",
3548 3549 3550
      "src/objects/js-collator-inl.h",
      "src/objects/js-collator.cc",
      "src/objects/js-collator.h",
3551 3552 3553
      "src/objects/js-date-time-format-inl.h",
      "src/objects/js-date-time-format.cc",
      "src/objects/js-date-time-format.h",
3554 3555 3556
      "src/objects/js-display-names-inl.h",
      "src/objects/js-display-names.cc",
      "src/objects/js-display-names.h",
3557 3558 3559
      "src/objects/js-list-format-inl.h",
      "src/objects/js-list-format.cc",
      "src/objects/js-list-format.h",
3560 3561 3562
      "src/objects/js-locale-inl.h",
      "src/objects/js-locale.cc",
      "src/objects/js-locale.h",
3563 3564 3565
      "src/objects/js-number-format-inl.h",
      "src/objects/js-number-format.cc",
      "src/objects/js-number-format.h",
3566 3567 3568
      "src/objects/js-plural-rules-inl.h",
      "src/objects/js-plural-rules.cc",
      "src/objects/js-plural-rules.h",
3569 3570 3571
      "src/objects/js-relative-time-format-inl.h",
      "src/objects/js-relative-time-format.cc",
      "src/objects/js-relative-time-format.h",
3572 3573 3574
      "src/objects/js-segment-iterator-inl.h",
      "src/objects/js-segment-iterator.cc",
      "src/objects/js-segment-iterator.h",
3575 3576 3577
      "src/objects/js-segmenter-inl.h",
      "src/objects/js-segmenter.cc",
      "src/objects/js-segmenter.h",
3578
      "src/runtime/runtime-intl.cc",
3579
      "src/strings/char-predicates.cc",
3580 3581 3582
    ]
  }

3583 3584 3585 3586
  deps += [
    "//third_party/zlib",
    "//third_party/zlib/google:compression_utils_portable",
  ]
3587

3588 3589 3590 3591
  if (v8_postmortem_support) {
    sources += [ "$target_gen_dir/debug-support.cc" ]
    deps += [ ":postmortem-metadata" ]
  }
3592

3593 3594 3595 3596 3597 3598
  libs = []

  if (v8_enable_third_party_heap) {
    libs += v8_third_party_heap_libs
  }

3599 3600 3601 3602 3603 3604
  # Platforms that don't have CAS support need to link atomic library
  # to implement atomic memory access
  if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" ||
      v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" ||
      v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
      v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3605
    libs += [ "atomic" ]
3606
  }
3607 3608 3609 3610 3611 3612 3613 3614

  if (v8_enable_vtunetracemark && (is_linux || is_win)) {
    sources += [
      "src/extensions/vtunedomain-support-extension.cc",
      "src/extensions/vtunedomain-support-extension.h",
    ]
    deps += [ "src/third_party/vtune:v8_vtune_trace_mark" ]
  }
3615 3616 3617 3618 3619 3620 3621 3622

  if (v8_use_perfetto) {
    sources -= [ "//base/trace_event/common/trace_event_common.h" ]
    sources += [
      "src/tracing/trace-categories.cc",
      "src/tracing/trace-categories.h",
    ]
  }
3623 3624
}

3625 3626 3627 3628 3629 3630 3631
group("v8_base") {
  public_deps = [
    ":v8_base_without_compiler",
    ":v8_compiler",
  ]
}

3632 3633 3634 3635 3636
v8_source_set("torque_base") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = [
    "src/torque/ast.h",
3637 3638
    "src/torque/cfg.cc",
    "src/torque/cfg.h",
3639
    "src/torque/class-debug-reader-generator.cc",
3640
    "src/torque/constants.h",
3641
    "src/torque/contextual.h",
3642 3643
    "src/torque/csa-generator.cc",
    "src/torque/csa-generator.h",
3644 3645 3646 3647 3648 3649 3650 3651
    "src/torque/declarable.cc",
    "src/torque/declarable.h",
    "src/torque/declaration-visitor.cc",
    "src/torque/declaration-visitor.h",
    "src/torque/declarations.cc",
    "src/torque/declarations.h",
    "src/torque/earley-parser.cc",
    "src/torque/earley-parser.h",
3652
    "src/torque/global-context.cc",
3653 3654 3655
    "src/torque/global-context.h",
    "src/torque/implementation-visitor.cc",
    "src/torque/implementation-visitor.h",
3656
    "src/torque/instance-type-generator.cc",
3657 3658
    "src/torque/instructions.cc",
    "src/torque/instructions.h",
3659
    "src/torque/parameter-difference.h",
3660 3661
    "src/torque/server-data.cc",
    "src/torque/server-data.h",
3662 3663
    "src/torque/source-positions.cc",
    "src/torque/source-positions.h",
3664 3665
    "src/torque/torque-compiler.cc",
    "src/torque/torque-compiler.h",
3666 3667
    "src/torque/torque-parser.cc",
    "src/torque/torque-parser.h",
3668 3669
    "src/torque/type-inference.cc",
    "src/torque/type-inference.h",
3670 3671
    "src/torque/type-oracle.cc",
    "src/torque/type-oracle.h",
3672 3673
    "src/torque/type-visitor.cc",
    "src/torque/type-visitor.h",
3674 3675 3676 3677 3678 3679
    "src/torque/types.cc",
    "src/torque/types.h",
    "src/torque/utils.cc",
    "src/torque/utils.h",
  ]

3680
  deps = [ ":v8_shared_internal_headers" ]
3681

3682
  public_deps = [ ":v8_libbase" ]
3683

3684 3685 3686
  # The use of exceptions for Torque in violation of the Chromium style-guide
  # is justified by the fact that it is only used from the non-essential
  # language server and can be removed anytime if it causes problems.
3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

  remove_configs = [
    "//build/config/compiler:no_exceptions",
    "//build/config/compiler:no_rtti",
  ]

3698
  if (is_win && is_asan) {
3699 3700
    # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
    # Torque on Windows.
3701
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3702
  }
3703 3704 3705 3706 3707 3708

  if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) {
    # The :no_optimize config is added to v8_add_configs in v8.gni.
    remove_configs += [ "//build/config/compiler:no_optimize" ]
    configs += [ ":always_optimize" ]
  }
3709 3710
}

3711 3712
v8_source_set("torque_ls_base") {
  sources = [
3713
    "src/torque/ls/globals.h",
3714 3715 3716 3717
    "src/torque/ls/json-parser.cc",
    "src/torque/ls/json-parser.h",
    "src/torque/ls/json.cc",
    "src/torque/ls/json.h",
3718 3719 3720 3721 3722
    "src/torque/ls/message-handler.cc",
    "src/torque/ls/message-handler.h",
    "src/torque/ls/message-macros.h",
    "src/torque/ls/message-pipe.h",
    "src/torque/ls/message.h",
3723 3724
  ]

3725
  public_deps = [ ":torque_base" ]
3726

3727 3728 3729
  # The use of exceptions for Torque in violation of the Chromium style-guide
  # is justified by the fact that it is only used from the non-essential
  # language server and can be removed anytime if it causes problems.
3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

  remove_configs = [
    "//build/config/compiler:no_exceptions",
    "//build/config/compiler:no_rtti",
  ]

3741
  if (is_win && is_asan) {
3742
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3743 3744 3745
  }
}

3746
v8_component("v8_libbase") {
3747
  sources = [
3748
    "src/base/address-region.h",
lpy's avatar
lpy committed
3749
    "src/base/atomic-utils.h",
3750 3751
    "src/base/atomicops.h",
    "src/base/atomicops_internals_atomicword_compat.h",
3752
    "src/base/atomicops_internals_portable.h",
3753
    "src/base/atomicops_internals_std.h",
3754
    "src/base/base-export.h",
3755
    "src/base/bit-field.h",
3756
    "src/base/bits-iterator.h",
3757
    "src/base/bits.cc",
3758
    "src/base/bits.h",
3759 3760
    "src/base/bounded-page-allocator.cc",
    "src/base/bounded-page-allocator.h",
3761
    "src/base/bounds.h",
3762
    "src/base/build_config.h",
3763
    "src/base/compiler-specific.h",
3764 3765
    "src/base/cpu.cc",
    "src/base/cpu.h",
3766 3767
    "src/base/debug/stack_trace.cc",
    "src/base/debug/stack_trace.h",
3768 3769
    "src/base/division-by-constant.cc",
    "src/base/division-by-constant.h",
3770
    "src/base/enum-set.h",
3771
    "src/base/export-template.h",
3772 3773
    "src/base/file-utils.cc",
    "src/base/file-utils.h",
3774
    "src/base/flags.h",
3775
    "src/base/free_deleter.h",
3776 3777
    "src/base/functional.cc",
    "src/base/functional.h",
3778
    "src/base/hashmap-entry.h",
lpy's avatar
lpy committed
3779
    "src/base/hashmap.h",
3780 3781
    "src/base/ieee754.cc",
    "src/base/ieee754.h",
3782
    "src/base/iterator.h",
3783
    "src/base/lazy-instance.h",
3784 3785
    "src/base/logging.cc",
    "src/base/logging.h",
3786
    "src/base/lsan.h",
3787
    "src/base/macros.h",
3788
    "src/base/memory.h",
3789 3790
    "src/base/once.cc",
    "src/base/once.h",
3791
    "src/base/optional.h",
3792
    "src/base/overflowing-math.h",
3793 3794
    "src/base/page-allocator.cc",
    "src/base/page-allocator.h",
3795 3796
    "src/base/platform/condition-variable.cc",
    "src/base/platform/condition-variable.h",
jochen's avatar
jochen committed
3797
    "src/base/platform/elapsed-timer.h",
3798 3799 3800 3801 3802
    "src/base/platform/mutex.cc",
    "src/base/platform/mutex.h",
    "src/base/platform/platform.h",
    "src/base/platform/semaphore.cc",
    "src/base/platform/semaphore.h",
jochen's avatar
jochen committed
3803 3804
    "src/base/platform/time.cc",
    "src/base/platform/time.h",
3805 3806
    "src/base/region-allocator.cc",
    "src/base/region-allocator.h",
3807
    "src/base/ring-buffer.h",
3808 3809
    "src/base/safe_conversions.h",
    "src/base/safe_conversions_impl.h",
3810
    "src/base/small-vector.h",
3811 3812
    "src/base/sys-info.cc",
    "src/base/sys-info.h",
3813
    "src/base/template-utils.h",
3814
    "src/base/timezone-cache.h",
3815
    "src/base/type-traits.h",
3816 3817
    "src/base/utils/random-number-generator.cc",
    "src/base/utils/random-number-generator.h",
3818 3819
    "src/base/vlq-base64.cc",
    "src/base/vlq-base64.h",
3820 3821
  ]

3822
  configs = [ ":internal_config_base" ]
3823

3824 3825
  public_configs = [ ":libbase_config" ]

3826
  deps = [ ":v8_headers" ]
3827

Michael Achenbach's avatar
Michael Achenbach committed
3828 3829
  public_deps = []

3830 3831
  data = []

3832 3833
  data_deps = []

3834 3835
  defines = []

3836 3837 3838 3839
  if (is_component_build) {
    defines = [ "BUILDING_V8_BASE_SHARED" ]
  }

3840
  if (is_posix || is_fuchsia) {
3841 3842 3843 3844
    sources += [
      "src/base/platform/platform-posix.cc",
      "src/base/platform/platform-posix.h",
    ]
3845 3846 3847
    if (current_os != "aix") {
      sources += [
        "src/base/platform/platform-posix-time.cc",
3848
        "src/base/platform/platform-posix-time.h",
3849 3850
      ]
    }
3851 3852 3853
  }

  if (is_linux) {
3854 3855 3856 3857
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-linux.cc",
    ]
3858

jochen's avatar
jochen committed
3859 3860
    libs = [
      "dl",
3861 3862 3863 3864 3865 3866 3867 3868 3869 3870
      "rt",
    ]
  } else if (current_os == "aix") {
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-aix.cc",
    ]

    libs = [
      "dl",
jochen's avatar
jochen committed
3871 3872
      "rt",
    ]
3873
  } else if (is_android) {
3874
    if (current_toolchain == host_toolchain) {
jochen's avatar
jochen committed
3875 3876 3877 3878
      libs = [
        "dl",
        "rt",
      ]
3879
      if (host_os == "mac") {
3880 3881 3882 3883
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-macos.cc",
        ]
3884
      } else {
3885 3886 3887 3888
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-linux.cc",
        ]
3889 3890
      }
    } else {
3891 3892 3893 3894
      sources += [
        "src/base/debug/stack_trace_android.cc",
        "src/base/platform/platform-linux.cc",
      ]
3895
    }
3896 3897 3898 3899 3900
  } else if (is_fuchsia) {
    sources += [
      "src/base/debug/stack_trace_fuchsia.cc",
      "src/base/platform/platform-fuchsia.cc",
    ]
3901
  } else if (is_mac || is_ios) {
3902 3903 3904 3905
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-macos.cc",
    ]
3906 3907 3908
  } else if (is_win) {
    # TODO(jochen): Add support for cygwin.
    sources += [
3909
      "src/base/debug/stack_trace_win.cc",
3910
      "src/base/platform/platform-win32.cc",
3911
      "src/base/win32-headers.h",
3912 3913 3914 3915
    ]

    defines += [ "_CRT_RAND_S" ]  # for rand_s()

3916
    libs = [
3917
      "dbghelp.lib",
3918 3919 3920
      "winmm.lib",
      "ws2_32.lib",
    ]
3921

3922
    data_deps += [ "//build/win:runtime_libs" ]
3923 3924
  }

3925 3926 3927 3928 3929 3930 3931 3932
  if (v8_current_cpu == "mips" || v8_current_cpu == "mips64") {
    # Add runtime libs for mips.
    data += [
      "tools/mips_toolchain/sysroot/usr/lib/",
      "tools/mips_toolchain/mips-mti-linux-gnu/lib",
    ]
  }

3933 3934 3935 3936 3937 3938
  if (is_ubsan && (v8_current_cpu == "x86" || v8_current_cpu == "arm" ||
                   v8_current_cpu == "mips")) {
    # Special UBSan 32-bit requirement.
    sources += [ "src/base/ubsan.cc" ]
  }

3939 3940 3941 3942
  if (is_tsan && !build_with_chromium) {
    data += [ "tools/sanitizers/tsan_suppressions.txt" ]
  }

3943
  # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
3944 3945
}

3946
v8_component("v8_libplatform") {
3947
  sources = [
3948
    "//base/trace_event/common/trace_event_common.h",
3949
    "include/libplatform/libplatform-export.h",
3950
    "include/libplatform/libplatform.h",
3951
    "include/libplatform/v8-tracing.h",
3952 3953
    "src/libplatform/default-foreground-task-runner.cc",
    "src/libplatform/default-foreground-task-runner.h",
3954 3955
    "src/libplatform/default-job.cc",
    "src/libplatform/default-job.h",
3956 3957
    "src/libplatform/default-platform.cc",
    "src/libplatform/default-platform.h",
3958 3959
    "src/libplatform/default-worker-threads-task-runner.cc",
    "src/libplatform/default-worker-threads-task-runner.h",
3960 3961
    "src/libplatform/delayed-task-queue.cc",
    "src/libplatform/delayed-task-queue.h",
3962 3963
    "src/libplatform/task-queue.cc",
    "src/libplatform/task-queue.h",
3964 3965 3966 3967 3968 3969 3970
    "src/libplatform/tracing/trace-buffer.cc",
    "src/libplatform/tracing/trace-buffer.h",
    "src/libplatform/tracing/trace-config.cc",
    "src/libplatform/tracing/trace-object.cc",
    "src/libplatform/tracing/trace-writer.cc",
    "src/libplatform/tracing/trace-writer.h",
    "src/libplatform/tracing/tracing-controller.cc",
3971 3972 3973 3974
    "src/libplatform/worker-thread.cc",
    "src/libplatform/worker-thread.h",
  ]

3975
  configs = [ ":internal_config_base" ]
3976

3977 3978 3979 3980
  if (is_component_build) {
    defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
  }

3981
  public_configs = [ ":libplatform_config" ]
3982

3983
  deps = [
3984
    ":v8_headers",
3985
    ":v8_libbase",
3986
    ":v8_tracing",
3987
  ]
3988

3989
  if (v8_use_perfetto) {
3990 3991 3992 3993 3994 3995 3996 3997
    sources -= [
      "//base/trace_event/common/trace_event_common.h",
      "src/libplatform/tracing/trace-buffer.cc",
      "src/libplatform/tracing/trace-buffer.h",
      "src/libplatform/tracing/trace-object.cc",
      "src/libplatform/tracing/trace-writer.cc",
      "src/libplatform/tracing/trace-writer.h",
    ]
3998
    sources += [
3999
      "src/libplatform/tracing/trace-event-listener.cc",
4000
      "src/libplatform/tracing/trace-event-listener.h",
4001
    ]
4002
    deps += [
4003
      # TODO(skyostil): Switch TraceEventListener to protozero.
4004
      "//third_party/perfetto/protos/perfetto/trace:lite",
4005
    ]
4006
  }
4007 4008
}

4009 4010
v8_source_set("v8_libsampler") {
  sources = [
4011 4012
    "src/libsampler/sampler.cc",
    "src/libsampler/sampler.h",
4013 4014
  ]

4015
  configs = [ ":internal_config" ]
4016 4017 4018

  public_configs = [ ":libsampler_config" ]

4019
  deps = [ ":v8_libbase" ]
4020 4021
}

4022
v8_source_set("fuzzer_support") {
jochen's avatar
jochen committed
4023 4024 4025 4026 4027 4028 4029
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = [
    "test/fuzzer/fuzzer-support.cc",
    "test/fuzzer/fuzzer-support.h",
  ]

4030
  configs = [ ":internal_config_base" ]
jochen's avatar
jochen committed
4031

4032
  public_deps = [
4033
    ":v8",
4034
    ":v8_libbase",
4035
    ":v8_libplatform",
4036
    ":v8_maybe_icu",
4037 4038 4039
  ]
}

Michael Lippautz's avatar
Michael Lippautz committed
4040 4041 4042 4043
v8_source_set("cppgc_base") {
  visibility = [ ":*" ]

  sources = [
4044
    "include/cppgc/allocation.h",
4045
    "include/cppgc/common.h",
4046
    "include/cppgc/custom-space.h",
4047 4048
    "include/cppgc/garbage-collected.h",
    "include/cppgc/heap.h",
4049
    "include/cppgc/internal/accessors.h",
4050
    "include/cppgc/internal/api-contants.h",
4051
    "include/cppgc/internal/compiler-specific.h",
4052 4053
    "include/cppgc/internal/finalizer-traits.h",
    "include/cppgc/internal/gc-info.h",
4054
    "include/cppgc/internal/persistent-node.h",
4055
    "include/cppgc/internal/pointer-policies.h",
4056
    "include/cppgc/internal/prefinalizer-handler.h",
4057
    "include/cppgc/liveness-broker.h",
4058 4059
    "include/cppgc/liveness-broker.h",
    "include/cppgc/macros.h",
Anton Bikineev's avatar
Anton Bikineev committed
4060
    "include/cppgc/member.h",
4061
    "include/cppgc/persistent.h",
4062
    "include/cppgc/platform.h",
4063
    "include/cppgc/prefinalizer.h",
4064
    "include/cppgc/source-location.h",
4065 4066 4067
    "include/cppgc/trace-trait.h",
    "include/cppgc/type-traits.h",
    "include/cppgc/visitor.h",
Michael Lippautz's avatar
Michael Lippautz committed
4068
    "include/v8config.h",
4069
    "src/heap/cppgc/allocation.cc",
4070 4071
    "src/heap/cppgc/free-list.cc",
    "src/heap/cppgc/free-list.h",
4072 4073 4074
    "src/heap/cppgc/gc-info-table.cc",
    "src/heap/cppgc/gc-info-table.h",
    "src/heap/cppgc/gc-info.cc",
4075
    "src/heap/cppgc/heap-inl.h",
4076 4077 4078
    "src/heap/cppgc/heap-object-header-inl.h",
    "src/heap/cppgc/heap-object-header.cc",
    "src/heap/cppgc/heap-object-header.h",
4079 4080
    "src/heap/cppgc/heap-page.cc",
    "src/heap/cppgc/heap-page.h",
4081 4082
    "src/heap/cppgc/heap-space.cc",
    "src/heap/cppgc/heap-space.h",
4083
    "src/heap/cppgc/heap-visitor.h",
4084 4085
    "src/heap/cppgc/heap.cc",
    "src/heap/cppgc/heap.h",
4086
    "src/heap/cppgc/liveness-broker.cc",
4087
    "src/heap/cppgc/logging.cc",
4088 4089 4090 4091
    "src/heap/cppgc/marker.cc",
    "src/heap/cppgc/marker.h",
    "src/heap/cppgc/marking-visitor.cc",
    "src/heap/cppgc/marking-visitor.h",
4092 4093 4094
    "src/heap/cppgc/object-allocator-inl.h",
    "src/heap/cppgc/object-allocator.cc",
    "src/heap/cppgc/object-allocator.h",
4095 4096
    "src/heap/cppgc/object-start-bitmap-inl.h",
    "src/heap/cppgc/object-start-bitmap.h",
4097 4098 4099
    "src/heap/cppgc/page-memory-inl.h",
    "src/heap/cppgc/page-memory.cc",
    "src/heap/cppgc/page-memory.h",
4100
    "src/heap/cppgc/persistent-node.cc",
4101
    "src/heap/cppgc/platform.cc",
4102
    "src/heap/cppgc/pointer-policies.cc",
4103 4104
    "src/heap/cppgc/prefinalizer-handler.cc",
    "src/heap/cppgc/prefinalizer-handler.h",
4105 4106
    "src/heap/cppgc/raw-heap.cc",
    "src/heap/cppgc/raw-heap.h",
4107
    "src/heap/cppgc/sanitizers.h",
4108
    "src/heap/cppgc/source-location.cc",
4109 4110
    "src/heap/cppgc/stack.cc",
    "src/heap/cppgc/stack.h",
4111 4112
    "src/heap/cppgc/sweeper.cc",
    "src/heap/cppgc/sweeper.h",
4113
    "src/heap/cppgc/visitor.cc",
Omer Katz's avatar
Omer Katz committed
4114
    "src/heap/cppgc/worklist.h",
Michael Lippautz's avatar
Michael Lippautz committed
4115 4116
  ]

4117
  if (is_clang || !is_win) {
4118
    if (target_cpu == "x64") {
4119
      sources += [ "src/heap/cppgc/asm/x64/push_registers_asm.cc" ]
4120
    } else if (target_cpu == "x86") {
4121
      sources += [ "src/heap/cppgc/asm/ia32/push_registers_asm.cc" ]
4122
    } else if (target_cpu == "arm") {
4123
      sources += [ "src/heap/cppgc/asm/arm/push_registers_asm.cc" ]
4124 4125
    } else if (target_cpu == "arm64") {
      sources += [ "src/heap/cppgc/asm/arm64/push_registers_asm.cc" ]
4126 4127 4128 4129
    } else if (target_cpu == "ppc64") {
      sources += [ "src/heap/cppgc/asm/ppc/push_registers_asm.cc" ]
    } else if (target_cpu == "s390x") {
      sources += [ "src/heap/cppgc/asm/s390/push_registers_asm.cc" ]
4130 4131 4132 4133
    } else if (target_cpu == "mipsel") {
      sources += [ "src/heap/cppgc/asm/mips/push_registers_asm.cc" ]
    } else if (target_cpu == "mips64el") {
      sources += [ "src/heap/cppgc/asm/mips64/push_registers_asm.cc" ]
4134
    }
4135 4136 4137 4138 4139
  } else if (is_win) {
    if (target_cpu == "x64") {
      sources += [ "src/heap/cppgc/asm/x64/push_registers_masm.S" ]
    } else if (target_cpu == "x86") {
      sources += [ "src/heap/cppgc/asm/ia32/push_registers_masm.S" ]
4140 4141
    } else if (target_cpu == "arm64") {
      sources += [ "src/heap/cppgc/asm/arm64/push_registers_masm.S" ]
4142
    }
4143 4144
  }

4145 4146 4147 4148
  configs = [
    ":internal_config",
    ":cppgc_base_config",
  ]
Michael Lippautz's avatar
Michael Lippautz committed
4149 4150 4151 4152

  public_deps = [ ":v8_libbase" ]
}

4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175
###############################################################################
# Produce a single static library for embedders
#

if (v8_monolithic) {
  # A component build is not monolithic.
  assert(!is_component_build)

  # Using external startup data would produce separate files.
  assert(!v8_use_external_startup_data)
  v8_static_library("v8_monolith") {
    deps = [
      ":v8",
      ":v8_libbase",
      ":v8_libplatform",
      ":v8_libsampler",
      "//build/win:default_exe_manifest",
    ]

    configs = [ ":internal_config" ]
  }
}

4176 4177 4178 4179 4180 4181
v8_static_library("wee8") {
  deps = [
    ":v8_base",
    ":v8_libbase",
    ":v8_libplatform",
    ":v8_libsampler",
4182
    ":v8_snapshot",
4183 4184 4185 4186 4187 4188 4189 4190
    "//build/win:default_exe_manifest",
  ]

  # TODO: v8dll-main.cc equivalent for shared library builds

  configs = [ ":internal_config" ]

  sources = [
4191
    ### gcmole(all) ###
4192
    "src/wasm/c-api.cc",
4193
    "src/wasm/c-api.h",
4194 4195
    "third_party/wasm-api/wasm.h",
    "third_party/wasm-api/wasm.hh",
4196 4197 4198
  ]
}

4199 4200 4201 4202
###############################################################################
# Executables
#

4203
if (current_toolchain == v8_generator_toolchain) {
4204
  v8_executable("bytecode_builtins_list_generator") {
4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216
    visibility = [ ":*" ]  # Only targets in this file can depend on this.

    include_dirs = [ "." ]

    sources = [
      "src/builtins/generate-bytecodes-builtins-list.cc",
      "src/interpreter/bytecode-operands.cc",
      "src/interpreter/bytecode-operands.h",
      "src/interpreter/bytecodes.cc",
      "src/interpreter/bytecodes.h",
    ]

4217 4218
    configs = [ ":internal_config" ]

4219 4220 4221 4222 4223 4224 4225
    deps = [
      ":v8_libbase",
      "//build/win:default_exe_manifest",
    ]
  }
}

4226
if (current_toolchain == v8_snapshot_toolchain) {
4227
  v8_executable("mksnapshot") {
4228
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
4229

4230
    sources = [
4231
      "src/snapshot/embedded/embedded-empty.cc",
4232 4233
      "src/snapshot/embedded/embedded-file-writer.cc",
      "src/snapshot/embedded/embedded-file-writer.h",
4234 4235
      "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
4236 4237 4238 4239
      "src/snapshot/embedded/platform-embedded-file-writer-base.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-base.h",
      "src/snapshot/embedded/platform-embedded-file-writer-generic.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-generic.h",
4240 4241 4242 4243
      "src/snapshot/embedded/platform-embedded-file-writer-mac.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-mac.h",
      "src/snapshot/embedded/platform-embedded-file-writer-win.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-win.h",
4244
      "src/snapshot/mksnapshot.cc",
4245
      "src/snapshot/snapshot-empty.cc",
4246
    ]
4247

4248
    configs = [ ":internal_config" ]
4249

4250
    deps = [
4251 4252
      ":v8_base_without_compiler",
      ":v8_compiler_for_mksnapshot",
4253
      ":v8_init",
4254
      ":v8_libbase",
4255
      ":v8_libplatform",
4256
      ":v8_maybe_icu",
4257
      ":v8_tracing",
4258
      "//build/win:default_exe_manifest",
4259
    ]
4260
  }
4261 4262
}

4263 4264 4265 4266
if (current_toolchain == v8_snapshot_toolchain) {
  v8_executable("torque") {
    visibility = [ ":*" ]  # Only targets in this file can depend on this.

4267
    sources = [ "src/torque/torque.cc" ]
4268 4269

    deps = [
4270
      ":torque_base",
4271 4272 4273
      "//build/win:default_exe_manifest",
    ]

4274 4275 4276
    # The use of exceptions for Torque in violation of the Chromium style-guide
    # is justified by the fact that it is only used from the non-essential
    # language server and can be removed anytime if it causes problems.
4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287
    configs = [
      ":internal_config",
      "//build/config/compiler:exceptions",
      "//build/config/compiler:rtti",
    ]

    remove_configs = [
      "//build/config/compiler:no_exceptions",
      "//build/config/compiler:no_rtti",
    ]

4288
    if (is_win && is_asan) {
4289
      remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
4290
    }
4291 4292 4293
  }
}

4294 4295 4296
v8_executable("torque-language-server") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

4297
  sources = [ "src/torque/ls/torque-language-server.cc" ]
4298 4299 4300 4301 4302 4303 4304

  deps = [
    ":torque_base",
    ":torque_ls_base",
    "//build/win:default_exe_manifest",
  ]

4305 4306 4307
  # The use of exceptions for Torque in violation of the Chromium style-guide
  # is justified by the fact that it is only used from the non-essential
  # language server and can be removed anytime if it causes problems.
4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

  remove_configs = [
    "//build/config/compiler:no_exceptions",
    "//build/config/compiler:no_rtti",
  ]

4319
  if (is_win && is_asan) {
4320
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
4321 4322 4323
  }
}

4324 4325 4326 4327
if (v8_enable_i18n_support) {
  if (current_toolchain == v8_generator_toolchain) {
    v8_executable("gen-regexp-special-case") {
      visibility = [ ":*" ]  # Only targets in this file can depend on this.
4328

4329
      sources = [ "src/regexp/gen-regexp-special-case.cc" ]
4330

4331 4332 4333 4334 4335
      deps = [
        ":v8_libbase",
        "//build/win:default_exe_manifest",
        "//third_party/icu",
      ]
4336

4337 4338
      configs = [ ":internal_config" ]
    }
4339 4340
  }

4341 4342
  action("run_gen-regexp-special-case") {
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
4343

4344
    script = "tools/run.py"
4345

4346
    deps = [ ":gen-regexp-special-case($v8_generator_toolchain)" ]
4347

4348
    output_file = "$target_gen_dir/src/regexp/special-case.cc"
4349

4350
    outputs = [ output_file ]
4351

4352 4353 4354 4355 4356 4357 4358 4359 4360
    args = [
      "./" + rebase_path(
              get_label_info(
                      ":gen-regexp-special-case($v8_generator_toolchain)",
                      "root_out_dir") + "/gen-regexp-special-case",
              root_build_dir),
      rebase_path(output_file, root_build_dir),
    ]
  }
4361 4362
}

4363 4364 4365
###############################################################################
# Public targets
#
4366

4367
want_v8_shell =
machenbach's avatar
machenbach committed
4368 4369 4370
    (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
    (current_toolchain == v8_snapshot_toolchain &&
     v8_toolset_for_shell == "host") ||
4371
    (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
machenbach's avatar
machenbach committed
4372 4373 4374 4375 4376 4377

group("gn_all") {
  testonly = true

  deps = [
    ":d8",
4378
    ":v8_fuzzers",
jochen's avatar
jochen committed
4379 4380
    ":v8_hello_world",
    ":v8_sample_process",
4381 4382
    "test:gn_all",
    "tools:gn_all",
machenbach's avatar
machenbach committed
4383 4384
  ]

4385 4386 4387 4388 4389
  if (v8_custom_deps != "") {
    # Custom dependency from directory under v8/custom_deps.
    deps += [ v8_custom_deps ]
  }

machenbach's avatar
machenbach committed
4390
  if (want_v8_shell) {
4391
    deps += [ ":v8_shell" ]
machenbach's avatar
machenbach committed
4392 4393 4394
  }
}

4395
group("v8_python_base") {
4396
  data = [ ".vpython" ]
4397 4398
}

4399
group("v8_clusterfuzz") {
4400 4401
  testonly = true

4402
  deps = [ ":d8" ]
4403 4404 4405 4406

  if (v8_multi_arch_build) {
    deps += [
      ":d8(//build/toolchain/linux:clang_x64)",
4407
      ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
4408
      ":d8(//build/toolchain/linux:clang_x86)",
4409
      ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
4410
      ":d8(tools/clusterfuzz/toolchain:clang_x64_pointer_compression)",
4411 4412 4413 4414
    ]
  }
}

4415
group("v8_archive") {
4416 4417
  testonly = true

4418
  deps = [ ":d8" ]
4419 4420 4421 4422 4423

  if (!is_win) {
    # On windows, cctest doesn't link with v8_static_library.
    deps += [ "test/cctest:cctest" ]
  }
4424 4425
}

4426 4427 4428 4429 4430
# TODO(dglazkov): Remove the "!build_with_chromium" condition once this clause
# is removed from Chromium.
if (is_fuchsia && !build_with_chromium) {
  import("//build/config/fuchsia/rules.gni")

4431
  cr_fuchsia_package("d8_fuchsia_pkg") {
4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443
    testonly = true
    binary = ":d8"
    package_name_override = "d8"
  }

  fuchsia_package_runner("d8_fuchsia") {
    testonly = true
    package = ":d8_fuchsia_pkg"
    package_name_override = "d8"
  }
}

4444 4445
group("v8_fuzzers") {
  testonly = true
4446
  data_deps = [
4447
    ":v8_simple_json_fuzzer",
4448
    ":v8_simple_multi_return_fuzzer",
4449
    ":v8_simple_parser_fuzzer",
4450
    ":v8_simple_regexp_builtins_fuzzer",
4451
    ":v8_simple_regexp_fuzzer",
4452
    ":v8_simple_wasm_async_fuzzer",
4453
    ":v8_simple_wasm_code_fuzzer",
4454
    ":v8_simple_wasm_compile_fuzzer",
4455 4456 4457 4458
    ":v8_simple_wasm_fuzzer",
  ]
}

4459
if (is_component_build) {
4460
  v8_component("v8") {
4461
    sources = [ "src/utils/v8dll-main.cc" ]
4462

4463 4464
    public_deps = [
      ":v8_base",
4465
      ":v8_snapshot",
4466
    ]
4467

4468
    configs = [ ":internal_config" ]
4469

4470
    public_configs = [ ":external_config" ]
4471
  }
4472 4473 4474 4475

  v8_component("v8_for_testing") {
    testonly = true

4476
    sources = [ "src/utils/v8dll-main.cc" ]
4477 4478

    public_deps = [
4479
      ":torque_base",
4480
      ":torque_ls_base",
4481
      ":v8_base",
4482
      ":v8_headers",
4483
      ":v8_initializers",
4484
      ":v8_snapshot",
4485 4486 4487 4488 4489 4490
    ]

    configs = [ ":internal_config" ]

    public_configs = [ ":external_config" ]
  }
Michael Lippautz's avatar
Michael Lippautz committed
4491

4492 4493 4494 4495 4496 4497 4498 4499
  v8_component("cppgc") {
    public_deps = [ ":cppgc_base" ]

    configs = [ ":internal_config" ]

    public_configs = [ ":external_config" ]
  }

Michael Lippautz's avatar
Michael Lippautz committed
4500 4501 4502 4503 4504 4505 4506 4507
  v8_component("cppgc_for_testing") {
    testonly = true

    public_deps = [ ":cppgc_base" ]

    configs = [ ":internal_config" ]
    public_configs = [ ":external_config" ]
  }
4508 4509
} else {
  group("v8") {
4510 4511
    public_deps = [
      ":v8_base",
4512
      ":v8_snapshot",
4513
    ]
4514

4515
    public_configs = [ ":external_config" ]
4516
  }
4517 4518 4519 4520 4521

  group("v8_for_testing") {
    testonly = true

    public_deps = [
4522
      ":torque_base",
4523
      ":torque_ls_base",
4524
      ":v8_base",
4525
      ":v8_initializers",
4526
      ":v8_snapshot",
4527 4528 4529 4530
    ]

    public_configs = [ ":external_config" ]
  }
Michael Lippautz's avatar
Michael Lippautz committed
4531

4532 4533 4534 4535 4536 4537
  group("cppgc") {
    public_deps = [ ":cppgc_base" ]

    public_configs = [ ":external_config" ]
  }

Michael Lippautz's avatar
Michael Lippautz committed
4538 4539 4540 4541 4542 4543 4544
  group("cppgc_for_testing") {
    testonly = true

    public_deps = [ ":cppgc_base" ]

    public_configs = [ ":external_config" ]
  }
4545
}
jochen's avatar
jochen committed
4546

4547
v8_executable("d8") {
4548
  sources = [
4549 4550 4551 4552 4553 4554 4555 4556 4557
    "src/d8/async-hooks-wrapper.cc",
    "src/d8/async-hooks-wrapper.h",
    "src/d8/d8-console.cc",
    "src/d8/d8-console.h",
    "src/d8/d8-js.cc",
    "src/d8/d8-platforms.cc",
    "src/d8/d8-platforms.h",
    "src/d8/d8.cc",
    "src/d8/d8.h",
4558
  ]
jochen's avatar
jochen committed
4559

4560
  configs = [
4561 4562 4563 4564
    # Note: don't use :internal_config here because this target will get
    # the :external_config applied to it by virtue of depending on :v8, and
    # you can't have both applied to the same target.
    ":internal_config_base",
4565
    ":v8_tracing_config",
4566
  ]
jochen's avatar
jochen committed
4567

4568 4569
  deps = [
    ":v8",
4570
    ":v8_libbase",
4571
    ":v8_libplatform",
4572
    ":v8_tracing",
4573 4574
    "//build/win:default_exe_manifest",
  ]
jochen's avatar
jochen committed
4575

4576
  if (is_posix || is_fuchsia) {
4577
    sources += [ "src/d8/d8-posix.cc" ]
4578
  } else if (is_win) {
4579
    sources += [ "src/d8/d8-windows.cc" ]
4580
  }
jochen's avatar
jochen committed
4581

4582
  if (v8_correctness_fuzzer) {
4583
    deps += [ "tools/clusterfuzz:v8_correctness_fuzzer_resources" ]
4584 4585
  }

4586
  defines = []
4587 4588

  if (v8_enable_vtunejit) {
4589
    deps += [ "src/third_party/vtune:v8_vtune" ]
4590
  }
jochen's avatar
jochen committed
4591
}
jochen's avatar
jochen committed
4592

jochen's avatar
jochen committed
4593
v8_executable("v8_hello_world") {
4594
  sources = [ "samples/hello-world.cc" ]
jochen's avatar
jochen committed
4595 4596 4597 4598 4599 4600 4601 4602 4603 4604

  configs = [
    # Note: don't use :internal_config here because this target will get
    # the :external_config applied to it by virtue of depending on :v8, and
    # you can't have both applied to the same target.
    ":internal_config_base",
  ]

  deps = [
    ":v8",
4605
    ":v8_libbase",
jochen's avatar
jochen committed
4606 4607 4608 4609 4610 4611
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
}

v8_executable("v8_sample_process") {
4612
  sources = [ "samples/process.cc" ]
jochen's avatar
jochen committed
4613 4614 4615 4616 4617 4618 4619 4620

  configs = [
    # Note: don't use :internal_config here because this target will get
    # the :external_config applied to it by virtue of depending on :v8, and
    # you can't have both applied to the same target.
    ":internal_config_base",
  ]

4621
  deps = [
4622
    ":v8",
4623
    ":v8_libbase",
4624 4625 4626 4627 4628
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
}

machenbach's avatar
machenbach committed
4629
if (want_v8_shell) {
4630
  v8_executable("v8_shell") {
4631
    sources = [ "samples/shell.cc" ]
4632

4633
    configs = [
4634 4635 4636 4637 4638 4639 4640 4641
      # Note: don't use :internal_config here because this target will get
      # the :external_config applied to it by virtue of depending on :v8, and
      # you can't have both applied to the same target.
      ":internal_config_base",
    ]

    deps = [
      ":v8",
4642
      ":v8_libbase",
4643 4644 4645 4646 4647 4648
      ":v8_libplatform",
      "//build/win:default_exe_manifest",
    ]
  }
}

machenbach's avatar
machenbach committed
4649 4650 4651
template("v8_fuzzer") {
  name = target_name
  forward_variables_from(invoker, "*")
4652
  v8_executable("v8_simple_" + name) {
machenbach's avatar
machenbach committed
4653 4654
    deps = [
      ":" + name,
4655
      "//build/win:default_exe_manifest",
machenbach's avatar
machenbach committed
4656 4657
    ]

4658
    sources = [ "test/fuzzer/fuzzer.cc" ]
4659

4660
    configs = [ ":external_config" ]
machenbach's avatar
machenbach committed
4661 4662 4663
  }
}

4664
v8_source_set("json_fuzzer") {
4665
  sources = [ "test/fuzzer/json.cc" ]
jochen's avatar
jochen committed
4666

4667
  deps = [ ":fuzzer_support" ]
jochen's avatar
jochen committed
4668

4669 4670 4671 4672
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4673 4674
}

4675 4676
v8_fuzzer("json_fuzzer") {
}
machenbach's avatar
machenbach committed
4677

4678
v8_source_set("multi_return_fuzzer") {
4679
  sources = [ "test/fuzzer/multi-return.cc" ]
4680

4681
  deps = [ ":fuzzer_support" ]
4682 4683 4684 4685 4686 4687 4688 4689 4690 4691

  configs = [
    ":external_config",
    ":internal_config_base",
  ]
}

v8_fuzzer("multi_return_fuzzer") {
}

4692
v8_source_set("parser_fuzzer") {
4693
  sources = [ "test/fuzzer/parser.cc" ]
jochen's avatar
jochen committed
4694

4695
  deps = [ ":fuzzer_support" ]
jochen's avatar
jochen committed
4696

4697 4698 4699 4700
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4701
}
4702

4703 4704
v8_fuzzer("parser_fuzzer") {
}
machenbach's avatar
machenbach committed
4705

4706 4707 4708 4709 4710 4711
v8_source_set("regexp_builtins_fuzzer") {
  sources = [
    "test/fuzzer/regexp-builtins.cc",
    "test/fuzzer/regexp_builtins/mjsunit.js.h",
  ]

4712
  deps = [ ":fuzzer_support" ]
4713 4714 4715 4716 4717 4718 4719 4720 4721 4722

  configs = [
    ":external_config",
    ":internal_config_base",
  ]
}

v8_fuzzer("regexp_builtins_fuzzer") {
}

4723
v8_source_set("regexp_fuzzer") {
4724
  sources = [ "test/fuzzer/regexp.cc" ]
4725

4726
  deps = [ ":fuzzer_support" ]
4727

4728 4729 4730 4731
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4732
}
4733

4734 4735
v8_fuzzer("regexp_fuzzer") {
}
machenbach's avatar
machenbach committed
4736

4737 4738 4739 4740 4741 4742
v8_source_set("wasm_module_runner") {
  sources = [
    "test/common/wasm/wasm-module-runner.cc",
    "test/common/wasm/wasm-module-runner.h",
  ]

4743
  deps = [
4744
    ":generate_bytecode_builtins_list",
4745
    ":run_torque",
4746
    ":v8_tracing",
4747 4748
  ]

4749
  public_deps = [ ":v8_maybe_icu" ]
4750

4751 4752 4753 4754
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4755 4756
}

4757
v8_source_set("wasm_fuzzer") {
4758
  sources = [ "test/fuzzer/wasm.cc" ]
4759 4760 4761

  deps = [
    ":fuzzer_support",
4762
    ":lib_wasm_fuzzer_common",
4763
    ":wasm_module_runner",
4764 4765
  ]

4766 4767 4768 4769
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4770 4771
}

4772 4773
v8_fuzzer("wasm_fuzzer") {
}
machenbach's avatar
machenbach committed
4774

4775
v8_source_set("wasm_async_fuzzer") {
4776
  sources = [ "test/fuzzer/wasm-async.cc" ]
4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792

  deps = [
    ":fuzzer_support",
    ":lib_wasm_fuzzer_common",
    ":wasm_module_runner",
  ]

  configs = [
    ":external_config",
    ":internal_config_base",
  ]
}

v8_fuzzer("wasm_async_fuzzer") {
}

4793 4794
v8_source_set("wasm_code_fuzzer") {
  sources = [
4795
    "test/common/wasm/test-signatures.h",
4796 4797 4798 4799 4800
    "test/fuzzer/wasm-code.cc",
  ]

  deps = [
    ":fuzzer_support",
4801
    ":lib_wasm_fuzzer_common",
4802
    ":wasm_module_runner",
4803 4804
  ]

4805 4806 4807 4808
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4809 4810 4811 4812
}

v8_fuzzer("wasm_code_fuzzer") {
}
4813

4814
v8_source_set("lib_wasm_fuzzer_common") {
4815
  sources = [
4816 4817
    "test/fuzzer/wasm-fuzzer-common.cc",
    "test/fuzzer/wasm-fuzzer-common.h",
4818 4819
  ]

4820
  deps = [
4821
    ":generate_bytecode_builtins_list",
4822
    ":run_torque",
4823
    ":v8_tracing",
4824 4825
  ]

4826
  public_deps = [ ":v8_maybe_icu" ]
4827

4828 4829 4830 4831
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4832 4833
}

4834 4835
v8_source_set("wasm_compile_fuzzer") {
  sources = [
4836
    "test/common/wasm/test-signatures.h",
4837 4838 4839 4840 4841
    "test/fuzzer/wasm-compile.cc",
  ]

  deps = [
    ":fuzzer_support",
4842
    ":lib_wasm_fuzzer_common",
4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853
    ":wasm_module_runner",
  ]

  configs = [
    ":external_config",
    ":internal_config_base",
  ]
}

v8_fuzzer("wasm_compile_fuzzer") {
}
4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864

# Target to build all generated .cc files.
group("v8_generated_cc_files") {
  testonly = true

  deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
    "src/inspector:v8_generated_cc_files",
  ]
}
4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881

# Protobuf targets, used only when building outside of chromium.

if (!build_with_chromium && v8_use_perfetto) {
  # This config is applied to the autogenerated .pb.{cc,h} files in
  # proto_library.gni. This config is propagated up to the source sets
  # that depend on generated proto headers.
  config("protobuf_gen_config") {
    defines = [
      "GOOGLE_PROTOBUF_NO_RTTI",
      "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
    ]
    cflags = [
      "-Wno-unknown-warning-option",
      "-Wno-deprecated",
      "-Wno-undef",
      "-Wno-zero-as-null-pointer-constant",
4882
      "-Wno-thread-safety-attributes",
4883
    ]
4884
    include_dirs = [ "third_party/protobuf/src" ]
4885 4886 4887 4888 4889 4890 4891
  }

  # Configuration used to build libprotobuf_* and the protoc compiler.
  config("protobuf_config") {
    # Apply the lighter supressions and macro definitions from above.
    configs = [ ":protobuf_gen_config" ]

4892 4893 4894
    if (!is_win) {
      defines = [ "HAVE_PTHREAD=1" ]
    }
4895 4896
    if (is_clang) {
      cflags = [
4897 4898 4899
        "-Wno-unused-private-field",
        "-Wno-unused-function",
        "-Wno-inconsistent-missing-override",
4900 4901 4902 4903 4904 4905
        "-Wno-unknown-warning-option",
        "-Wno-enum-compare-switch",
        "-Wno-user-defined-warnings",
        "-Wno-tautological-constant-compare",
      ]
    }
4906
    if (is_win && is_clang) {
4907 4908
      cflags += [ "-Wno-microsoft-unqualified-friend" ]
    }
4909 4910 4911 4912
  }

  source_set("protobuf_lite") {
    sources = [
4913
      "third_party/protobuf/src/google/protobuf/any_lite.cc",
4914 4915
      "third_party/protobuf/src/google/protobuf/arena.cc",
      "third_party/protobuf/src/google/protobuf/extension_set.cc",
4916
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
4917
      "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
4918
      "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
4919
      "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
4920
      "third_party/protobuf/src/google/protobuf/io/strtod.cc",
4921 4922 4923 4924 4925 4926 4927
      "third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc",
      "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
      "third_party/protobuf/src/google/protobuf/message_lite.cc",
      "third_party/protobuf/src/google/protobuf/repeated_field.cc",
      "third_party/protobuf/src/google/protobuf/stubs/bytestream.cc",
      "third_party/protobuf/src/google/protobuf/stubs/common.cc",
      "third_party/protobuf/src/google/protobuf/stubs/int128.cc",
4928
      "third_party/protobuf/src/google/protobuf/stubs/io_win32.cc",
4929 4930 4931 4932 4933 4934 4935 4936 4937 4938
      "third_party/protobuf/src/google/protobuf/stubs/status.cc",
      "third_party/protobuf/src/google/protobuf/stubs/statusor.cc",
      "third_party/protobuf/src/google/protobuf/stubs/stringpiece.cc",
      "third_party/protobuf/src/google/protobuf/stubs/stringprintf.cc",
      "third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc",
      "third_party/protobuf/src/google/protobuf/stubs/strutil.cc",
      "third_party/protobuf/src/google/protobuf/stubs/time.cc",
      "third_party/protobuf/src/google/protobuf/wire_format_lite.cc",
    ]
    configs -= [ "//build/config/compiler:chromium_code" ]
4939 4940 4941 4942
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4943 4944 4945
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4946 4947 4948 4949 4950
    public_configs = [ ":protobuf_gen_config" ]
  }

  # This target should be used only by the protoc compiler and by test targets.
  source_set("protobuf_full") {
4951
    deps = [ ":protobuf_lite" ]
4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966
    sources = [
      "third_party/protobuf/src/google/protobuf/any.cc",
      "third_party/protobuf/src/google/protobuf/any.pb.cc",
      "third_party/protobuf/src/google/protobuf/api.pb.cc",
      "third_party/protobuf/src/google/protobuf/compiler/importer.cc",
      "third_party/protobuf/src/google/protobuf/compiler/parser.cc",
      "third_party/protobuf/src/google/protobuf/descriptor.cc",
      "third_party/protobuf/src/google/protobuf/descriptor.pb.cc",
      "third_party/protobuf/src/google/protobuf/descriptor_database.cc",
      "third_party/protobuf/src/google/protobuf/duration.pb.cc",
      "third_party/protobuf/src/google/protobuf/dynamic_message.cc",
      "third_party/protobuf/src/google/protobuf/empty.pb.cc",
      "third_party/protobuf/src/google/protobuf/extension_set_heavy.cc",
      "third_party/protobuf/src/google/protobuf/field_mask.pb.cc",
      "third_party/protobuf/src/google/protobuf/generated_message_reflection.cc",
4967
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven.cc",
4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983
      "third_party/protobuf/src/google/protobuf/io/gzip_stream.cc",
      "third_party/protobuf/src/google/protobuf/io/printer.cc",
      "third_party/protobuf/src/google/protobuf/io/tokenizer.cc",
      "third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
      "third_party/protobuf/src/google/protobuf/map_field.cc",
      "third_party/protobuf/src/google/protobuf/message.cc",
      "third_party/protobuf/src/google/protobuf/reflection_ops.cc",
      "third_party/protobuf/src/google/protobuf/service.cc",
      "third_party/protobuf/src/google/protobuf/source_context.pb.cc",
      "third_party/protobuf/src/google/protobuf/struct.pb.cc",
      "third_party/protobuf/src/google/protobuf/stubs/mathlimits.cc",
      "third_party/protobuf/src/google/protobuf/stubs/substitute.cc",
      "third_party/protobuf/src/google/protobuf/text_format.cc",
      "third_party/protobuf/src/google/protobuf/timestamp.pb.cc",
      "third_party/protobuf/src/google/protobuf/type.pb.cc",
      "third_party/protobuf/src/google/protobuf/unknown_field_set.cc",
4984
      "third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc",
4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008
      "third_party/protobuf/src/google/protobuf/util/field_comparator.cc",
      "third_party/protobuf/src/google/protobuf/util/field_mask_util.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/datapiece.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/error_listener.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/json_escaping.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/object_writer.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/proto_writer.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/type_info.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
      "third_party/protobuf/src/google/protobuf/util/internal/utility.cc",
      "third_party/protobuf/src/google/protobuf/util/json_util.cc",
      "third_party/protobuf/src/google/protobuf/util/message_differencer.cc",
      "third_party/protobuf/src/google/protobuf/util/time_util.cc",
      "third_party/protobuf/src/google/protobuf/util/type_resolver_util.cc",
      "third_party/protobuf/src/google/protobuf/wire_format.cc",
      "third_party/protobuf/src/google/protobuf/wrappers.pb.cc",
    ]
    configs -= [ "//build/config/compiler:chromium_code" ]
5009 5010 5011 5012
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
5013 5014 5015
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
5016 5017 5018 5019 5020
    public_configs = [ ":protobuf_gen_config" ]
  }

  if (current_toolchain == host_toolchain) {
    source_set("protoc_lib") {
5021
      deps = [ ":protobuf_full" ]
5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034
      sources = [
        "third_party/protobuf/src/google/protobuf/compiler/code_generator.cc",
        "third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
5035
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
5036 5037 5038 5039 5040 5041 5042 5043 5044
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
        "third_party/protobuf/src/google/protobuf/compiler/plugin.cc",
        "third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc",
        "third_party/protobuf/src/google/protobuf/compiler/subprocess.cc",
        "third_party/protobuf/src/google/protobuf/compiler/zip_writer.cc",
      ]
      configs -= [ "//build/config/compiler:chromium_code" ]
5045 5046 5047 5048
      configs += [
        "//build/config/compiler:no_chromium_code",
        ":protobuf_config",
      ]
5049 5050 5051
      if (is_win) {
        configs -= [ "//build/config/win:lean_and_mean" ]
      }
5052 5053 5054 5055 5056 5057 5058 5059
      public_configs = [ ":protobuf_gen_config" ]
    }

    executable("protoc") {
      deps = [
        ":protoc_lib",
        "//build/win:default_exe_manifest",
      ]
5060
      sources = [ "src/protobuf/protobuf-compiler-main.cc" ]
5061
      configs -= [ "//build/config/compiler:chromium_code" ]
5062
      configs += [ "//build/config/compiler:no_chromium_code" ]
5063 5064
    }
  }  # host_toolchain
5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081

  v8_component("v8_libperfetto") {
    configs = [ ":v8_tracing_config" ]
    public_configs = [ "//third_party/perfetto/gn:public_config" ]
    deps = [
      "//third_party/perfetto/src/trace_processor:export_json",
      "//third_party/perfetto/src/trace_processor:storage_minimal",
      "//third_party/perfetto/src/tracing:client_api",
      "//third_party/perfetto/src/tracing/core",

      # TODO(skyostil): Support non-POSIX platforms.
      "//third_party/perfetto/protos/perfetto/config:cpp",
      "//third_party/perfetto/protos/perfetto/trace/track_event:zero",
      "//third_party/perfetto/src/tracing:in_process_backend",
      "//third_party/perfetto/src/tracing:platform_posix",
    ]
  }
5082
}  # if (!build_with_chromium && v8_use_perfetto)