BUILD.gn 144 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.
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 = false
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

  # Redirect allocation in young generation so that there will be only one single generation.
  v8_enable_single_generation = false
193 194
}

195 196 197 198 199 200 201 202 203
# We reuse the snapshot toolchain for building torque and other generators to
# avoid building v8_libbase on the host more than once. On mips with big endian,
# the snapshot toolchain is the target toolchain and, hence, can't be used.
v8_generator_toolchain = v8_snapshot_toolchain
if (host_cpu == "x64" &&
    (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) {
  v8_generator_toolchain = "//build/toolchain/linux:clang_x64"
}

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

237 238 239
assert(v8_current_cpu != "x86" || !v8_untrusted_code_mitigations,
       "Untrusted code mitigations are unsupported on ia32")

240 241 242 243
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")
244

245 246 247
assert(
    !v8_enable_pointer_compression || !v8_enable_shared_ro_heap,
    "Pointer compression is not supported with shared read-only heap enabled")
248 249
assert(v8_use_snapshot || !v8_enable_shared_ro_heap,
       "Shared read-only heap requires snapshot")
250

251
v8_random_seed = "314159265"
252
v8_toolset_for_shell = "host"
253 254 255 256

###############################################################################
# Configurations
#
257 258

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

261 262 263 264
  include_dirs = [
    ".",
    "$target_gen_dir",
  ]
265 266
}

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

271 272 273 274
  configs = [
    "//build/config/compiler:wexit_time_destructors",
    ":internal_config_base",
    ":v8_header_features",
275
  ]
276 277 278 279

  if (is_component_build) {
    defines += [ "BUILDING_V8_SHARED" ]
  }
280 281
}

282 283 284
# This config should be applied to code using the libplatform.
config("libplatform_config") {
  include_dirs = [ "include" ]
285 286 287
  if (is_component_build) {
    defines = [ "USING_V8_PLATFORM_SHARED" ]
  }
288 289
}

290 291 292 293 294 295 296 297 298 299 300
# 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" ]
  }
}

301 302 303 304 305
# This config should be applied to code using the libsampler.
config("libsampler_config") {
  include_dirs = [ "include" ]
}

306 307 308
# This config should only be applied to code using V8 and not any V8 code
# itself.
config("external_config") {
309
  defines = []
310
  configs = [ ":v8_header_features" ]
311
  if (is_component_build) {
312 313
    defines += [ "USING_V8_SHARED" ]
  }
314 315 316 317
  include_dirs = [
    "include",
    "$target_gen_dir/include",
  ]
318 319
}

320 321 322 323 324 325 326 327
# 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" ]
  }
}

328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
# 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.
354
config("features") {
355
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
356 357 358

  defines = []

359 360
  configs = [ ":v8_header_features" ]

361 362 363
  if (v8_embedder_string != "") {
    defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
  }
364
  if (v8_enable_disassembler) {
365
    defines += [ "ENABLE_DISASSEMBLER" ]
366
  }
367 368 369 370
  if (v8_promise_internal_field_count != 0) {
    defines +=
        [ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
  }
371 372
  defines +=
      [ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
373 374 375
  if (v8_enable_raw_heap_snapshots) {
    defines += [ "V8_ENABLE_RAW_HEAP_SNAPSHOTS" ]
  }
376 377 378
  if (v8_enable_future) {
    defines += [ "V8_ENABLE_FUTURE" ]
  }
379 380
  if (v8_enable_lite_mode) {
    defines += [ "V8_LITE_MODE" ]
381 382 383 384

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

462
config("toolchain") {
463
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
464 465 466

  defines = []
  cflags = []
brettw's avatar
brettw committed
467
  ldflags = []
468

469
  if (v8_current_cpu == "arm") {
470
    defines += [ "V8_TARGET_ARCH_ARM" ]
471
    if (arm_version >= 7) {
472 473 474 475 476
      defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
    }
    if (arm_fpu == "vfpv3-d16") {
      defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
    } else if (arm_fpu == "vfpv3") {
477 478 479
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
480 481 482 483 484 485
      ]
    } else if (arm_fpu == "neon") {
      defines += [
        "CAN_USE_VFP3_INSTRUCTIONS",
        "CAN_USE_VFP32DREGS",
        "CAN_USE_NEON",
486 487
      ]
    }
488

489
    # TODO(jochen): Add support for arm_test_noprobe.
490 491 492 493 494 495 496 497 498

    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" ]
      }
    }
499
  }
500
  if (v8_current_cpu == "arm64") {
501
    defines += [ "V8_TARGET_ARCH_ARM64" ]
502
  }
503

504 505 506 507 508 509
  # Mips64el/mipsel simulators.
  if (is_target_simulator &&
      (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) {
    defines += [ "_MIPS_TARGET_SIMULATOR" ]
  }

510
  if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") {
wtc's avatar
wtc committed
511
    defines += [ "V8_TARGET_ARCH_MIPS" ]
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
    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",
      ]
528 529 530
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
531 532 533 534 535 536 537 538 539 540 541 542
    } 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" ]
    }
543

544
    # TODO(jochen): Add support for mips_arch_variant rx and loongson.
wtc's avatar
wtc committed
545
  }
546

547
  if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") {
wtc's avatar
wtc committed
548
    defines += [ "V8_TARGET_ARCH_MIPS64" ]
549 550 551
    if (v8_can_use_fpu_instructions) {
      defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
    }
552

553 554 555 556 557
    if (host_byteorder == "little") {
      defines += [ "V8_TARGET_ARCH_MIPS64_LE" ]
    } else if (host_byteorder == "big") {
      defines += [ "V8_TARGET_ARCH_MIPS64_BE" ]
    }
558 559 560 561 562 563 564 565 566 567
    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" ]
568 569 570
      if (mips_use_msa) {
        defines += [ "_MIPS_MSA" ]
      }
571 572 573
    } else if (mips_arch_variant == "r2") {
      defines += [ "_MIPS_ARCH_MIPS64R2" ]
    }
wtc's avatar
wtc committed
574
  }
575
  if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
576
    defines += [ "V8_TARGET_ARCH_S390" ]
577
    if (v8_current_cpu == "s390x") {
578 579
      defines += [ "V8_TARGET_ARCH_S390X" ]
    }
580
    if (host_byteorder == "little") {
581
      defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
582 583 584 585 586 587 588 589 590
    } 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" ]
    }
591
    if (host_byteorder == "little") {
592
      defines += [ "V8_TARGET_ARCH_PPC_LE" ]
593
    } else if (host_byteorder == "big") {
594 595 596 597 598 599 600 601 602 603 604
      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",
        ]
      }
605
    }
606
  }
607

608
  if (v8_current_cpu == "x86") {
609
    defines += [ "V8_TARGET_ARCH_IA32" ]
brettw's avatar
brettw committed
610 611 612 613
    if (is_win) {
      # Ensure no surprising artifacts from 80bit double math with x86.
      cflags += [ "/arch:SSE2" ]
    }
614
  }
615
  if (v8_current_cpu == "x64") {
616
    defines += [ "V8_TARGET_ARCH_X64" ]
brettw's avatar
brettw committed
617 618 619 620 621 622
    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" ]
    }
623
  }
624 625 626
  if (is_android && v8_android_log_stdout) {
    defines += [ "V8_ANDROID_LOG_STDOUT" ]
  }
627

brettw's avatar
brettw committed
628
  # TODO(jochen): Support v8_enable_prof on Windows.
629 630
  # TODO(jochen): Add support for compiling with simulators.

631
  if (v8_enable_debugging_features) {
632 633 634 635
    if (is_linux && v8_enable_backtrace) {
      ldflags += [ "-rdynamic" ]
    }

636
    defines += [ "DEBUG" ]
637
    if (v8_enable_slow_dchecks) {
638 639
      defines += [ "ENABLE_SLOW_DCHECKS" ]
    }
640 641
  } else if (dcheck_always_on) {
    defines += [ "DEBUG" ]
642
  }
643

644 645 646 647
  if (v8_enable_verify_csa) {
    defines += [ "ENABLE_VERIFY_CSA" ]
  }

648 649 650 651
  if (!v8_untrusted_code_mitigations) {
    defines += [ "DISABLE_UNTRUSTED_CODE_MITIGATIONS" ]
  }

652
  if (v8_no_inline) {
653 654 655 656 657 658 659 660
    if (is_win) {
      cflags += [ "/Ob0" ]
    } else {
      cflags += [
        "-fno-inline-functions",
        "-fno-inline",
      ]
    }
661
  }
