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/jumbo.gni")
10
import("//build/config/mips.gni")
11
import("//build/config/sanitizers/sanitizers.gni")
12
import("//build_overrides/build.gni")
13

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

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

21 22 23 24 25 26
# 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)

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

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

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

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

41 42 43
  # Sets -DV8_ENABLE_FUTURE.
  v8_enable_future = false

44 45 46 47 48
  # 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

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

52 53 54
  # Sets -DVERIFY_PREDICTABLE
  v8_enable_verify_predictable = false

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

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

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

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

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

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

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

76 77 78
  # Sets -dENABLE_VTUNE_JIT_INTERFACE.
  v8_enable_vtunejit = false

79 80 81
  # Sets -dENABLE_HANDLE_ZAPPING.
  v8_enable_handle_zapping = true

82 83 84
  # Enable slow dchecks.
  v8_enable_slow_dchecks = false

85 86 87
  # Enable fast mksnapshot runs.
  v8_enable_fast_mksnapshot = false

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

91
  # Enable embedded builtins.
92
  v8_enable_embedded_builtins = true
93

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

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

100 101 102 103 104 105
  # 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 = ""

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

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

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

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

  # Sets -dV8_ENABLE_CHECKS.
  v8_enable_v8_checks = ""
121

122 123
  # Sets -dV8_TRACE_IGNITION.
  v8_enable_trace_ignition = false
124

125 126 127
  # Sets -dV8_TRACE_FEEDBACK_UPDATES.
  v8_enable_trace_feedback_updates = false

128
  # Sets -dV8_CONCURRENT_MARKING
129
  v8_enable_concurrent_marking = true
130

131 132
  # Enables various testing features.
  v8_enable_test_features = ""
133

134 135 136 137
  # 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
138

139 140 141
  # Use Siphash as added protection against hash flooding attacks.
  v8_use_siphash = false

142 143 144
  # Switches off inlining in V8.
  v8_no_inline = false

145 146 147
  # Override OS page size when generating snapshot
  v8_os_page_size = "0"

148 149 150 151 152
  # 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
153

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

157 158 159 160
  # List of extra files to snapshot. They will be snapshotted in order so
  # if files export symbols used by later files, they should go first.
  #
  # This default is used by cctests. Projects using V8 will want to override.
161
  v8_extra_library_files = [ "//test/cctest/test-extra.js" ]
162

Jakob Kummerow's avatar
Jakob Kummerow committed
163 164 165
  v8_enable_gdbjit =
      ((v8_current_cpu == "x86" || v8_current_cpu == "x64") &&
       (is_linux || is_mac)) || (v8_current_cpu == "ppc64" && is_linux)
166 167 168 169

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

171
  # Enable mitigations for executing untrusted code.
172 173 174 175 176 177
  # 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)
178 179 180

  # Enable minor mark compact.
  v8_enable_minor_mc = true
181 182 183 184 185

  # 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
186 187

  # Enable sharing read-only space across isolates.
188 189
  # Sets -DV8_SHARED_RO_HEAP.
  v8_enable_shared_ro_heap = ""
190

191 192
  # Enable lazy source positions by default.
  v8_enable_lazy_source_positions = true
193

194 195 196 197 198 199 200
  # 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 = ""
201 202 203 204

  # Use token threaded dispatch for the regular expression interpreter.
  # Use switch-based dispatch if this is false
  v8_enable_regexp_interpreter_threaded_dispatch = true
205 206
}

207
# Derived defaults.
208
if (v8_enable_verify_heap == "") {
209
  v8_enable_verify_heap = v8_enable_debugging_features
210 211
}
if (v8_enable_object_print == "") {
212
  v8_enable_object_print = v8_enable_debugging_features
213 214
}
if (v8_enable_disassembler == "") {
215
  v8_enable_disassembler = v8_enable_debugging_features
216 217
}
if (v8_enable_trace_maps == "") {
218
  v8_enable_trace_maps = v8_enable_debugging_features
219
}
220
if (v8_enable_test_features == "") {
221
  v8_enable_test_features = v8_enable_debugging_features || dcheck_always_on
222
}
223
if (v8_enable_v8_checks == "") {
224
  v8_enable_v8_checks = v8_enable_debugging_features
225
}
226
if (v8_check_microtasks_scopes_consistency == "") {
227 228
  v8_check_microtasks_scopes_consistency =
      v8_enable_debugging_features || dcheck_always_on
229
}
230 231 232
if (v8_enable_snapshot_native_code_counters == "") {
  v8_enable_snapshot_native_code_counters = v8_enable_debugging_features
}
233
if (v8_enable_shared_ro_heap == "") {
234
  v8_enable_shared_ro_heap = !v8_enable_pointer_compression && v8_use_snapshot
235
}
236 237 238
if (v8_enable_fast_torque == "") {
  v8_enable_fast_torque = v8_enable_fast_mksnapshot
}
239

240 241 242 243 244 245 246
if (v8_enable_single_generation == "") {
  v8_enable_single_generation = v8_disable_write_barriers
}

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

247 248 249
assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations,
       "Untrusted code mitigations are unsupported on ia32")

250 251 252 253
assert(!v8_enable_lite_mode || v8_enable_embedded_builtins,
       "Lite mode requires embedded builtins")
assert(!v8_enable_lite_mode || v8_use_snapshot,
       "Lite mode requires a snapshot build")
254

255 256 257
assert(
    !v8_enable_pointer_compression || !v8_enable_shared_ro_heap,
    "Pointer compression is not supported with shared read-only heap enabled")
258 259
assert(v8_use_snapshot || !v8_enable_shared_ro_heap,
       "Shared read-only heap requires snapshot")
260

261
v8_random_seed = "314159265"
262
v8_toolset_for_shell = "host"
263 264 265 266

###############################################################################
# Configurations
#
267 268

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

271 272 273 274
  include_dirs = [
    ".",
    "$target_gen_dir",
  ]
275 276
}

277 278
config("internal_config") {
  defines = []
279
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
280

281 282 283 284
  configs = [
    "//build/config/compiler:wexit_time_destructors",
    ":internal_config_base",
    ":v8_header_features",
285
  ]
286 287 288 289

  if (is_component_build) {
    defines += [ "BUILDING_V8_SHARED" ]
  }
290 291
}

292 293 294
# This config should be applied to code using the libplatform.
config("libplatform_config") {
  include_dirs = [ "include" ]
295 296 297
  if (is_component_build) {
    defines = [ "USING_V8_PLATFORM_SHARED" ]
  }
298 299
}

300 301 302 303 304 305 306 307 308 309 310
# 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" ]
  }
}

311 312 313 314 315
# This config should be applied to code using the libsampler.
config("libsampler_config") {
  include_dirs = [ "include" ]
}

316 317 318
# This config should only be applied to code using V8 and not any V8 code
# itself.
config("external_config") {
319
  defines = []
320
  configs = [ ":v8_header_features" ]
321
  if (is_component_build) {
322 323
    defines += [ "USING_V8_SHARED" ]
  }
324 325 326 327
  include_dirs = [
    "include",
    "$target_gen_dir/include",
  ]
328 329
}

330 331 332 333 334 335 336 337
# 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" ]
  }
}

338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
# 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.
364
config("features") {
365
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
366 367 368

  defines = []

369 370
  configs = [ ":v8_header_features" ]

371 372 373
  if (v8_embedder_string != "") {
    defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
  }
374
  if (v8_enable_disassembler) {
375
    defines += [ "ENABLE_DISASSEMBLER" ]
376
  }
377 378 379 380
  if (v8_promise_internal_field_count != 0) {
    defines +=
        [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
  }
381 382
  defines +=
      [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
383 384 385
  if (v8_enable_raw_heap_snapshots) {
    defines += [ "V8_ENABLE_RAW_HEAP_SNAPSHOTS" ]
  }
386 387 388
  if (v8_enable_future) {
    defines += [ "V8_ENABLE_FUTURE" ]
  }
389 390
  if (v8_enable_lite_mode) {
    defines += [ "V8_LITE_MODE" ]
391 392 393 394

    # TODO(v8:7777): Remove the define once the --jitless runtime flag does
    # everything we need.
    defines += [ "V8_JITLESS_MODE" ]
395
  }
396
  if (v8_enable_gdbjit) {
397
    defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
398
  }
399 400 401
  if (v8_enable_vtunejit) {
    defines += [ "ENABLE_VTUNE_JIT_INTERFACE" ]
  }
402 403 404
  if (v8_enable_minor_mc) {
    defines += [ "ENABLE_MINOR_MC" ]
  }
405
  if (v8_enable_object_print) {
406
    defines += [ "OBJECT_PRINT" ]
407
  }
408
  if (v8_enable_verify_heap) {
409
    defines += [ "VERIFY_HEAP" ]
410
  }
411 412 413
  if (v8_enable_verify_predictable) {
    defines += [ "VERIFY_PREDICTABLE" ]
  }
414
  if (v8_enable_trace_maps) {
415 416 417 418
    defines += [ "V8_TRACE_MAPS" ]
  }
  if (v8_enable_trace_ignition) {
    defines += [ "V8_TRACE_IGNITION" ]
419
  }
420 421 422
  if (v8_enable_trace_feedback_updates) {
    defines += [ "V8_TRACE_FEEDBACK_UPDATES" ]
  }
423 424
  if (v8_enable_test_features) {
    defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
425
    defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
426
    defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
427
  }
428
  if (v8_enable_i18n_support) {
429
    defines += [ "V8_INTL_SUPPORT" ]
430
  }
431
  if (v8_enable_handle_zapping) {
432
    defines += [ "ENABLE_HANDLE_ZAPPING" ]
433
  }
434 435
  if (v8_use_snapshot) {
    defines += [ "V8_USE_SNAPSHOT" ]
436 437 438
    if (v8_enable_snapshot_native_code_counters) {
      defines += [ "V8_SNAPSHOT_NATIVE_CODE_COUNTERS" ]
    }
439
  }
440 441 442
  if (v8_enable_single_generation) {
    defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
  }
443 444 445
  if (v8_disable_write_barriers) {
    defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
  }
446
  if (v8_use_external_startup_data) {
447
    defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
448
  }
449 450 451
  if (v8_enable_concurrent_marking) {
    defines += [ "V8_CONCURRENT_MARKING" ]
  }
452 453 454
  if (v8_enable_lazy_source_positions) {
    defines += [ "V8_ENABLE_LAZY_SOURCE_POSITIONS" ]
  }
455 456 457
  if (v8_check_microtasks_scopes_consistency) {
    defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ]
  }
458
  if (v8_enable_embedded_builtins) {
459
    defines += [ "V8_EMBEDDED_BUILTINS" ]
460
  }
461 462 463
  if (v8_use_multi_snapshots) {
    defines += [ "V8_MULTI_SNAPSHOTS" ]
  }
464 465 466
  if (v8_use_siphash) {
    defines += [ "V8_USE_SIPHASH" ]
  }
467 468 469
  if (v8_enable_shared_ro_heap) {
    defines += [ "V8_SHARED_RO_HEAP" ]
  }
470 471 472
  if (v8_use_perfetto) {
    defines += [ "V8_USE_PERFETTO" ]
  }
473 474 475
  if (v8_win64_unwinding_info) {
    defines += [ "V8_WIN64_UNWINDING_INFO" ]
  }
476 477 478
  if (v8_enable_regexp_interpreter_threaded_dispatch) {
    defines += [ "V8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH" ]
  }
479 480
}

481
config("toolchain") {
482
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
483 484 485

  defines = []
  cflags = []
brettw's avatar
brettw committed
486
  ldflags = []
487

488
  if (v8_current_cpu == "arm") {
489
    defines += [ "V8_TARGET_ARCH_ARM" ]
490
    if (arm_version >= 7) {
491 492 493 494 495
      defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
    }
    if (arm_fpu == "vfpv3-d16") {
      defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
    } else if (arm_fpu == "vfpv3") {
496 497 498
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
499 500 501 502 503 504
      ]
    } else if (arm_fpu == "neon") {
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
        "CAN_USE_NEON",
505 506
      ]
    }
507

508
    # TODO(jochen): Add support for arm_test_noprobe.
509 510 511 512 513 514 515 516 517

    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" ]
      }
    }
