BUILD.gn 147 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 23 24 25
# 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.
is_target_simulator = (target_cpu != v8_target_cpu && !v8_multi_arch_build) ||
                      (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 = true
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 131 132
  # Sets -dV8_ARRAY_BUFFER_EXTENSION
  v8_enable_array_buffer_extension = true

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 173
  # 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 =
      v8_current_cpu != "x86" && (is_android || is_target_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
# Derived defaults.
213
if (v8_enable_verify_heap == "") {
214
  v8_enable_verify_heap = v8_enable_debugging_features
215 216
}
if (v8_enable_object_print == "") {
217
  v8_enable_object_print = v8_enable_debugging_features
218 219
}
if (v8_enable_disassembler == "") {
220
  v8_enable_disassembler = v8_enable_debugging_features
221 222
}
if (v8_enable_trace_maps == "") {
223
  v8_enable_trace_maps = v8_enable_debugging_features
224
}
225
if (v8_enable_test_features == "") {
226
  v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
227
}
228
if (v8_enable_v8_checks == "") {
229
  v8_enable_v8_checks = v8_enable_debugging_features
230
}
231
if (v8_check_microtasks_scopes_consistency == "") {
232 233
  v8_check_microtasks_scopes_consistency =
      v8_enable_debugging_features || dcheck_always_on
234
}
235 236 237
if (v8_enable_snapshot_native_code_counters == "") {
  v8_enable_snapshot_native_code_counters = v8_enable_debugging_features
}
238
if (v8_enable_pointer_compression == "") {
239 240 241
  # TODO(v8:v7703): temporarily enable pointer compression on arm64 and on x64
  v8_enable_pointer_compression =
      v8_current_cpu == "arm64" || v8_current_cpu == "x64"
242
}
243 244 245
if (v8_enable_fast_torque == "") {
  v8_enable_fast_torque = v8_enable_fast_mksnapshot
}
246

247 248 249 250
if (v8_enable_single_generation == "") {
  v8_enable_single_generation = v8_disable_write_barriers
}

251 252 253 254 255 256 257 258
# 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
}
259 260 261
if (v8_enable_shared_ro_heap == "") {
  v8_enable_shared_ro_heap = !v8_enable_pointer_compression
}
262

263 264 265
assert(!v8_disable_write_barriers || v8_enable_single_generation,
       "Disabling write barriers works only with single generation")

266 267 268
assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations,
       "Untrusted code mitigations are unsupported on ia32")

269 270 271 272
assert(
    !v8_enable_pointer_compression || !v8_enable_shared_ro_heap,
    "Pointer compression is not supported with shared read-only heap enabled")

273
v8_random_seed = "314159265"
274
v8_toolset_for_shell = "host"
275 276 277 278

###############################################################################
# Configurations
#
279 280

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

283 284 285 286
  include_dirs = [
    ".",
    "$target_gen_dir",
  ]
287 288
}

289 290
config("internal_config") {
  defines = []
291
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
292

293 294 295 296
  configs = [
    "//build/config/compiler:wexit_time_destructors",
    ":internal_config_base",
    ":v8_header_features",
297
  ]
298 299 300 301

  if (is_component_build) {
    defines += [ "BUILDING_V8_SHARED" ]
  }
302 303
}

304 305 306
# This config should be applied to code using the libplatform.
config("libplatform_config") {
  include_dirs = [ "include" ]
307 308 309
  if (is_component_build) {
    defines = [ "USING_V8_PLATFORM_SHARED" ]
  }
310 311
}

312 313 314 315 316 317 318 319 320 321 322
# 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" ]
  }
}

323 324 325 326 327
# This config should be applied to code using the libsampler.
config("libsampler_config") {
  include_dirs = [ "include" ]
}

328 329 330
# This config should only be applied to code using V8 and not any V8 code
# itself.
config("external_config") {
331
  defines = []
332
  configs = [ ":v8_header_features" ]
333
  if (is_component_build) {
334 335
    defines += [ "USING_V8_SHARED" ]
  }
336 337 338 339
  include_dirs = [
    "include",
    "$target_gen_dir/include",
  ]
340 341
}

342 343 344 345 346 347 348 349
# 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" ]
  }
}

350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
# 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" ]
  }
  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.
376
config("features") {
377
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
378 379 380

  defines = []

381 382
  configs = [ ":v8_header_features" ]

383 384 385
  if (v8_embedder_string != "") {
    defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
  }
386
  if (v8_enable_disassembler) {
387
    defines += [ "ENABLE_DISASSEMBLER" ]
388
  }
389 390 391 392
  if (v8_promise_internal_field_count != 0) {
    defines +=
        [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
  }
393 394
  defines +=
      [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
395 396 397 398 399

  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.")

400 401 402
  if (v8_enable_future) {
    defines += [ "V8_ENABLE_FUTURE" ]
  }
403 404
  if (v8_enable_lite_mode) {
    defines += [ "V8_LITE_MODE" ]
405 406 407 408

    # TODO(v8:7777): Remove the define once the --jitless runtime flag does
    # everything we need.
    defines += [ "V8_JITLESS_MODE" ]
409
  }
410
  if (v8_enable_gdbjit) {
411
    defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
412
  }
413 414 415
  if (v8_enable_vtunejit) {
    defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
  }
416 417 418
  if (v8_enable_vtunetracemark) {
    defines += [ "ENABLE_VTUNE_TRACEMARK" ]
  }
419 420 421
  if (v8_enable_minor_mc) {
    defines += [ "ENABLE_MINOR_MC" ]
  }
422
  if (v8_enable_object_print) {
423
    defines += [ "OBJECT_PRINT" ]
424
  }
425
  if (v8_enable_verify_heap) {
426
    defines += [ "VERIFY_HEAP" ]
427
  }
428 429 430
  if (v8_enable_verify_predictable) {
    defines += [ "VERIFY_PREDICTABLE" ]
  }
431
  if (v8_enable_trace_maps) {
432 433 434 435
    defines += [ "V8_TRACE_MAPS" ]
  }
  if (v8_enable_trace_ignition) {
    defines += [ "V8_TRACE_IGNITION" ]
436
  }
437 438 439
  if (v8_enable_trace_feedback_updates) {
    defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
  }
440 441
  if (v8_enable_test_features) {
    defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
442
    defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
443
    defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
444
  }
445
  if (v8_enable_i18n_support) {
446
    defines += [ "V8_INTL_SUPPORT" ]
447
  }
448
  if (v8_enable_handle_zapping) {
449
    defines += [ "ENABLE_HANDLE_ZAPPING" ]
450
  }
451 452
  if (v8_enable_snapshot_native_code_counters) {
    defines += [ "V8_SNAPSHOT_NATIVE_CODE_COUNTERS" ]
453
  }
454 455 456
  if (v8_enable_single_generation) {
    defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
  }
457 458 459
  if (v8_disable_write_barriers) {
    defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
  }
460 461 462
  if (v8_enable_third_party_heap) {
    defines += [ "V8_ENABLE_THIRD_PARTY_HEAP" ]
  }
463
  if (v8_use_external_startup_data) {
464
    defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
465
  }
466 467 468
  if (v8_enable_concurrent_marking) {
    defines += [ "V8_CONCURRENT_MARKING" ]
  }
469 470 471
  if (v8_enable_array_buffer_extension) {
    defines += [ "V8_ARRAY_BUFFER_EXTENSION" ]
  }
472 473 474
  if (v8_enable_lazy_source_positions) {
    defines += [ "V8_ENABLE_LAZY_SOURCE_POSITIONS" ]
  }
475 476 477
  if (v8_check_microtasks_scopes_consistency) {
    defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ]
  }
478 479 480 481

  # TODO(v8:8519): Remove the define once all use-sites in
  #                the code are removed/fixed
  defines += [ "V8_EMBEDDED_BUILTINS" ]
482 483 484
  if (v8_use_multi_snapshots) {
    defines += [ "V8_MULTI_SNAPSHOTS" ]
  }
485 486 487
  if (v8_use_siphash) {
    defines += [ "V8_USE_SIPHASH" ]
  }
488 489 490
  if (v8_enable_shared_ro_heap) {
    defines += [ "V8_SHARED_RO_HEAP" ]
  }
491 492 493
  if (v8_use_perfetto) {
    defines += [ "V8_USE_PERFETTO" ]
  }
494 495 496
  if (v8_win64_unwinding_info) {
    defines += [ "V8_WIN64_UNWINDING_INFO" ]
  }
497 498 499
  if (v8_enable_regexp_interpreter_threaded_dispatch) {
    defines += [ "V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH" ]
  }
500 501
}

502
config("toolchain") {
503
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
504 505 506

  defines = []
  cflags = []
brettw's avatar
brettw committed
507
  ldflags = []
508

509
  if (v8_current_cpu == "arm") {
510
    defines += [ "V8_TARGET_ARCH_ARM" ]
511
    if (arm_version >= 7) {
512 513 514 515 516
      defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
    }
    if (arm_fpu == "vfpv3-d16") {
      defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
    } else if (arm_fpu == "vfpv3") {
517 518 519
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
520 521 522 523 524 525
      ]
    } else if (arm_fpu == "neon") {
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
        "CAN_USE_NEON",
526 527
      ]
    }
528

529
    # TODO(jochen): Add support for arm_test_noprobe.
530 531 532 533 534 535 536 537 538

    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" ]
      }
    }
539
  }
540
  if (v8_current_cpu == "arm64") {
541
    defines += [ "V8_TARGET_ARCH_ARM64" ]
542
  }
543

544 545 546 547 548 549
  # Mips64el/mipsel simulators.
  if (is_target_simulator &&
      (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) {
    defines += [ "_MIPS_TARGET_SIMULATOR" ]
  }

550
  if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") {
wtc's avatar
wtc committed
551
    defines += [ "V8_TARGET_ARCH_MIPS" ]
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
    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",
      ]
568 569 570
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
571 572 573 574 575 576 577 578 579 580 581 582
    } 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" ]
    }
583

584
    # TODO(jochen): Add support for mips_arch_variant rx and loongson.
wtc's avatar
wtc committed
585
  }
586

587
  if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
wtc's avatar
wtc committed
588
    defines += [ "V8_TARGET_ARCH_MIPS64" ]
589 590 591
    if (v8_can_use_fpu_instructions) {
      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
    }
592

593 594 595 596 597
    if (host_byteorder == "little") {
      defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
    } else if (host_byteorder == "big") {
      defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
    }
598 599 600 601 602 603 604 605 606 607
    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" ]
608 609 610
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
611 612 613
    } else if (mips_arch_variant == "r2") {
      defines += [ "_MIPS_ARCH_MIPS64R2" ]
    }
wtc's avatar
wtc committed
614
  }
615
  if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
616
    defines += [ "V8_TARGET_ARCH_S390" ]
617
    if (v8_current_cpu == "s390x") {
618 619
      defines += [ "V8_TARGET_ARCH_S390X" ]
    }
620
    if (host_byteorder == "little") {
621
      defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
622 623 624 625 626 627 628 629 630
    } else {
      cflags += [ "-march=z196" ]
    }
  }
  if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
    defines += [ "V8_TARGET_ARCH_PPC" ]
    if (v8_current_cpu == "ppc64") {
      defines += [ "V8_TARGET_ARCH_PPC64" ]
    }
631
    if (host_byteorder == "little") {
632
      defines += [ "V8_TARGET_ARCH_PPC_LE" ]
633
    } else if (host_byteorder == "big") {
634 635 636 637 638 639 640 641 642 643 644
      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",
        ]
      }
645
    }
646
  }
647

648
  if (v8_current_cpu == "x86") {
649
    defines += [ "V8_TARGET_ARCH_IA32" ]
brettw's avatar
brettw committed
650 651 652 653
    if (is_win) {
      # Ensure no surprising artifacts from 80bit double math with x86.
      cflags += [ "/arch:SSE2" ]
    }
654
  }
655
  if (v8_current_cpu == "x64") {
656
    defines += [ "V8_TARGET_ARCH_X64" ]
brettw's avatar
brettw committed
657 658 659 660 661 662
    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" ]
    }
663
  }
664 665 666
  if (is_android && v8_android_log_stdout) {
    defines += [ "V8_ANDROID_LOG_STDOUT" ]
  }
667

668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
  # 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
692
  # TODO(jochen): Support v8_enable_prof on Windows.
693 694
  # TODO(jochen): Add support for compiling with simulators.

695
  if (v8_enable_debugging_features) {
696 697 698 699
    if (is_linux && v8_enable_backtrace) {
      ldflags += [ "-rdynamic" ]
    }

700
    defines += [ "DEBUG" ]
701
    if (v8_enable_slow_dchecks) {
702 703
      defines += [ "ENABLE_SLOW_DCHECKS" ]
    }
704 705
  } else if (dcheck_always_on) {
    defines += [ "DEBUG" ]
706
  }
707

708 709 710 711
  if (v8_enable_verify_csa) {
    defines += [ "ENABLE_VERIFY_CSA" ]
  }

712 713 714 715
  if (!v8_untrusted_code_mitigations) {
    defines += [ "DISABLE_UNTRUSTED_CODE_MITIGATIONS" ]
  }

716
  if (v8_no_inline) {
717 718 719 720 721 722 723 724
    if (is_win) {
      cflags += [ "/Ob0" ]
    } else {
      cflags += [
        "-fno-inline-functions",
        "-fno-inline",
      ]
    }
725
  }
726 727

  if (is_clang) {
728
    cflags += [ "-Wmissing-field-initializers" ]
729 730 731 732 733 734

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

735 736 737 738
    if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
        v8_current_cpu == "mips64el") {
      cflags += [ "-Wshorten-64-to-32" ]
    }
739
  }
740 741 742 743 744 745 746 747 748 749

  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).
750
      "/wd4714",  # Function marked forceinline not inlined.
751 752 753 754 755

      # 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.

756
      "/wd4718",  # Recursive call has no side-effect.
757 758
      "/wd4723",  # https://crbug.com/v8/7771
      "/wd4724",  # https://crbug.com/v8/7771
759 760 761
      "/wd4800",  # Forcing value to bool.
    ]
  }
762 763 764 765 766 767 768

  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",
769 770 771 772

      # 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",
773 774
    ]
  }
775 776 777 778 779

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

782 783 784 785 786 787 788 789 790 791 792 793 794 795
# 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" ]
  }
}

796 797
# Configs for code coverage with gcov. Separate configs for cflags and ldflags
# to selectively influde cflags in non-test targets only.
798 799 800 801 802
config("v8_gcov_coverage_cflags") {
  cflags = [
    "-fprofile-arcs",
    "-ftest-coverage",
  ]
803 804
}

805 806
config("v8_gcov_coverage_ldflags") {
  ldflags = [ "-fprofile-arcs" ]
807 808
}

809 810 811 812
###############################################################################
# Actions
#

813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845
# 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"
    deps = [
      ":run_mksnapshot_" + name,
    ]
    sources = [
      "$target_gen_dir/embedded${suffix}.S",
    ]
    outputs = [
      "$target_gen_dir/embedded${suffix}.cc",
    ]
    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),
    ]
  }
}

846
if (is_android && enable_java_templates) {
847 848
  android_assets("v8_external_startup_data_assets") {
    if (v8_use_external_startup_data) {
849 850
      # We don't support side-by-side snapshots on Android within Chromium.
      assert(!v8_use_multi_snapshots)
851 852 853
      deps = [
        "//v8",
      ]
854 855 856 857 858 859 860
      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" ]
      }
861 862 863 864 865
      disable_compression = true
    }
  }
}