662 663

  if (is_clang) {
664
    cflags += [ "-Wmissing-field-initializers" ]
665 666 667 668 669 670

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

671 672 673 674
    if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
        v8_current_cpu == "mips64el") {
      cflags += [ "-Wshorten-64-to-32" ]
    }
675
  }
676 677 678 679 680 681 682 683 684 685

  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).
686
      "/wd4714",  # Function marked forceinline not inlined.
687 688 689 690 691

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

692
      "/wd4718",  # Recursive call has no side-effect.
693 694
      "/wd4723",  # https://crbug.com/v8/7771
      "/wd4724",  # https://crbug.com/v8/7771
695 696 697
      "/wd4800",  # Forcing value to bool.
    ]
  }
698 699 700 701 702 703 704

  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",
705 706 707 708

      # 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",
709 710
    ]
  }
711 712 713 714 715

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

718 719 720 721 722 723 724 725 726 727 728 729 730 731
# 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" ]
  }
}

732 733
# Configs for code coverage with gcov. Separate configs for cflags and ldflags
# to selectively influde cflags in non-test targets only.
734 735 736 737 738
config("v8_gcov_coverage_cflags") {
  cflags = [
    "-fprofile-arcs",
    "-ftest-coverage",
  ]
739 740
}

741 742
config("v8_gcov_coverage_ldflags") {
  ldflags = [ "-fprofile-arcs" ]
743 744
}

745 746 747 748
###############################################################################
# Actions
#

749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
# 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),
    ]
  }
}

782 783 784 785 786 787 788 789 790 791 792 793
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
794
           rebase_path("$target_gen_dir/extras-libraries.cc", root_build_dir),
795 796 797 798 799 800 801 802 803 804 805 806
           "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),
    ]
  }
}

807
if (is_android && enable_java_templates) {
808 809
  android_assets("v8_external_startup_data_assets") {
    if (v8_use_external_startup_data) {
810 811
      # We don't support side-by-side snapshots on Android within Chromium.
      assert(!v8_use_multi_snapshots)
812 813 814
      deps = [
        "//v8",
      ]
815 816 817 818 819 820 821 822 823 824
      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" ]
      }
825 826 827 828 829
      disable_compression = true
    }
  }
}

830 831
if (v8_use_external_startup_data) {
  action("natives_blob") {
832
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
833 834

    deps = [
jochen's avatar
jochen committed
835
      ":js2c_extras",
836 837
    ]

838
    # NOSORT
839
    sources = [
jochen's avatar
jochen committed
840
      "$target_gen_dir/libraries_extras.bin",
841 842 843
    ]

    outputs = [
844
      "$root_out_dir/natives_blob.bin",
845 846
    ]

847 848 849 850
    data = [
      "$root_out_dir/natives_blob.bin",
    ]

851 852 853 854
    script = "tools/concatenate-files.py"

    args = rebase_path(sources + outputs, root_build_dir)
  }
855 856 857
}

action("postmortem-metadata") {
858 859 860 861 862 863
  # Only targets in this file and the top-level visibility target can
  # depend on this.
  visibility = [
    ":*",
    "//:gn_visibility",
  ]
864

865 866
  script = "tools/gen-postmortem-metadata.py"

867
  # NOSORT
868
  sources = [
869 870
    "src/objects/objects.h",
    "src/objects/objects-inl.h",
871 872
    "src/objects/allocation-site-inl.h",
    "src/objects/allocation-site.h",
873 874
    "src/objects/cell-inl.h",
    "src/objects/cell.h",
875 876
    "src/objects/code-inl.h",
    "src/objects/code.h",
877 878
    "src/objects/data-handler.h",
    "src/objects/data-handler-inl.h",
879 880
    "src/objects/feedback-cell.h",
    "src/objects/feedback-cell-inl.h",
881 882
    "src/objects/fixed-array-inl.h",
    "src/objects/fixed-array.h",
883 884
    "src/objects/heap-number-inl.h",
    "src/objects/heap-number.h",
885 886
    "src/objects/heap-object-inl.h",
    "src/objects/heap-object.h",
887
    "src/objects/instance-type.h",
888 889
    "src/objects/js-array-inl.h",
    "src/objects/js-array.h",
890 891
    "src/objects/js-array-buffer-inl.h",
    "src/objects/js-array-buffer.h",
892 893
    "src/objects/js-objects-inl.h",
    "src/objects/js-objects.h",
894 895
    "src/objects/js-promise-inl.h",
    "src/objects/js-promise.h",
896 897
    "src/objects/js-regexp-inl.h",
    "src/objects/js-regexp.h",
898 899
    "src/objects/js-regexp-string-iterator-inl.h",
    "src/objects/js-regexp-string-iterator.h",
900
    "src/objects/map.h",
901
    "src/objects/map.cc",
902
    "src/objects/map-inl.h",
903
    "src/objects/js-objects.cc",
904 905
    "src/objects/name.h",
    "src/objects/name-inl.h",
906 907
    "src/objects/oddball-inl.h",
    "src/objects/oddball.h",
908
    "src/objects/scope-info.h",
909 910
    "src/objects/script.h",
    "src/objects/script-inl.h",
911 912
    "src/objects/shared-function-info.h",
    "src/objects/shared-function-info-inl.h",
913
    "src/objects/string.cc",
914
    "src/objects/string.h",
915 916
    "src/objects/string-comparator.cc",
    "src/objects/string-comparator.h",
917
    "src/objects/string-inl.h",
918 919
    "src/objects/struct.h",
    "src/objects/struct-inl.h",
920 921 922
  ]

  outputs = [
923
    "$target_gen_dir/debug-support.cc",
924 925
  ]

926 927
  args = rebase_path(outputs, root_build_dir) +
         rebase_path(sources, root_build_dir)
928 929
}

930
torque_files = [
931
  "src/builtins/arguments.tq",
932
  "src/builtins/array-copywithin.tq",
933
  "src/builtins/array-every.tq",
934
  "src/builtins/array-filter.tq",
935 936
  "src/builtins/array-find.tq",
  "src/builtins/array-findindex.tq",
937
  "src/builtins/array-foreach.tq",
938
  "src/builtins/array-join.tq",
939
  "src/builtins/array-lastindexof.tq",
940
  "src/builtins/array-map.tq",
941
  "src/builtins/array-of.tq",
942
  "src/builtins/array-reduce-right.tq",
943
  "src/builtins/array-reduce.tq",
944
  "src/builtins/array-reverse.tq",
945
  "src/builtins/array-shift.tq",
946
  "src/builtins/array-slice.tq",
947
  "src/builtins/array-some.tq",
948
  "src/builtins/array-splice.tq",
949
  "src/builtins/array-unshift.tq",
950 951
  "src/builtins/array.tq",
  "src/builtins/base.tq",
952
  "src/builtins/bigint.tq",
953
  "src/builtins/boolean.tq",
954
  "src/builtins/collections.tq",
955
  "src/builtins/data-view.tq",
956
  "src/builtins/extras-utils.tq",
957 958
  "src/builtins/frames.tq",
  "src/builtins/growable-fixed-array.tq",
959
  "src/builtins/internal-coverage.tq",
960
  "src/builtins/iterator.tq",
961
  "src/builtins/math.tq",
962
  "src/builtins/object-fromentries.tq",
963
  "src/builtins/object.tq",
964
  "src/builtins/proxy-constructor.tq",
965
  "src/builtins/proxy-delete-property.tq",
966
  "src/builtins/proxy-get-property.tq",
967
  "src/builtins/proxy-get-prototype-of.tq",
968
  "src/builtins/proxy-has-property.tq",
969
  "src/builtins/proxy-is-extensible.tq",
970
  "src/builtins/proxy-prevent-extensions.tq",
971
  "src/builtins/proxy-revocable.tq",
972
  "src/builtins/proxy-revoke.tq",
973
  "src/builtins/proxy-set-property.tq",
974
  "src/builtins/proxy-set-prototype-of.tq",
975
  "src/builtins/proxy.tq",
976
  "src/builtins/reflect.tq",
977
  "src/builtins/regexp-replace.tq",
978
  "src/builtins/regexp.tq",
979
  "src/builtins/string.tq",
980
  "src/builtins/string-endswith.tq",
981
  "src/builtins/string-html.tq",
982
  "src/builtins/string-iterator.tq",
983
  "src/builtins/string-repeat.tq",
984
  "src/builtins/string-slice.tq",
985
  "src/builtins/string-startswith.tq",
986
  "src/builtins/string-substring.tq",
987
  "src/builtins/torque-internal.tq",
988
  "src/builtins/typed-array-createtypedarray.tq",
989
  "src/builtins/typed-array-every.tq",
990
  "src/builtins/typed-array-filter.tq",
991 992
  "src/builtins/typed-array-find.tq",
  "src/builtins/typed-array-findindex.tq",
993 994 995
  "src/builtins/typed-array-foreach.tq",
  "src/builtins/typed-array-reduce.tq",
  "src/builtins/typed-array-reduceright.tq",
996
  "src/builtins/typed-array-slice.tq",
997
  "src/builtins/typed-array-some.tq",
998
  "src/builtins/typed-array-subarray.tq",
999
  "src/builtins/typed-array.tq",
1000
  "src/objects/intl-objects.tq",
1001
  "test/torque/test-torque.tq",
1002
  "third_party/v8/builtins/array-sort.tq",
1003 1004
]