518
  }
519
  if (v8_current_cpu == "arm64") {
520
    defines += [ "V8_TARGET_ARCH_ARM64" ]
521
  }
522

523 524 525 526 527 528
  # Mips64el/mipsel simulators.
  if (is_target_simulator &&
      (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) {
    defines += [ "_MIPS_TARGET_SIMULATOR" ]
  }

529
  if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") {
wtc's avatar
wtc committed
530
    defines += [ "V8_TARGET_ARCH_MIPS" ]
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
    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",
      ]
547 548 549
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
550 551 552 553 554 555 556 557 558 559 560 561
    } 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" ]
    }
562

563
    # TODO(jochen): Add support for mips_arch_variant rx and loongson.
wtc's avatar
wtc committed
564
  }
565

566
  if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
wtc's avatar
wtc committed
567
    defines += [ "V8_TARGET_ARCH_MIPS64" ]
568 569 570
    if (v8_can_use_fpu_instructions) {
      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
    }
571

572 573 574 575 576
    if (host_byteorder == "little") {
      defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
    } else if (host_byteorder == "big") {
      defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
    }
577 578 579 580 581 582 583 584 585 586
    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" ]
587 588 589
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
590 591 592
    } else if (mips_arch_variant == "r2") {
      defines += [ "_MIPS_ARCH_MIPS64R2" ]
    }
wtc's avatar
wtc committed
593
  }
594
  if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
595
    defines += [ "V8_TARGET_ARCH_S390" ]
596
    if (v8_current_cpu == "s390x") {
597 598
      defines += [ "V8_TARGET_ARCH_S390X" ]
    }
599
    if (host_byteorder == "little") {
600
      defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
601 602 603 604 605 606 607 608 609
    } 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" ]
    }
610
    if (host_byteorder == "little") {
611
      defines += [ "V8_TARGET_ARCH_PPC_LE" ]
612
    } else if (host_byteorder == "big") {
613 614 615 616 617 618 619 620 621 622 623
      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",
        ]
      }
624
    }
625
  }
626

627
  if (v8_current_cpu == "x86") {
628
    defines += [ "V8_TARGET_ARCH_IA32" ]
brettw's avatar
brettw committed
629 630 631 632
    if (is_win) {
      # Ensure no surprising artifacts from 80bit double math with x86.
      cflags += [ "/arch:SSE2" ]
    }
633
  }
634
  if (v8_current_cpu == "x64") {
635
    defines += [ "V8_TARGET_ARCH_X64" ]
brettw's avatar
brettw committed
636 637 638 639 640 641
    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" ]
    }
642
  }
643 644 645
  if (is_android && v8_android_log_stdout) {
    defines += [ "V8_ANDROID_LOG_STDOUT" ]
  }
646

647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
  # 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
671
  # TODO(jochen): Support v8_enable_prof on Windows.
672 673
  # TODO(jochen): Add support for compiling with simulators.

674
  if (v8_enable_debugging_features) {
675 676 677 678
    if (is_linux && v8_enable_backtrace) {
      ldflags += [ "-rdynamic" ]
    }

679
    defines += [ "DEBUG" ]
680
    if (v8_enable_slow_dchecks) {
681 682
      defines += [ "ENABLE_SLOW_DCHECKS" ]
    }
683 684
  } else if (dcheck_always_on) {
    defines += [ "DEBUG" ]
685
  }
686

687 688 689 690
  if (v8_enable_verify_csa) {
    defines += [ "ENABLE_VERIFY_CSA" ]
  }

691 692 693 694
  if (!v8_untrusted_code_mitigations) {
    defines += [ "DISABLE_UNTRUSTED_CODE_MITIGATIONS" ]
  }

695
  if (v8_no_inline) {
696 697 698 699 700 701 702 703
    if (is_win) {
      cflags += [ "/Ob0" ]
    } else {
      cflags += [
        "-fno-inline-functions",
        "-fno-inline",
      ]
    }
704
  }
705 706

  if (is_clang) {
707
    cflags += [ "-Wmissing-field-initializers" ]
708 709 710 711 712 713

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

714 715 716 717
    if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
        v8_current_cpu == "mips64el") {
      cflags += [ "-Wshorten-64-to-32" ]
    }
718
  }
719 720 721 722 723 724 725 726 727 728

  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).
729
      "/wd4714",  # Function marked forceinline not inlined.
730 731 732 733 734

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

735
      "/wd4718",  # Recursive call has no side-effect.
736 737
      "/wd4723",  # https://crbug.com/v8/7771
      "/wd4724",  # https://crbug.com/v8/7771
738 739 740
      "/wd4800",  # Forcing value to bool.
    ]
  }
741 742 743 744 745 746 747

  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",
748 749 750 751

      # 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",
752 753
    ]
  }
754 755 756 757 758

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

761 762 763 764 765 766 767 768 769 770 771 772 773 774
# 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" ]
  }
}

775 776
# Configs for code coverage with gcov. Separate configs for cflags and ldflags
# to selectively influde cflags in non-test targets only.
777 778 779 780 781
config("v8_gcov_coverage_cflags") {
  cflags = [
    "-fprofile-arcs",
    "-ftest-coverage",
  ]
782 783
}

784 785
config("v8_gcov_coverage_ldflags") {
  ldflags = [ "-fprofile-arcs" ]
786 787
}

788 789 790 791
###############################################################################
# Actions
#

792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824
# 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),
    ]
  }
}

825 826 827 828 829 830 831 832 833 834 835 836
action("js2c_extras") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  script = "tools/js2c.py"

  sources = v8_extra_library_files

  outputs = [
    "$target_gen_dir/extras-libraries.cc",
  ]

  args = [
jochen's avatar
jochen committed
837
           rebase_path("$target_gen_dir/extras-libraries.cc", root_build_dir),
838 839 840 841 842 843 844 845 846 847 848 849
           "EXTRAS",
         ] + rebase_path(sources, root_build_dir)

  if (v8_use_external_startup_data) {
    outputs += [ "$target_gen_dir/libraries_extras.bin" ]
    args += [
      "--startup_blob",
      rebase_path("$target_gen_dir/libraries_extras.bin", root_build_dir),
    ]
  }
}

850
if (is_android && enable_java_templates) {
851 852
  android_assets("v8_external_startup_data_assets") {
    if (v8_use_external_startup_data) {
853 854
      # We don't support side-by-side snapshots on Android within Chromium.
      assert(!v8_use_multi_snapshots)
855 856 857
      deps = [
        "//v8",
      ]
858 859 860 861 862 863 864 865 866 867
      sources = [
        "$root_out_dir/natives_blob.bin",
      ]
      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" ]
      }
868 869 870 871 872
      disable_compression = true
    }
  }
}

873 874
if (v8_use_external_startup_data) {
  action("natives_blob") {
875
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
876 877

    deps = [
jochen's avatar
jochen committed
878
      ":js2c_extras",
879 880
    ]

881
    # NOSORT
882
    sources = [
jochen's avatar
jochen committed
883
      "$target_gen_dir/libraries_extras.bin",
884 885 886
    ]

    outputs = [
887
      "$root_out_dir/natives_blob.bin",
888 889
    ]

890 891 892 893
    data = [
      "$root_out_dir/natives_blob.bin",
    ]

894 895 896 897
    script = "tools/concatenate-files.py"

    args = rebase_path(sources + outputs, root_build_dir)
  }
898 899 900
}

action("postmortem-metadata") {
901 902 903 904 905 906
  # Only targets in this file and the top-level visibility target can
  # depend on this.
  visibility = [
    ":*",
    "//:gn_visibility",
  ]
907

908 909
  script = "tools/gen-postmortem-metadata.py"

910
  # NOSORT
911
  sources = [
912 913
    "src/objects/objects.h",
    "src/objects/objects-inl.h",
914 915
    "src/objects/allocation-site-inl.h",
    "src/objects/allocation-site.h",
916 917
    "src/objects/cell-inl.h",
    "src/objects/cell.h",
918 919
    "src/objects/code-inl.h",
    "src/objects/code.h",
920 921
    "src/objects/data-handler.h",
    "src/objects/data-handler-inl.h",
922 923
    "src/objects/feedback-cell.h",
    "src/objects/feedback-cell-inl.h",
924 925
    "src/objects/fixed-array-inl.h",
    "src/objects/fixed-array.h",
926 927
    "src/objects/heap-number-inl.h",
    "src/objects/heap-number.h",
928 929
    "src/objects/heap-object-inl.h",
    "src/objects/heap-object.h",
930
    "src/objects/instance-type.h",
931 932
    "src/objects/js-array-inl.h",
    "src/objects/js-array.h",
933 934
    "src/objects/js-array-buffer-inl.h",
    "src/objects/js-array-buffer.h",
935 936
    "src/objects/js-objects-inl.h",
    "src/objects/js-objects.h",
937 938
    "src/objects/js-promise-inl.h",
    "src/objects/js-promise.h",
939
    "src/objects/js-regexp-inl.h",
940
    "src/objects/js-regexp.cc",
941
    "src/objects/js-regexp.h",
942 943
    "src/objects/js-regexp-string-iterator-inl.h",
    "src/objects/js-regexp-string-iterator.h",
944
    "src/objects/map.h",
945
    "src/objects/map.cc",
946
    "src/objects/map-inl.h",
947
    "src/objects/js-objects.cc",
948 949
    "src/objects/name.h",
    "src/objects/name-inl.h",
950 951
    "src/objects/oddball-inl.h",
    "src/objects/oddball.h",
952
    "src/objects/scope-info.h",
953 954
    "src/objects/script.h",
    "src/objects/script-inl.h",
955 956
    "src/objects/shared-function-info.h",
    "src/objects/shared-function-info-inl.h",
957
    "src/objects/string.cc",
958
    "src/objects/string.h",
959 960
    "src/objects/string-comparator.cc",
    "src/objects/string-comparator.h",
961
    "src/objects/string-inl.h",
962 963
    "src/objects/struct.h",
    "src/objects/struct-inl.h",
964 965 966
  ]

  outputs = [
967
    "$target_gen_dir/debug-support.cc",
968 969
  ]

970 971
  args = rebase_path(outputs, root_build_dir) +
         rebase_path(sources, root_build_dir)
972 973
}