866
action("postmortem-metadata") {
867 868 869 870 871 872
  # Only targets in this file and the top-level visibility target can
  # depend on this.
  visibility = [
    ":*",
    "//:gn_visibility",
  ]
873

874 875
  script = "tools/gen-postmortem-metadata.py"

876
  # NOSORT
877
  sources = [
878 879
    "src/objects/objects.h",
    "src/objects/objects-inl.h",
880 881
    "src/objects/allocation-site-inl.h",
    "src/objects/allocation-site.h",
882 883
    "src/objects/cell-inl.h",
    "src/objects/cell.h",
884 885
    "src/objects/code-inl.h",
    "src/objects/code.h",
886 887
    "src/objects/data-handler.h",
    "src/objects/data-handler-inl.h",
888 889
    "src/objects/descriptor-array.h",
    "src/objects/descriptor-array-inl.h",
890 891
    "src/objects/feedback-cell.h",
    "src/objects/feedback-cell-inl.h",
892 893
    "src/objects/fixed-array-inl.h",
    "src/objects/fixed-array.h",
894 895
    "src/objects/heap-number-inl.h",
    "src/objects/heap-number.h",
896 897
    "src/objects/heap-object-inl.h",
    "src/objects/heap-object.h",
898
    "src/objects/instance-type.h",
899 900
    "src/objects/js-array-inl.h",
    "src/objects/js-array.h",
901 902
    "src/objects/js-array-buffer-inl.h",
    "src/objects/js-array-buffer.h",
903 904
    "src/objects/js-objects-inl.h",
    "src/objects/js-objects.h",
905 906
    "src/objects/js-promise-inl.h",
    "src/objects/js-promise.h",
907
    "src/objects/js-regexp-inl.h",
908
    "src/objects/js-regexp.cc",
909
    "src/objects/js-regexp.h",
910 911
    "src/objects/js-regexp-string-iterator-inl.h",
    "src/objects/js-regexp-string-iterator.h",
912
    "src/objects/map.h",
913
    "src/objects/map.cc",
914
    "src/objects/map-inl.h",
915
    "src/objects/js-objects.cc",
916 917
    "src/objects/name.h",
    "src/objects/name-inl.h",
918 919
    "src/objects/oddball-inl.h",
    "src/objects/oddball.h",
920 921
    "src/objects/primitive-heap-object.h",
    "src/objects/primitive-heap-object-inl.h",
922
    "src/objects/scope-info.h",
923 924
    "src/objects/script.h",
    "src/objects/script-inl.h",
925 926
    "src/objects/shared-function-info.h",
    "src/objects/shared-function-info-inl.h",
927
    "src/objects/string.cc",
928
    "src/objects/string.h",
929 930
    "src/objects/string-comparator.cc",
    "src/objects/string-comparator.h",
931
    "src/objects/string-inl.h",
932 933
    "src/objects/struct.h",
    "src/objects/struct-inl.h",
934
    "$target_gen_dir/torque-generated/instance-types-tq.h",
935 936 937
  ]

  outputs = [
938
    "$target_gen_dir/debug-support.cc",
939 940
  ]

941 942
  args = rebase_path(outputs, root_build_dir) +
         rebase_path(sources, root_build_dir)
943 944 945 946

  deps = [
    ":run_torque",
  ]
947 948
}

949
torque_files = [
950
  "src/builtins/array-copywithin.tq",
951
  "src/builtins/array-every.tq",
952
  "src/builtins/array-filter.tq",
953 954
  "src/builtins/array-find.tq",
  "src/builtins/array-findindex.tq",
955
  "src/builtins/array-foreach.tq",
956
  "src/builtins/array-isarray.tq",
957
  "src/builtins/array-join.tq",
958
  "src/builtins/array-lastindexof.tq",
959
  "src/builtins/array-map.tq",
960
  "src/builtins/array-of.tq",
961
  "src/builtins/array-reduce-right.tq",
962
  "src/builtins/array-reduce.tq",
963
  "src/builtins/array-reverse.tq",
964
  "src/builtins/array-shift.tq",
965
  "src/builtins/array-slice.tq",
966
  "src/builtins/array-some.tq",
967
  "src/builtins/array-splice.tq",
968
  "src/builtins/array-unshift.tq",
969 970
  "src/builtins/array.tq",
  "src/builtins/base.tq",
971
  "src/builtins/bigint.tq",
972
  "src/builtins/boolean.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
973
  "src/builtins/builtins-string.tq",
974
  "src/builtins/collections.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
975 976
  "src/builtins/cast.tq",
  "src/builtins/convert.tq",
977
  "src/builtins/console.tq",
978
  "src/builtins/data-view.tq",
979
  "src/builtins/frames.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
980
  "src/builtins/frame-arguments.tq",
981
  "src/builtins/growable-fixed-array.tq",
982
  "src/builtins/internal-coverage.tq",
983
  "src/builtins/iterator.tq",
984
  "src/builtins/math.tq",
985
  "src/builtins/number.tq",
986
  "src/builtins/object-fromentries.tq",
987
  "src/builtins/object.tq",
988
  "src/builtins/promise-abstract-operations.tq",
989
  "src/builtins/promise-constructor.tq",
990
  "src/builtins/promise-finally.tq",
991
  "src/builtins/promise-reaction-job.tq",
992
  "src/builtins/promise-resolve.tq",
993
  "src/builtins/promise-then.tq",
994
  "src/builtins/promise-jobs.tq",
995
  "src/builtins/proxy-constructor.tq",
996
  "src/builtins/proxy-delete-property.tq",
997
  "src/builtins/proxy-get-property.tq",
998
  "src/builtins/proxy-get-prototype-of.tq",
999
  "src/builtins/proxy-has-property.tq",
1000
  "src/builtins/proxy-is-extensible.tq",
1001
  "src/builtins/proxy-prevent-extensions.tq",
1002
  "src/builtins/proxy-revocable.tq",
1003
  "src/builtins/proxy-revoke.tq",
1004
  "src/builtins/proxy-set-property.tq",
1005
  "src/builtins/proxy-set-prototype-of.tq",
1006
  "src/builtins/proxy.tq",
1007
  "src/builtins/reflect.tq",
1008
  "src/builtins/regexp-exec.tq",
1009
  "src/builtins/regexp-match-all.tq",
1010
  "src/builtins/regexp-match.tq",
1011
  "src/builtins/regexp-replace.tq",
1012
  "src/builtins/regexp-search.tq",
1013
  "src/builtins/regexp-source.tq",
1014
  "src/builtins/regexp-split.tq",
1015
  "src/builtins/regexp-test.tq",
1016
  "src/builtins/regexp.tq",
1017
  "src/builtins/string-endswith.tq",
1018
  "src/builtins/string-html.tq",
1019
  "src/builtins/string-iterator.tq",
1020
  "src/builtins/string-pad.tq",
1021
  "src/builtins/string-repeat.tq",
1022
  "src/builtins/string-replaceall.tq",
1023
  "src/builtins/string-slice.tq",
1024
  "src/builtins/string-startswith.tq",
1025
  "src/builtins/string-substring.tq",
1026
  "src/builtins/string-substr.tq",
1027
  "src/builtins/symbol.tq",
1028
  "src/builtins/torque-internal.tq",
1029
  "src/builtins/typed-array-createtypedarray.tq",
1030
  "src/builtins/typed-array-every.tq",
1031
  "src/builtins/typed-array-filter.tq",
1032 1033
  "src/builtins/typed-array-find.tq",
  "src/builtins/typed-array-findindex.tq",
1034
  "src/builtins/typed-array-foreach.tq",
1035
  "src/builtins/typed-array-from.tq",
1036
  "src/builtins/typed-array-of.tq",
1037 1038
  "src/builtins/typed-array-reduce.tq",
  "src/builtins/typed-array-reduceright.tq",
1039
  "src/builtins/typed-array-set.tq",
1040
  "src/builtins/typed-array-slice.tq",
1041
  "src/builtins/typed-array-some.tq",
1042
  "src/builtins/typed-array-sort.tq",
1043
  "src/builtins/typed-array-subarray.tq",
1044
  "src/builtins/typed-array.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062
  "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",
1063
  "src/objects/intl-objects.tq",
Tobias Tebbi's avatar
Tobias Tebbi committed
1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097
  "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",
  "src/objects/prototype-info.tq",
  "src/objects/regexp-match-info.tq",
  "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",
1098
  "test/torque/test-torque.tq",
1099
  "third_party/v8/builtins/array-sort.tq",
1100 1101
]

1102 1103 1104 1105
if (!v8_enable_i18n_support) {
  torque_files -= [ "src/objects/intl-objects.tq" ]
}

1106 1107 1108
action("run_torque") {
  visibility = [
    ":*",
1109
    "tools/debug_helper/:*",
1110
    "tools/gcmole/:*",
1111
    "test/cctest/:*",
1112 1113 1114
  ]

  deps = [
1115
    ":torque($v8_generator_toolchain)",
1116 1117 1118 1119
  ]

  script = "tools/run.py"

1120
  sources = torque_files
1121 1122

  outputs = [
1123
    "$target_gen_dir/torque-generated/bit-fields-tq.h",
1124
    "$target_gen_dir/torque-generated/builtin-definitions-tq.h",
1125
    "$target_gen_dir/torque-generated/interface-descriptors-tq.inc",
1126 1127 1128 1129
    "$target_gen_dir/torque-generated/field-offsets-tq.h",
    "$target_gen_dir/torque-generated/class-verifiers-tq.cc",
    "$target_gen_dir/torque-generated/class-verifiers-tq.h",
    "$target_gen_dir/torque-generated/objects-printer-tq.cc",
1130 1131 1132
    "$target_gen_dir/torque-generated/class-definitions-tq.cc",
    "$target_gen_dir/torque-generated/class-definitions-tq-inl.h",
    "$target_gen_dir/torque-generated/class-definitions-tq.h",
1133 1134
    "$target_gen_dir/torque-generated/class-debug-readers-tq.cc",
    "$target_gen_dir/torque-generated/class-debug-readers-tq.h",
1135 1136 1137
    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.cc",
    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.h",
    "$target_gen_dir/torque-generated/csa-types-tq.h",
1138
    "$target_gen_dir/torque-generated/instance-types-tq.h",
1139 1140
    "$target_gen_dir/torque-generated/internal-class-definitions-tq.h",
    "$target_gen_dir/torque-generated/internal-class-definitions-tq-inl.h",
1141
  ]
1142 1143
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1144
    outputs += [
1145 1146
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1147 1148
    ]
  }
1149 1150

  args = [
1151
    "./" + rebase_path(get_label_info(":torque($v8_generator_toolchain)",
1152 1153 1154
                                      "root_out_dir") + "/torque",
                       root_build_dir),
    "-o",
1155
    rebase_path("$target_gen_dir/torque-generated", root_build_dir),
1156 1157
    "-v8-root",
    rebase_path(".", root_build_dir),
1158
  ]
1159
  args += torque_files
1160 1161
}

1162 1163 1164 1165 1166 1167 1168 1169
group("v8_maybe_icu") {
  if (v8_enable_i18n_support) {
    public_deps = [
      "//third_party/icu",
    ]
  }
}

1170 1171 1172 1173
v8_source_set("torque_generated_initializers") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1174
    ":generate_bytecode_builtins_list",
1175 1176 1177
    ":run_torque",
  ]

1178 1179 1180
  public_deps = [
    ":v8_maybe_icu",
  ]
1181

1182 1183 1184 1185 1186
  sources = [
    "$target_gen_dir/torque-generated/csa-types-tq.h",
    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.cc",
    "$target_gen_dir/torque-generated/exported-macros-assembler-tq.h",
  ]
1187 1188
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1189
    sources += [
1190 1191
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1192 1193 1194
    ]
  }

1195
  configs = [ ":internal_config" ]
1196 1197
}

1198 1199 1200 1201
v8_source_set("torque_generated_definitions") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
John Budorick's avatar
John Budorick committed
1202
    ":generate_bytecode_builtins_list",
1203 1204 1205
    ":run_torque",
  ]

1206 1207 1208
  public_deps = [
    ":v8_maybe_icu",
  ]
1209 1210

  sources = [
1211
    "$target_gen_dir/torque-generated/class-definitions-tq.cc",
1212 1213 1214
    "$target_gen_dir/torque-generated/class-verifiers-tq.cc",
    "$target_gen_dir/torque-generated/class-verifiers-tq.h",
    "$target_gen_dir/torque-generated/objects-printer-tq.cc",
1215 1216 1217 1218 1219
  ]

  configs = [ ":internal_config" ]
}

1220 1221 1222 1223 1224 1225
action("generate_bytecode_builtins_list") {
  script = "tools/run.py"
  outputs = [
    "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
  ]
  deps = [
1226
    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1227 1228 1229
  ]
  args = [
    "./" + rebase_path(
1230
            get_label_info(
1231
                    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1232
                    "root_out_dir") + "/bytecode_builtins_list_generator",
1233
            root_build_dir),
1234 1235
    rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
                root_build_dir),
1236 1237 1238
  ]
}

1239 1240 1241
# 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.
1242
# Otherwise files are suffixed, e.g. embedded_<name>.S and
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256
# 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) {
1257
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1258

1259 1260 1261
    deps = [
      ":mksnapshot($v8_snapshot_toolchain)",
    ]
1262

1263
    script = "tools/run.py"
1264

1265
    sources = []
1266

1267
    outputs = []
1268

1269 1270
    data = []

1271 1272 1273 1274
    args = [
      "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
                                        "root_out_dir") + "/mksnapshot",
                         root_build_dir),
1275
      "--turbo_instruction_scheduling",
1276 1277 1278 1279 1280

      # 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|.
1281
      "--target_os=$current_os",
1282
      "--target_arch=$current_cpu",
1283 1284 1285

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

1288 1289
    args += invoker.args

1290 1291
    outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
    if (invoker.embedded_variant != "") {
1292
      args += [
1293 1294
        "--embedded_variant",
        invoker.embedded_variant,
1295 1296 1297
      ]
    }

1298 1299 1300 1301 1302 1303
    if (v8_random_seed != "0") {
      args += [
        "--random-seed",
        v8_random_seed,
      ]
    }
1304

1305 1306 1307 1308 1309 1310
    if (v8_os_page_size != "0") {
      args += [
        "--v8_os_page_size",
        v8_os_page_size,
      ]
    }
1311

1312
    if (v8_use_external_startup_data) {
1313
      outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1314
      data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1315 1316
      args += [
        "--startup_blob",
1317
        rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
1318
      ]
1319
    } else {
1320
      outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
1321 1322
      args += [
        "--startup_src",
1323
        rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
1324
      ]
1325 1326 1327 1328 1329 1330 1331
    }

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

1332 1333 1334 1335
    if (v8_enable_snapshot_code_comments) {
      args += [ "--code-comments" ]
    }

1336 1337 1338 1339 1340 1341 1342 1343
    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" ]
    }

1344 1345 1346 1347 1348
    if (v8_enable_fast_mksnapshot) {
      args += [
        "--no-turbo-rewrite-far-jumps",
        "--no-turbo-verify-allocation",
      ]
1349 1350 1351 1352 1353

      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" ]
      }
1354
    }
1355 1356 1357 1358

    if (v8_enable_verify_heap) {
      args += [ "--verify-heap" ]
    }
1359
  }
1360 1361
}

1362 1363
run_mksnapshot("default") {
  args = []
1364
  embedded_variant = "Default"
1365 1366 1367
}
if (emit_builtins_as_inline_asm) {
  asm_to_inline_asm("default") {
1368
    args = []
1369 1370 1371 1372 1373
  }
}
if (v8_use_multi_snapshots) {
  run_mksnapshot("trusted") {
    args = [ "--no-untrusted-code-mitigations" ]
1374
    embedded_variant = "Trusted"
1375
  }
1376
  if (emit_builtins_as_inline_asm) {
1377
    asm_to_inline_asm("trusted") {
1378 1379 1380
      args = []
    }
  }
1381 1382
}