1005 1006 1007 1008
if (!v8_enable_i18n_support) {
  torque_files -= [ "src/objects/intl-objects.tq" ]
}

1009 1010 1011 1012
action("run_torque") {
  visibility = [
    ":*",
    "tools/gcmole/:*",
1013
    "test/cctest/:*",
1014 1015 1016
  ]

  deps = [
1017
    ":torque($v8_generator_toolchain)",
1018 1019 1020 1021
  ]

  script = "tools/run.py"

1022
  sources = torque_files
1023 1024

  outputs = [
1025 1026 1027 1028 1029
    "$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",
1030 1031 1032
    "$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",
1033 1034 1035
    "$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",
1036
    "$target_gen_dir/torque-generated/instance-types-tq.h",
1037
  ]
1038 1039
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1040
    outputs += [
1041 1042
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1043 1044
    ]
  }
1045 1046

  args = [
1047
    "./" + rebase_path(get_label_info(":torque($v8_generator_toolchain)",
1048 1049 1050
                                      "root_out_dir") + "/torque",
                       root_build_dir),
    "-o",
1051
    rebase_path("$target_gen_dir/torque-generated", root_build_dir),
1052 1053
    "-v8-root",
    rebase_path(".", root_build_dir),
1054
  ]
1055
  args += torque_files
1056 1057
}

1058 1059 1060 1061 1062 1063 1064 1065
group("v8_maybe_icu") {
  if (v8_enable_i18n_support) {
    public_deps = [
      "//third_party/icu",
    ]
  }
}

1066 1067 1068 1069
v8_source_set("torque_generated_initializers") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1070
    ":generate_bytecode_builtins_list",
1071 1072 1073
    ":run_torque",
  ]

1074 1075 1076
  public_deps = [
    ":v8_maybe_icu",
  ]
1077

1078 1079 1080 1081 1082
  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",
  ]
1083 1084
  foreach(file, torque_files) {
    filetq = string_replace(file, ".tq", "-tq-csa")
1085
    sources += [
1086 1087
      "$target_gen_dir/torque-generated/$filetq.cc",
      "$target_gen_dir/torque-generated/$filetq.h",
1088 1089 1090
    ]
  }

1091
  configs = [ ":internal_config" ]
1092 1093
}

1094 1095 1096 1097
v8_source_set("torque_generated_definitions") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
John Budorick's avatar
John Budorick committed
1098
    ":generate_bytecode_builtins_list",
1099 1100 1101
    ":run_torque",
  ]

1102 1103 1104
  public_deps = [
    ":v8_maybe_icu",
  ]
1105 1106

  sources = [
1107
    "$target_gen_dir/torque-generated/class-definitions-tq.cc",
1108 1109 1110
    "$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",
1111 1112 1113 1114 1115
  ]

  configs = [ ":internal_config" ]
}

1116 1117 1118 1119 1120 1121
action("generate_bytecode_builtins_list") {
  script = "tools/run.py"
  outputs = [
    "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
  ]
  deps = [
1122
    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1123 1124 1125
  ]
  args = [
    "./" + rebase_path(
1126
            get_label_info(
1127
                    ":bytecode_builtins_list_generator($v8_generator_toolchain)",
1128
                    "root_out_dir") + "/bytecode_builtins_list_generator",
1129
            root_build_dir),
1130 1131
    rebase_path("$target_gen_dir/builtins-generated/bytecodes-builtins-list.h",
                root_build_dir),
1132 1133 1134
  ]
}

1135 1136 1137
# 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.
1138
# Otherwise files are suffixed, e.g. embedded_<name>.S and
1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152
# 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) {
1153
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1154

1155 1156 1157
    deps = [
      ":mksnapshot($v8_snapshot_toolchain)",
    ]
1158

1159
    script = "tools/run.py"
1160

1161
    sources = []
1162

1163
    outputs = []
1164

1165 1166
    data = []

1167 1168 1169 1170 1171
    args = [
      "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)",
                                        "root_out_dir") + "/mksnapshot",
                         root_build_dir),
      "--turbo_instruction_scheduling",
1172 1173 1174 1175 1176

      # 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|.
1177
      "--target_os=$current_os",
1178
      "--target_arch=$current_cpu",
1179 1180
    ]

1181 1182
    args += invoker.args

1183
    if (v8_enable_embedded_builtins) {
1184
      outputs += [ "$target_gen_dir/embedded${suffix}.S" ]
1185 1186
      args += [
        "--embedded_src",
1187
        rebase_path("$target_gen_dir/embedded${suffix}.S", root_build_dir),
1188
      ]
1189 1190 1191 1192 1193 1194
      if (invoker.embedded_variant != "") {
        args += [
          "--embedded_variant",
          invoker.embedded_variant,
        ]
      }
1195 1196
    }

1197 1198 1199 1200 1201 1202
    if (v8_random_seed != "0") {
      args += [
        "--random-seed",
        v8_random_seed,
      ]
    }
1203

1204 1205 1206 1207 1208 1209
    if (v8_os_page_size != "0") {
      args += [
        "--v8_os_page_size",
        v8_os_page_size,
      ]
    }
1210

1211
    if (v8_use_external_startup_data) {
1212
      outputs += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1213
      data += [ "$root_out_dir/snapshot_blob${suffix}.bin" ]
1214 1215
      args += [
        "--startup_blob",
1216
        rebase_path("$root_out_dir/snapshot_blob${suffix}.bin", root_build_dir),
1217
      ]
1218
    } else {
1219
      outputs += [ "$target_gen_dir/snapshot${suffix}.cc" ]
1220 1221
      args += [
        "--startup_src",
1222
        rebase_path("$target_gen_dir/snapshot${suffix}.cc", root_build_dir),
1223
      ]
1224 1225 1226 1227 1228 1229 1230
    }

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

1231 1232 1233 1234
    if (v8_enable_snapshot_code_comments) {
      args += [ "--code-comments" ]
    }

1235 1236 1237 1238 1239 1240 1241 1242
    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" ]
    }

1243 1244 1245 1246 1247
    if (v8_enable_fast_mksnapshot) {
      args += [
        "--no-turbo-rewrite-far-jumps",
        "--no-turbo-verify-allocation",
      ]
1248 1249 1250 1251 1252

      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" ]
      }
1253
    }
1254
  }
1255 1256
}

1257 1258 1259 1260 1261 1262 1263
if (v8_use_snapshot) {
  run_mksnapshot("default") {
    args = []
    if (v8_enable_embedded_builtins) {
      embedded_variant = "Default"
    }
  }
1264 1265 1266 1267 1268
  if (emit_builtins_as_inline_asm) {
    asm_to_inline_asm("default") {
      args = []
    }
  }
1269 1270 1271 1272 1273 1274 1275
  if (v8_use_multi_snapshots) {
    run_mksnapshot("trusted") {
      args = [ "--no-untrusted-code-mitigations" ]
      if (v8_enable_embedded_builtins) {
        embedded_variant = "Trusted"
      }
    }
1276 1277 1278 1279 1280
    if (emit_builtins_as_inline_asm) {
      asm_to_inline_asm("trusted") {
        args = []
      }
    }
1281 1282 1283
  }
}