974
torque_files = [
975
  "src/builtins/arguments.tq",
976
  "src/builtins/array-copywithin.tq",
977
  "src/builtins/array-every.tq",
978
  "src/builtins/array-filter.tq",
979 980
  "src/builtins/array-find.tq",
  "src/builtins/array-findindex.tq",
981
  "src/builtins/array-foreach.tq",
982
  "src/builtins/array-join.tq",
983
  "src/builtins/array-lastindexof.tq",
984
  "src/builtins/array-map.tq",
985
  "src/builtins/array-of.tq",
986
  "src/builtins/array-reduce-right.tq",
987
  "src/builtins/array-reduce.tq",
988
  "src/builtins/array-reverse.tq",
989
  "src/builtins/array-shift.tq",
990
  "src/builtins/array-slice.tq",
991
  "src/builtins/array-some.tq",
992
  "src/builtins/array-splice.tq",
993
  "src/builtins/array-unshift.tq",
994 995
  "src/builtins/array.tq",
  "src/builtins/base.tq",
996
  "src/builtins/bigint.tq",
997
  "src/builtins/boolean.tq",
998
  "src/builtins/collections.tq",
999
  "src/builtins/data-view.tq",
1000
  "src/builtins/extras-utils.tq",
1001 1002
  "src/builtins/frames.tq",
  "src/builtins/growable-fixed-array.tq",
1003
  "src/builtins/internal-coverage.tq",
1004
  "src/builtins/iterator.tq",
1005
  "src/builtins/math.tq",
1006
  "src/builtins/object-fromentries.tq",
1007
  "src/builtins/object.tq",
1008
  "src/builtins/proxy-constructor.tq",
1009
  "src/builtins/proxy-delete-property.tq",
1010
  "src/builtins/proxy-get-property.tq",
1011
  "src/builtins/proxy-get-prototype-of.tq",
1012
  "src/builtins/proxy-has-property.tq",
1013
  "src/builtins/proxy-is-extensible.tq",
1014
  "src/builtins/proxy-prevent-extensions.tq",
1015
  "src/builtins/proxy-revocable.tq",
1016
  "src/builtins/proxy-revoke.tq",
1017
  "src/builtins/proxy-set-property.tq",
1018
  "src/builtins/proxy-set-prototype-of.tq",
1019
  "src/builtins/proxy.tq",
1020
  "src/builtins/reflect.tq",
1021
  "src/builtins/regexp-exec.tq",
1022
  "src/builtins/regexp-match-all.tq",
1023
  "src/builtins/regexp-match.tq",
1024
  "src/builtins/regexp-replace.tq",
1025
  "src/builtins/regexp-search.tq",
1026
  "src/builtins/regexp-source.tq",
1027
  "src/builtins/regexp-split.tq",
1028
  "src/builtins/regexp-test.tq",
1029
  "src/builtins/regexp.tq",
1030
  "src/builtins/string.tq",
1031
  "src/builtins/string-endswith.tq",
1032
  "src/builtins/string-html.tq",
1033
  "src/builtins/string-iterator.tq",
1034
  "src/builtins/string-pad.tq",
1035
  "src/builtins/string-repeat.tq",
1036
  "src/builtins/string-slice.tq",
1037
  "src/builtins/string-startswith.tq",
1038
  "src/builtins/string-substring.tq",
1039
  "src/builtins/torque-internal.tq",
1040
  "src/builtins/typed-array-createtypedarray.tq",
1041
  "src/builtins/typed-array-every.tq",
1042
  "src/builtins/typed-array-filter.tq",
1043 1044
  "src/builtins/typed-array-find.tq",
  "src/builtins/typed-array-findindex.tq",
1045 1046 1047
  "src/builtins/typed-array-foreach.tq",
  "src/builtins/typed-array-reduce.tq",
  "src/builtins/typed-array-reduceright.tq",
1048
  "src/builtins/typed-array-slice.tq",
1049
  "src/builtins/typed-array-some.tq",
1050
  "src/builtins/typed-array-subarray.tq",
1051
  "src/builtins/typed-array.tq",
1052
  "src/objects/intl-objects.tq",
1053
  "test/torque/test-torque.tq",
1054
  "third_party/v8/builtins/array-sort.tq",
1055 1056
]

1057 1058 1059 1060
if (!v8_enable_i18n_support) {
  torque_files -= [ "src/objects/intl-objects.tq" ]
}

1061 1062 1063
action("run_torque") {
  visibility = [
    ":*",
1064
    "tools/debug_helper/:*",
1065
    "tools/gcmole/:*",
1066
    "test/cctest/:*",
1067 1068 1069
  ]

  deps = [
1070
    ":torque($v8_generator_toolchain)",
1071 1072 1073 1074
  ]

  script = "tools/run.py"

1075
  sources = torque_files
1076 1077

  outputs = [
1078 1079 1080 1081 1082
    "$target_gen_dir/torque-generated/builtin-definitions-tq.h",
    "$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",
1083 1084 1085
    "$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",
1086 1087
    "$target_gen_dir/torque-generated/class-debug-readers-tq.cc",
    "$target_gen_dir/torque-generated/class-debug-readers-tq.h",
1088 1089 1090
    "$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",
1091
    "$target_gen_dir/torque-generated/instance-types-tq.h",
1092
  ]
1093 1094
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1095
    outputs += [
1096 1097
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1098 1099
    ]
  }
1100 1101

  args = [
1102
    "./" + rebase_path(get_label_info(":torque($v8_generator_toolchain)",
1103 1104 1105
                                      "root_out_dir") + "/torque",
                       root_build_dir),
    "-o",
1106
    rebase_path("$target_gen_dir/torque-generated", root_build_dir),
1107 1108
    "-v8-root",
    rebase_path(".", root_build_dir),
1109
  ]
1110
  args += torque_files
1111 1112
}

1113 1114 1115 1116 1117 1118 1119 1120
group("v8_maybe_icu") {
  if (v8_enable_i18n_support) {
    public_deps = [
      "//third_party/icu",
    ]
  }
}

1121 1122 1123 1124
v8_source_set("torque_generated_initializers") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1125
    ":generate_bytecode_builtins_list",
1126 1127 1128
    ":run_torque",
  ]

1129 1130 1131
  public_deps = [
    ":v8_maybe_icu",
  ]
1132

1133 1134 1135 1136 1137
  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",
  ]
1138 1139
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1140
    sources += [
1141 1142
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1143 1144 1145
    ]
  }

1146
  configs = [ ":internal_config" ]
1147 1148
}

1149 1150 1151 1152
v8_source_set("torque_generated_definitions") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
John Budorick's avatar
John Budorick committed
1153
    ":generate_bytecode_builtins_list",
1154 1155 1156
    ":run_torque",
  ]

1157 1158 1159
  public_deps = [
    ":v8_maybe_icu",
  ]
1160 1161

  sources = [
1162
    "$target_gen_dir/torque-generated/class-definitions-tq.cc",
1163 1164 1165
    "$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",
1166 1167 1168 1169 1170
  ]

  configs = [ ":internal_config" ]
}

1171 1172 1173 1174 1175 1176
action("generate_bytecode_builtins_list") {
  script = "tools/run.py"
  outputs = [
    "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
  ]
  deps = [
1177
    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1178 1179 1180
  ]
  args = [
    "./" + rebase_path(
1181
            get_label_info(
1182
                    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1183
                    "root_out_dir") + "/bytecode_builtins_list_generator",
1184
            root_build_dir),
1185 1186
    rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
                root_build_dir),
1187 1188 1189
  ]
}

1190 1191 1192
# 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.
1193
# Otherwise files are suffixed, e.g. embedded_<name>.S and
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207
# 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) {
1208
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1209

1210 1211 1212
    deps = [
      ":mksnapshot($v8_snapshot_toolchain)",
    ]
1213

1214
    script = "tools/run.py"
1215

1216
    sources = []
1217

1218
    outputs = []
1219

1220 1221
    data = []

1222 1223 1224 1225 1226
    args = [
      "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
                                        "root_out_dir") + "/mksnapshot",
                         root_build_dir),
      "--turbo_instruction_scheduling",
1227 1228 1229 1230 1231

      # 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|.
1232
      "--target_os=$current_os",
1233
      "--target_arch=$current_cpu",
1234 1235
    ]

1236 1237
    args += invoker.args

1238
    if (v8_enable_embedded_builtins) {
1239
      outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
1240 1241
      args += [
        "--embedded_src",
1242
        rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1243
      ]
1244 1245 1246 1247 1248 1249
      if (invoker.embedded_variant != "") {
        args += [
          "--embedded_variant",
          invoker.embedded_variant,
        ]
      }
1250 1251
    }

1252 1253 1254 1255 1256 1257
    if (v8_random_seed != "0") {
      args += [
        "--random-seed",
        v8_random_seed,
      ]
    }
1258

1259 1260 1261 1262 1263 1264
    if (v8_os_page_size != "0") {
      args += [
        "--v8_os_page_size",
        v8_os_page_size,
      ]
    }
1265

1266
    if (v8_use_external_startup_data) {
1267
      outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1268
      data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1269 1270
      args += [
        "--startup_blob",
1271
        rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
1272
      ]
1273
    } else {
1274
      outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
1275 1276
      args += [
        "--startup_src",
1277
        rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
1278
      ]
1279 1280 1281 1282 1283 1284 1285
    }

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

1286 1287 1288 1289
    if (v8_enable_snapshot_code_comments) {
      args += [ "--code-comments" ]
    }

1290 1291 1292 1293 1294 1295 1296 1297
    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" ]
    }

1298 1299 1300 1301 1302
    if (v8_enable_fast_mksnapshot) {
      args += [
        "--no-turbo-rewrite-far-jumps",
        "--no-turbo-verify-allocation",
      ]
1303 1304 1305 1306 1307

      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" ]
      }
1308
    }
1309
  }
1310 1311
}