1383 1384
action("v8_dump_build_config") {
  script = "tools/testrunner/utils/dump_build_config.py"
1385 1386 1387
  outputs = [
    "$root_out_dir/v8_build_config.json",
  ]
1388
  is_gcov_coverage = v8_code_coverage && !is_clang
1389
  is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
1390 1391
  args = [
    rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
1392
    "current_cpu=\"$current_cpu\"",
1393
    "dcheck_always_on=$dcheck_always_on",
1394
    "is_android=$is_android",
1395 1396
    "is_asan=$is_asan",
    "is_cfi=$is_cfi",
1397
    "is_clang=$is_clang",
1398
    "is_component_build=$is_component_build",
1399
    "is_debug=$v8_enable_debugging_features",
1400
    "is_full_debug=$is_full_debug",
1401
    "is_gcov_coverage=$is_gcov_coverage",
1402 1403
    "is_msan=$is_msan",
    "is_tsan=$is_tsan",
1404
    "is_ubsan_vptr=$is_ubsan_vptr",
1405
    "target_cpu=\"$target_cpu\"",
1406
    "v8_current_cpu=\"$v8_current_cpu\"",
1407
    "v8_enable_i18n_support=$v8_enable_i18n_support",
1408
    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
1409
    "v8_target_cpu=\"$v8_target_cpu\"",
1410
    "v8_enable_verify_csa=$v8_enable_verify_csa",
1411
    "v8_enable_lite_mode=$v8_enable_lite_mode",
1412
    "v8_enable_pointer_compression=$v8_enable_pointer_compression",
1413
  ]
1414 1415 1416 1417 1418 1419 1420 1421

  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",
    ]
  }
1422 1423
}

1424 1425 1426 1427
###############################################################################
# Source Sets (aka static libraries)
#

1428 1429
v8_source_set("v8_snapshot") {
  visibility = [ ":*" ]  # Targets in this file can depend on this.
1430

1431
  deps = []
1432 1433 1434 1435 1436
  public_deps = [
    # This should be public so downstream targets can declare the snapshot
    # output file as their inputs.
    ":run_mksnapshot_default",
  ]
1437

1438 1439
  # Do not publicize any header to remove build dependency.
  public = []
1440

1441 1442 1443
  sources = [
    "src/init/setup-isolate-deserialize.cc",
  ]
1444 1445 1446 1447 1448
  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" ]
1449
  }
1450

1451
  configs = [ ":internal_config" ]
1452

1453
  if (v8_use_external_startup_data) {
1454 1455
    deps += [ ":v8_base" ]

1456
    sources += [ "src/snapshot/snapshot-external.cc" ]
1457

1458 1459
    if (v8_use_multi_snapshots) {
      public_deps += [ ":run_mksnapshot_trusted" ]
1460
      if (emit_builtins_as_inline_asm) {
1461 1462
        deps += [ ":asm_to_inline_asm_trusted" ]
        sources += [ "$target_gen_dir/embedded_trusted.cc" ]
1463
      } else {
1464
        sources += [ "$target_gen_dir/embedded_trusted.S" ]
1465
      }
1466
    }
1467
  } else {
1468 1469 1470 1471 1472
    # Also top-level visibility targets can depend on this.
    visibility += [ "//:gn_visibility" ]

    public_deps += [ ":v8_maybe_icu" ]

1473
    sources += [ "$target_gen_dir/snapshot.cc" ]
1474 1475 1476
  }
}

1477
v8_source_set("v8_initializers") {
1478 1479 1480 1481
  visibility = [
    ":*",
    "test/cctest:*",
  ]
1482 1483

  deps = [
1484
    ":torque_generated_initializers",
Takuto Ikuta's avatar
Takuto Ikuta committed
1485 1486
  ]

1487 1488 1489
  sources = [
    ### gcmole(all) ###
    "src/builtins/builtins-array-gen.cc",
1490
    "src/builtins/builtins-array-gen.h",
1491 1492
    "src/builtins/builtins-async-function-gen.cc",
    "src/builtins/builtins-async-gen.cc",
1493
    "src/builtins/builtins-async-gen.h",
1494
    "src/builtins/builtins-async-generator-gen.cc",
1495
    "src/builtins/builtins-async-iterator-gen.cc",
1496
    "src/builtins/builtins-bigint-gen.cc",
1497
    "src/builtins/builtins-bigint-gen.h",
1498
    "src/builtins/builtins-call-gen.cc",
1499
    "src/builtins/builtins-call-gen.h",
1500
    "src/builtins/builtins-collections-gen.cc",
1501
    "src/builtins/builtins-constructor-gen.cc",
1502
    "src/builtins/builtins-constructor-gen.h",
1503 1504
    "src/builtins/builtins-constructor.h",
    "src/builtins/builtins-conversion-gen.cc",
1505
    "src/builtins/builtins-data-view-gen.h",
1506
    "src/builtins/builtins-date-gen.cc",
1507
    "src/builtins/builtins-debug-gen.cc",
1508 1509 1510 1511 1512 1513
    "src/builtins/builtins-function-gen.cc",
    "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",
1514
    "src/builtins/builtins-interpreter-gen.cc",
1515
    "src/builtins/builtins-intl-gen.cc",
1516 1517
    "src/builtins/builtins-iterator-gen.cc",
    "src/builtins/builtins-iterator-gen.h",
1518 1519
    "src/builtins/builtins-lazy-gen.cc",
    "src/builtins/builtins-lazy-gen.h",
1520
    "src/builtins/builtins-microtask-queue-gen.cc",
1521 1522 1523
    "src/builtins/builtins-number-gen.cc",
    "src/builtins/builtins-object-gen.cc",
    "src/builtins/builtins-promise-gen.cc",
1524
    "src/builtins/builtins-promise-gen.h",
1525
    "src/builtins/builtins-proxy-gen.cc",
1526
    "src/builtins/builtins-proxy-gen.h",
1527 1528 1529 1530
    "src/builtins/builtins-regexp-gen.cc",
    "src/builtins/builtins-regexp-gen.h",
    "src/builtins/builtins-sharedarraybuffer-gen.cc",
    "src/builtins/builtins-string-gen.cc",
1531
    "src/builtins/builtins-string-gen.h",
1532 1533
    "src/builtins/builtins-typed-array-gen.cc",
    "src/builtins/builtins-typed-array-gen.h",
1534 1535
    "src/builtins/builtins-utils-gen.h",
    "src/builtins/builtins-wasm-gen.cc",
1536 1537
    "src/builtins/growable-fixed-array-gen.cc",
    "src/builtins/growable-fixed-array-gen.h",
1538
    "src/builtins/setup-builtins-internal.cc",
1539 1540
    "src/codegen/code-stub-assembler.cc",
    "src/codegen/code-stub-assembler.h",
1541
    "src/heap/setup-heap-internal.cc",
1542 1543
    "src/ic/accessor-assembler.cc",
    "src/ic/accessor-assembler.h",
1544 1545
    "src/ic/binary-op-assembler.cc",
    "src/ic/binary-op-assembler.h",
1546 1547
    "src/ic/keyed-store-generic.cc",
    "src/ic/keyed-store-generic.h",
1548 1549
    "src/interpreter/interpreter-assembler.cc",
    "src/interpreter/interpreter-assembler.h",
1550 1551
    "src/interpreter/interpreter-generator.cc",
    "src/interpreter/interpreter-generator.h",
1552 1553
    "src/interpreter/interpreter-intrinsics-generator.cc",
    "src/interpreter/interpreter-intrinsics-generator.h",
1554 1555
  ]

1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
  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",
    ]
  } else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
    sources += [
      ### gcmole(arch:ppc) ###
      "src/builtins/ppc/builtins-ppc.cc",
    ]
  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
    sources += [
      ### gcmole(arch:s390) ###
      "src/builtins/s390/builtins-s390.cc",
    ]
  }

1598 1599 1600 1601
  if (!v8_enable_i18n_support) {
    sources -= [ "src/builtins/builtins-intl-gen.cc" ]
  }

1602
  configs = [ ":internal_config" ]
1603 1604
}

1605
v8_source_set("v8_init") {
1606 1607 1608
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1609
    ":v8_initializers",
1610 1611 1612 1613
  ]

  sources = [
    ### gcmole(all) ###
1614
    "src/init/setup-isolate-full.cc",
1615
  ]
1616 1617 1618 1619

  public_deps = [
    ":v8_maybe_icu",
  ]
1620 1621 1622 1623

  configs = [ ":internal_config" ]
}

1624 1625
# 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.
1626
v8_header_set("v8_version") {
1627 1628 1629
  configs = [ ":internal_config" ]

  sources = [
1630
    "include/v8-value-serializer-version.h",
1631 1632 1633 1634 1635
    "include/v8-version-string.h",
    "include/v8-version.h",
  ]
}

1636 1637 1638 1639
# 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" ]
1640
  public_configs = [ ":v8_header_features" ]
1641 1642

  sources = [
1643
    "include/v8-internal.h",
1644 1645 1646 1647
    "include/v8.h",
    "include/v8config.h",
  ]

1648 1649 1650 1651 1652 1653 1654
  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",
  ]
1655

1656 1657 1658 1659 1660
  deps = [
    ":v8_version",
  ]
}

1661 1662 1663 1664 1665 1666
# 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" ]

  sources = [
1667
    "src/common/globals.h",
1668 1669 1670 1671 1672 1673 1674
  ]

  deps = [
    ":v8_headers",
  ]
}

1675
v8_compiler_sources = [
1676
  ### gcmole(all) ###
1677 1678 1679 1680
  "src/compiler/access-builder.cc",
  "src/compiler/access-builder.h",
  "src/compiler/access-info.cc",
  "src/compiler/access-info.h",
1681 1682
  "src/compiler/add-type-assertions-reducer.cc",
  "src/compiler/add-type-assertions-reducer.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 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743
  "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",
1744 1745
  "src/compiler/csa-load-elimination.cc",
  "src/compiler/csa-load-elimination.h",
1746 1747
  "src/compiler/dead-code-elimination.cc",
  "src/compiler/dead-code-elimination.h",
1748 1749
  "src/compiler/decompression-optimizer.cc",
  "src/compiler/decompression-optimizer.h",
1750 1751 1752 1753 1754 1755 1756
  "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",
1757 1758
  "src/compiler/feedback-source.cc",
  "src/compiler/feedback-source.h",
1759 1760 1761 1762 1763
  "src/compiler/frame-states.cc",
  "src/compiler/frame-states.h",
  "src/compiler/frame.cc",
  "src/compiler/frame.h",
  "src/compiler/functional-list.h",
1764
  "src/compiler/globals.h",
1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822
  "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",
1823 1824
  "src/compiler/map-inference.cc",
  "src/compiler/map-inference.h",
1825 1826
  "src/compiler/memory-lowering.cc",
  "src/compiler/memory-lowering.h",
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
  "src/compiler/memory-optimizer.cc",
  "src/compiler/memory-optimizer.h",
  "src/compiler/node-aux-data.h",
  "src/compiler/node-cache.cc",
  "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",
1870 1871
  "src/compiler/scheduled-machine-lowering.cc",
  "src/compiler/scheduled-machine-lowering.h",
1872 1873 1874 1875 1876 1877
  "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",
1878
  "src/compiler/serializer-hints.h",
1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906
  "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",
1907
  "src/compiler/write-barrier-kind.h",
1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920
  "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",
1921
    ":v8_maybe_icu",
1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944
  ]

  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",
1945
    ":v8_maybe_icu",
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963
  ]

  configs = [ ":internal_config" ]
}

group("v8_compiler_for_mksnapshot") {
  if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
    deps = [
      ":v8_compiler_opt",
    ]
  } else {
    deps = [
      ":v8_compiler",
    ]
  }
}

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

1966 1967 1968
  # Split static libraries on windows into two.
  split_count = 2