1284 1285
action("v8_dump_build_config") {
  script = "tools/testrunner/utils/dump_build_config.py"
1286 1287 1288
  outputs = [
    "$root_out_dir/v8_build_config.json",
  ]
1289
  is_gcov_coverage = v8_code_coverage && !is_clang
1290
  is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
1291 1292
  args = [
    rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
1293
    "current_cpu=\"$current_cpu\"",
1294
    "dcheck_always_on=$dcheck_always_on",
1295
    "is_android=$is_android",
1296 1297
    "is_asan=$is_asan",
    "is_cfi=$is_cfi",
1298
    "is_clang=$is_clang",
1299
    "is_component_build=$is_component_build",
1300
    "is_debug=$v8_enable_debugging_features",
1301
    "is_full_debug=$is_full_debug",
1302
    "is_gcov_coverage=$is_gcov_coverage",
1303 1304
    "is_msan=$is_msan",
    "is_tsan=$is_tsan",
1305
    "is_ubsan_vptr=$is_ubsan_vptr",
1306
    "target_cpu=\"$target_cpu\"",
1307
    "v8_current_cpu=\"$v8_current_cpu\"",
1308
    "v8_enable_i18n_support=$v8_enable_i18n_support",
1309
    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
1310 1311
    "v8_target_cpu=\"$v8_target_cpu\"",
    "v8_use_snapshot=$v8_use_snapshot",
1312
    "v8_enable_embedded_builtins=$v8_enable_embedded_builtins",
1313
    "v8_enable_verify_csa=$v8_enable_verify_csa",
1314
    "v8_enable_lite_mode=$v8_enable_lite_mode",
1315
    "v8_enable_pointer_compression=$v8_enable_pointer_compression",
1316
  ]
1317 1318 1319 1320 1321 1322 1323 1324

  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",
    ]
  }
1325 1326
}

1327 1328 1329 1330
###############################################################################
# Source Sets (aka static libraries)
#

machenbach's avatar
machenbach committed
1331 1332
source_set("v8_maybe_snapshot") {
  if (v8_use_snapshot && v8_use_external_startup_data) {
1333 1334 1335
    public_deps = [
      ":v8_external_snapshot",
    ]
machenbach's avatar
machenbach committed
1336
  } else if (v8_use_snapshot) {
1337 1338 1339
    public_deps = [
      ":v8_snapshot",
    ]
machenbach's avatar
machenbach committed
1340
  } else {
1341
    # Ignore v8_use_external_startup_data setting if no snapshot is used.
1342
    public_deps = [
1343
      ":v8_init",
1344 1345
      ":v8_nosnapshot",
    ]
machenbach's avatar
machenbach committed
1346 1347 1348
  }
}

1349
v8_source_set("v8_nosnapshot") {
1350
  visibility = [ ":*" ]  # Only targets in this file can depend on this.
1351 1352

  deps = [
jochen's avatar
jochen committed
1353
    ":js2c_extras",
1354
    ":torque_generated_initializers",
1355 1356
  ]

1357 1358 1359
  public_deps = [
    ":v8_maybe_icu",
  ]
1360

1361
  sources = [
1362
    "$target_gen_dir/extras-libraries.cc",
1363
    "src/snapshot/embedded/embedded-empty.cc",
1364
    "src/snapshot/snapshot-empty.cc",
1365 1366
  ]

1367
  configs = [ ":internal_config" ]
1368 1369
}

1370
if (v8_use_snapshot && !v8_use_external_startup_data) {
1371 1372 1373 1374 1375 1376 1377
  v8_source_set("v8_snapshot") {
    # Only targets in this file and the top-level visibility target can
    # depend on this.
    visibility = [
      ":*",
      "//:gn_visibility",
    ]
1378

1379 1380 1381
    deps = [
      ":js2c_extras",
    ]
1382

1383 1384 1385
    public_deps = [
      # This should be public so downstream targets can declare the snapshot
      # output file as their inputs.
1386
      ":run_mksnapshot_default",
1387
      ":v8_maybe_icu",
1388
    ]
1389

1390 1391 1392
    # Do not publicize any header to remove build dependency.
    public = []

1393 1394 1395
    sources = [
      "$target_gen_dir/extras-libraries.cc",
      "$target_gen_dir/snapshot.cc",
1396
      "src/init/setup-isolate-deserialize.cc",
1397 1398
    ]

1399 1400 1401 1402
    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) {
1403
      sources += [ "$target_gen_dir/embedded.S" ]
1404
    } else {
1405
      sources += [ "src/snapshot/embedded/embedded-empty.cc" ]
1406 1407
    }

1408 1409
    configs = [ ":internal_config" ]
  }
1410 1411
}

1412
if (v8_use_snapshot && v8_use_external_startup_data) {
1413
  v8_source_set("v8_external_snapshot") {
1414
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
1415 1416

    deps = [
jochen's avatar
jochen committed
1417
      ":js2c_extras",
1418
      ":v8_base",
1419 1420
    ]
    public_deps = [
1421
      ":natives_blob",
1422
      ":run_mksnapshot_default",
1423 1424
    ]

1425 1426 1427 1428
    if (v8_use_multi_snapshots) {
      public_deps += [ ":run_mksnapshot_trusted" ]
    }

1429
    sources = [
1430
      "src/init/setup-isolate-deserialize.cc",
1431 1432
      "src/snapshot/natives-external.cc",
      "src/snapshot/snapshot-external.cc",
1433 1434
    ]

1435 1436 1437
    # Do not publicize any header to remove build dependency.
    public = []

1438 1439 1440 1441 1442 1443 1444
    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" ]
1445
        jumbo_excluded_sources = [ "$target_gen_dir/embedded_trusted.cc" ]
1446 1447
      }
    } else if (v8_enable_embedded_builtins) {
1448
      sources += [ "$target_gen_dir/embedded.S" ]
1449

1450
      if (v8_use_multi_snapshots) {
1451
        sources += [ "$target_gen_dir/embedded_trusted.S" ]
1452 1453 1454 1455
        jumbo_excluded_sources = [
          # Duplicated symbols with embedded.S
          "$target_gen_dir/embedded_trusted.S",
        ]
1456
      }
1457
    } else {
1458
      sources += [ "src/snapshot/embedded/embedded-empty.cc" ]
1459 1460
    }

1461
    configs = [ ":internal_config" ]
1462 1463 1464
  }
}

1465
v8_source_set("v8_initializers") {
1466 1467 1468 1469
  visibility = [
    ":*",
    "test/cctest:*",
  ]
1470 1471

  deps = [
1472
    ":torque_generated_initializers",
Takuto Ikuta's avatar
Takuto Ikuta committed
1473 1474
  ]

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

1552 1553 1554 1555
  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",
1556

1557 1558 1559
    # These source files take an unusually large amount of time to
    # compile.  Build them separately to avoid bottlenecks.
    "src/builtins/builtins-regexp-gen.cc",
1560
    "src/codegen/code-stub-assembler.cc",
1561
  ]
1562

1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604
  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",
    ]
  }

1605 1606 1607 1608
  if (!v8_enable_i18n_support) {
    sources -= [ "src/builtins/builtins-intl-gen.cc" ]
  }

1609
  configs = [ ":internal_config" ]
1610 1611
}

1612
v8_source_set("v8_init") {
1613 1614 1615
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  deps = [
1616
    ":v8_initializers",
1617 1618 1619 1620
  ]

  sources = [
    ### gcmole(all) ###
1621
    "src/init/setup-isolate-full.cc",
1622
  ]
1623 1624 1625 1626

  public_deps = [
    ":v8_maybe_icu",
  ]
1627 1628 1629 1630

  configs = [ ":internal_config" ]
}

1631 1632
# 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.
1633
v8_header_set("v8_version") {
1634 1635 1636
  configs = [ ":internal_config" ]

  sources = [
1637
    "include/v8-value-serializer-version.h",
1638 1639 1640 1641 1642
    "include/v8-version-string.h",
    "include/v8-version.h",
  ]
}

1643 1644 1645 1646
# 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" ]
1647
  public_configs = [ ":v8_header_features" ]
1648 1649

  sources = [
1650
    "include/v8-internal.h",
1651 1652 1653 1654
    "include/v8.h",
    "include/v8config.h",
  ]

1655 1656 1657 1658 1659 1660 1661
  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",
  ]
1662

1663 1664 1665 1666 1667
  deps = [
    ":v8_version",
  ]
}

1668 1669 1670 1671 1672 1673
# 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 = [
1674
    "src/common/globals.h",
1675 1676 1677 1678 1679 1680 1681
  ]

  deps = [
    ":v8_headers",
  ]
}

1682
v8_compiler_sources = [
1683
  ### gcmole(all) ###
1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748
  "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",
1749 1750
  "src/compiler/csa-load-elimination.cc",
  "src/compiler/csa-load-elimination.h",
1751 1752
  "src/compiler/dead-code-elimination.cc",
  "src/compiler/dead-code-elimination.h",
1753 1754
  "src/compiler/decompression-elimination.cc",
  "src/compiler/decompression-elimination.h",
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 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824
  "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",
  "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",
1825 1826
  "src/compiler/map-inference.cc",
  "src/compiler/map-inference.h",
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887
  "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",
1888 1889
  "src/compiler/add-type-assertions-reducer.cc",
  "src/compiler/add-type-assertions-reducer.h",
1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
  "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",
1902 1903
  "src/compiler/vector-slot-pair.cc",
  "src/compiler/vector-slot-pair.h",
1904 1905 1906 1907
  "src/compiler/verifier.cc",
  "src/compiler/verifier.h",
  "src/compiler/wasm-compiler.cc",
  "src/compiler/wasm-compiler.h",
1908
  "src/compiler/write-barrier-kind.h",
1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921
  "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",
1922
    ":v8_maybe_icu",
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
  ]

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

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

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

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

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