1312 1313 1314 1315 1316 1317 1318
if (v8_use_snapshot) {
  run_mksnapshot("default") {
    args = []
    if (v8_enable_embedded_builtins) {
      embedded_variant = "Default"
    }
  }
1319 1320 1321 1322 1323
  if (emit_builtins_as_inline_asm) {
    asm_to_inline_asm("default") {
      args = []
    }
  }
1324 1325 1326 1327 1328 1329 1330
  if (v8_use_multi_snapshots) {
    run_mksnapshot("trusted") {
      args = [ "--no-untrusted-code-mitigations" ]
      if (v8_enable_embedded_builtins) {
        embedded_variant = "Trusted"
      }
    }
1331 1332 1333 1334 1335
    if (emit_builtins_as_inline_asm) {
      asm_to_inline_asm("trusted") {
        args = []
      }
    }
1336 1337 1338
  }
}

1339 1340
action("v8_dump_build_config") {
  script = "tools/testrunner/utils/dump_build_config.py"
1341 1342 1343
  outputs = [
    "$root_out_dir/v8_build_config.json",
  ]
1344
  is_gcov_coverage = v8_code_coverage && !is_clang
1345
  is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
1346 1347
  args = [
    rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
1348
    "current_cpu=\"$current_cpu\"",
1349
    "dcheck_always_on=$dcheck_always_on",
1350
    "is_android=$is_android",
1351 1352
    "is_asan=$is_asan",
    "is_cfi=$is_cfi",
1353
    "is_clang=$is_clang",
1354
    "is_component_build=$is_component_build",
1355
    "is_debug=$v8_enable_debugging_features",
1356
    "is_full_debug=$is_full_debug",
1357
    "is_gcov_coverage=$is_gcov_coverage",
1358 1359
    "is_msan=$is_msan",
    "is_tsan=$is_tsan",
1360
    "is_ubsan_vptr=$is_ubsan_vptr",
1361
    "target_cpu=\"$target_cpu\"",
1362
    "v8_current_cpu=\"$v8_current_cpu\"",
1363
    "v8_enable_i18n_support=$v8_enable_i18n_support",
1364
    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
1365 1366
    "v8_target_cpu=\"$v8_target_cpu\"",
    "v8_use_snapshot=$v8_use_snapshot",
1367
    "v8_enable_embedded_builtins=$v8_enable_embedded_builtins",
1368
    "v8_enable_verify_csa=$v8_enable_verify_csa",
1369
    "v8_enable_lite_mode=$v8_enable_lite_mode",
1370
    "v8_enable_pointer_compression=$v8_enable_pointer_compression",
1371
  ]
1372 1373 1374 1375 1376 1377 1378 1379

  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",
    ]
  }
1380 1381
}

1382 1383 1384 1385
###############################################################################
# Source Sets (aka static libraries)
#

machenbach's avatar
machenbach committed
1386 1387
source_set("v8_maybe_snapshot") {
  if (v8_use_snapshot && v8_use_external_startup_data) {
1388 1389 1390
    public_deps = [
      ":v8_external_snapshot",
    ]
machenbach's avatar
machenbach committed
1391
  } else if (v8_use_snapshot) {
1392 1393 1394
    public_deps = [
      ":v8_snapshot",
    ]
machenbach's avatar
machenbach committed
1395
  } else {
1396
    # Ignore v8_use_external_startup_data setting if no snapshot is used.
1397
    public_deps = [
1398
      ":v8_init",
1399 1400
      ":v8_nosnapshot",
    ]
machenbach's avatar
machenbach committed
1401 1402 1403
  }
}

1404
v8_source_set("v8_nosnapshot") {
1405
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
1406 1407

  deps = [
jochen's avatar
jochen committed
1408
    ":js2c_extras",
1409
    ":torque_generated_initializers",
1410 1411
  ]

1412 1413 1414
  public_deps = [
    ":v8_maybe_icu",
  ]
1415

1416
  sources = [
1417
    "$target_gen_dir/extras-libraries.cc",
1418
    "src/snapshot/embedded/embedded-empty.cc",
1419
    "src/snapshot/snapshot-empty.cc",
1420 1421
  ]

1422
  configs = [ ":internal_config" ]
1423 1424
}

1425
if (v8_use_snapshot && !v8_use_external_startup_data) {
1426 1427 1428 1429 1430 1431 1432
  v8_source_set("v8_snapshot") {
    # Only targets in this file and the top-level visibility target can
    # depend on this.
    visibility = [
      ":*",
      "//:gn_visibility",
    ]
1433

1434 1435 1436
    deps = [
      ":js2c_extras",
    ]
1437

1438 1439 1440
    public_deps = [
      # This should be public so downstream targets can declare the snapshot
      # output file as their inputs.
1441
      ":run_mksnapshot_default",
1442
      ":v8_maybe_icu",
1443
    ]
1444

1445 1446 1447
    # Do not publicize any header to remove build dependency.
    public = []

1448 1449 1450
    sources = [
      "$target_gen_dir/extras-libraries.cc",
      "$target_gen_dir/snapshot.cc",
1451
      "src/init/setup-isolate-deserialize.cc",
1452 1453
    ]

1454 1455 1456 1457
    if (v8_enable_embedded_builtins && emit_builtins_as_inline_asm) {
      deps += [ ":asm_to_inline_asm_default" ]
      sources += [ "$target_gen_dir/embedded.cc" ]
    } else if (v8_enable_embedded_builtins) {
1458
      sources += [ "$target_gen_dir/embedded.S" ]
1459
    } else {
1460
      sources += [ "src/snapshot/embedded/embedded-empty.cc" ]
1461 1462
    }

1463 1464
    configs = [ ":internal_config" ]
  }
1465 1466
}

1467
if (v8_use_snapshot && v8_use_external_startup_data) {
1468
  v8_source_set("v8_external_snapshot") {
1469
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1470 1471

    deps = [
jochen's avatar
jochen committed
1472
      ":js2c_extras",
1473
      ":v8_base",
1474 1475
    ]
    public_deps = [
1476
      ":natives_blob",
1477
      ":run_mksnapshot_default",
1478 1479
    ]

1480 1481 1482 1483
    if (v8_use_multi_snapshots) {
      public_deps += [ ":run_mksnapshot_trusted" ]
    }

1484
    sources = [
1485
      "src/init/setup-isolate-deserialize.cc",
1486 1487
      "src/snapshot/natives-external.cc",
      "src/snapshot/snapshot-external.cc",
1488 1489
    ]

1490 1491 1492
    # Do not publicize any header to remove build dependency.
    public = []

1493 1494 1495 1496 1497 1498 1499
    if (v8_enable_embedded_builtins && emit_builtins_as_inline_asm) {
      deps += [ ":asm_to_inline_asm_default" ]
      sources += [ "$target_gen_dir/embedded.cc" ]

      if (v8_use_multi_snapshots) {
        deps += [ ":asm_to_inline_asm_trusted" ]
        sources += [ "$target_gen_dir/embedded_trusted.cc" ]
1500
        jumbo_excluded_sources = [ "$target_gen_dir/embedded_trusted.cc" ]
1501 1502
      }
    } else if (v8_enable_embedded_builtins) {
1503
      sources += [ "$target_gen_dir/embedded.S" ]
1504

1505
      if (v8_use_multi_snapshots) {
1506
        sources += [ "$target_gen_dir/embedded_trusted.S" ]
1507 1508 1509 1510
        jumbo_excluded_sources = [
          # Duplicated symbols with embedded.S
          "$target_gen_dir/embedded_trusted.S",
        ]
1511
      }
1512
    } else {
1513
      sources += [ "src/snapshot/embedded/embedded-empty.cc" ]
1514 1515
    }

1516
    configs = [ ":internal_config" ]
1517 1518 1519
  }
}

1520
v8_source_set("v8_initializers") {
1521 1522 1523 1524
  visibility = [
    ":*",
    "test/cctest:*",
  ]
1525 1526

  deps = [
1527
    ":torque_generated_initializers",
Takuto Ikuta's avatar
Takuto Ikuta committed
1528 1529
  ]

1530 1531 1532
  sources = [
    ### gcmole(all) ###
    "src/builtins/builtins-arguments-gen.cc",
1533
    "src/builtins/builtins-arguments-gen.h",
1534
    "src/builtins/builtins-array-gen.cc",
1535
    "src/builtins/builtins-array-gen.h",
1536 1537
    "src/builtins/builtins-async-function-gen.cc",
    "src/builtins/builtins-async-gen.cc",
1538
    "src/builtins/builtins-async-gen.h",
1539
    "src/builtins/builtins-async-generator-gen.cc",
1540
    "src/builtins/builtins-async-iterator-gen.cc",
1541
    "src/builtins/builtins-bigint-gen.cc",
1542
    "src/builtins/builtins-bigint-gen.h",
1543
    "src/builtins/builtins-boolean-gen.cc",
1544
    "src/builtins/builtins-call-gen.cc",
1545
    "src/builtins/builtins-call-gen.h",
1546
    "src/builtins/builtins-collections-gen.cc",
1547
    "src/builtins/builtins-console-gen.cc",
1548
    "src/builtins/builtins-constructor-gen.cc",
1549
    "src/builtins/builtins-constructor-gen.h",
1550 1551
    "src/builtins/builtins-constructor.h",
    "src/builtins/builtins-conversion-gen.cc",
1552
    "src/builtins/builtins-data-view-gen.h",
1553
    "src/builtins/builtins-date-gen.cc",
1554
    "src/builtins/builtins-debug-gen.cc",
1555 1556 1557 1558 1559 1560
    "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",
1561
    "src/builtins/builtins-interpreter-gen.cc",
1562
    "src/builtins/builtins-intl-gen.cc",
1563 1564
    "src/builtins/builtins-iterator-gen.cc",
    "src/builtins/builtins-iterator-gen.h",
1565 1566
    "src/builtins/builtins-lazy-gen.cc",
    "src/builtins/builtins-lazy-gen.h",
1567
    "src/builtins/builtins-math-gen.cc",
1568
    "src/builtins/builtins-math-gen.h",
1569
    "src/builtins/builtins-microtask-queue-gen.cc",
1570 1571 1572
    "src/builtins/builtins-number-gen.cc",
    "src/builtins/builtins-object-gen.cc",
    "src/builtins/builtins-promise-gen.cc",
1573
    "src/builtins/builtins-promise-gen.h",
1574
    "src/builtins/builtins-proxy-gen.cc",
1575
    "src/builtins/builtins-proxy-gen.h",
1576
    "src/builtins/builtins-reflect-gen.cc",
1577 1578 1579 1580
    "src/builtins/builtins-regexp-gen.cc",
    "src/builtins/builtins-regexp-gen.h",
    "src/builtins/builtins-sharedarraybuffer-gen.cc",
    "src/builtins/builtins-string-gen.cc",
1581
    "src/builtins/builtins-string-gen.h",
1582
    "src/builtins/builtins-symbol-gen.cc",
1583 1584
    "src/builtins/builtins-typed-array-gen.cc",
    "src/builtins/builtins-typed-array-gen.h",
1585 1586
    "src/builtins/builtins-utils-gen.h",
    "src/builtins/builtins-wasm-gen.cc",
1587 1588
    "src/builtins/growable-fixed-array-gen.cc",
    "src/builtins/growable-fixed-array-gen.h",
1589
    "src/builtins/setup-builtins-internal.cc",
1590 1591
    "src/codegen/code-stub-assembler.cc",
    "src/codegen/code-stub-assembler.h",
1592
    "src/heap/setup-heap-internal.cc",
1593 1594
    "src/ic/accessor-assembler.cc",
    "src/ic/accessor-assembler.h",
1595 1596
    "src/ic/binary-op-assembler.cc",
    "src/ic/binary-op-assembler.h",
1597 1598
    "src/ic/keyed-store-generic.cc",
    "src/ic/keyed-store-generic.h",
1599 1600
    "src/interpreter/interpreter-assembler.cc",
    "src/interpreter/interpreter-assembler.h",
1601 1602
    "src/interpreter/interpreter-generator.cc",
    "src/interpreter/interpreter-generator.h",
1603 1604
    "src/interpreter/interpreter-intrinsics-generator.cc",
    "src/interpreter/interpreter-intrinsics-generator.h",
1605 1606
  ]

1607 1608 1609 1610
  jumbo_excluded_sources = [
    # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
    "src/builtins/builtins-async-iterator-gen.cc",
    "src/builtins/builtins-async-generator-gen.cc",
1611

1612 1613 1614
    # These source files take an unusually large amount of time to
    # compile.  Build them separately to avoid bottlenecks.
    "src/builtins/builtins-regexp-gen.cc",
1615
    "src/codegen/code-stub-assembler.cc",
1616
  ]
1617

1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659
  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",
    ]
  }