1969
  sources = [
1970
    "//base/trace_event/common/trace_event_common.h",
1971 1972

    ### gcmole(all) ###
1973
    "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
1974 1975
    "include/v8-inspector-protocol.h",
    "include/v8-inspector.h",
1976
    "include/v8-internal.h",
machenbach's avatar
machenbach committed
1977 1978 1979
    "include/v8-platform.h",
    "include/v8-profiler.h",
    "include/v8-util.h",
1980
    "include/v8-wasm-trap-handler-posix.h",
machenbach's avatar
machenbach committed
1981 1982
    "include/v8.h",
    "include/v8config.h",
1983 1984 1985 1986 1987 1988 1989
    "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",
1990 1991
    "src/asmjs/asm-js.cc",
    "src/asmjs/asm-js.h",
1992
    "src/asmjs/asm-names.h",
1993 1994
    "src/asmjs/asm-parser.cc",
    "src/asmjs/asm-parser.h",
1995 1996
    "src/asmjs/asm-scanner.cc",
    "src/asmjs/asm-scanner.h",
1997 1998
    "src/asmjs/asm-types.cc",
    "src/asmjs/asm-types.h",
1999 2000
    "src/ast/ast-function-literal-id-reindexer.cc",
    "src/ast/ast-function-literal-id-reindexer.h",
2001
    "src/ast/ast-source-ranges.h",
2002
    "src/ast/ast-traversal-visitor.h",
2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
    "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",
2013 2014
    "src/ast/source-range-ast-visitor.cc",
    "src/ast/source-range-ast-visitor.h",
2015 2016
    "src/ast/variables.cc",
    "src/ast/variables.h",
2017 2018
    "src/builtins/accessors.cc",
    "src/builtins/accessors.h",
2019
    "src/builtins/builtins-api.cc",
2020
    "src/builtins/builtins-array.cc",
2021
    "src/builtins/builtins-arraybuffer.cc",
2022
    "src/builtins/builtins-async-module.cc",
2023
    "src/builtins/builtins-bigint.cc",
2024
    "src/builtins/builtins-call.cc",
2025
    "src/builtins/builtins-callsite.cc",
2026
    "src/builtins/builtins-collections.cc",
2027
    "src/builtins/builtins-console.cc",
2028
    "src/builtins/builtins-constructor.h",
2029 2030
    "src/builtins/builtins-dataview.cc",
    "src/builtins/builtins-date.cc",
2031
    "src/builtins/builtins-definitions.h",
2032
    "src/builtins/builtins-descriptors.h",
jgruber's avatar
jgruber committed
2033
    "src/builtins/builtins-error.cc",
2034 2035 2036
    "src/builtins/builtins-function.cc",
    "src/builtins/builtins-global.cc",
    "src/builtins/builtins-internal.cc",
2037
    "src/builtins/builtins-intl.cc",
2038 2039 2040
    "src/builtins/builtins-json.cc",
    "src/builtins/builtins-number.cc",
    "src/builtins/builtins-object.cc",
2041
    "src/builtins/builtins-promise.cc",
2042
    "src/builtins/builtins-promise.h",
2043
    "src/builtins/builtins-reflect.cc",
2044
    "src/builtins/builtins-regexp.cc",
2045 2046 2047
    "src/builtins/builtins-sharedarraybuffer.cc",
    "src/builtins/builtins-string.cc",
    "src/builtins/builtins-symbol.cc",
2048
    "src/builtins/builtins-trace.cc",
2049
    "src/builtins/builtins-typed-array.cc",
2050
    "src/builtins/builtins-utils-inl.h",
2051
    "src/builtins/builtins-utils.h",
2052
    "src/builtins/builtins-weak-refs.cc",
2053 2054
    "src/builtins/builtins.cc",
    "src/builtins/builtins.h",
2055 2056
    "src/builtins/constants-table-builder.cc",
    "src/builtins/constants-table-builder.h",
2057 2058 2059 2060 2061 2062
    "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",
2063
    "src/codegen/callable.h",
2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079
    "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",
2080 2081 2082 2083
    "src/codegen/external-reference-table.cc",
    "src/codegen/external-reference-table.h",
    "src/codegen/external-reference.cc",
    "src/codegen/external-reference.h",
2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096
    "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",
2097 2098
    "src/codegen/pending-optimization-table.cc",
    "src/codegen/pending-optimization-table.h",
2099 2100 2101
    "src/codegen/register-arch.h",
    "src/codegen/register-configuration.cc",
    "src/codegen/register-configuration.h",
2102
    "src/codegen/register.cc",
2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115
    "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",
2116 2117
    "src/codegen/tick-counter.cc",
    "src/codegen/tick-counter.h",
2118
    "src/codegen/tnode.cc",
2119
    "src/codegen/tnode.h",
2120 2121 2122 2123
    "src/codegen/turbo-assembler.cc",
    "src/codegen/turbo-assembler.h",
    "src/codegen/unoptimized-compilation-info.cc",
    "src/codegen/unoptimized-compilation-info.h",
2124 2125 2126
    "src/common/assert-scope.cc",
    "src/common/assert-scope.h",
    "src/common/checks.h",
2127
    "src/common/message-template.h",
2128 2129
    "src/common/ptr-compr-inl.h",
    "src/common/ptr-compr.h",
2130 2131
    "src/compiler-dispatcher/compiler-dispatcher.cc",
    "src/compiler-dispatcher/compiler-dispatcher.h",
2132 2133
    "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
    "src/compiler-dispatcher/optimizing-compile-dispatcher.h",
Yang Guo's avatar
Yang Guo committed
2134 2135 2136 2137 2138
    "src/date/date.cc",
    "src/date/date.h",
    "src/date/dateparser-inl.h",
    "src/date/dateparser.cc",
    "src/date/dateparser.h",
2139 2140
    "src/debug/debug-coverage.cc",
    "src/debug/debug-coverage.h",
2141 2142 2143 2144
    "src/debug/debug-evaluate.cc",
    "src/debug/debug-evaluate.h",
    "src/debug/debug-frames.cc",
    "src/debug/debug-frames.h",
2145
    "src/debug/debug-interface.h",
2146 2147
    "src/debug/debug-property-iterator.cc",
    "src/debug/debug-property-iterator.h",
2148 2149
    "src/debug/debug-scope-iterator.cc",
    "src/debug/debug-scope-iterator.h",
2150 2151
    "src/debug/debug-scopes.cc",
    "src/debug/debug-scopes.h",
2152 2153
    "src/debug/debug-stack-trace-iterator.cc",
    "src/debug/debug-stack-trace-iterator.h",
2154 2155
    "src/debug/debug-type-profile.cc",
    "src/debug/debug-type-profile.h",
2156 2157
    "src/debug/debug.cc",
    "src/debug/debug.h",
2158
    "src/debug/interface-types.h",
2159 2160
    "src/debug/liveedit.cc",
    "src/debug/liveedit.h",
2161 2162 2163 2164
    "src/deoptimizer/deoptimize-reason.cc",
    "src/deoptimizer/deoptimize-reason.h",
    "src/deoptimizer/deoptimizer.cc",
    "src/deoptimizer/deoptimizer.h",
2165 2166
    "src/diagnostics/basic-block-profiler.cc",
    "src/diagnostics/basic-block-profiler.h",
2167
    "src/diagnostics/code-tracer.h",
2168 2169
    "src/diagnostics/compilation-statistics.cc",
    "src/diagnostics/compilation-statistics.h",
2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181
    "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",
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192
    "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",
2193 2194
    "src/execution/interrupts-scope.cc",
    "src/execution/interrupts-scope.h",
2195 2196
    "src/execution/isolate-data.h",
    "src/execution/isolate-inl.h",
2197
    "src/execution/isolate-utils.h",
2198 2199 2200 2201 2202 2203
    "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",
2204 2205 2206
    "src/execution/protectors-inl.h",
    "src/execution/protectors.cc",
    "src/execution/protectors.h",
2207 2208 2209 2210 2211
    "src/execution/runtime-profiler.cc",
    "src/execution/runtime-profiler.h",
    "src/execution/simulator-base.cc",
    "src/execution/simulator-base.h",
    "src/execution/simulator.h",
2212 2213
    "src/execution/stack-guard.cc",
    "src/execution/stack-guard.h",
2214 2215 2216 2217
    "src/execution/thread-id.cc",
    "src/execution/thread-id.h",
    "src/execution/thread-local-top.cc",
    "src/execution/thread-local-top.h",
2218 2219
    "src/execution/v8threads.cc",
    "src/execution/v8threads.h",
2220 2221
    "src/execution/vm-state-inl.h",
    "src/execution/vm-state.h",
Tianyou Li's avatar
Tianyou Li committed
2222 2223
    "src/extensions/cputracemark-extension.cc",
    "src/extensions/cputracemark-extension.h",
2224 2225 2226 2227
    "src/extensions/externalize-string-extension.cc",
    "src/extensions/externalize-string-extension.h",
    "src/extensions/gc-extension.cc",
    "src/extensions/gc-extension.h",
2228 2229
    "src/extensions/ignition-statistics-extension.cc",
    "src/extensions/ignition-statistics-extension.h",
2230 2231 2232 2233
    "src/extensions/statistics-extension.cc",
    "src/extensions/statistics-extension.h",
    "src/extensions/trigger-failure-extension.cc",
    "src/extensions/trigger-failure-extension.h",
2234 2235 2236
    "src/flags/flag-definitions.h",
    "src/flags/flags.cc",
    "src/flags/flags.h",
2237 2238 2239 2240 2241 2242 2243
    "src/handles/global-handles.cc",
    "src/handles/global-handles.h",
    "src/handles/handles-inl.h",
    "src/handles/handles.cc",
    "src/handles/handles.h",
    "src/handles/maybe-handles-inl.h",
    "src/handles/maybe-handles.h",
2244 2245
    "src/heap/array-buffer-collector.cc",
    "src/heap/array-buffer-collector.h",
2246
    "src/heap/array-buffer-tracker-inl.h",
2247 2248
    "src/heap/array-buffer-tracker.cc",
    "src/heap/array-buffer-tracker.h",
2249
    "src/heap/barrier.h",
2250 2251
    "src/heap/basic-memory-chunk.cc",
    "src/heap/basic-memory-chunk.h",
2252 2253
    "src/heap/code-stats.cc",
    "src/heap/code-stats.h",
2254 2255
    "src/heap/combined-heap.cc",
    "src/heap/combined-heap.h",
2256 2257
    "src/heap/concurrent-marking.cc",
    "src/heap/concurrent-marking.h",
2258 2259
    "src/heap/embedder-tracing.cc",
    "src/heap/embedder-tracing.h",
2260 2261 2262
    "src/heap/factory-inl.h",
    "src/heap/factory.cc",
    "src/heap/factory.h",
2263 2264
    "src/heap/gc-idle-time-handler.cc",
    "src/heap/gc-idle-time-handler.h",
2265 2266
    "src/heap/gc-tracer.cc",
    "src/heap/gc-tracer.h",
2267 2268
    "src/heap/heap-controller.cc",
    "src/heap/heap-controller.h",
2269
    "src/heap/heap-inl.h",
2270 2271
    "src/heap/heap-write-barrier-inl.h",
    "src/heap/heap-write-barrier.h",
2272 2273
    "src/heap/heap.cc",
    "src/heap/heap.h",
2274
    "src/heap/incremental-marking-inl.h",
2275 2276
    "src/heap/incremental-marking-job.cc",
    "src/heap/incremental-marking-job.h",
2277 2278
    "src/heap/incremental-marking.cc",
    "src/heap/incremental-marking.h",
2279 2280 2281
    "src/heap/invalidated-slots-inl.h",
    "src/heap/invalidated-slots.cc",
    "src/heap/invalidated-slots.h",
2282
    "src/heap/item-parallel-job.cc",
2283
    "src/heap/item-parallel-job.h",
2284
    "src/heap/local-allocator-inl.h",
2285
    "src/heap/local-allocator.h",
2286 2287 2288
    "src/heap/mark-compact-inl.h",
    "src/heap/mark-compact.cc",
    "src/heap/mark-compact.h",
2289 2290
    "src/heap/marking-visitor-inl.h",
    "src/heap/marking-visitor.h",
2291 2292
    "src/heap/marking-worklist.cc",
    "src/heap/marking-worklist.h",
2293
    "src/heap/marking.cc",
2294
    "src/heap/marking.h",
2295 2296
    "src/heap/memory-measurement.cc",
    "src/heap/memory-measurement.h",
2297 2298
    "src/heap/memory-reducer.cc",
    "src/heap/memory-reducer.h",
2299 2300
    "src/heap/object-stats.cc",
    "src/heap/object-stats.h",
2301 2302 2303
    "src/heap/objects-visiting-inl.h",
    "src/heap/objects-visiting.cc",
    "src/heap/objects-visiting.h",
2304
    "src/heap/read-only-heap-inl.h",
2305 2306
    "src/heap/read-only-heap.cc",
    "src/heap/read-only-heap.h",
2307
    "src/heap/remembered-set.h",
ulan's avatar
ulan committed
2308
    "src/heap/scavenge-job.cc",
jochen's avatar
jochen committed
2309
    "src/heap/scavenge-job.h",
2310 2311 2312
    "src/heap/scavenger-inl.h",
    "src/heap/scavenger.cc",
    "src/heap/scavenger.h",
2313
    "src/heap/slot-set.cc",
ulan's avatar
ulan committed
2314
    "src/heap/slot-set.h",
2315 2316 2317
    "src/heap/spaces-inl.h",
    "src/heap/spaces.cc",
    "src/heap/spaces.h",
2318 2319
    "src/heap/stress-marking-observer.cc",
    "src/heap/stress-marking-observer.h",
2320 2321
    "src/heap/stress-scavenge-observer.cc",
    "src/heap/stress-scavenge-observer.h",
2322 2323
    "src/heap/sweeper.cc",
    "src/heap/sweeper.h",
2324
    "src/heap/worklist.h",
2325 2326
    "src/ic/call-optimization.cc",
    "src/ic/call-optimization.h",
2327
    "src/ic/handler-configuration-inl.h",
2328
    "src/ic/handler-configuration.cc",
2329
    "src/ic/handler-configuration.h",
2330
    "src/ic/ic-inl.h",
2331 2332
    "src/ic/ic-stats.cc",
    "src/ic/ic-stats.h",
2333 2334 2335 2336
    "src/ic/ic.cc",
    "src/ic/ic.h",
    "src/ic/stub-cache.cc",
    "src/ic/stub-cache.h",
2337 2338
    "src/init/bootstrapper.cc",
    "src/init/bootstrapper.h",
2339
    "src/init/heap-symbols.h",
2340 2341 2342 2343 2344 2345 2346
    "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",
2347 2348
    "src/init/v8.cc",
    "src/init/v8.h",
2349
    "src/interpreter/block-coverage-builder.h",
2350 2351
    "src/interpreter/bytecode-array-accessor.cc",
    "src/interpreter/bytecode-array-accessor.h",
2352 2353
    "src/interpreter/bytecode-array-builder.cc",
    "src/interpreter/bytecode-array-builder.h",
2354 2355
    "src/interpreter/bytecode-array-iterator.cc",
    "src/interpreter/bytecode-array-iterator.h",
2356 2357
    "src/interpreter/bytecode-array-random-iterator.cc",
    "src/interpreter/bytecode-array-random-iterator.h",
2358 2359
    "src/interpreter/bytecode-array-writer.cc",
    "src/interpreter/bytecode-array-writer.h",
2360 2361 2362 2363
    "src/interpreter/bytecode-decoder.cc",
    "src/interpreter/bytecode-decoder.h",
    "src/interpreter/bytecode-flags.cc",
    "src/interpreter/bytecode-flags.h",
2364 2365
    "src/interpreter/bytecode-generator.cc",
    "src/interpreter/bytecode-generator.h",
2366
    "src/interpreter/bytecode-jump-table.h",
2367
    "src/interpreter/bytecode-label.cc",
2368
    "src/interpreter/bytecode-label.h",
2369 2370
    "src/interpreter/bytecode-node.cc",
    "src/interpreter/bytecode-node.h",
2371 2372
    "src/interpreter/bytecode-operands.cc",
    "src/interpreter/bytecode-operands.h",
2373
    "src/interpreter/bytecode-register-allocator.h",
2374 2375
    "src/interpreter/bytecode-register-optimizer.cc",
    "src/interpreter/bytecode-register-optimizer.h",
2376 2377
    "src/interpreter/bytecode-register.cc",
    "src/interpreter/bytecode-register.h",
2378 2379
    "src/interpreter/bytecode-source-info.cc",
    "src/interpreter/bytecode-source-info.h",
2380
    "src/interpreter/bytecode-traits.h",
jochen's avatar
jochen committed
2381 2382
    "src/interpreter/bytecodes.cc",
    "src/interpreter/bytecodes.h",
2383 2384
    "src/interpreter/constant-array-builder.cc",
    "src/interpreter/constant-array-builder.h",
2385 2386
    "src/interpreter/control-flow-builders.cc",
    "src/interpreter/control-flow-builders.h",
2387 2388
    "src/interpreter/handler-table-builder.cc",
    "src/interpreter/handler-table-builder.h",
2389
    "src/interpreter/interpreter-generator.h",
2390 2391
    "src/interpreter/interpreter-intrinsics.cc",
    "src/interpreter/interpreter-intrinsics.h",
jochen's avatar
jochen committed
2392 2393
    "src/interpreter/interpreter.cc",
    "src/interpreter/interpreter.h",
Yang Guo's avatar
Yang Guo committed
2394 2395 2396 2397
    "src/json/json-parser.cc",
    "src/json/json-parser.h",
    "src/json/json-stringifier.cc",
    "src/json/json-stringifier.h",
2398
    "src/logging/code-events.h",
2399 2400 2401 2402 2403 2404 2405 2406 2407
    "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",
2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425
    "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",
2426
    "src/numbers/hash-seed-inl.h",
2427 2428 2429 2430
    "src/numbers/math-random.cc",
    "src/numbers/math-random.h",
    "src/numbers/strtod.cc",
    "src/numbers/strtod.h",
2431
    "src/objects/allocation-site-inl.h",
2432 2433
    "src/objects/allocation-site-scopes-inl.h",
    "src/objects/allocation-site-scopes.h",
2434
    "src/objects/allocation-site.h",
2435 2436
    "src/objects/api-callbacks-inl.h",
    "src/objects/api-callbacks.h",
2437 2438
    "src/objects/arguments-inl.h",
    "src/objects/arguments.h",
2439 2440
    "src/objects/backing-store.cc",
    "src/objects/backing-store.h",
2441 2442
    "src/objects/bigint.cc",
    "src/objects/bigint.h",
2443 2444
    "src/objects/cell-inl.h",
    "src/objects/cell.h",
2445
    "src/objects/code-inl.h",
2446
    "src/objects/code.cc",
2447
    "src/objects/code.h",
2448 2449
    "src/objects/compilation-cache-inl.h",
    "src/objects/compilation-cache.h",
2450 2451
    "src/objects/compressed-slots-inl.h",
    "src/objects/compressed-slots.h",
2452 2453 2454
    "src/objects/contexts-inl.h",
    "src/objects/contexts.cc",
    "src/objects/contexts.h",
2455
    "src/objects/data-handler.h",
2456 2457 2458
    "src/objects/debug-objects-inl.h",
    "src/objects/debug-objects.cc",
    "src/objects/debug-objects.h",
2459
    "src/objects/descriptor-array-inl.h",
2460
    "src/objects/descriptor-array.h",
2461
    "src/objects/dictionary-inl.h",
2462
    "src/objects/dictionary.h",
2463 2464 2465 2466 2467
    "src/objects/elements-inl.h",
    "src/objects/elements-kind.cc",
    "src/objects/elements-kind.h",
    "src/objects/elements.cc",
    "src/objects/elements.h",
2468 2469 2470
    "src/objects/embedder-data-array-inl.h",
    "src/objects/embedder-data-array.cc",
    "src/objects/embedder-data-array.h",
2471 2472
    "src/objects/embedder-data-slot-inl.h",
    "src/objects/embedder-data-slot.h",
2473 2474
    "src/objects/feedback-cell-inl.h",
    "src/objects/feedback-cell.h",
2475 2476 2477
    "src/objects/feedback-vector-inl.h",
    "src/objects/feedback-vector.cc",
    "src/objects/feedback-vector.h",
2478 2479 2480 2481
    "src/objects/field-index-inl.h",
    "src/objects/field-index.h",
    "src/objects/field-type.cc",
    "src/objects/field-type.h",
2482 2483
    "src/objects/fixed-array-inl.h",
    "src/objects/fixed-array.h",
2484 2485
    "src/objects/frame-array-inl.h",
    "src/objects/frame-array.h",
2486
    "src/objects/function-kind.h",
2487
    "src/objects/hash-table-inl.h",
2488
    "src/objects/hash-table.h",
2489 2490
    "src/objects/heap-number-inl.h",
    "src/objects/heap-number.h",
2491 2492
    "src/objects/heap-object-inl.h",
    "src/objects/heap-object.h",
2493 2494
    "src/objects/instance-type-inl.h",
    "src/objects/instance-type.h",
2495
    "src/objects/internal-index.h",
2496 2497
    "src/objects/intl-objects.cc",
    "src/objects/intl-objects.h",
2498
    "src/objects/js-array-buffer-inl.h",
2499
    "src/objects/js-array-buffer.cc",
2500
    "src/objects/js-array-buffer.h",
2501 2502
    "src/objects/js-array-inl.h",
    "src/objects/js-array.h",
2503 2504 2505
    "src/objects/js-break-iterator-inl.h",
    "src/objects/js-break-iterator.cc",
    "src/objects/js-break-iterator.h",
2506 2507 2508
    "src/objects/js-collator-inl.h",
    "src/objects/js-collator.cc",
    "src/objects/js-collator.h",
2509
    "src/objects/js-collection-inl.h",
2510
    "src/objects/js-collection-iterator.h",
2511
    "src/objects/js-collection.h",
2512 2513 2514
    "src/objects/js-date-time-format-inl.h",
    "src/objects/js-date-time-format.cc",
    "src/objects/js-date-time-format.h",
2515 2516 2517
    "src/objects/js-display-names-inl.h",
    "src/objects/js-display-names.cc",
    "src/objects/js-display-names.h",
2518 2519
    "src/objects/js-generator-inl.h",
    "src/objects/js-generator.h",
2520 2521 2522
    "src/objects/js-list-format-inl.h",
    "src/objects/js-list-format.cc",
    "src/objects/js-list-format.h",
2523 2524 2525
    "src/objects/js-locale-inl.h",
    "src/objects/js-locale.cc",
    "src/objects/js-locale.h",
2526 2527 2528
    "src/objects/js-number-format-inl.h",
    "src/objects/js-number-format.cc",
    "src/objects/js-number-format.h",
2529
    "src/objects/js-objects-inl.h",
2530
    "src/objects/js-objects.cc",
2531
    "src/objects/js-objects.h",
2532 2533 2534
    "src/objects/js-plural-rules-inl.h",
    "src/objects/js-plural-rules.cc",
    "src/objects/js-plural-rules.h",
2535 2536
    "src/objects/js-promise-inl.h",
    "src/objects/js-promise.h",
2537 2538
    "src/objects/js-proxy-inl.h",
    "src/objects/js-proxy.h",
2539
    "src/objects/js-regexp-inl.h",
2540 2541
    "src/objects/js-regexp-string-iterator-inl.h",
    "src/objects/js-regexp-string-iterator.h",
2542
    "src/objects/js-regexp.cc",
2543
    "src/objects/js-regexp.h",
2544 2545 2546
    "src/objects/js-relative-time-format-inl.h",
    "src/objects/js-relative-time-format.cc",
    "src/objects/js-relative-time-format.h",
2547 2548 2549
    "src/objects/js-segment-iterator-inl.h",
    "src/objects/js-segment-iterator.cc",
    "src/objects/js-segment-iterator.h",
2550 2551 2552
    "src/objects/js-segmenter-inl.h",
    "src/objects/js-segmenter.cc",
    "src/objects/js-segmenter.h",
2553 2554
    "src/objects/js-weak-refs-inl.h",
    "src/objects/js-weak-refs.h",
2555 2556
    "src/objects/keys.cc",
    "src/objects/keys.h",
2557 2558 2559
    "src/objects/layout-descriptor-inl.h",
    "src/objects/layout-descriptor.cc",
    "src/objects/layout-descriptor.h",
2560
    "src/objects/literal-objects-inl.h",
2561 2562
    "src/objects/literal-objects.cc",
    "src/objects/literal-objects.h",
2563 2564 2565 2566 2567 2568
    "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",
2569 2570
    "src/objects/managed.cc",
    "src/objects/managed.h",
2571
    "src/objects/map-inl.h",
2572 2573
    "src/objects/map-updater.cc",
    "src/objects/map-updater.h",
2574
    "src/objects/map.cc",
2575
    "src/objects/map.h",
2576 2577
    "src/objects/maybe-object-inl.h",
    "src/objects/maybe-object.h",
2578 2579
    "src/objects/microtask-inl.h",
    "src/objects/microtask.h",
2580 2581 2582
    "src/objects/module-inl.h",
    "src/objects/module.cc",
    "src/objects/module.h",
2583 2584
    "src/objects/name-inl.h",
    "src/objects/name.h",
2585
    "src/objects/object-list-macros.h",
2586 2587
    "src/objects/object-macros-undef.h",
    "src/objects/object-macros.h",
2588 2589
    "src/objects/objects-body-descriptors-inl.h",
    "src/objects/objects-body-descriptors.h",
2590 2591 2592
    "src/objects/objects-inl.h",
    "src/objects/objects.cc",
    "src/objects/objects.h",
2593 2594
    "src/objects/oddball-inl.h",
    "src/objects/oddball.h",
2595 2596 2597
    "src/objects/ordered-hash-table-inl.h",
    "src/objects/ordered-hash-table.cc",
    "src/objects/ordered-hash-table.h",
2598 2599 2600
    "src/objects/osr-optimized-code-cache-inl.h",
    "src/objects/osr-optimized-code-cache.cc",
    "src/objects/osr-optimized-code-cache.h",
2601 2602
    "src/objects/primitive-heap-object-inl.h",
    "src/objects/primitive-heap-object.h",
2603 2604
    "src/objects/promise-inl.h",
    "src/objects/promise.h",
2605 2606
    "src/objects/property-array-inl.h",
    "src/objects/property-array.h",
2607 2608
    "src/objects/property-cell-inl.h",
    "src/objects/property-cell.h",
2609 2610
    "src/objects/property-descriptor-object-inl.h",
    "src/objects/property-descriptor-object.h",
2611 2612 2613 2614 2615
    "src/objects/property-descriptor.cc",
    "src/objects/property-descriptor.h",
    "src/objects/property-details.h",
    "src/objects/property.cc",
    "src/objects/property.h",
2616 2617
    "src/objects/prototype-info-inl.h",
    "src/objects/prototype-info.h",
2618
    "src/objects/prototype.h",
2619
    "src/objects/regexp-match-info.h",
2620
    "src/objects/scope-info.cc",
2621
    "src/objects/scope-info.h",
2622 2623
    "src/objects/script-inl.h",
    "src/objects/script.h",
2624 2625
    "src/objects/shared-function-info-inl.h",
    "src/objects/shared-function-info.h",
2626
    "src/objects/slots-atomic-inl.h",
2627 2628
    "src/objects/slots-inl.h",
    "src/objects/slots.h",
2629 2630
    "src/objects/source-text-module.cc",
    "src/objects/source-text-module.h",
2631
    "src/objects/stack-frame-info-inl.h",
2632
    "src/objects/stack-frame-info.cc",
2633
    "src/objects/stack-frame-info.h",
2634 2635
    "src/objects/string-comparator.cc",
    "src/objects/string-comparator.h",
2636
    "src/objects/string-inl.h",
2637
    "src/objects/string-table-inl.h",
2638
    "src/objects/string-table.h",
2639
    "src/objects/string.cc",
2640
    "src/objects/string.h",
2641 2642
    "src/objects/struct-inl.h",
    "src/objects/struct.h",
2643 2644
    "src/objects/synthetic-module.cc",
    "src/objects/synthetic-module.h",
2645 2646
    "src/objects/tagged-field-inl.h",
    "src/objects/tagged-field.h",
2647 2648 2649
    "src/objects/tagged-impl-inl.h",
    "src/objects/tagged-impl.cc",
    "src/objects/tagged-impl.h",
2650 2651
    "src/objects/tagged-value-inl.h",
    "src/objects/tagged-value.h",
2652
    "src/objects/template-objects-inl.h",
2653 2654
    "src/objects/template-objects.cc",
    "src/objects/template-objects.h",
2655 2656
    "src/objects/templates-inl.h",
    "src/objects/templates.h",
2657 2658 2659
    "src/objects/transitions-inl.h",
    "src/objects/transitions.cc",
    "src/objects/transitions.h",
2660 2661 2662 2663 2664 2665
    "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",
2666
    "src/parsing/expression-scope.h",
2667 2668
    "src/parsing/func-name-inferrer.cc",
    "src/parsing/func-name-inferrer.h",
2669 2670
    "src/parsing/literal-buffer.cc",
    "src/parsing/literal-buffer.h",
2671 2672
    "src/parsing/parse-info.cc",
    "src/parsing/parse-info.h",
2673
    "src/parsing/parser-base.h",
2674 2675
    "src/parsing/parser.cc",
    "src/parsing/parser.h",
2676 2677
    "src/parsing/parsing.cc",
    "src/parsing/parsing.h",
2678 2679
    "src/parsing/pending-compilation-error-handler.cc",
    "src/parsing/pending-compilation-error-handler.h",
2680 2681 2682
    "src/parsing/preparse-data-impl.h",
    "src/parsing/preparse-data.cc",
    "src/parsing/preparse-data.h",
2683
    "src/parsing/preparser-logger.h",
2684 2685 2686 2687 2688 2689 2690 2691 2692 2693
    "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",
2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708
    "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
2709 2710
    "src/profiler/profiler-listener.cc",
    "src/profiler/profiler-listener.h",
2711 2712
    "src/profiler/sampling-heap-profiler.cc",
    "src/profiler/sampling-heap-profiler.h",
2713 2714
    "src/profiler/strings-storage.cc",
    "src/profiler/strings-storage.h",
lpy's avatar
lpy committed
2715 2716
    "src/profiler/tick-sample.cc",
    "src/profiler/tick-sample.h",
2717 2718
    "src/profiler/tracing-cpu-profiler.cc",
    "src/profiler/tracing-cpu-profiler.h",
2719 2720
    "src/regexp/property-sequences.cc",
    "src/regexp/property-sequences.h",
2721 2722
    "src/regexp/regexp-ast.cc",
    "src/regexp/regexp-ast.h",
2723 2724 2725
    "src/regexp/regexp-bytecode-generator-inl.h",
    "src/regexp/regexp-bytecode-generator.cc",
    "src/regexp/regexp-bytecode-generator.h",
2726 2727 2728
    "src/regexp/regexp-bytecode-peephole.cc",
    "src/regexp/regexp-bytecode-peephole.h",
    "src/regexp/regexp-bytecodes.cc",
2729
    "src/regexp/regexp-bytecodes.h",
2730
    "src/regexp/regexp-compiler-tonode.cc",
2731
    "src/regexp/regexp-compiler.cc",
2732
    "src/regexp/regexp-compiler.h",
2733 2734
    "src/regexp/regexp-dotprinter.cc",
    "src/regexp/regexp-dotprinter.h",
2735 2736
    "src/regexp/regexp-interpreter.cc",
    "src/regexp/regexp-interpreter.h",
2737
    "src/regexp/regexp-macro-assembler-arch.h",
2738 2739 2740 2741
    "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",
2742
    "src/regexp/regexp-nodes.h",
2743 2744
    "src/regexp/regexp-parser.cc",
    "src/regexp/regexp-parser.h",
2745 2746
    "src/regexp/regexp-stack.cc",
    "src/regexp/regexp-stack.h",
2747 2748
    "src/regexp/regexp-utils.cc",
    "src/regexp/regexp-utils.h",
2749 2750
    "src/regexp/regexp.cc",
    "src/regexp/regexp.h",
2751
    "src/regexp/special-case.h",
2752 2753 2754
    "src/roots/roots-inl.h",
    "src/roots/roots.cc",
    "src/roots/roots.h",
2755
    "src/runtime/runtime-array.cc",
binji's avatar
binji committed
2756
    "src/runtime/runtime-atomics.cc",
2757
    "src/runtime/runtime-bigint.cc",
2758
    "src/runtime/runtime-classes.cc",
2759 2760
    "src/runtime/runtime-collections.cc",
    "src/runtime/runtime-compiler.cc",
2761 2762
    "src/runtime/runtime-date.cc",
    "src/runtime/runtime-debug.cc",
2763
    "src/runtime/runtime-forin.cc",
2764
    "src/runtime/runtime-function.cc",
binji's avatar
binji committed
2765
    "src/runtime/runtime-futex.cc",
2766
    "src/runtime/runtime-generator.cc",
2767
    "src/runtime/runtime-internal.cc",
2768
    "src/runtime/runtime-interpreter.cc",
2769
    "src/runtime/runtime-intl.cc",
2770
    "src/runtime/runtime-literals.cc",
2771
    "src/runtime/runtime-module.cc",
2772
    "src/runtime/runtime-numbers.cc",
2773
    "src/runtime/runtime-object.cc",
2774
    "src/runtime/runtime-operators.cc",
2775
    "src/runtime/runtime-promise.cc",
2776
    "src/runtime/runtime-proxy.cc",
2777
    "src/runtime/runtime-regexp.cc",
2778
    "src/runtime/runtime-scopes.cc",
2779
    "src/runtime/runtime-strings.cc",
2780
    "src/runtime/runtime-symbol.cc",
2781 2782
    "src/runtime/runtime-test.cc",
    "src/runtime/runtime-typedarray.cc",
2783
    "src/runtime/runtime-utils.h",
2784
    "src/runtime/runtime-wasm.cc",
2785 2786
    "src/runtime/runtime.cc",
    "src/runtime/runtime.h",
2787
    "src/sanitizer/asan.h",
2788 2789
    "src/sanitizer/lsan-page-allocator.cc",
    "src/sanitizer/lsan-page-allocator.h",
2790
    "src/sanitizer/msan.h",
2791
    "src/sanitizer/tsan.h",
2792 2793
    "src/snapshot/code-serializer.cc",
    "src/snapshot/code-serializer.h",
2794 2795
    "src/snapshot/deserializer-allocator.cc",
    "src/snapshot/deserializer-allocator.h",
2796 2797
    "src/snapshot/deserializer.cc",
    "src/snapshot/deserializer.h",
2798 2799
    "src/snapshot/embedded/embedded-data.cc",
    "src/snapshot/embedded/embedded-data.h",
2800 2801 2802 2803
    "src/snapshot/object-deserializer.cc",
    "src/snapshot/object-deserializer.h",
    "src/snapshot/partial-deserializer.cc",
    "src/snapshot/partial-deserializer.h",
2804 2805
    "src/snapshot/partial-serializer.cc",
    "src/snapshot/partial-serializer.h",
2806 2807 2808 2809
    "src/snapshot/read-only-deserializer.cc",
    "src/snapshot/read-only-deserializer.h",
    "src/snapshot/read-only-serializer.cc",
    "src/snapshot/read-only-serializer.h",
2810
    "src/snapshot/references.h",
2811 2812
    "src/snapshot/roots-serializer.cc",
    "src/snapshot/roots-serializer.h",
2813 2814
    "src/snapshot/serializer-allocator.cc",
    "src/snapshot/serializer-allocator.h",
2815 2816
    "src/snapshot/serializer-common.cc",
    "src/snapshot/serializer-common.h",
jochen's avatar
jochen committed
2817 2818
    "src/snapshot/serializer.cc",
    "src/snapshot/serializer.h",
2819 2820 2821
    "src/snapshot/snapshot-common.cc",
    "src/snapshot/snapshot-source-sink.cc",
    "src/snapshot/snapshot-source-sink.h",
jochen's avatar
jochen committed
2822
    "src/snapshot/snapshot.h",
2823 2824
    "src/snapshot/startup-deserializer.cc",
    "src/snapshot/startup-deserializer.h",
2825 2826
    "src/snapshot/startup-serializer.cc",
    "src/snapshot/startup-serializer.h",
2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845
    "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",
2846 2847 2848 2849
    "src/tasks/cancelable-task.cc",
    "src/tasks/cancelable-task.h",
    "src/tasks/task-utils.cc",
    "src/tasks/task-utils.h",
2850 2851
    "src/third_party/siphash/halfsiphash.cc",
    "src/third_party/siphash/halfsiphash.h",
2852
    "src/third_party/utf8-decoder/utf8-decoder.h",
2853 2854
    "src/tracing/trace-event.cc",
    "src/tracing/trace-event.h",
2855 2856
    "src/tracing/traced-value.cc",
    "src/tracing/traced-value.h",
2857 2858
    "src/tracing/tracing-category-observer.cc",
    "src/tracing/tracing-category-observer.h",
2859
    "src/trap-handler/handler-inside.cc",
eholk's avatar
eholk committed
2860 2861 2862
    "src/trap-handler/handler-outside.cc",
    "src/trap-handler/handler-shared.cc",
    "src/trap-handler/trap-handler-internal.h",
2863
    "src/trap-handler/trap-handler.h",
2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887
    "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",
2888
    "src/wasm/baseline/liftoff-assembler-defs.h",
2889 2890 2891
    "src/wasm/baseline/liftoff-assembler.cc",
    "src/wasm/baseline/liftoff-assembler.h",
    "src/wasm/baseline/liftoff-compiler.cc",
2892
    "src/wasm/baseline/liftoff-compiler.h",
2893
    "src/wasm/baseline/liftoff-register.h",
2894
    "src/wasm/compilation-environment.h",
2895
    "src/wasm/decoder.h",
2896
    "src/wasm/function-body-decoder-impl.h",
2897 2898
    "src/wasm/function-body-decoder.cc",
    "src/wasm/function-body-decoder.h",
2899 2900
    "src/wasm/function-compiler.cc",
    "src/wasm/function-compiler.h",
2901 2902
    "src/wasm/graph-builder-interface.cc",
    "src/wasm/graph-builder-interface.h",
2903 2904
    "src/wasm/jump-table-assembler.cc",
    "src/wasm/jump-table-assembler.h",
2905
    "src/wasm/leb-helper.h",
2906 2907
    "src/wasm/local-decl-encoder.cc",
    "src/wasm/local-decl-encoder.h",
2908 2909
    "src/wasm/memory-tracing.cc",
    "src/wasm/memory-tracing.h",
2910 2911
    "src/wasm/module-compiler.cc",
    "src/wasm/module-compiler.h",
2912 2913
    "src/wasm/module-decoder.cc",
    "src/wasm/module-decoder.h",
2914 2915
    "src/wasm/module-instantiate.cc",
    "src/wasm/module-instantiate.h",
2916
    "src/wasm/object-access.h",
2917 2918
    "src/wasm/signature-map.cc",
    "src/wasm/signature-map.h",
2919 2920
    "src/wasm/streaming-decoder.cc",
    "src/wasm/streaming-decoder.h",
2921
    "src/wasm/value-type.h",
2922
    "src/wasm/wasm-arguments.h",
2923 2924
    "src/wasm/wasm-code-manager.cc",
    "src/wasm/wasm-code-manager.h",
2925
    "src/wasm/wasm-constants.h",
2926
    "src/wasm/wasm-debug.cc",
2927
    "src/wasm/wasm-engine.cc",
2928
    "src/wasm/wasm-engine.h",
2929
    "src/wasm/wasm-external-refs.cc",
2930
    "src/wasm/wasm-external-refs.h",
2931 2932 2933
    "src/wasm/wasm-feature-flags.h",
    "src/wasm/wasm-features.cc",
    "src/wasm/wasm-features.h",
2934
    "src/wasm/wasm-import-wrapper-cache.cc",
2935
    "src/wasm/wasm-import-wrapper-cache.h",
2936 2937
    "src/wasm/wasm-interpreter.cc",
    "src/wasm/wasm-interpreter.h",
2938 2939
    "src/wasm/wasm-js.cc",
    "src/wasm/wasm-js.h",
2940
    "src/wasm/wasm-limits.h",
2941
    "src/wasm/wasm-linkage.h",
2942 2943
    "src/wasm/wasm-module-builder.cc",
    "src/wasm/wasm-module-builder.h",
2944 2945
    "src/wasm/wasm-module-sourcemap.cc",
    "src/wasm/wasm-module-sourcemap.h",
2946 2947
    "src/wasm/wasm-module.cc",
    "src/wasm/wasm-module.h",
2948
    "src/wasm/wasm-objects-inl.h",
2949 2950
    "src/wasm/wasm-objects.cc",
    "src/wasm/wasm-objects.h",
2951 2952 2953 2954
    "src/wasm/wasm-opcodes.cc",
    "src/wasm/wasm-opcodes.h",
    "src/wasm/wasm-result.cc",
    "src/wasm/wasm-result.h",
2955 2956
    "src/wasm/wasm-serialization.cc",
    "src/wasm/wasm-serialization.h",
2957 2958
    "src/wasm/wasm-text.cc",
    "src/wasm/wasm-text.h",
2959
    "src/wasm/wasm-tier.h",
2960
    "src/wasm/wasm-value.h",
2961 2962 2963
    "src/zone/accounting-allocator.cc",
    "src/zone/accounting-allocator.h",
    "src/zone/zone-allocator.h",
2964
    "src/zone/zone-chunk-list.h",
2965
    "src/zone/zone-containers.h",
2966
    "src/zone/zone-handle-set.h",
2967
    "src/zone/zone-list-inl.h",
heimbuef's avatar
heimbuef committed
2968
    "src/zone/zone-segment.cc",
2969 2970 2971
    "src/zone/zone-segment.h",
    "src/zone/zone.cc",
    "src/zone/zone.h",
2972 2973
  ]