2960 2961 2962 2963 2964 2965 2966
  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
  }

2967 2968 2969
  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
2970

2971 2972
    # These source files take an unusually large amount of time to
    # compile.  Build them separately to avoid bottlenecks.
2973
    "src/api/api.cc",
2974
    "src/heap/heap.cc",
2975
    "src/objects/elements.cc",
2976
    "src/objects/objects.cc",
2977 2978
    "src/parsing/parser.cc",
  ]
2979

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

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

3242
  configs = [ ":internal_config" ]
3243 3244

  defines = []
3245
  deps = [
3246
    ":torque_generated_definitions",
3247
    ":v8_headers",
3248
    ":v8_libbase",
3249
    ":v8_libsampler",
3250
    ":v8_shared_internal_headers",
3251
    ":v8_version",
3252
    "src/inspector:inspector",
3253
  ]
3254

Takuto Ikuta's avatar
Takuto Ikuta committed
3255 3256 3257
  public_deps = [
    ":generate_bytecode_builtins_list",
    ":run_torque",
3258
    ":v8_maybe_icu",
Takuto Ikuta's avatar
Takuto Ikuta committed
3259 3260
  ]

3261
  if (v8_enable_i18n_support) {
3262 3263
    deps += [ ":run_gen-regexp-special-case" ]
    sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
3264 3265 3266 3267 3268
    if (is_win) {
      deps += [ "//third_party/icu:icudata" ]
    }
  } else {
    sources -= [
3269 3270 3271
      "src/builtins/builtins-intl.cc",
      "src/objects/intl-objects.cc",
      "src/objects/intl-objects.h",
3272 3273 3274
      "src/objects/js-break-iterator-inl.h",
      "src/objects/js-break-iterator.cc",
      "src/objects/js-break-iterator.h",
3275 3276 3277
      "src/objects/js-collator-inl.h",
      "src/objects/js-collator.cc",
      "src/objects/js-collator.h",
3278 3279 3280
      "src/objects/js-date-time-format-inl.h",
      "src/objects/js-date-time-format.cc",
      "src/objects/js-date-time-format.h",
3281 3282 3283
      "src/objects/js-list-format-inl.h",
      "src/objects/js-list-format.cc",
      "src/objects/js-list-format.h",
3284 3285 3286
      "src/objects/js-locale-inl.h",
      "src/objects/js-locale.cc",
      "src/objects/js-locale.h",
3287 3288 3289
      "src/objects/js-number-format-inl.h",
      "src/objects/js-number-format.cc",
      "src/objects/js-number-format.h",
3290 3291 3292
      "src/objects/js-plural-rules-inl.h",
      "src/objects/js-plural-rules.cc",
      "src/objects/js-plural-rules.h",
3293 3294 3295
      "src/objects/js-relative-time-format-inl.h",
      "src/objects/js-relative-time-format.cc",
      "src/objects/js-relative-time-format.h",
3296 3297 3298
      "src/objects/js-segment-iterator-inl.h",
      "src/objects/js-segment-iterator.cc",
      "src/objects/js-segment-iterator.h",
3299 3300 3301
      "src/objects/js-segmenter-inl.h",
      "src/objects/js-segmenter.cc",
      "src/objects/js-segmenter.h",
3302
      "src/runtime/runtime-intl.cc",
3303
      "src/strings/char-predicates.cc",
3304 3305 3306
    ]
  }

3307 3308 3309 3310
  if (v8_postmortem_support) {
    sources += [ "$target_gen_dir/debug-support.cc" ]
    deps += [ ":postmortem-metadata" ]
  }
3311 3312 3313 3314 3315 3316 3317 3318 3319

  # 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" ]
  }
3320 3321
}

3322 3323 3324 3325 3326 3327 3328
group("v8_base") {
  public_deps = [
    ":v8_base_without_compiler",
    ":v8_compiler",
  ]
}

3329 3330 3331 3332 3333
v8_source_set("torque_base") {
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

  sources = [
    "src/torque/ast.h",
3334 3335
    "src/torque/cfg.cc",
    "src/torque/cfg.h",
3336
    "src/torque/constants.h",
3337
    "src/torque/contextual.h",
3338 3339
    "src/torque/csa-generator.cc",
    "src/torque/csa-generator.h",
3340 3341 3342 3343 3344 3345 3346 3347
    "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",
3348
    "src/torque/global-context.cc",
3349 3350 3351
    "src/torque/global-context.h",
    "src/torque/implementation-visitor.cc",
    "src/torque/implementation-visitor.h",
3352 3353
    "src/torque/instructions.cc",
    "src/torque/instructions.h",
3354 3355
    "src/torque/server-data.cc",
    "src/torque/server-data.h",
3356 3357
    "src/torque/source-positions.cc",
    "src/torque/source-positions.h",
3358 3359
    "src/torque/torque-compiler.cc",
    "src/torque/torque-compiler.h",
3360 3361 3362 3363
    "src/torque/torque-parser.cc",
    "src/torque/torque-parser.h",
    "src/torque/type-oracle.cc",
    "src/torque/type-oracle.h",
3364 3365
    "src/torque/type-visitor.cc",
    "src/torque/type-visitor.h",
3366 3367 3368 3369 3370 3371 3372
    "src/torque/types.cc",
    "src/torque/types.h",
    "src/torque/utils.cc",
    "src/torque/utils.h",
  ]

  deps = [
3373
    ":v8_shared_internal_headers",
3374 3375
  ]

3376 3377 3378 3379
  public_deps = [
    ":v8_libbase",
  ]

3380 3381 3382
  # 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.
3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3394
  if (is_win && is_asan) {
3395 3396
    # Due to a bug in ASAN on Windows (chromium:893437), we disable ASAN for
    # Torque on Windows.
3397
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3398
  }
3399 3400 3401 3402 3403 3404

  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" ]
  }
3405 3406
}

3407 3408
v8_source_set("torque_ls_base") {
  sources = [
3409
    "src/torque/ls/globals.h",
3410 3411 3412 3413
    "src/torque/ls/json-parser.cc",
    "src/torque/ls/json-parser.h",
    "src/torque/ls/json.cc",
    "src/torque/ls/json.h",
3414 3415 3416 3417 3418
    "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",
3419 3420
  ]

3421
  public_deps = [
3422 3423 3424
    ":torque_base",
  ]

3425 3426 3427
  # 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.
3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3439
  if (is_win && is_asan) {
3440
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3441 3442 3443
  }
}