1660 1661 1662 1663
  if (!v8_enable_i18n_support) {
    sources -= [ "src/builtins/builtins-intl-gen.cc" ]
  }

1664
  configs = [ ":internal_config" ]
1665 1666
}

1667
v8_source_set("v8_init") {
1668 1669 1670
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1671
    ":v8_initializers",
1672 1673 1674 1675
  ]

  sources = [
    ### gcmole(all) ###
1676
    "src/init/setup-isolate-full.cc",
1677
  ]
1678 1679 1680 1681

  public_deps = [
    ":v8_maybe_icu",
  ]
1682 1683 1684 1685

  configs = [ ":internal_config" ]
}

1686 1687
# 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.
1688
v8_header_set("v8_version") {
1689 1690 1691
  configs = [ ":internal_config" ]

  sources = [
1692
    "include/v8-value-serializer-version.h",
1693 1694 1695 1696 1697
    "include/v8-version-string.h",
    "include/v8-version.h",
  ]
}

1698 1699 1700 1701
# 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" ]
1702
  public_configs = [ ":v8_header_features" ]
1703 1704

  sources = [
1705
    "include/v8-internal.h",
1706 1707 1708 1709
    "include/v8.h",
    "include/v8config.h",
  ]

1710 1711 1712 1713 1714 1715 1716
  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",
  ]
1717

1718 1719 1720 1721 1722
  deps = [
    ":v8_version",
  ]
}

1723 1724 1725 1726 1727 1728
# 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 = [
1729
    "src/common/globals.h",
1730 1731 1732 1733 1734 1735 1736
  ]

  deps = [
    ":v8_headers",
  ]
}

1737
v8_compiler_sources = [
1738
  ### gcmole(all) ###
1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 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
  "src/compiler/access-builder.cc",
  "src/compiler/access-builder.h",
  "src/compiler/access-info.cc",
  "src/compiler/access-info.h",
  "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",
1804 1805
  "src/compiler/csa-load-elimination.cc",
  "src/compiler/csa-load-elimination.h",
1806 1807
  "src/compiler/dead-code-elimination.cc",
  "src/compiler/dead-code-elimination.h",
1808 1809
  "src/compiler/decompression-elimination.cc",
  "src/compiler/decompression-elimination.h",
1810 1811 1812 1813 1814 1815 1816
  "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",
1817 1818
  "src/compiler/feedback-source.cc",
  "src/compiler/feedback-source.h",
1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881
  "src/compiler/frame-states.cc",
  "src/compiler/frame-states.h",
  "src/compiler/frame.cc",
  "src/compiler/frame.h",
  "src/compiler/functional-list.h",
  "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",
1882 1883
  "src/compiler/map-inference.cc",
  "src/compiler/map-inference.h",
1884 1885
  "src/compiler/memory-lowering.cc",
  "src/compiler/memory-lowering.h",
1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946
  "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",
  "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",
  "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",
1947 1948
  "src/compiler/add-type-assertions-reducer.cc",
  "src/compiler/add-type-assertions-reducer.h",
1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964
  "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",
1965
  "src/compiler/write-barrier-kind.h",
1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978
  "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",
1979
    ":v8_maybe_icu",
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002
  ]

  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",
2003
    ":v8_maybe_icu",
2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021
  ]

  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") {
2022
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
2023

2024 2025 2026
  # Split static libraries on windows into two.
  split_count = 2

2027
  sources = [
2028
    "//base/trace_event/common/trace_event_common.h",
2029 2030

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

3026 3027 3028 3029 3030 3031 3032
  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
  }

3033 3034 3035
  jumbo_excluded_sources = [
    # TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
    "src/profiler/heap-snapshot-generator.cc",  # Macro clash in mman-linux.h
3036

3037 3038
    # These source files take an unusually large amount of time to
    # compile.  Build them separately to avoid bottlenecks.
3039
    "src/api/api.cc",
3040
    "src/heap/heap.cc",
3041
    "src/objects/elements.cc",
3042
    "src/objects/objects.cc",
3043 3044
    "src/parsing/parser.cc",
  ]
3045

3046
  if (v8_current_cpu == "x86") {
3047
    sources += [  ### gcmole(arch:ia32) ###
3048 3049 3050 3051 3052 3053 3054 3055 3056 3057
      "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",
3058 3059 3060 3061
      "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",
3062
      "src/debug/ia32/debug-ia32.cc",
3063 3064 3065 3066
      "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",
3067 3068
      "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
      "src/regexp/ia32/regexp-macro-assembler-ia32.h",
3069
      "src/wasm/baseline/ia32/liftoff-assembler-ia32.h",
3070
    ]
3071
  } else if (v8_current_cpu == "x64") {
3072
    sources += [  ### gcmole(arch:x64) ###
3073 3074 3075 3076 3077 3078 3079 3080 3081 3082
      "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",
3083 3084 3085 3086 3087 3088
      "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",
3089
      "src/debug/x64/debug-x64.cc",
3090 3091 3092 3093 3094
      "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",
3095 3096
      "src/regexp/x64/regexp-macro-assembler-x64.cc",
      "src/regexp/x64/regexp-macro-assembler-x64.h",
3097
      "src/third_party/valgrind/valgrind.h",
3098
      "src/wasm/baseline/x64/liftoff-assembler-x64.h",
3099
    ]
3100

3101 3102 3103
    # 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.
    if (is_linux || is_mac || is_ios) {
3104
      sources += [
3105 3106 3107
        "src/trap-handler/handler-inside-posix.cc",
        "src/trap-handler/handler-inside-posix.h",
        "src/trap-handler/handler-outside-posix.cc",
3108 3109 3110
      ]
    }
    if (is_win) {
3111
      sources += [
3112 3113
        "src/diagnostics/unwinding-info-win64.cc",
        "src/diagnostics/unwinding-info-win64.h",
3114 3115 3116 3117
        "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
3118
    }
3119
  } else if (v8_current_cpu == "arm") {
3120
    sources += [  ### gcmole(arch:arm) ###
3121 3122 3123 3124 3125 3126 3127 3128 3129 3130
      "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",
3131 3132 3133 3134 3135 3136
      "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",
3137
      "src/debug/arm/debug-arm.cc",
3138 3139 3140 3141 3142 3143 3144
      "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",
3145 3146
      "src/regexp/arm/regexp-macro-assembler-arm.cc",
      "src/regexp/arm/regexp-macro-assembler-arm.h",
3147
      "src/wasm/baseline/arm/liftoff-assembler-arm.h",
3148
    ]
3149
  } else if (v8_current_cpu == "arm64") {
3150
    sources += [  ### gcmole(arch:arm64) ###
3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171
      "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",
3172 3173 3174 3175 3176 3177
      "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",
3178
      "src/debug/arm64/debug-arm64.cc",
3179 3180 3181 3182 3183 3184
      "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",
3185
      "src/execution/arm64/pointer-auth-arm64.cc",
3186 3187 3188
      "src/execution/arm64/simulator-arm64.cc",
      "src/execution/arm64/simulator-arm64.h",
      "src/execution/arm64/simulator-logic-arm64.cc",
3189 3190
      "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
      "src/regexp/arm64/regexp-macro-assembler-arm64.h",
3191
      "src/wasm/baseline/arm64/liftoff-assembler-arm64.h",
3192
    ]
3193 3194 3195 3196 3197 3198
    if (is_win) {
      sources += [
        "src/diagnostics/unwinding-info-win64.cc",
        "src/diagnostics/unwinding-info-win64.h",
      ]
    }
3199 3200 3201
    jumbo_excluded_sources += [
      # TODO(mostynb@vewd.com): fix this code so it doesn't need
      # to be excluded, see the comments inside.
3202
      "src/codegen/arm64/instructions-arm64-constants.cc",
3203
    ]
3204 3205
  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
    sources += [  ### gcmole(arch:mipsel) ###
3206 3207 3208 3209 3210 3211 3212 3213 3214 3215
      "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",
3216 3217 3218 3219
      "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",
3220
      "src/debug/mips/debug-mips.cc",
3221 3222 3223 3224 3225 3226
      "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",
3227 3228
      "src/regexp/mips/regexp-macro-assembler-mips.cc",
      "src/regexp/mips/regexp-macro-assembler-mips.h",
3229
      "src/wasm/baseline/mips/liftoff-assembler-mips.h",
3230
    ]
3231 3232
  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    sources += [  ### gcmole(arch:mips64el) ###
3233 3234 3235 3236 3237 3238 3239 3240 3241 3242
      "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",
3243 3244 3245 3246
      "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",
3247
      "src/debug/mips64/debug-mips64.cc",
3248 3249 3250 3251 3252 3253
      "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",
3254 3255
      "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
      "src/regexp/mips64/regexp-macro-assembler-mips64.h",
3256
      "src/wasm/baseline/mips64/liftoff-assembler-mips64.h",
3257
    ]
3258 3259
  } else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
    sources += [  ### gcmole(arch:ppc) ###
3260 3261 3262 3263 3264 3265 3266 3267 3268 3269
      "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",
3270 3271 3272 3273
      "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",
3274
      "src/debug/ppc/debug-ppc.cc",
3275 3276 3277 3278 3279 3280
      "src/deoptimizer/ppc/deoptimizer-ppc.cc",
      "src/diagnostics/ppc/disasm-ppc.cc",
      "src/execution/ppc/frame-constants-ppc.cc",
      "src/execution/ppc/frame-constants-ppc.h",
      "src/execution/ppc/simulator-ppc.cc",
      "src/execution/ppc/simulator-ppc.h",
3281 3282
      "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
      "src/regexp/ppc/regexp-macro-assembler-ppc.h",
3283
      "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
3284
    ]
3285
  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
3286
    sources += [  ### gcmole(arch:s390) ###
3287 3288 3289 3290 3291 3292 3293 3294 3295 3296
      "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",
3297 3298 3299 3300
      "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",
3301
      "src/debug/s390/debug-s390.cc",
3302 3303 3304 3305 3306 3307
      "src/deoptimizer/s390/deoptimizer-s390.cc",
      "src/diagnostics/s390/disasm-s390.cc",
      "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
3308 3309
      "src/regexp/s390/regexp-macro-assembler-s390.cc",
      "src/regexp/s390/regexp-macro-assembler-s390.h",
3310
      "src/wasm/baseline/s390/liftoff-assembler-s390.h",
3311
    ]
3312 3313
  }