2974 2975 2976 2977
  if (v8_enable_third_party_heap) {
    sources += v8_third_party_heap_files
  }

2978 2979 2980 2981 2982 2983 2984
  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
  }

2985
  if (v8_current_cpu == "x86") {
2986
    sources += [  ### gcmole(arch:ia32) ###
2987 2988 2989 2990 2991 2992 2993 2994 2995 2996
      "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",
2997 2998 2999 3000
      "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",
3001
      "src/debug/ia32/debug-ia32.cc",
3002 3003 3004 3005
      "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",
3006 3007
      "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
      "src/regexp/ia32/regexp-macro-assembler-ia32.h",
3008
      "src/wasm/baseline/ia32/liftoff-assembler-ia32.h",
3009
    ]
3010
  } else if (v8_current_cpu == "x64") {
3011
    sources += [  ### gcmole(arch:x64) ###
3012 3013 3014 3015 3016 3017 3018 3019 3020 3021
      "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",
      "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",
3022 3023 3024 3025 3026 3027
      "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",
3028
      "src/debug/x64/debug-x64.cc",
3029 3030 3031 3032 3033
      "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",
3034 3035
      "src/regexp/x64/regexp-macro-assembler-x64.cc",
      "src/regexp/x64/regexp-macro-assembler-x64.h",
3036
      "src/third_party/valgrind/valgrind.h",
3037
      "src/wasm/baseline/x64/liftoff-assembler-x64.h",
3038
    ]
3039

3040 3041
    # 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.
3042
    if (is_linux || is_mac || is_ios || target_os == "freebsd") {
3043
      sources += [
3044 3045 3046
        "src/trap-handler/handler-inside-posix.cc",
        "src/trap-handler/handler-inside-posix.h",
        "src/trap-handler/handler-outside-posix.cc",
3047 3048 3049
      ]
    }
    if (is_win) {
3050
      sources += [
3051 3052
        "src/diagnostics/unwinding-info-win64.cc",
        "src/diagnostics/unwinding-info-win64.h",
3053 3054 3055 3056
        "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
3057
    }
3058
  } else if (v8_current_cpu == "arm") {
3059
    sources += [  ### gcmole(arch:arm) ###
3060 3061 3062 3063 3064 3065 3066 3067 3068 3069
      "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",
3070 3071 3072 3073 3074 3075
      "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",
3076
      "src/debug/arm/debug-arm.cc",
3077 3078 3079 3080 3081 3082 3083
      "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",
3084 3085
      "src/regexp/arm/regexp-macro-assembler-arm.cc",
      "src/regexp/arm/regexp-macro-assembler-arm.h",
3086
      "src/wasm/baseline/arm/liftoff-assembler-arm.h",
3087
    ]
3088
  } else if (v8_current_cpu == "arm64") {
3089
    sources += [  ### gcmole(arch:arm64) ###
3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110
      "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/instrument-arm64.cc",
      "src/codegen/arm64/instrument-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",
3111 3112 3113 3114 3115 3116
      "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",
3117
      "src/debug/arm64/debug-arm64.cc",
3118 3119 3120 3121 3122 3123
      "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",
3124
      "src/execution/arm64/pointer-auth-arm64.cc",
3125 3126 3127
      "src/execution/arm64/simulator-arm64.cc",
      "src/execution/arm64/simulator-arm64.h",
      "src/execution/arm64/simulator-logic-arm64.cc",
3128 3129
      "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
      "src/regexp/arm64/regexp-macro-assembler-arm64.h",
3130
      "src/wasm/baseline/arm64/liftoff-assembler-arm64.h",
3131
    ]
3132 3133 3134 3135 3136 3137
    if (is_win) {
      sources += [
        "src/diagnostics/unwinding-info-win64.cc",
        "src/diagnostics/unwinding-info-win64.h",
      ]
    }
3138 3139
  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
    sources += [  ### gcmole(arch:mipsel) ###
3140 3141 3142 3143 3144 3145 3146 3147 3148 3149
      "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",
3150 3151 3152 3153
      "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",
3154
      "src/debug/mips/debug-mips.cc",
3155 3156 3157 3158 3159 3160
      "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",
3161 3162
      "src/regexp/mips/regexp-macro-assembler-mips.cc",
      "src/regexp/mips/regexp-macro-assembler-mips.h",
3163
      "src/wasm/baseline/mips/liftoff-assembler-mips.h",
3164
    ]
3165 3166
  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    sources += [  ### gcmole(arch:mips64el) ###
3167 3168 3169 3170 3171 3172 3173 3174 3175 3176
      "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",
3177 3178 3179 3180
      "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",
3181
      "src/debug/mips64/debug-mips64.cc",
3182 3183 3184 3185 3186 3187
      "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",
3188 3189
      "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
      "src/regexp/mips64/regexp-macro-assembler-mips64.h",
3190
      "src/wasm/baseline/mips64/liftoff-assembler-mips64.h",
3191
    ]
3192 3193
  } else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
    sources += [  ### gcmole(arch:ppc) ###
3194 3195 3196 3197 3198 3199 3200 3201 3202 3203
      "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",
3204 3205 3206 3207
      "src/compiler/backend/ppc/code-generator-ppc.cc",
      "src/compiler/backend/ppc/instruction-codes-ppc.h",
      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
3208 3209
      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
      "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
3210
      "src/debug/ppc/debug-ppc.cc",
3211 3212
      "src/deoptimizer/ppc/deoptimizer-ppc.cc",
      "src/diagnostics/ppc/disasm-ppc.cc",
3213
      "src/diagnostics/ppc/eh-frame-ppc.cc",
3214 3215 3216 3217
      "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",
3218 3219
      "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
      "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3220
      "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3221
    ]
3222
  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3223
    sources += [  ### gcmole(arch:s390) ###
3224 3225 3226 3227 3228 3229 3230 3231 3232 3233
      "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",
3234 3235 3236 3237
      "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",
3238 3239
      "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
      "src/compiler/backend/s390/unwinding-info-writer-s390.h",
3240
      "src/debug/s390/debug-s390.cc",
3241 3242
      "src/deoptimizer/s390/deoptimizer-s390.cc",
      "src/diagnostics/s390/disasm-s390.cc",
3243
      "src/diagnostics/s390/eh-frame-s390.cc",
3244 3245 3246 3247
      "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
3248 3249
      "src/regexp/s390/regexp-macro-assembler-s390.cc",
      "src/regexp/s390/regexp-macro-assembler-s390.h",
3250
      "src/wasm/baseline/s390/liftoff-assembler-s390.h",
3251
    ]
3252 3253
  }