3444
v8_component("v8_libbase") {
3445
  sources = [
3446
    "src/base/adapters.h",
3447
    "src/base/address-region.h",
lpy's avatar
lpy committed
3448
    "src/base/atomic-utils.h",
3449 3450
    "src/base/atomicops.h",
    "src/base/atomicops_internals_atomicword_compat.h",
3451
    "src/base/atomicops_internals_portable.h",
3452
    "src/base/atomicops_internals_std.h",
3453
    "src/base/base-export.h",
3454
    "src/base/bits.cc",
3455
    "src/base/bits.h",
3456 3457
    "src/base/bounded-page-allocator.cc",
    "src/base/bounded-page-allocator.h",
3458
    "src/base/build_config.h",
3459
    "src/base/compiler-specific.h",
3460 3461
    "src/base/cpu.cc",
    "src/base/cpu.h",
3462 3463
    "src/base/debug/stack_trace.cc",
    "src/base/debug/stack_trace.h",
3464 3465
    "src/base/division-by-constant.cc",
    "src/base/division-by-constant.h",
3466
    "src/base/enum-set.h",
3467
    "src/base/export-template.h",
3468 3469
    "src/base/file-utils.cc",
    "src/base/file-utils.h",
3470
    "src/base/flags.h",
3471
    "src/base/free_deleter.h",
3472 3473
    "src/base/functional.cc",
    "src/base/functional.h",
3474
    "src/base/hashmap-entry.h",
lpy's avatar
lpy committed
3475
    "src/base/hashmap.h",
3476 3477
    "src/base/ieee754.cc",
    "src/base/ieee754.h",
3478
    "src/base/iterator.h",
3479
    "src/base/lazy-instance.h",
3480
    "src/base/list.h",
3481 3482
    "src/base/logging.cc",
    "src/base/logging.h",
3483
    "src/base/lsan.h",
3484
    "src/base/macros.h",
3485
    "src/base/memory.h",
3486 3487
    "src/base/once.cc",
    "src/base/once.h",
3488
    "src/base/optional.h",
3489
    "src/base/overflowing-math.h",
3490 3491
    "src/base/page-allocator.cc",
    "src/base/page-allocator.h",
3492 3493
    "src/base/platform/condition-variable.cc",
    "src/base/platform/condition-variable.h",
jochen's avatar
jochen committed
3494
    "src/base/platform/elapsed-timer.h",
3495 3496 3497 3498 3499
    "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
3500 3501
    "src/base/platform/time.cc",
    "src/base/platform/time.h",
3502 3503
    "src/base/region-allocator.cc",
    "src/base/region-allocator.h",
3504
    "src/base/ring-buffer.h",
3505 3506
    "src/base/safe_conversions.h",
    "src/base/safe_conversions_impl.h",
3507
    "src/base/small-vector.h",
3508 3509
    "src/base/sys-info.cc",
    "src/base/sys-info.h",
3510
    "src/base/template-utils.h",
3511
    "src/base/timezone-cache.h",
3512
    "src/base/type-traits.h",
3513 3514
    "src/base/utils/random-number-generator.cc",
    "src/base/utils/random-number-generator.h",
3515 3516
    "src/base/vlq-base64.cc",
    "src/base/vlq-base64.h",
3517 3518
  ]

3519
  configs = [ ":internal_config_base" ]
3520

3521 3522
  public_configs = [ ":libbase_config" ]

3523 3524 3525 3526
  deps = [
    ":v8_headers",
  ]

Michael Achenbach's avatar
Michael Achenbach committed
3527 3528
  public_deps = []

3529 3530
  data = []

3531 3532
  data_deps = []

3533 3534
  defines = []

3535 3536 3537 3538
  if (is_component_build) {
    defines = [ "BUILDING_V8_BASE_SHARED" ]
  }

3539
  if (is_posix || is_fuchsia) {
3540 3541 3542 3543
    sources += [
      "src/base/platform/platform-posix.cc",
      "src/base/platform/platform-posix.h",
    ]
3544 3545 3546
    if (current_os != "aix") {
      sources += [
        "src/base/platform/platform-posix-time.cc",
3547
        "src/base/platform/platform-posix-time.h",
3548 3549
      ]
    }
3550 3551 3552
  }

  if (is_linux) {
3553 3554 3555 3556
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-linux.cc",
    ]
3557

jochen's avatar
jochen committed
3558 3559
    libs = [
      "dl",
3560 3561 3562 3563 3564 3565 3566 3567 3568 3569
      "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
3570 3571
      "rt",
    ]
3572
  } else if (is_android) {
3573
    if (current_toolchain == host_toolchain) {
jochen's avatar
jochen committed
3574 3575 3576 3577
      libs = [
        "dl",
        "rt",
      ]
3578
      if (host_os == "mac") {
3579 3580 3581 3582
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-macos.cc",
        ]
3583
      } else {
3584 3585 3586 3587
        sources += [
          "src/base/debug/stack_trace_posix.cc",
          "src/base/platform/platform-linux.cc",
        ]
3588 3589
      }
    } else {
3590 3591 3592 3593
      sources += [
        "src/base/debug/stack_trace_android.cc",
        "src/base/platform/platform-linux.cc",
      ]
3594
    }
3595 3596 3597 3598 3599
  } else if (is_fuchsia) {
    sources += [
      "src/base/debug/stack_trace_fuchsia.cc",
      "src/base/platform/platform-fuchsia.cc",
    ]
3600
  } else if (is_mac || is_ios) {
3601 3602 3603 3604
    sources += [
      "src/base/debug/stack_trace_posix.cc",
      "src/base/platform/platform-macos.cc",
    ]
3605 3606 3607
  } else if (is_win) {
    # TODO(jochen): Add support for cygwin.
    sources += [
3608
      "src/base/debug/stack_trace_win.cc",
3609
      "src/base/platform/platform-win32.cc",
3610
      "src/base/win32-headers.h",
3611 3612 3613 3614
    ]

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

3615
    libs = [
3616
      "dbghelp.lib",
3617 3618 3619
      "winmm.lib",
      "ws2_32.lib",
    ]
3620

3621
    data_deps += [ "//build/win:runtime_libs" ]
3622 3623
  }

3624 3625 3626 3627 3628 3629 3630 3631
  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",
    ]
  }

3632 3633 3634 3635
  if (is_tsan && !build_with_chromium) {
    data += [ "tools/sanitizers/tsan_suppressions.txt" ]
  }

3636
  # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
3637 3638
}

3639
v8_component("v8_libplatform") {
3640
  sources = [
3641
    "//base/trace_event/common/trace_event_common.h",
3642
    "include/libplatform/libplatform-export.h",
3643
    "include/libplatform/libplatform.h",
3644
    "include/libplatform/v8-tracing.h",
3645 3646
    "src/libplatform/default-foreground-task-runner.cc",
    "src/libplatform/default-foreground-task-runner.h",
3647 3648
    "src/libplatform/default-platform.cc",
    "src/libplatform/default-platform.h",
3649 3650
    "src/libplatform/default-worker-threads-task-runner.cc",
    "src/libplatform/default-worker-threads-task-runner.h",
3651 3652
    "src/libplatform/delayed-task-queue.cc",
    "src/libplatform/delayed-task-queue.h",
3653 3654
    "src/libplatform/task-queue.cc",
    "src/libplatform/task-queue.h",
3655 3656 3657 3658 3659 3660 3661
    "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",
3662 3663 3664 3665
    "src/libplatform/worker-thread.cc",
    "src/libplatform/worker-thread.h",
  ]

3666
  configs = [ ":internal_config_base" ]
3667

3668 3669 3670 3671
  if (is_component_build) {
    defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
  }

3672
  public_configs = [ ":libplatform_config" ]
3673

3674
  deps = [
3675
    ":v8_headers",
3676 3677
    ":v8_libbase",
  ]
3678
  if (v8_use_perfetto) {
3679
    sources += [
3680 3681
      "src/libplatform/tracing/json-trace-event-listener.cc",
      "src/libplatform/tracing/json-trace-event-listener.h",
3682
      "src/libplatform/tracing/trace-event-listener.cc",
3683
      "src/libplatform/tracing/trace-event-listener.h",
3684
    ]
3685
    deps += [
3686
      "//third_party/perfetto/protos/perfetto/trace:lite",
3687
      "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
3688 3689 3690
      "//third_party/perfetto/protos/perfetto/trace/chrome:zero",
      "//third_party/perfetto/src/tracing:client_api",
      "//third_party/perfetto/src/tracing:platform_posix",
3691
    ]
3692
  }
3693 3694
}

3695 3696
v8_source_set("v8_libsampler") {
  sources = [
3697 3698
    "src/libsampler/sampler.cc",
    "src/libsampler/sampler.h",
3699 3700
  ]

3701
  configs = [ ":internal_config" ]
3702 3703 3704 3705 3706 3707 3708 3709

  public_configs = [ ":libsampler_config" ]

  deps = [
    ":v8_libbase",
  ]
}

3710
v8_source_set("fuzzer_support") {
jochen's avatar
jochen committed
3711 3712 3713 3714 3715 3716 3717
  visibility = [ ":*" ]  # Only targets in this file can depend on this.

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

3718
  configs = [ ":internal_config_base" ]
jochen's avatar
jochen committed
3719

3720 3721 3722 3723 3724
  deps = [
    ":v8",
  ]

  public_deps = [
3725
    ":v8_libbase",
3726
    ":v8_libplatform",
3727
    ":v8_maybe_icu",
3728 3729 3730
  ]
}

3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753
###############################################################################
# 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" ]
  }
}

3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768
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 = [
3769
    ### gcmole(all) ###
3770
    "src/wasm/c-api.cc",
3771
    "src/wasm/c-api.h",
3772 3773
    "third_party/wasm-api/wasm.h",
    "third_party/wasm-api/wasm.hh",
3774 3775 3776
  ]
}

3777 3778 3779 3780
###############################################################################
# Executables
#

3781
if (current_toolchain == v8_generator_toolchain) {
3782
  v8_executable("bytecode_builtins_list_generator") {
3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794
    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",
    ]

3795 3796
    configs = [ ":internal_config" ]

3797 3798 3799 3800 3801 3802 3803
    deps = [
      ":v8_libbase",
      "//build/win:default_exe_manifest",
    ]
  }
}