3314
  configs = [ ":internal_config" ]
3315 3316

  defines = []
3317
  deps = [
3318
    ":torque_generated_definitions",
3319
    ":v8_headers",
3320
    ":v8_libbase",
3321
    ":v8_libsampler",
3322
    ":v8_shared_internal_headers",
3323
    ":v8_version",
3324
    "src/inspector:inspector",
3325
  ]
3326

Takuto Ikuta's avatar
Takuto Ikuta committed
3327 3328 3329
  public_deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
3330
    ":v8_maybe_icu",
Takuto Ikuta's avatar
Takuto Ikuta committed
3331 3332
  ]

3333
  if (v8_enable_i18n_support) {
3334 3335
    deps += [ ":run_gen-regexp-special-case" ]
    sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
3336 3337 3338 3339 3340
    if (is_win) {
      deps += [ "//third_party/icu:icudata" ]
    }
  } else {
    sources -= [
3341 3342 3343
      "src/builtins/builtins-intl.cc",
      "src/objects/intl-objects.cc",
      "src/objects/intl-objects.h",
3344 3345 3346
      "src/objects/js-break-iterator-inl.h",
      "src/objects/js-break-iterator.cc",
      "src/objects/js-break-iterator.h",
3347 3348 3349
      "src/objects/js-collator-inl.h",
      "src/objects/js-collator.cc",
      "src/objects/js-collator.h",
3350 3351 3352
      "src/objects/js-date-time-format-inl.h",
      "src/objects/js-date-time-format.cc",
      "src/objects/js-date-time-format.h",
3353 3354 3355
      "src/objects/js-list-format-inl.h",
      "src/objects/js-list-format.cc",
      "src/objects/js-list-format.h",
3356 3357 3358
      "src/objects/js-locale-inl.h",
      "src/objects/js-locale.cc",
      "src/objects/js-locale.h",
3359 3360 3361
      "src/objects/js-number-format-inl.h",
      "src/objects/js-number-format.cc",
      "src/objects/js-number-format.h",
3362 3363 3364
      "src/objects/js-plural-rules-inl.h",
      "src/objects/js-plural-rules.cc",
      "src/objects/js-plural-rules.h",
3365 3366 3367
      "src/objects/js-relative-time-format-inl.h",
      "src/objects/js-relative-time-format.cc",
      "src/objects/js-relative-time-format.h",
3368 3369 3370
      "src/objects/js-segment-iterator-inl.h",
      "src/objects/js-segment-iterator.cc",
      "src/objects/js-segment-iterator.h",
3371 3372 3373
      "src/objects/js-segmenter-inl.h",
      "src/objects/js-segmenter.cc",
      "src/objects/js-segmenter.h",
3374
      "src/runtime/runtime-intl.cc",
3375
      "src/strings/char-predicates.cc",
3376 3377 3378
    ]
  }

3379 3380 3381 3382
  if (v8_postmortem_support) {
    sources += [ "$target_gen_dir/debug-support.cc" ]
    deps += [ ":postmortem-metadata" ]
  }
3383 3384 3385 3386 3387 3388 3389 3390 3391

  # 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") {
    libs = [ "atomic" ]
  }
3392 3393
}

3394 3395 3396 3397 3398 3399 3400
group("v8_base") {
  public_deps = [
    ":v8_base_without_compiler",
    ":v8_compiler",
  ]
}

3401 3402 3403 3404 3405
v8_source_set("torque_base") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = [
    "src/torque/ast.h",
3406 3407
    "src/torque/cfg.cc",
    "src/torque/cfg.h",
3408
    "src/torque/class-debug-reader-generator.cc",
3409
    "src/torque/constants.h",
3410
    "src/torque/contextual.h",
3411 3412
    "src/torque/csa-generator.cc",
    "src/torque/csa-generator.h",
3413 3414 3415 3416 3417 3418 3419 3420
    "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",
3421
    "src/torque/global-context.cc",
3422 3423 3424
    "src/torque/global-context.h",
    "src/torque/implementation-visitor.cc",
    "src/torque/implementation-visitor.h",
3425 3426
    "src/torque/instructions.cc",
    "src/torque/instructions.h",
3427 3428
    "src/torque/server-data.cc",
    "src/torque/server-data.h",
3429 3430
    "src/torque/source-positions.cc",
    "src/torque/source-positions.h",
3431 3432
    "src/torque/torque-compiler.cc",
    "src/torque/torque-compiler.h",
3433 3434
    "src/torque/torque-parser.cc",
    "src/torque/torque-parser.h",
3435 3436
    "src/torque/type-inference.cc",
    "src/torque/type-inference.h",
3437 3438
    "src/torque/type-oracle.cc",
    "src/torque/type-oracle.h",
3439 3440
    "src/torque/type-visitor.cc",
    "src/torque/type-visitor.h",
3441 3442 3443 3444 3445 3446 3447
    "src/torque/types.cc",
    "src/torque/types.h",
    "src/torque/utils.cc",
    "src/torque/utils.h",
  ]

  deps = [
3448
    ":v8_shared_internal_headers",
3449 3450
  ]

3451 3452 3453 3454
  public_deps = [
    ":v8_libbase",
  ]

3455 3456 3457
  # 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.
3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3469
  if (is_win && is_asan) {
3470 3471
    # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
    # Torque on Windows.
3472
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3473
  }
3474 3475 3476 3477 3478 3479

  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" ]
  }
3480 3481
}

3482 3483
v8_source_set("torque_ls_base") {
  sources = [
3484
    "src/torque/ls/globals.h",
3485 3486 3487 3488
    "src/torque/ls/json-parser.cc",
    "src/torque/ls/json-parser.h",
    "src/torque/ls/json.cc",
    "src/torque/ls/json.h",
3489 3490 3491 3492 3493
    "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",
3494 3495
  ]

3496
  public_deps = [
3497 3498 3499
    ":torque_base",
  ]

3500 3501 3502
  # 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.
3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3514
  if (is_win && is_asan) {
3515
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3516 3517 3518
  }
}

3519
v8_component("v8_libbase") {
3520
  sources = [
3521
    "src/base/address-region.h",
lpy's avatar
lpy committed
3522
    "src/base/atomic-utils.h",
3523 3524
    "src/base/atomicops.h",
    "src/base/atomicops_internals_atomicword_compat.h",
3525
    "src/base/atomicops_internals_portable.h",
3526
    "src/base/atomicops_internals_std.h",
3527
    "src/base/base-export.h",
3528
    "src/base/bits.cc",
3529
    "src/base/bits.h",
3530 3531
    "src/base/bounded-page-allocator.cc",
    "src/base/bounded-page-allocator.h",
3532
    "src/base/build_config.h",
3533
    "src/base/compiler-specific.h",
3534 3535
    "src/base/cpu.cc",
    "src/base/cpu.h",
3536 3537
    "src/base/debug/stack_trace.cc",
    "src/base/debug/stack_trace.h",
3538 3539
    "src/base/division-by-constant.cc",
    "src/base/division-by-constant.h",
3540
    "src/base/enum-set.h",
3541
    "src/base/export-template.h",
3542 3543
    "src/base/file-utils.cc",
    "src/base/file-utils.h",
3544
    "src/base/flags.h",
3545
    "src/base/free_deleter.h",
3546 3547
    "src/base/functional.cc",
    "src/base/functional.h",
3548
    "src/base/hashmap-entry.h",
lpy's avatar
lpy committed
3549
    "src/base/hashmap.h",
3550 3551
    "src/base/ieee754.cc",
    "src/base/ieee754.h",
3552
    "src/base/iterator.h",
3553
    "src/base/lazy-instance.h",
3554
    "src/base/list.h",
3555 3556
    "src/base/logging.cc",
    "src/base/logging.h",
3557
    "src/base/lsan.h",
3558
    "src/base/macros.h",
3559
    "src/base/memory.h",
3560 3561
    "src/base/once.cc",
    "src/base/once.h",
3562
    "src/base/optional.h",
3563
    "src/base/overflowing-math.h",
3564 3565
    "src/base/page-allocator.cc",
    "src/base/page-allocator.h",
3566 3567
    "src/base/platform/condition-variable.cc",
    "src/base/platform/condition-variable.h",
jochen's avatar
jochen committed
3568
    "src/base/platform/elapsed-timer.h",
3569 3570 3571 3572 3573
    "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
3574 3575
    "src/base/platform/time.cc",
    "src/base/platform/time.h",
3576 3577
    "src/base/region-allocator.cc",
    "src/base/region-allocator.h",
3578
    "src/base/ring-buffer.h",
3579 3580
    "src/base/safe_conversions.h",
    "src/base/safe_conversions_impl.h",
3581
    "src/base/small-vector.h",
3582 3583
    "src/base/sys-info.cc",
    "src/base/sys-info.h",
3584
    "src/base/template-utils.h",
3585
    "src/base/timezone-cache.h",
3586
    "src/base/type-traits.h",
3587 3588
    "src/base/utils/random-number-generator.cc",
    "src/base/utils/random-number-generator.h",
3589 3590
    "src/base/vlq-base64.cc",
    "src/base/vlq-base64.h",
3591 3592
  ]

3593
  configs = [ ":internal_config_base" ]
3594

3595 3596
  public_configs = [ ":libbase_config" ]

3597 3598 3599 3600
  deps = [
    ":v8_headers",
  ]

Michael Achenbach's avatar
Michael Achenbach committed
3601 3602
  public_deps = []

3603 3604
  data = []

3605 3606
  data_deps = []

3607 3608
  defines = []

3609 3610 3611 3612
  if (is_component_build) {
    defines = [ "BUILDING_V8_BASE_SHARED" ]
  }

3613
  if (is_posix || is_fuchsia) {
3614 3615 3616 3617
    sources += [
      "src/base/platform/platform-posix.cc",
      "src/base/platform/platform-posix.h",
    ]
3618 3619 3620
    if (current_os != "aix") {
      sources += [
        "src/base/platform/platform-posix-time.cc",
3621
        "src/base/platform/platform-posix-time.h",
3622 3623
      ]
    }
3624 3625 3626
  }

  if (is_linux) {
3627 3628 3629 3630
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-linux.cc",
    ]
3631

jochen's avatar
jochen committed
3632 3633
    libs = [
      "dl",
3634 3635 3636 3637 3638 3639 3640 3641 3642 3643
      "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
3644 3645
      "rt",
    ]
3646
  } else if (is_android) {
3647
    if (current_toolchain == host_toolchain) {
jochen's avatar
jochen committed
3648 3649 3650 3651
      libs = [
        "dl",
        "rt",
      ]
3652
      if (host_os == "mac") {
3653 3654 3655 3656
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-macos.cc",
        ]
3657
      } else {
3658 3659 3660 3661
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-linux.cc",
        ]
3662 3663
      }
    } else {
3664 3665 3666 3667
      sources += [
        "src/base/debug/stack_trace_android.cc",
        "src/base/platform/platform-linux.cc",
      ]
3668
    }