3254
  configs = [ ":internal_config" ]
3255 3256

  defines = []
3257
  deps = [
3258
    ":torque_generated_definitions",
3259
    ":v8_headers",
3260
    ":v8_libbase",
3261
    ":v8_libsampler",
3262
    ":v8_shared_internal_headers",
3263
    ":v8_version",
3264
    "src/inspector:inspector",
3265
  ]
3266

Takuto Ikuta's avatar
Takuto Ikuta committed
3267 3268 3269
  public_deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
3270
    ":v8_maybe_icu",
Takuto Ikuta's avatar
Takuto Ikuta committed
3271 3272
  ]

3273
  if (v8_enable_i18n_support) {
3274 3275
    deps += [ ":run_gen-regexp-special-case" ]
    sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
3276 3277 3278 3279 3280
    if (is_win) {
      deps += [ "//third_party/icu:icudata" ]
    }
  } else {
    sources -= [
3281 3282 3283
      "src/builtins/builtins-intl.cc",
      "src/objects/intl-objects.cc",
      "src/objects/intl-objects.h",
3284 3285 3286
      "src/objects/js-break-iterator-inl.h",
      "src/objects/js-break-iterator.cc",
      "src/objects/js-break-iterator.h",
3287 3288 3289
      "src/objects/js-collator-inl.h",
      "src/objects/js-collator.cc",
      "src/objects/js-collator.h",
3290 3291 3292
      "src/objects/js-date-time-format-inl.h",
      "src/objects/js-date-time-format.cc",
      "src/objects/js-date-time-format.h",
3293 3294 3295
      "src/objects/js-display-names-inl.h",
      "src/objects/js-display-names.cc",
      "src/objects/js-display-names.h",
3296 3297 3298
      "src/objects/js-list-format-inl.h",
      "src/objects/js-list-format.cc",
      "src/objects/js-list-format.h",
3299 3300 3301
      "src/objects/js-locale-inl.h",
      "src/objects/js-locale.cc",
      "src/objects/js-locale.h",
3302 3303 3304
      "src/objects/js-number-format-inl.h",
      "src/objects/js-number-format.cc",
      "src/objects/js-number-format.h",
3305 3306 3307
      "src/objects/js-plural-rules-inl.h",
      "src/objects/js-plural-rules.cc",
      "src/objects/js-plural-rules.h",
3308 3309 3310
      "src/objects/js-relative-time-format-inl.h",
      "src/objects/js-relative-time-format.cc",
      "src/objects/js-relative-time-format.h",
3311 3312 3313
      "src/objects/js-segment-iterator-inl.h",
      "src/objects/js-segment-iterator.cc",
      "src/objects/js-segment-iterator.h",
3314 3315 3316
      "src/objects/js-segmenter-inl.h",
      "src/objects/js-segmenter.cc",
      "src/objects/js-segmenter.h",
3317
      "src/runtime/runtime-intl.cc",
3318
      "src/strings/char-predicates.cc",
3319 3320 3321
    ]
  }