3804
if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
3805
  v8_executable("mksnapshot") {
3806
    visibility = [ ":*" ]  # Only targets in this file can depend on this.
3807

3808
    sources = [
3809 3810
      "src/snapshot/embedded/embedded-file-writer.cc",
      "src/snapshot/embedded/embedded-file-writer.h",
3811 3812
      "src/snapshot/embedded/platform-embedded-file-writer-aix.cc",
      "src/snapshot/embedded/platform-embedded-file-writer-aix.h",
3813 3814 3815 3816
      "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",
3817 3818 3819 3820
      "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",
3821
      "src/snapshot/mksnapshot.cc",
3822
    ]
3823

3824
    configs = [ ":internal_config" ]
3825

3826
    deps = [
3827 3828
      ":v8_base_without_compiler",
      ":v8_compiler_for_mksnapshot",
3829
      ":v8_init",
3830
      ":v8_libbase",
3831
      ":v8_libplatform",
3832
      ":v8_nosnapshot",
3833
      "//build/win:default_exe_manifest",
3834
    ]
3835
  }
3836 3837
}

3838 3839 3840 3841 3842 3843 3844 3845 3846
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 = [
3847
      ":torque_base",
3848 3849 3850
      "//build/win:default_exe_manifest",
    ]

3851 3852 3853
    # 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.
3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864
    configs = [
      ":internal_config",
      "//build/config/compiler:exceptions",
      "//build/config/compiler:rtti",
    ]

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

3865
    if (is_win && is_asan) {
3866
      remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3867
    }
3868 3869 3870
  }
}

3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883
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",
  ]

3884 3885 3886
  # 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.
3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897
  configs = [
    ":internal_config",
    "//build/config/compiler:exceptions",
    "//build/config/compiler:rtti",
  ]

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

3898
  if (is_win && is_asan) {
3899
    remove_configs += [ "//build/config/sanitizers:default_sanitizer_flags" ]
3900 3901 3902
  }
}

3903 3904 3905 3906
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.
3907

3908 3909 3910
      sources = [
        "src/regexp/gen-regexp-special-case.cc",
      ]
3911

3912 3913 3914 3915 3916
      deps = [
        ":v8_libbase",
        "//build/win:default_exe_manifest",
        "//third_party/icu",
      ]
3917

3918 3919
      configs = [ ":internal_config" ]
    }
3920 3921
  }

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

3925
    script = "tools/run.py"
3926

3927
    sources = v8_extra_library_files
3928

3929 3930 3931
    deps = [
      ":gen-regexp-special-case($v8_generator_toolchain)",
    ]
3932

3933
    output_file = "$target_gen_dir/src/regexp/special-case.cc"
3934

3935 3936 3937
    outputs = [
      output_file,
    ]
3938

3939 3940 3941 3942 3943 3944 3945 3946 3947
    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),
    ]
  }
3948 3949
}

3950 3951 3952
###############################################################################
# Public targets
#
brettw's avatar
brettw committed
3953

3954
want_v8_shell =
machenbach's avatar
machenbach committed
3955 3956 3957
    (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") ||
    (current_toolchain == v8_snapshot_toolchain &&
     v8_toolset_for_shell == "host") ||
3958
    (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")
machenbach's avatar
machenbach committed
3959 3960 3961 3962 3963 3964

group("gn_all") {
  testonly = true

  deps = [
    ":d8",
3965
    ":v8_fuzzers",
jochen's avatar
jochen committed
3966 3967
    ":v8_hello_world",
    ":v8_sample_process",
3968 3969
    "test:gn_all",
    "tools:gn_all",
machenbach's avatar
machenbach committed
3970 3971
  ]

3972 3973 3974 3975 3976
  if (v8_custom_deps != "") {
    # Custom dependency from directory under v8/custom_deps.
    deps += [ v8_custom_deps ]
  }

machenbach's avatar
machenbach committed
3977
  if (want_v8_shell) {
3978
    deps += [ ":v8_shell" ]
machenbach's avatar
machenbach committed
3979 3980 3981
  }
}

3982 3983 3984 3985 3986 3987
group("v8_python_base") {
  data = [
    ".vpython",
  ]
}

3988
group("v8_clusterfuzz") {
3989 3990
  testonly = true

3991 3992 3993 3994 3995 3996 3997
  deps = [
    ":d8",
  ]

  if (v8_multi_arch_build) {
    deps += [
      ":d8(//build/toolchain/linux:clang_x64)",
3998
      ":d8(//build/toolchain/linux:clang_x64_v8_arm64)",
3999
      ":d8(//build/toolchain/linux:clang_x86)",
4000
      ":d8(//build/toolchain/linux:clang_x86_v8_arm)",
4001 4002 4003 4004
    ]
  }
}

4005
group("v8_archive") {
4006 4007
  testonly = true

4008 4009 4010
  deps = [
    ":d8",
  ]
4011 4012 4013 4014 4015

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

4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035
# 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"
  }
}

4036 4037
group("v8_fuzzers") {
  testonly = true
4038
  data_deps = [
4039
    ":v8_simple_json_fuzzer",
4040
    ":v8_simple_multi_return_fuzzer",
4041
    ":v8_simple_parser_fuzzer",
4042
    ":v8_simple_regexp_builtins_fuzzer",
4043
    ":v8_simple_regexp_fuzzer",
4044
    ":v8_simple_wasm_async_fuzzer",
4045
    ":v8_simple_wasm_code_fuzzer",
4046
    ":v8_simple_wasm_compile_fuzzer",
4047 4048 4049 4050
    ":v8_simple_wasm_fuzzer",
  ]
}

4051
if (is_component_build) {
4052
  v8_component("v8") {
4053
    sources = [
4054
      "src/utils/v8dll-main.cc",
4055
    ]
4056

4057 4058
    public_deps = [
      ":v8_base",
machenbach's avatar
machenbach committed
4059
      ":v8_maybe_snapshot",
4060
    ]
4061

4062
    configs = [ ":internal_config" ]
4063

4064
    public_configs = [ ":external_config" ]
4065
  }
4066 4067 4068 4069 4070

  v8_component("v8_for_testing") {
    testonly = true

    sources = [
4071
      "src/utils/v8dll-main.cc",
4072 4073 4074
    ]

    public_deps = [
4075
      ":torque_base",
4076
      ":torque_ls_base",
4077
      ":v8_base",
4078
      ":v8_headers",
4079 4080 4081 4082
      ":v8_maybe_snapshot",
    ]

    if (v8_use_snapshot) {
4083
      public_deps += [ ":v8_initializers" ]
4084 4085 4086 4087 4088 4089
    }

    configs = [ ":internal_config" ]

    public_configs = [ ":external_config" ]
  }
4090 4091
} else {
  group("v8") {
4092 4093
    public_deps = [
      ":v8_base",
machenbach's avatar
machenbach committed
4094
      ":v8_maybe_snapshot",
4095
    ]
4096

4097
    public_configs = [ ":external_config" ]
4098
  }
4099 4100 4101 4102 4103

  group("v8_for_testing") {
    testonly = true

    public_deps = [
4104
      ":torque_base",
4105
      ":torque_ls_base",
4106 4107 4108 4109 4110
      ":v8_base",
      ":v8_maybe_snapshot",
    ]

    if (v8_use_snapshot) {
4111
      public_deps += [ ":v8_initializers" ]
4112 4113 4114 4115
    }

    public_configs = [ ":external_config" ]
  }
4116
}
jochen's avatar
jochen committed
4117

4118
v8_executable("d8") {
4119
  sources = [
4120 4121 4122 4123 4124 4125 4126 4127 4128
    "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",
4129
  ]
jochen's avatar
jochen committed
4130

4131
  configs = [
4132 4133 4134 4135 4136
    # 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
4137

4138 4139
  deps = [
    ":v8",
4140
    ":v8_libbase",
4141 4142 4143
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
jochen's avatar
jochen committed
4144

4145
  if (is_posix || is_fuchsia) {
4146
    sources += [ "src/d8/d8-posix.cc" ]
4147
  } else if (is_win) {
4148
    sources += [ "src/d8/d8-windows.cc" ]
4149
  }
jochen's avatar
jochen committed
4150

4151
  if (v8_correctness_fuzzer) {
4152
    deps += [ "tools/clusterfuzz:v8_correctness_fuzzer_resources" ]
4153 4154
  }

4155
  defines = []
4156 4157

  if (v8_enable_vtunejit) {
4158
    deps += [ "src/third_party/vtune:v8_vtune" ]
4159
  }
4160 4161 4162 4163

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

jochen's avatar
jochen committed
4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179
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",
4180
    ":v8_libbase",
jochen's avatar
jochen committed
4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197
    ":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",
  ]

4198
  deps = [
4199
    ":v8",
4200
    ":v8_libbase",
4201 4202 4203 4204 4205
    ":v8_libplatform",
    "//build/win:default_exe_manifest",
  ]
}

machenbach's avatar
machenbach committed
4206
if (want_v8_shell) {
4207
  v8_executable("v8_shell") {
4208 4209 4210 4211
    sources = [
      "samples/shell.cc",
    ]

4212
    configs = [
4213 4214 4215 4216 4217 4218 4219 4220
      # 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",
4221
      ":v8_libbase",
4222 4223 4224 4225 4226 4227
      ":v8_libplatform",
      "//build/win:default_exe_manifest",
    ]
  }
}

machenbach's avatar
machenbach committed
4228 4229 4230
template("v8_fuzzer") {
  name = target_name
  forward_variables_from(invoker, "*")
4231
  v8_executable("v8_simple_" + name) {
machenbach's avatar
machenbach committed
4232 4233
    deps = [
      ":" + name,
4234
      "//build/win:default_exe_manifest",
machenbach's avatar
machenbach committed
4235 4236
    ]

4237 4238 4239 4240
    sources = [
      "test/fuzzer/fuzzer.cc",
    ]

4241
    configs = [ ":external_config" ]
machenbach's avatar
machenbach committed
4242 4243 4244
  }
}

4245
v8_source_set("json_fuzzer") {
jochen's avatar
jochen committed
4246 4247 4248 4249 4250 4251 4252 4253
  sources = [
    "test/fuzzer/json.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

4254 4255 4256 4257
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
jochen's avatar
jochen committed
4258 4259
}

4260 4261
v8_fuzzer("json_fuzzer") {
}
machenbach's avatar
machenbach committed
4262

4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280
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") {
}

4281
v8_source_set("parser_fuzzer") {
jochen's avatar
jochen committed
4282 4283 4284 4285 4286
  sources = [
    "test/fuzzer/parser.cc",
  ]

  deps = [
4287
    ":fuzzer_support",
jochen's avatar
jochen committed
4288 4289
  ]

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

4296 4297
v8_fuzzer("parser_fuzzer") {
}
machenbach's avatar
machenbach committed
4298

4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317
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") {
}

4318
v8_source_set("regexp_fuzzer") {
4319 4320 4321 4322 4323 4324 4325 4326
  sources = [
    "test/fuzzer/regexp.cc",
  ]

  deps = [
    ":fuzzer_support",
  ]

4327 4328 4329 4330
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4331
}
4332

4333 4334
v8_fuzzer("regexp_fuzzer") {
}
machenbach's avatar
machenbach committed
4335

4336 4337 4338 4339 4340 4341
v8_source_set("wasm_module_runner") {
  sources = [
    "test/common/wasm/wasm-module-runner.cc",
    "test/common/wasm/wasm-module-runner.h",
  ]

4342
  deps = [
4343
    ":generate_bytecode_builtins_list",
4344
    ":run_torque",
4345 4346
  ]

4347 4348 4349
  public_deps = [
    ":v8_maybe_icu",
  ]
4350

4351 4352 4353 4354
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4355 4356
}

4357
v8_source_set("wasm_fuzzer") {
4358 4359 4360 4361 4362 4363
  sources = [
    "test/fuzzer/wasm.cc",
  ]

  deps = [
    ":fuzzer_support",
4364
    ":lib_wasm_fuzzer_common",
4365
    ":wasm_module_runner",
4366 4367
  ]

4368 4369 4370 4371
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4372 4373
}

4374 4375
v8_fuzzer("wasm_fuzzer") {
}
machenbach's avatar
machenbach committed
4376

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

4397 4398
v8_source_set("wasm_code_fuzzer") {
  sources = [
4399
    "test/common/wasm/test-signatures.h",
4400 4401 4402 4403 4404
    "test/fuzzer/wasm-code.cc",
  ]

  deps = [
    ":fuzzer_support",
4405
    ":lib_wasm_fuzzer_common",
4406
    ":wasm_module_runner",
4407 4408
  ]

4409 4410 4411 4412
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4413 4414 4415 4416
}

v8_fuzzer("wasm_code_fuzzer") {
}
4417

4418
v8_source_set("lib_wasm_fuzzer_common") {
4419
  sources = [
4420 4421
    "test/fuzzer/wasm-fuzzer-common.cc",
    "test/fuzzer/wasm-fuzzer-common.h",
4422 4423
  ]

4424
  deps = [
4425
    ":generate_bytecode_builtins_list",
4426
    ":run_torque",
4427 4428
  ]

4429 4430 4431
  public_deps = [
    ":v8_maybe_icu",
  ]
4432

4433 4434 4435 4436
  configs = [
    ":external_config",
    ":internal_config_base",
  ]
4437 4438
}

4439 4440
v8_source_set("wasm_compile_fuzzer") {
  sources = [
4441
    "test/common/wasm/test-signatures.h",
4442 4443 4444 4445 4446
    "test/fuzzer/wasm-compile.cc",
  ]

  deps = [
    ":fuzzer_support",
4447
    ":lib_wasm_fuzzer_common",
4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458
    ":wasm_module_runner",
  ]

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

v8_fuzzer("wasm_compile_fuzzer") {
}
4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470

# 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",
  ]
}
4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487

# 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",
4488
      "-Wno-thread-safety-attributes",
4489
    ]