3669 3670 3671 3672 3673
  } else if (is_fuchsia) {
    sources += [
      "src/base/debug/stack_trace_fuchsia.cc",
      "src/base/platform/platform-fuchsia.cc",
    ]
3674
  } else if (is_mac || is_ios) {
3675 3676 3677 3678
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-macos.cc",
    ]
3679 3680 3681
  } else if (is_win) {
    # TODO(jochen): Add support for cygwin.
    sources += [
3682
      "src/base/debug/stack_trace_win.cc",
3683
      "src/base/platform/platform-win32.cc",
3684
      "src/base/win32-headers.h",
3685 3686 3687 3688
    ]

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

3689
    libs = [
3690
      "dbghelp.lib",
3691 3692 3693
      "winmm.lib",
      "ws2_32.lib",
    ]
3694

3695
    data_deps += [ "//build/win:runtime_libs" ]
3696 3697
  }

3698 3699 3700 3701 3702 3703 3704 3705
  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",
    ]
  }

3706 3707 3708 3709 3710 3711
  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" ]
  }

3712 3713 3714 3715
  if (is_tsan && !build_with_chromium) {
    data += [ "tools/sanitizers/tsan_suppressions.txt" ]
  }

3716
  # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
3717 3718
}

3719
v8_component("v8_libplatform") {
3720
  sources = [
3721
    "//base/trace_event/common/trace_event_common.h",
3722
    "include/libplatform/libplatform-export.h",
3723
    "include/libplatform/libplatform.h",
3724
    "include/libplatform/v8-tracing.h",
3725 3726
    "src/libplatform/default-foreground-task-runner.cc",
    "src/libplatform/default-foreground-task-runner.h",
3727 3728
    "src/libplatform/default-platform.cc",
    "src/libplatform/default-platform.h",
3729 3730
    "src/libplatform/default-worker-threads-task-runner.cc",
    "src/libplatform/default-worker-threads-task-runner.h",
3731 3732
    "src/libplatform/delayed-task-queue.cc",
    "src/libplatform/delayed-task-queue.h",
3733 3734
    "src/libplatform/task-queue.cc",
    "src/libplatform/task-queue.h",
3735 3736 3737 3738 3739 3740 3741
    "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",
3742 3743 3744 3745
    "src/libplatform/worker-thread.cc",
    "src/libplatform/worker-thread.h",
  ]

3746
  configs = [ ":internal_config_base" ]
3747

3748 3749 3750 3751
  if (is_component_build) {
    defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
  }

3752
  public_configs = [ ":libplatform_config" ]
3753

3754
  deps = [
3755
    ":v8_headers",
3756 3757
    ":v8_libbase",
  ]
3758
  if (v8_use_perfetto) {
3759
    sources += [
3760 3761
      "src/libplatform/tracing/json-trace-event-listener.cc",
      "src/libplatform/tracing/json-trace-event-listener.h",
3762
      "src/libplatform/tracing/trace-event-listener.cc",
3763
      "src/libplatform/tracing/trace-event-listener.h",
3764
    ]
3765
    deps += [
3766
      "//third_party/perfetto/protos/perfetto/trace:lite",
3767
      "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
3768 3769 3770
      "//third_party/perfetto/protos/perfetto/trace/chrome:zero",
      "//third_party/perfetto/src/tracing:client_api",
      "//third_party/perfetto/src/tracing:platform_posix",
3771
    ]
3772
  }
3773 3774
}

3775 3776
v8_source_set("v8_libsampler") {
  sources = [
3777 3778
    "src/libsampler/sampler.cc",
    "src/libsampler/sampler.h",
3779 3780
  ]

3781
  configs = [ ":internal_config" ]
3782 3783 3784 3785 3786 3787 3788 3789

  public_configs = [ ":libsampler_config" ]

  deps = [
    ":v8_libbase",
  ]
}

3790
v8_source_set("fuzzer_support") {
jochen's avatar
jochen committed
3791 3792 3793 3794 3795 3796 3797
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

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

3798
  configs = [ ":internal_config_base" ]
jochen's avatar
jochen committed
3799

3800 3801 3802 3803 3804
  deps = [
    ":v8",
  ]

  public_deps = [
3805
    ":v8_libbase",
3806
    ":v8_libplatform",
3807
    ":v8_maybe_icu",
3808 3809 3810
  ]
}

3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833
###############################################################################
# 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" ]
  }
}

3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848
v8_static_library("wee8") {
  deps = [
    ":v8_base",
    ":v8_libbase",
    ":v8_libplatform",
    ":v8_libsampler",
    ":v8_maybe_snapshot",
    "//build/win:default_exe_manifest",
  ]

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

  configs = [ ":internal_config" ]

  sources = [
3849
    ### gcmole(all) ###
3850
    "src/wasm/c-api.cc",
3851
    "src/wasm/c-api.h",
3852 3853
    "third_party/wasm-api/wasm.h",
    "third_party/wasm-api/wasm.hh",
3854 3855 3856
  ]
}

3857 3858 3859 3860
###############################################################################
# Executables
#

3861
if (current_toolchain == v8_generator_toolchain) {
3862
  v8_executable("bytecode_builtins_list_generator") {
3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874
    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",
    ]

3875 3876
    configs = [ ":internal_config" ]

3877 3878 3879 3880 3881 3882 3883
    deps = [
      ":v8_libbase",
      "//build/win:default_exe_manifest",
    ]
  }
}

3884
if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
3885
  v8_executable("mksnapshot") {
3886
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
3887

3888
    sources = [
3889 3890
      "src/snapshot/embedded/embedded-file-writer.cc",
      "src/snapshot/embedded/embedded-file-writer.h",
3891 3892
      "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
3893 3894 3895 3896
      "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",
3897 3898 3899 3900
      "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",
3901
      "src/snapshot/mksnapshot.cc",
3902
    ]
3903

3904
    configs = [ ":internal_config" ]
3905

3906
    deps = [
3907 3908
      ":v8_base_without_compiler",
      ":v8_compiler_for_mksnapshot",
3909
      ":v8_init",
3910
      ":v8_libbase",
3911
      ":v8_libplatform",
3912
      ":v8_nosnapshot",
3913
      "//build/win:default_exe_manifest",
3914
    ]
3915
  }
3916 3917
}

3918 3919 3920 3921 3922 3923 3924 3925 3926
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 = [
3927
      ":torque_base",
3928 3929 3930
      "//build/win:default_exe_manifest",
    ]

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

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

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

3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963
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",
  ]

3964 3965 3966
  # 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.
3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3978
  if (is_win && is_asan) {
3979
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3980 3981 3982
  }
}

3983 3984 3985 3986
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.
3987

3988 3989 3990
      sources = [
        "src/regexp/gen-regexp-special-case.cc",
      ]
3991

3992 3993 3994 3995 3996
      deps = [
        ":v8_libbase",
        "//build/win:default_exe_manifest",
        "//third_party/icu",
      ]
3997

3998 3999
      configs = [ ":internal_config" ]
    }
4000 4001
  }

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

4005
    script = "tools/run.py"
4006

4007
    sources = v8_extra_library_files
4008

4009 4010 4011
    deps = [
      ":gen-regexp-special-case($v8_generator_toolchain)",
    ]
4012

4013
    output_file = "$target_gen_dir/src/regexp/special-case.cc"
4014

4015 4016 4017
    outputs = [
      output_file,
    ]
4018

4019 4020 4021 4022 4023 4024 4025 4026 4027
    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),
    ]
  }
4028 4029
}

4030 4031 4032
###############################################################################
# Public targets
#
4033