3322 3323
  deps += [ "//third_party/zlib" ]

3324 3325 3326 3327
  if (v8_postmortem_support) {
    sources += [ "$target_gen_dir/debug-support.cc" ]
    deps += [ ":postmortem-metadata" ]
  }
3328

3329 3330 3331 3332 3333 3334
  libs = []

  if (v8_enable_third_party_heap) {
    libs += v8_third_party_heap_libs
  }

3335 3336 3337 3338 3339 3340
  # 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") {
3341
    libs += [ "atomic" ]
3342
  }
3343 3344 3345 3346 3347 3348 3349 3350

  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" ]
  }
3351 3352
}

3353 3354 3355 3356 3357 3358 3359
group("v8_base") {
  public_deps = [
    ":v8_base_without_compiler",
    ":v8_compiler",
  ]
}

3360 3361 3362 3363 3364
v8_source_set("torque_base") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = [
    "src/torque/ast.h",
3365 3366
    "src/torque/cfg.cc",
    "src/torque/cfg.h",
3367
    "src/torque/class-debug-reader-generator.cc",
3368
    "src/torque/constants.h",
3369
    "src/torque/contextual.h",
3370 3371
    "src/torque/csa-generator.cc",
    "src/torque/csa-generator.h",
3372 3373 3374 3375 3376 3377 3378 3379
    "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",
3380
    "src/torque/global-context.cc",
3381 3382 3383
    "src/torque/global-context.h",
    "src/torque/implementation-visitor.cc",
    "src/torque/implementation-visitor.h",
3384
    "src/torque/instance-type-generator.cc",
3385 3386
    "src/torque/instructions.cc",
    "src/torque/instructions.h",
3387
    "src/torque/parameter-difference.h",
3388 3389
    "src/torque/server-data.cc",
    "src/torque/server-data.h",
3390 3391
    "src/torque/source-positions.cc",
    "src/torque/source-positions.h",
3392 3393
    "src/torque/torque-compiler.cc",
    "src/torque/torque-compiler.h",
3394 3395
    "src/torque/torque-parser.cc",
    "src/torque/torque-parser.h",
3396 3397
    "src/torque/type-inference.cc",
    "src/torque/type-inference.h",
3398 3399
    "src/torque/type-oracle.cc",
    "src/torque/type-oracle.h",
3400 3401
    "src/torque/type-visitor.cc",
    "src/torque/type-visitor.h",
3402 3403 3404 3405 3406 3407 3408
    "src/torque/types.cc",
    "src/torque/types.h",
    "src/torque/utils.cc",
    "src/torque/utils.h",
  ]

  deps = [
3409
    ":v8_shared_internal_headers",
3410 3411
  ]

3412 3413 3414 3415
  public_deps = [
    ":v8_libbase",
  ]

3416 3417 3418
  # 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.
3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3430
  if (is_win && is_asan) {
3431 3432
    # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
    # Torque on Windows.
3433
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3434
  }
3435 3436 3437 3438 3439 3440

  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" ]
  }
3441 3442
}

3443 3444
v8_source_set("torque_ls_base") {
  sources = [
3445
    "src/torque/ls/globals.h",
3446 3447 3448 3449
    "src/torque/ls/json-parser.cc",
    "src/torque/ls/json-parser.h",
    "src/torque/ls/json.cc",
    "src/torque/ls/json.h",
3450 3451 3452 3453 3454
    "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",
3455 3456
  ]

3457
  public_deps = [
3458 3459 3460
    ":torque_base",
  ]

3461 3462 3463
  # 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.
3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3475
  if (is_win && is_asan) {
3476
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3477 3478 3479
  }
}

3480
v8_component("v8_libbase") {
3481
  sources = [
3482
    "src/base/address-region.h",
lpy's avatar
lpy committed
3483
    "src/base/atomic-utils.h",
3484 3485
    "src/base/atomicops.h",
    "src/base/atomicops_internals_atomicword_compat.h",
3486
    "src/base/atomicops_internals_portable.h",
3487
    "src/base/atomicops_internals_std.h",
3488
    "src/base/base-export.h",
3489
    "src/base/bit-field.h",
3490
    "src/base/bits.cc",
3491
    "src/base/bits.h",
3492 3493
    "src/base/bounded-page-allocator.cc",
    "src/base/bounded-page-allocator.h",
3494
    "src/base/bounds.h",
3495
    "src/base/build_config.h",
3496
    "src/base/compiler-specific.h",
3497 3498
    "src/base/cpu.cc",
    "src/base/cpu.h",
3499 3500
    "src/base/debug/stack_trace.cc",
    "src/base/debug/stack_trace.h",
3501 3502
    "src/base/division-by-constant.cc",
    "src/base/division-by-constant.h",
3503
    "src/base/enum-set.h",
3504
    "src/base/export-template.h",
3505 3506
    "src/base/file-utils.cc",
    "src/base/file-utils.h",
3507
    "src/base/flags.h",
3508
    "src/base/free_deleter.h",
3509 3510
    "src/base/functional.cc",
    "src/base/functional.h",
3511
    "src/base/hashmap-entry.h",
lpy's avatar
lpy committed
3512
    "src/base/hashmap.h",
3513 3514
    "src/base/ieee754.cc",
    "src/base/ieee754.h",
3515
    "src/base/iterator.h",
3516
    "src/base/lazy-instance.h",
3517
    "src/base/list.h",
3518 3519
    "src/base/logging.cc",
    "src/base/logging.h",
3520
    "src/base/lsan.h",
3521
    "src/base/macros.h",
3522
    "src/base/memory.h",
3523 3524
    "src/base/once.cc",
    "src/base/once.h",
3525
    "src/base/optional.h",
3526
    "src/base/overflowing-math.h",
3527 3528
    "src/base/page-allocator.cc",
    "src/base/page-allocator.h",
3529 3530
    "src/base/platform/condition-variable.cc",
    "src/base/platform/condition-variable.h",
jochen's avatar
jochen committed
3531
    "src/base/platform/elapsed-timer.h",
3532 3533 3534 3535 3536
    "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
3537 3538
    "src/base/platform/time.cc",
    "src/base/platform/time.h",
3539 3540
    "src/base/region-allocator.cc",
    "src/base/region-allocator.h",
3541
    "src/base/ring-buffer.h",
3542 3543
    "src/base/safe_conversions.h",
    "src/base/safe_conversions_impl.h",
3544
    "src/base/small-vector.h",
3545 3546
    "src/base/sys-info.cc",
    "src/base/sys-info.h",
3547
    "src/base/template-utils.h",
3548
    "src/base/timezone-cache.h",
3549
    "src/base/type-traits.h",
3550 3551
    "src/base/utils/random-number-generator.cc",
    "src/base/utils/random-number-generator.h",
3552 3553
    "src/base/vlq-base64.cc",
    "src/base/vlq-base64.h",
3554 3555
  ]

3556
  configs = [ ":internal_config_base" ]
3557

3558 3559
  public_configs = [ ":libbase_config" ]

3560 3561 3562 3563
  deps = [
    ":v8_headers",
  ]

Michael Achenbach's avatar
Michael Achenbach committed
3564 3565
  public_deps = []

3566 3567
  data = []

3568 3569
  data_deps = []

3570 3571
  defines = []

3572 3573 3574 3575
  if (is_component_build) {
    defines = [ "BUILDING_V8_BASE_SHARED" ]
  }

3576
  if (is_posix || is_fuchsia) {
3577 3578 3579 3580
    sources += [
      "src/base/platform/platform-posix.cc",
      "src/base/platform/platform-posix.h",
    ]
3581 3582 3583
    if (current_os != "aix") {
      sources += [
        "src/base/platform/platform-posix-time.cc",
3584
        "src/base/platform/platform-posix-time.h",
3585 3586
      ]
    }
3587 3588 3589
  }

  if (is_linux) {
3590 3591 3592 3593
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-linux.cc",
    ]
3594

jochen's avatar
jochen committed
3595 3596
    libs = [
      "dl",
3597 3598 3599 3600 3601 3602 3603 3604 3605 3606
      "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
3607 3608
      "rt",
    ]
3609
  } else if (is_android) {
3610
    if (current_toolchain == host_toolchain) {
jochen's avatar
jochen committed
3611 3612 3613 3614
      libs = [
        "dl",
        "rt",
      ]
3615
      if (host_os == "mac") {
3616 3617 3618 3619
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-macos.cc",
        ]
3620
      } else {
3621 3622 3623 3624
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-linux.cc",
        ]
3625 3626
      }
    } else {
3627 3628 3629 3630
      sources += [
        "src/base/debug/stack_trace_android.cc",
        "src/base/platform/platform-linux.cc",
      ]
3631
    }
3632 3633 3634 3635 3636
  } else if (is_fuchsia) {
    sources += [
      "src/base/debug/stack_trace_fuchsia.cc",
      "src/base/platform/platform-fuchsia.cc",
    ]
3637
  } else if (is_mac || is_ios) {
3638 3639 3640 3641
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-macos.cc",
    ]
3642 3643 3644
  } else if (is_win) {
    # TODO(jochen): Add support for cygwin.
    sources += [
3645
      "src/base/debug/stack_trace_win.cc",
3646
      "src/base/platform/platform-win32.cc",
3647
      "src/base/win32-headers.h",
3648 3649 3650 3651
    ]

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

3652
    libs = [
3653
      "dbghelp.lib",
3654 3655 3656
      "winmm.lib",
      "ws2_32.lib",
    ]
3657

3658
    data_deps += [ "//build/win:runtime_libs" ]
3659 3660
  }

3661 3662 3663 3664 3665 3666 3667 3668
  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",
    ]
  }

3669 3670 3671 3672 3673 3674
  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" ]
  }

3675 3676 3677 3678
  if (is_tsan && !build_with_chromium) {
    data += [ "tools/sanitizers/tsan_suppressions.txt" ]
  }

3679
  # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
3680 3681
}

3682
v8_component("v8_libplatform") {
3683
  sources = [
3684
    "//base/trace_event/common/trace_event_common.h",
3685
    "include/libplatform/libplatform-export.h",
3686
    "include/libplatform/libplatform.h",
3687
    "include/libplatform/v8-tracing.h",
3688 3689
    "src/libplatform/default-foreground-task-runner.cc",
    "src/libplatform/default-foreground-task-runner.h",
3690 3691
    "src/libplatform/default-platform.cc",
    "src/libplatform/default-platform.h",
3692 3693
    "src/libplatform/default-worker-threads-task-runner.cc",
    "src/libplatform/default-worker-threads-task-runner.h",
3694 3695
    "src/libplatform/delayed-task-queue.cc",
    "src/libplatform/delayed-task-queue.h",
3696 3697
    "src/libplatform/task-queue.cc",
    "src/libplatform/task-queue.h",
3698 3699 3700 3701 3702 3703 3704
    "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",
3705 3706 3707 3708
    "src/libplatform/worker-thread.cc",
    "src/libplatform/worker-thread.h",
  ]

3709
  configs = [ ":internal_config_base" ]
3710

3711 3712 3713 3714
  if (is_component_build) {
    defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
  }

3715
  public_configs = [ ":libplatform_config" ]
3716

3717
  deps = [
3718
    ":v8_headers",
3719 3720
    ":v8_libbase",
  ]
3721
  if (v8_use_perfetto) {
3722
    sources += [
3723 3724
      "src/libplatform/tracing/json-trace-event-listener.cc",
      "src/libplatform/tracing/json-trace-event-listener.h",
3725
      "src/libplatform/tracing/trace-event-listener.cc",
3726
      "src/libplatform/tracing/trace-event-listener.h",
3727
    ]
3728
    deps += [
3729
      "//third_party/perfetto/protos/perfetto/trace:lite",
3730
      "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
3731 3732 3733
      "//third_party/perfetto/protos/perfetto/trace/chrome:zero",
      "//third_party/perfetto/src/tracing:client_api",
      "//third_party/perfetto/src/tracing:platform_posix",
3734
    ]
3735
  }
3736 3737
}

3738 3739
v8_source_set("v8_libsampler") {
  sources = [
3740 3741
    "src/libsampler/sampler.cc",
    "src/libsampler/sampler.h",
3742 3743
  ]

3744
  configs = [ ":internal_config" ]
3745 3746 3747 3748 3749 3750 3751 3752

  public_configs = [ ":libsampler_config" ]

  deps = [
    ":v8_libbase",
  ]
}

3753
v8_source_set("fuzzer_support") {
jochen's avatar
jochen committed
3754 3755 3756 3757 3758 3759 3760
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

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

3761
  configs = [ ":internal_config_base" ]
jochen's avatar
jochen committed
3762

3763 3764 3765 3766 3767
  deps = [
    ":v8",
  ]

  public_deps = [
3768
    ":v8_libbase",
3769
    ":v8_libplatform",
3770
    ":v8_maybe_icu",
3771 3772 3773
  ]
}

3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796
###############################################################################
# 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" ]
  }
}

3797 3798 3799 3800 3801 3802
v8_static_library("wee8") {
  deps = [
    ":v8_base",
    ":v8_libbase",
    ":v8_libplatform",
    ":v8_libsampler",
3803
    ":v8_snapshot",
3804 3805 3806 3807 3808 3809 3810 3811
    "//build/win:default_exe_manifest",
  ]

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

  configs = [ ":internal_config" ]

  sources = [
3812
    ### gcmole(all) ###
3813
    "src/wasm/c-api.cc",
3814
    "src/wasm/c-api.h",
3815 3816
    "third_party/wasm-api/wasm.h",
    "third_party/wasm-api/wasm.hh",
3817 3818 3819
  ]
}

3820 3821 3822 3823
###############################################################################
# Executables
#

3824
if (current_toolchain == v8_generator_toolchain) {
3825
  v8_executable("bytecode_builtins_list_generator") {
3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837
    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",
    ]

3838 3839
    configs = [ ":internal_config" ]

3840 3841 3842 3843 3844 3845 3846
    deps = [
      ":v8_libbase",
      "//build/win:default_exe_manifest",
    ]
  }
}

3847
if (current_toolchain == v8_snapshot_toolchain) {
3848
  v8_executable("mksnapshot") {
3849
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
3850

3851
    sources = [
3852
      "src/snapshot/embedded/embedded-empty.cc",
3853 3854
      "src/snapshot/embedded/embedded-file-writer.cc",
      "src/snapshot/embedded/embedded-file-writer.h",
3855 3856
      "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
3857 3858 3859 3860
      "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",
3861 3862 3863 3864
      "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",
3865
      "src/snapshot/mksnapshot.cc",
3866
      "src/snapshot/snapshot-empty.cc",
3867
    ]
3868

3869
    configs = [ ":internal_config" ]
3870

3871
    deps = [
3872 3873
      ":v8_base_without_compiler",
      ":v8_compiler_for_mksnapshot",
3874
      ":v8_init",
3875
      ":v8_libbase",
3876
      ":v8_libplatform",
3877
      ":v8_maybe_icu",
3878
      "//build/win:default_exe_manifest",
3879
    ]
3880
  }
3881 3882
}

3883 3884 3885 3886 3887 3888 3889 3890 3891
if (current_toolchain == v8_snapshot_toolchain) {
  v8_executable("torque") {
    visibility = [ ":*" ]  # Only targets in this file can depend on this.

    sources = [
      "src/torque/torque.cc",
    ]

    deps = [
3892
      ":torque_base",
3893 3894 3895
      "//build/win:default_exe_manifest",
    ]

3896 3897 3898
    # 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.
3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909
    configs = [
      ":internal_config",
      "//build/config/compiler:exceptions",
      "//build/config/compiler:rtti",
    ]

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

3910
    if (is_win && is_asan) {
3911
      remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3912
    }
3913 3914 3915
  }
}

3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928
v8_executable("torque-language-server") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = [
    "src/torque/ls/torque-language-server.cc",
  ]

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