4490
    include_dirs = [ "third_party/protobuf/src" ]
4491 4492 4493 4494 4495 4496 4497
  }

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

4498 4499 4500
    if (!is_win) {
      defines = [ "HAVE_PTHREAD=1" ]
    }
4501 4502
    if (is_clang) {
      cflags = [
4503 4504 4505
        "-Wno-unused-private-field",
        "-Wno-unused-function",
        "-Wno-inconsistent-missing-override",
4506 4507 4508 4509 4510 4511
        "-Wno-unknown-warning-option",
        "-Wno-enum-compare-switch",
        "-Wno-user-defined-warnings",
        "-Wno-tautological-constant-compare",
      ]
    }
4512 4513 4514
    if (is_win) {
      cflags += [ "-Wno-microsoft-unqualified-friend" ]
    }
4515 4516 4517 4518
  }

  source_set("protobuf_lite") {
    sources = [
4519
      "third_party/protobuf/src/google/protobuf/any_lite.cc",
4520 4521
      "third_party/protobuf/src/google/protobuf/arena.cc",
      "third_party/protobuf/src/google/protobuf/extension_set.cc",
4522
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
4523
      "third_party/protobuf/src/google/protobuf/generated_message_util.cc",
4524
      "third_party/protobuf/src/google/protobuf/implicit_weak_message.cc",
4525
      "third_party/protobuf/src/google/protobuf/io/coded_stream.cc",
4526
      "third_party/protobuf/src/google/protobuf/io/strtod.cc",
4527 4528 4529 4530 4531 4532 4533
      "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",
4534
      "third_party/protobuf/src/google/protobuf/stubs/io_win32.cc",
4535 4536 4537 4538 4539 4540 4541 4542 4543 4544
      "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" ]
4545 4546 4547 4548
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4549 4550 4551
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574
    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",
4575
      "third_party/protobuf/src/google/protobuf/generated_message_table_driven.cc",
4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591
      "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",
4592
      "third_party/protobuf/src/google/protobuf/util/delimited_message_util.cc",
4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616
      "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" ]
4617 4618 4619 4620
    configs += [
      "//build/config/compiler:no_chromium_code",
      ":protobuf_config",
    ]
4621 4622 4623
    if (is_win) {
      configs -= [ "//build/config/win:lean_and_mean" ]
    }
4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644
    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",
4645
        "third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
4646 4647 4648 4649 4650 4651 4652 4653 4654
        "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" ]
4655 4656 4657 4658
      configs += [
        "//build/config/compiler:no_chromium_code",
        ":protobuf_config",
      ]
4659 4660 4661
      if (is_win) {
        configs -= [ "//build/config/win:lean_and_mean" ]
      }
4662 4663 4664 4665 4666 4667 4668 4669 4670
      public_configs = [ ":protobuf_gen_config" ]
    }

    executable("protoc") {
      deps = [
        ":protoc_lib",
        "//build/win:default_exe_manifest",
      ]
      sources = [
4671
        "src/protobuf/protobuf-compiler-main.cc",
4672 4673
      ]
      configs -= [ "//build/config/compiler:chromium_code" ]
4674
      configs += [ "//build/config/compiler:no_chromium_code" ]
4675 4676 4677
    }
  }  # host_toolchain
}  # if (!build_with_chromium && v8_use_perfetto)