4034
want_v8_shell =
machenbach's avatar
machenbach committed
4035 4036 4037
    (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
    (current_toolchain == v8_snapshot_toolchain &&
     v8_toolset_for_shell == "host") ||
4038
    (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
machenbach's avatar
machenbach committed
4039 4040 4041 4042 4043 4044

group("gn_all") {
  testonly = true

  deps = [
    ":d8",
4045
    ":v8_fuzzers",
jochen's avatar
jochen committed
4046 4047
    ":v8_hello_world",
    ":v8_sample_process",
4048 4049
    "test:gn_all",
    "tools:gn_all",
machenbach's avatar
machenbach committed
4050 4051
  ]

4052 4053 4054 4055 4056
  if (v8_custom_deps != "") {
    # Custom dependency from directory under v8/custom_deps.
    deps += [ v8_custom_deps ]
  }

machenbach's avatar
machenbach committed
4057
  if (want_v8_shell) {
4058
    deps += [ ":v8_shell" ]
machenbach's avatar
machenbach committed
4059 4060 4061
  }
}

4062 4063 4064 4065 4066 4067
group("v8_python_base") {
  data = [
    ".vpython",
  ]
}

4068
group("v8_clusterfuzz") {
4069 4070
  testonly = true

4071 4072 4073 4074 4075 4076 4077
  deps = [
    ":d8",
  ]

  if (v8_multi_arch_build) {
    deps += [
      ":d8(//build/toolchain/linux:clang_x64)",
4078
      ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
4079
      ":d8(//build/toolchain/linux:clang_x86)",
4080
      ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
4081 4082 4083 4084
    ]
  }
}

4085
group("v8_archive") {
4086 4087
  testonly = true

4088 4089 4090
  deps = [
    ":d8",
  ]
4091 4092 4093 4094 4095

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

4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115
# 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"
  }
}

4116 4117
group("v8_fuzzers") {
  testonly = true
4118
  data_deps = [
4119
    ":v8_simple_json_fuzzer",
4120
    ":v8_simple_multi_return_fuzzer",
4121
    ":v8_simple_parser_fuzzer",
4122
    ":v8_simple_regexp_builtins_fuzzer",
4123
    ":v8_simple_regexp_fuzzer",
4124
    ":v8_simple_wasm_async_fuzzer",
4125
    ":v8_simple_wasm_code_fuzzer",
4126
    ":v8_simple_wasm_compile_fuzzer",
4127 4128 4129 4130
    ":v8_simple_wasm_fuzzer",
  ]
}

4131
if (is_component_build) {
4132
  v8_component("v8") {
4133
    sources = [
4134
      "src/utils/v8dll-main.cc",
4135
    ]
4136

4137 4138
    public_deps = [
      ":v8_base",
machenbach's avatar
machenbach committed
4139
      ":v8_maybe_snapshot",
4140
    ]
4141

4142
    configs = [ ":internal_config" ]
4143

4144
    public_configs = [ ":external_config" ]
4145
  }
4146 4147 4148 4149 4150

  v8_component("v8_for_testing") {
    testonly = true

    sources = [
4151
      "src/utils/v8dll-main.cc",
4152 4153 4154
    ]

    public_deps = [
4155
      ":torque_base",
4156
      ":torque_ls_base",
4157
      ":v8_base",
4158
      ":v8_headers",
4159 4160 4161 4162
      ":v8_maybe_snapshot",
    ]

    if (v8_use_snapshot) {
4163
      public_deps += [ ":v8_initializers" ]
4164 4165 4166 4167 4168 4169
    }

    configs = [ ":internal_config" ]

    public_configs = [ ":external_config" ]
  }
4170 4171
} else {
  group("v8") {
4172 4173
    public_deps = [
      ":v8_base",
machenbach's avatar
machenbach committed
4174
      ":v8_maybe_snapshot",
4175
    ]
4176

4177
    public_configs = [ ":external_config" ]
4178
  }
4179 4180 4181 4182 4183

  group("v8_for_testing") {
    testonly = true

    public_deps = [
4184
      ":torque_base",
4185
      ":torque_ls_base",
4186 4187 4188 4189 4190
      ":v8_base",
      ":v8_maybe_snapshot",
    ]

    if (v8_use_snapshot) {
4191
      public_deps += [ ":v8_initializers" ]
4192 4193 4194 4195
    }

    public_configs = [ ":external_config" ]
  }
4196
}
jochen's avatar
jochen committed
4197

4198
v8_executable("d8") {
4199
  sources = [
4200 4201 4202 4203 4204 4205 4206 4207 4208
    "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",
4209
  ]
jochen's avatar
jochen committed
4210

4211
  configs = [
4212 4213 4214 4215 4216
    # 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
4217

4218 4219
  deps = [
    ":v8",
4220
    ":v8_libbase",
4221 4222 4223
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
jochen's avatar
jochen committed
4224

4225
  if (is_posix || is_fuchsia) {
4226
    sources += [ "src/d8/d8-posix.cc" ]
4227
  } else if (is_win) {
4228
    sources += [ "src/d8/d8-windows.cc" ]
4229
  }
jochen's avatar
jochen committed
4230

4231
  if (v8_correctness_fuzzer) {
4232
    deps += [ "tools/clusterfuzz:v8_correctness_fuzzer_resources" ]
4233 4234
  }

4235
  defines = []
4236 4237

  if (v8_enable_vtunejit) {
4238
    deps += [ "src/third_party/vtune:v8_vtune" ]
4239
  }
4240 4241 4242 4243

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

jochen's avatar
jochen committed
4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259
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",
4260
    ":v8_libbase",
jochen's avatar
jochen committed
4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277
    ":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",
  ]

4278
  deps = [
4279
    ":v8",
4280
    ":v8_libbase",
4281 4282 4283 4284 4285
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
}

machenbach's avatar
machenbach committed
4286
if (want_v8_shell) {
4287
  v8_executable("v8_shell") {
4288 4289 4290 4291
    sources = [
      "samples/shell.cc",
    ]

4292
    configs = [
4293 4294 4295 4296 4297 4298 4299 4300
      # 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",
4301
      ":v8_libbase",
4302 4303 4304 4305 4306 4307
      ":v8_libplatform",
      "//build/win:default_exe_manifest",
    ]
  }
}

machenbach's avatar
machenbach committed
4308 4309 4310
template("v8_fuzzer") {
  name = target_name
  forward_variables_from(invoker, "*")
4311
  v8_executable("v8_simple_" + name) {
machenbach's avatar
machenbach committed
4312 4313
    deps = [
      ":" + name,
4314
      "//build/win:default_exe_manifest",
machenbach's avatar
machenbach committed
4315 4316
    ]

4317 4318 4319 4320
    sources = [
      "test/fuzzer/fuzzer.cc",
    ]

4321
    configs = [ ":external_config" ]
machenbach's avatar
machenbach committed
4322 4323 4324
  }
}

4325
v8_source_set("json_fuzzer") {
jochen's avatar
jochen committed
4326 4327 4328 4329 4330 4331 4332 4333
  sources = [
    "test/fuzzer/json.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

4334 4335 4336 4337
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4338 4339
}

4340 4341
v8_fuzzer("json_fuzzer") {
}
machenbach's avatar
machenbach committed
4342

4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360
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") {
}

4361
v8_source_set("parser_fuzzer") {
jochen's avatar
jochen committed
4362 4363 4364 4365 4366
  sources = [
    "test/fuzzer/parser.cc",
  ]

  deps = [
4367
    ":fuzzer_support",
jochen's avatar
jochen committed
4368 4369
  ]

4370 4371 4372 4373
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4374
}
4375

4376 4377
v8_fuzzer("parser_fuzzer") {
}
machenbach's avatar
machenbach committed
4378

4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397
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") {
}

4398
v8_source_set("regexp_fuzzer") {
4399 4400 4401 4402 4403 4404 4405 4406
  sources = [
    "test/fuzzer/regexp.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

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

4413 4414
v8_fuzzer("regexp_fuzzer") {
}
machenbach's avatar
machenbach committed
4415

4416 4417 4418 4419 4420 4421
v8_source_set("wasm_module_runner") {
  sources = [
    "test/common/wasm/wasm-module-runner.cc",
    "test/common/wasm/wasm-module-runner.h",
  ]

4422
  deps = [
4423
    ":generate_bytecode_builtins_list",
4424
    ":run_torque",
4425 4426
  ]

4427 4428 4429
  public_deps = [
    ":v8_maybe_icu",
  ]
4430

4431 4432 4433 4434
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4435 4436
}

4437
v8_source_set("wasm_fuzzer") {
4438 4439 4440 4441 4442 4443
  sources = [
    "test/fuzzer/wasm.cc",
  ]

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

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

4454 4455
v8_fuzzer("wasm_fuzzer") {
}
machenbach's avatar
machenbach committed
4456

4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476
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") {
}

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

  deps = [
    ":fuzzer_support",
4485
    ":lib_wasm_fuzzer_common",
4486
    ":wasm_module_runner",
4487 4488
  ]

4489 4490 4491 4492
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4493 4494 4495 4496
}

v8_fuzzer("wasm_code_fuzzer") {
}
4497

4498
v8_source_set("lib_wasm_fuzzer_common") {
4499
  sources = [
4500 4501
    "test/fuzzer/wasm-fuzzer-common.cc",
    "test/fuzzer/wasm-fuzzer-common.h",
4502 4503
  ]

4504
  deps = [
4505
    ":generate_bytecode_builtins_list",
4506
    ":run_torque",
4507 4508
  ]

4509 4510 4511
  public_deps = [
    ":v8_maybe_icu",
  ]
4512

4513 4514 4515 4516
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4517 4518
}

4519 4520
v8_source_set("wasm_compile_fuzzer") {
  sources = [
4521
    "test/common/wasm/test-signatures.h",
4522 4523 4524 4525 4526
    "test/fuzzer/wasm-compile.cc",
  ]

  deps = [
    ":fuzzer_support",
4527
    ":lib_wasm_fuzzer_common",
4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538
    ":wasm_module_runner",
  ]

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

v8_fuzzer("wasm_compile_fuzzer") {
}
4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550

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

  deps = [
    ":generate_bytecode_builtins_list",
    ":js2c_extras",
    ":run_torque",
    "src/inspector:v8_generated_cc_files",
  ]
}
4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567

# 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",
4568
      "-Wno-thread-safety-attributes",
4569
    ]
4570
    include_dirs = [ "third_party/protobuf/src" ]
4571 4572 4573 4574 4575 4576 4577
  }

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

4578 4579 4580
    if (!is_win) {
      defines = [ "HAVE_PTHREAD=1" ]
    }
4581 4582
    if (is_clang) {
      cflags = [
4583 4584 4585
        "-Wno-unused-private-field",
        "-Wno-unused-function",
        "-Wno-inconsistent-missing-override",
4586 4587 4588 4589 4590 4591
        "-Wno-unknown-warning-option",
        "-Wno-enum-compare-switch",
        "-Wno-user-defined-warnings",
        "-Wno-tautological-constant-compare",
      ]
    }
4592 4593 4594
    if (is_win) {
      cflags += [ "-Wno-microsoft-unqualified-friend" ]
    }
4595 4596 4597 4598
  }

  source_set("protobuf_lite") {
    sources = [
4599
      "third_party/protobuf/src/google/protobuf/any_lite.cc",
4600 4601
      "third_party/protobuf/src/google/protobuf/arena.cc",
      "third_party/protobuf/src/google/protobuf/extension_set.cc",
4602
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
4603
      "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
4604
      "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
4605
      "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
4606
      "third_party/protobuf/src/google/protobuf/io/strtod.cc",
4607 4608 4609 4610 4611 4612 4613
      "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",
4614
      "third_party/protobuf/src/google/protobuf/stubs/io_win32.cc",
4615 4616 4617 4618 4619 4620 4621 4622 4623 4624
      "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" ]
4625 4626 4627 4628
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4629 4630 4631
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654
    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",
4655
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven.cc",
4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671
      "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",
4672
      "third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc",
4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696
      "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" ]
4697 4698 4699 4700
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4701 4702 4703
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724
    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",
4725
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
4726 4727 4728 4729 4730 4731 4732 4733 4734
        "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" ]
4735 4736 4737 4738
      configs += [
        "//build/config/compiler:no_chromium_code",
        ":protobuf_config",
      ]
4739 4740 4741
      if (is_win) {
        configs -= [ "//build/config/win:lean_and_mean" ]
      }
4742 4743 4744 4745 4746 4747 4748 4749 4750
      public_configs = [ ":protobuf_gen_config" ]
    }

    executable("protoc") {
      deps = [
        ":protoc_lib",
        "//build/win:default_exe_manifest",
      ]
      sources = [
4751
        "src/protobuf/protobuf-compiler-main.cc",
4752 4753
      ]
      configs -= [ "//build/config/compiler:chromium_code" ]
4754
      configs += [ "//build/config/compiler:no_chromium_code" ]
4755 4756 4757
    }
  }  # host_toolchain
}  # if (!build_with_chromium && v8_use_perfetto)