3929 3930 3931
  # 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.
3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3943
  if (is_win && is_asan) {
3944
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3945 3946 3947
  }
}

3948 3949 3950 3951
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.
3952

3953 3954 3955
      sources = [
        "src/regexp/gen-regexp-special-case.cc",
      ]
3956

3957 3958 3959 3960 3961
      deps = [
        ":v8_libbase",
        "//build/win:default_exe_manifest",
        "//third_party/icu",
      ]
3962

3963 3964
      configs = [ ":internal_config" ]
    }
3965 3966
  }

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

3970
    script = "tools/run.py"
3971

3972 3973 3974
    deps = [
      ":gen-regexp-special-case($v8_generator_toolchain)",
    ]
3975

3976
    output_file = "$target_gen_dir/src/regexp/special-case.cc"
3977

3978 3979 3980
    outputs = [
      output_file,
    ]
3981

3982 3983 3984 3985 3986 3987 3988 3989 3990
    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),
    ]
  }
3991 3992
}

3993 3994 3995
###############################################################################
# Public targets
#
brettw's avatar
brettw committed
3996

3997
want_v8_shell =
machenbach's avatar
machenbach committed
3998 3999 4000
    (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
    (current_toolchain == v8_snapshot_toolchain &&
     v8_toolset_for_shell == "host") ||
4001
    (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
machenbach's avatar
machenbach committed
4002 4003 4004 4005 4006 4007

group("gn_all") {
  testonly = true

  deps = [
    ":d8",
4008
    ":v8_fuzzers",
jochen's avatar
jochen committed
4009 4010
    ":v8_hello_world",
    ":v8_sample_process",
4011 4012
    "test:gn_all",
    "tools:gn_all",
machenbach's avatar
machenbach committed
4013 4014
  ]

4015 4016 4017 4018 4019
  if (v8_custom_deps != "") {
    # Custom dependency from directory under v8/custom_deps.
    deps += [ v8_custom_deps ]
  }

machenbach's avatar
machenbach committed
4020
  if (want_v8_shell) {
4021
    deps += [ ":v8_shell" ]
machenbach's avatar
machenbach committed
4022 4023 4024
  }
}

4025 4026 4027 4028 4029 4030
group("v8_python_base") {
  data = [
    ".vpython",
  ]
}

4031
group("v8_clusterfuzz") {
4032 4033
  testonly = true

4034 4035 4036 4037 4038 4039 4040
  deps = [
    ":d8",
  ]

  if (v8_multi_arch_build) {
    deps += [
      ":d8(//build/toolchain/linux:clang_x64)",
4041
      ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
4042
      ":d8(//build/toolchain/linux:clang_x86)",
4043
      ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
4044
      ":d8(tools/clusterfuzz/toolchain:clang_x64_pointer_compression)",
4045 4046 4047 4048
    ]
  }
}

4049
group("v8_archive") {
4050 4051
  testonly = true

4052 4053 4054
  deps = [
    ":d8",
  ]
4055 4056 4057 4058 4059

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

4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079
# 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")

  fuchsia_package("d8_fuchsia_pkg") {
    testonly = true
    binary = ":d8"
    package_name_override = "d8"
  }

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

4080 4081
group("v8_fuzzers") {
  testonly = true
4082
  data_deps = [
4083
    ":v8_simple_json_fuzzer",
4084
    ":v8_simple_multi_return_fuzzer",
4085
    ":v8_simple_parser_fuzzer",
4086
    ":v8_simple_regexp_builtins_fuzzer",
4087
    ":v8_simple_regexp_fuzzer",
4088
    ":v8_simple_wasm_async_fuzzer",
4089
    ":v8_simple_wasm_code_fuzzer",
4090
    ":v8_simple_wasm_compile_fuzzer",
4091 4092 4093 4094
    ":v8_simple_wasm_fuzzer",
  ]
}

4095
if (is_component_build) {
4096
  v8_component("v8") {
4097
    sources = [
4098
      "src/utils/v8dll-main.cc",
4099
    ]
4100

4101 4102
    public_deps = [
      ":v8_base",
4103
      ":v8_snapshot",
4104
    ]
4105

4106
    configs = [ ":internal_config" ]
4107

4108
    public_configs = [ ":external_config" ]
4109
  }
4110 4111 4112 4113 4114

  v8_component("v8_for_testing") {
    testonly = true

    sources = [
4115
      "src/utils/v8dll-main.cc",
4116 4117 4118
    ]

    public_deps = [
4119
      ":torque_base",
4120
      ":torque_ls_base",
4121
      ":v8_base",
4122
      ":v8_headers",
4123
      ":v8_initializers",
4124
      ":v8_snapshot",
4125 4126 4127 4128 4129 4130
    ]

    configs = [ ":internal_config" ]

    public_configs = [ ":external_config" ]
  }
4131 4132
} else {
  group("v8") {
4133 4134
    public_deps = [
      ":v8_base",
4135
      ":v8_snapshot",
4136
    ]
4137

4138
    public_configs = [ ":external_config" ]
4139
  }
4140 4141 4142 4143 4144

  group("v8_for_testing") {
    testonly = true

    public_deps = [
4145
      ":torque_base",
4146
      ":torque_ls_base",
4147
      ":v8_base",
4148
      ":v8_initializers",
4149
      ":v8_snapshot",
4150 4151 4152 4153
    ]

    public_configs = [ ":external_config" ]
  }
4154
}
jochen's avatar
jochen committed
4155

4156
v8_executable("d8") {
4157
  sources = [
4158 4159 4160 4161 4162 4163 4164 4165 4166
    "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",
4167
  ]
jochen's avatar
jochen committed
4168

4169
  configs = [
4170 4171 4172 4173 4174
    # 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",
  ]
jochen's avatar
jochen committed
4175

4176 4177
  deps = [
    ":v8",
4178
    ":v8_libbase",
4179 4180 4181
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
jochen's avatar
jochen committed
4182

4183
  if (is_posix || is_fuchsia) {
4184
    sources += [ "src/d8/d8-posix.cc" ]
4185
  } else if (is_win) {
4186
    sources += [ "src/d8/d8-windows.cc" ]
4187
  }
jochen's avatar
jochen committed
4188

4189
  if (v8_correctness_fuzzer) {
4190
    deps += [ "tools/clusterfuzz:v8_correctness_fuzzer_resources" ]
4191 4192
  }

4193
  defines = []
4194 4195

  if (v8_enable_vtunejit) {
4196
    deps += [ "src/third_party/vtune:v8_vtune" ]
4197
  }
4198 4199 4200 4201

  if (v8_use_perfetto) {
    deps += [ "//third_party/perfetto/include/perfetto/tracing" ]
  }
jochen's avatar
jochen committed
4202
}
jochen's avatar
jochen committed
4203

jochen's avatar
jochen committed
4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217
v8_executable("v8_hello_world") {
  sources = [
    "samples/hello-world.cc",
  ]

  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",
4218
    ":v8_libbase",
jochen's avatar
jochen committed
4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
}

v8_executable("v8_sample_process") {
  sources = [
    "samples/process.cc",
  ]

  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",
  ]

4236
  deps = [
4237
    ":v8",
4238
    ":v8_libbase",
4239 4240 4241 4242 4243
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
}

machenbach's avatar
machenbach committed
4244
if (want_v8_shell) {
4245
  v8_executable("v8_shell") {
4246 4247 4248 4249
    sources = [
      "samples/shell.cc",
    ]

4250
    configs = [
4251 4252 4253 4254 4255 4256 4257 4258
      # 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",
4259
      ":v8_libbase",
4260 4261 4262 4263 4264 4265
      ":v8_libplatform",
      "//build/win:default_exe_manifest",
    ]
  }
}

machenbach's avatar
machenbach committed
4266 4267 4268
template("v8_fuzzer") {
  name = target_name
  forward_variables_from(invoker, "*")
4269
  v8_executable("v8_simple_" + name) {
machenbach's avatar
machenbach committed
4270 4271
    deps = [
      ":" + name,
4272
      "//build/win:default_exe_manifest",
machenbach's avatar
machenbach committed
4273 4274
    ]

4275 4276 4277 4278
    sources = [
      "test/fuzzer/fuzzer.cc",
    ]

4279
    configs = [ ":external_config" ]
machenbach's avatar
machenbach committed
4280 4281 4282
  }
}

4283
v8_source_set("json_fuzzer") {
jochen's avatar
jochen committed
4284 4285 4286 4287 4288 4289 4290 4291
  sources = [
    "test/fuzzer/json.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

4292 4293 4294 4295
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4296 4297
}

4298 4299
v8_fuzzer("json_fuzzer") {
}
machenbach's avatar
machenbach committed
4300

4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318
v8_source_set("multi_return_fuzzer") {
  sources = [
    "test/fuzzer/multi-return.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

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

v8_fuzzer("multi_return_fuzzer") {
}

4319
v8_source_set("parser_fuzzer") {
jochen's avatar
jochen committed
4320 4321 4322 4323 4324
  sources = [
    "test/fuzzer/parser.cc",
  ]

  deps = [
4325
    ":fuzzer_support",
jochen's avatar
jochen committed
4326 4327
  ]

4328 4329 4330 4331
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4332
}
4333

4334 4335
v8_fuzzer("parser_fuzzer") {
}
machenbach's avatar
machenbach committed
4336

4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355
v8_source_set("regexp_builtins_fuzzer") {
  sources = [
    "test/fuzzer/regexp-builtins.cc",
    "test/fuzzer/regexp_builtins/mjsunit.js.h",
  ]

  deps = [
    ":fuzzer_support",
  ]

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

v8_fuzzer("regexp_builtins_fuzzer") {
}

4356
v8_source_set("regexp_fuzzer") {
4357 4358 4359 4360 4361 4362 4363 4364
  sources = [
    "test/fuzzer/regexp.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

4365 4366 4367 4368
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4369
}
4370

4371 4372
v8_fuzzer("regexp_fuzzer") {
}
machenbach's avatar
machenbach committed
4373

4374 4375 4376 4377 4378 4379
v8_source_set("wasm_module_runner") {
  sources = [
    "test/common/wasm/wasm-module-runner.cc",
    "test/common/wasm/wasm-module-runner.h",
  ]

4380
  deps = [
4381
    ":generate_bytecode_builtins_list",
4382
    ":run_torque",
4383 4384
  ]

4385 4386 4387
  public_deps = [
    ":v8_maybe_icu",
  ]
4388

4389 4390 4391 4392
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4393 4394
}

4395
v8_source_set("wasm_fuzzer") {
4396 4397 4398 4399 4400 4401
  sources = [
    "test/fuzzer/wasm.cc",
  ]

  deps = [
    ":fuzzer_support",
4402
    ":lib_wasm_fuzzer_common",
4403
    ":wasm_module_runner",
4404 4405
  ]

4406 4407 4408 4409
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4410 4411
}

4412 4413
v8_fuzzer("wasm_fuzzer") {
}
machenbach's avatar
machenbach committed
4414

4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434
v8_source_set("wasm_async_fuzzer") {
  sources = [
    "test/fuzzer/wasm-async.cc",
  ]

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

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

v8_fuzzer("wasm_async_fuzzer") {
}

4435 4436
v8_source_set("wasm_code_fuzzer") {
  sources = [
4437
    "test/common/wasm/test-signatures.h",
4438 4439 4440 4441 4442
    "test/fuzzer/wasm-code.cc",
  ]

  deps = [
    ":fuzzer_support",
4443
    ":lib_wasm_fuzzer_common",
4444
    ":wasm_module_runner",
4445 4446
  ]

4447 4448 4449 4450
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4451 4452 4453 4454
}

v8_fuzzer("wasm_code_fuzzer") {
}
4455

4456
v8_source_set("lib_wasm_fuzzer_common") {
4457
  sources = [
4458 4459
    "test/fuzzer/wasm-fuzzer-common.cc",
    "test/fuzzer/wasm-fuzzer-common.h",
4460 4461
  ]

4462
  deps = [
4463
    ":generate_bytecode_builtins_list",
4464
    ":run_torque",
4465 4466
  ]

4467 4468 4469
  public_deps = [
    ":v8_maybe_icu",
  ]
4470

4471 4472 4473 4474
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4475 4476
}

4477 4478
v8_source_set("wasm_compile_fuzzer") {
  sources = [
4479
    "test/common/wasm/test-signatures.h",
4480 4481 4482 4483 4484
    "test/fuzzer/wasm-compile.cc",
  ]

  deps = [
    ":fuzzer_support",
4485
    ":lib_wasm_fuzzer_common",
4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496
    ":wasm_module_runner",
  ]

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

v8_fuzzer("wasm_compile_fuzzer") {
}
4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507

# 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",
  ]
}
4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524

# 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",
4525
      "-Wno-thread-safety-attributes",
4526
    ]
4527
    include_dirs = [ "third_party/protobuf/src" ]
4528 4529 4530 4531 4532 4533 4534
  }

  # 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" ]

4535 4536 4537
    if (!is_win) {
      defines = [ "HAVE_PTHREAD=1" ]
    }
4538 4539
    if (is_clang) {
      cflags = [
4540 4541 4542
        "-Wno-unused-private-field",
        "-Wno-unused-function",
        "-Wno-inconsistent-missing-override",
4543 4544 4545 4546 4547 4548
        "-Wno-unknown-warning-option",
        "-Wno-enum-compare-switch",
        "-Wno-user-defined-warnings",
        "-Wno-tautological-constant-compare",
      ]
    }
4549 4550 4551
    if (is_win) {
      cflags += [ "-Wno-microsoft-unqualified-friend" ]
    }
4552 4553 4554 4555
  }

  source_set("protobuf_lite") {
    sources = [
4556
      "third_party/protobuf/src/google/protobuf/any_lite.cc",
4557 4558
      "third_party/protobuf/src/google/protobuf/arena.cc",
      "third_party/protobuf/src/google/protobuf/extension_set.cc",
4559
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
4560
      "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
4561
      "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
4562
      "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
4563
      "third_party/protobuf/src/google/protobuf/io/strtod.cc",
4564 4565 4566 4567 4568 4569 4570
      "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",
4571
      "third_party/protobuf/src/google/protobuf/stubs/io_win32.cc",
4572 4573 4574 4575 4576 4577 4578 4579 4580 4581
      "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" ]
4582 4583 4584 4585
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4586 4587 4588
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611
    public_configs = [ ":protobuf_gen_config" ]
  }

  # This target should be used only by the protoc compiler and by test targets.
  source_set("protobuf_full") {
    deps = [
      ":protobuf_lite",
    ]
    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",
4612
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven.cc",
4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628
      "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",
4629
      "third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc",
4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653
      "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" ]
4654 4655 4656 4657
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4658 4659 4660
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681
    public_configs = [ ":protobuf_gen_config" ]
  }

  if (current_toolchain == host_toolchain) {
    source_set("protoc_lib") {
      deps = [
        ":protobuf_full",
      ]
      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",
4682
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
4683 4684 4685 4686 4687 4688 4689 4690 4691
        "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" ]
4692 4693 4694 4695
      configs += [
        "//build/config/compiler:no_chromium_code",
        ":protobuf_config",
      ]
4696 4697 4698
      if (is_win) {
        configs -= [ "//build/config/win:lean_and_mean" ]
      }
4699 4700 4701 4702 4703 4704 4705 4706 4707
      public_configs = [ ":protobuf_gen_config" ]
    }

    executable("protoc") {
      deps = [
        ":protoc_lib",
        "//build/win:default_exe_manifest",
      ]
      sources = [
4708
        "src/protobuf/protobuf-compiler-main.cc",
4709 4710
      ]
      configs -= [ "//build/config/compiler:chromium_code" ]
4711
      configs += [ "//build/config/compiler:no_chromium_code" ]
4712 4713 4714
    }
  }  # host_toolchain
}  # if (!build_with_chromium && v8_use_perfetto)