65e51010182ff1a7b03eb26769b1cca118021c3b
[platform/upstream/v8.git] / BUILD.gn
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/android/config.gni")
6 import("//build/config/arm.gni")
7 import("//build/config/mips.gni")
8
9 # Because standalone V8 builds are not supported, assume this is part of a
10 # Chromium build.
11 import("//build/module_args/v8.gni")
12
13 # TODO(jochen): These will need to be user-settable to support standalone V8
14 # builds.
15 v8_deprecation_warnings = false
16 v8_enable_disassembler = false
17 v8_enable_gdbjit = false
18 v8_enable_handle_zapping = true
19 v8_enable_i18n_support = true
20 v8_enable_verify_heap = false
21 v8_interpreted_regexp = false
22 v8_object_print = false
23 v8_postmortem_support = false
24 v8_use_snapshot = true
25 v8_target_arch = target_cpu
26 v8_random_seed = "314159265"
27 v8_toolset_for_d8 = "host"
28
29 # The snapshot needs to be compiled for the host, but compiled with
30 # a toolchain that matches the bit-width of the target.
31 #
32 # TODO(GYP): For now we only support 32-bit little-endian target builds from an
33 # x64 Linux host. Eventually we need to support all of the host/target
34 # configurations v8 runs on.
35 if (host_cpu == "x64" && host_os == "linux") {
36   if (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86") {
37     snapshot_toolchain = "//build/toolchain/linux:clang_x86"
38   } else if (target_cpu == "x64") {
39     snapshot_toolchain = "//build/toolchain/linux:clang_x64"
40   } else {
41     assert(false, "Need environment for this arch")
42   }
43 } else {
44   snapshot_toolchain = default_toolchain
45 }
46
47 ###############################################################################
48 # Configurations
49 #
50 config("internal_config") {
51   visibility = [ ":*" ]  # Only targets in this file can depend on this.
52
53   include_dirs = [ "." ]
54
55   if (is_component_build) {
56     defines = [
57       "V8_SHARED",
58       "BUILDING_V8_SHARED",
59     ]
60   }
61 }
62
63 config("internal_config_base") {
64   visibility = [ ":*" ]  # Only targets in this file can depend on this.
65
66   include_dirs = [ "." ]
67 }
68
69 # This config should only be applied to code using V8 and not any V8 code
70 # itself.
71 config("external_config") {
72   if (is_component_build) {
73     defines = [
74       "V8_SHARED",
75       "USING_V8_SHARED",
76     ]
77   }
78   include_dirs = [ "include" ]
79 }
80
81 config("features") {
82   visibility = [ ":*" ]  # Only targets in this file can depend on this.
83
84   defines = []
85
86   if (v8_enable_disassembler == true) {
87     defines += [ "ENABLE_DISASSEMBLER" ]
88   }
89   if (v8_enable_gdbjit == true) {
90     defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
91   }
92   if (v8_object_print == true) {
93     defines += [ "OBJECT_PRINT" ]
94   }
95   if (v8_enable_verify_heap == true) {
96     defines += [ "VERIFY_HEAP" ]
97   }
98   if (v8_interpreted_regexp == true) {
99     defines += [ "V8_INTERPRETED_REGEXP" ]
100   }
101   if (v8_deprecation_warnings == true) {
102     defines += [ "V8_DEPRECATION_WARNINGS" ]
103   }
104   if (v8_enable_i18n_support == true) {
105     defines += [ "V8_I18N_SUPPORT" ]
106   }
107   if (v8_enable_handle_zapping == true) {
108     defines += [ "ENABLE_HANDLE_ZAPPING" ]
109   }
110   if (v8_use_external_startup_data == true) {
111     defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
112   }
113 }
114
115 config("toolchain") {
116   visibility = [ ":*" ]  # Only targets in this file can depend on this.
117
118   defines = []
119   cflags = []
120
121   # TODO(jochen): Add support for arm subarchs, mips, mipsel, mips64el.
122
123   if (v8_target_arch == "arm") {
124     defines += [ "V8_TARGET_ARCH_ARM" ]
125     if (current_cpu == "arm") {
126       if (arm_version == 7) {
127         defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
128       }
129       if (arm_fpu == "vfpv3-d16") {
130         defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
131       } else if (arm_fpu == "vfpv3") {
132         defines += [
133           "CAN_USE_VFP3_INSTRUCTIONS",
134           "CAN_USE_VFP32DREGS",
135         ]
136       } else if (arm_fpu == "neon") {
137         defines += [
138           "CAN_USE_VFP3_INSTRUCTIONS",
139           "CAN_USE_VFP32DREGS",
140           "CAN_USE_NEON",
141         ]
142       }
143     } else {
144       # These defines ares used for the ARM simulator.
145       defines += [
146         "CAN_USE_ARMV7_INSTRUCTIONS",
147         "CAN_USE_VFP3_INSTRUCTIONS",
148         "CAN_USE_VFP32DREGS",
149         "USE_EABI_HARDFLOAT=0",
150       ]
151     }
152
153     # TODO(jochen): Add support for arm_test_noprobe.
154   }
155   if (v8_target_arch == "arm64") {
156     defines += [ "V8_TARGET_ARCH_ARM64" ]
157   }
158   if (v8_target_arch == "mipsel") {
159     defines += [ "V8_TARGET_ARCH_MIPS" ]
160   }
161   if (v8_target_arch == "mips64el") {
162     defines += [ "V8_TARGET_ARCH_MIPS64" ]
163   }
164   if (v8_target_arch == "x86") {
165     defines += [ "V8_TARGET_ARCH_IA32" ]
166   }
167   if (v8_target_arch == "x64") {
168     defines += [ "V8_TARGET_ARCH_X64" ]
169   }
170   if (is_win) {
171     defines += [ "WIN32" ]
172     # TODO(jochen): Support v8_enable_prof.
173   }
174
175   # TODO(jochen): Add support for compiling with simulators.
176
177   if (is_debug) {
178     # TODO(jochen): Add support for different debug optimization levels.
179     defines += [
180       "ENABLE_DISASSEMBLER",
181       "V8_ENABLE_CHECKS",
182       "OBJECT_PRINT",
183       "VERIFY_HEAP",
184       "DEBUG",
185       "OPTIMIZED_DEBUG",
186     ]
187   }
188 }
189
190 ###############################################################################
191 # Actions
192 #
193
194 action("js2c") {
195   visibility = [ ":*" ]  # Only targets in this file can depend on this.
196
197   script = "tools/js2c.py"
198
199   # The script depends on this other script, this rule causes a rebuild if it
200   # changes.
201   inputs = [ "tools/jsmin.py" ]
202
203   sources = [
204     "src/macros.py",
205     "src/messages.h",
206     "src/runtime.js",
207     "src/prologue.js",
208     "src/v8natives.js",
209     "src/symbol.js",
210     "src/array.js",
211     "src/string.js",
212     "src/uri.js",
213     "src/math.js",
214     "src/third_party/fdlibm/fdlibm.js",
215     "src/date.js",
216     "src/regexp.js",
217     "src/arraybuffer.js",
218     "src/typedarray.js",
219     "src/iterator-prototype.js",
220     "src/generator.js",
221     "src/object-observe.js",
222     "src/collection.js",
223     "src/weak-collection.js",
224     "src/collection-iterator.js",
225     "src/promise.js",
226     "src/messages.js",
227     "src/json.js",
228     "src/array-iterator.js",
229     "src/string-iterator.js",
230     "src/debug-debugger.js",
231     "src/mirror-debugger.js",
232     "src/liveedit-debugger.js",
233     "src/templates.js",
234     "src/harmony-array.js",
235     "src/harmony-typedarray.js",
236   ]
237
238   outputs = [
239     "$target_gen_dir/libraries.cc",
240   ]
241
242   if (v8_enable_i18n_support) {
243     sources += [ "src/i18n.js" ]
244   }
245
246   args = [
247            rebase_path("$target_gen_dir/libraries.cc", root_build_dir),
248            "CORE",
249          ] + rebase_path(sources, root_build_dir)
250
251   if (v8_use_external_startup_data) {
252     outputs += [ "$target_gen_dir/libraries.bin" ]
253     args += [
254       "--startup_blob",
255       rebase_path("$target_gen_dir/libraries.bin", root_build_dir),
256     ]
257   }
258 }
259
260 action("js2c_code_stubs") {
261   visibility = [ ":*" ]  # Only targets in this file can depend on this.
262
263   script = "tools/js2c.py"
264
265   # The script depends on this other script, this rule causes a rebuild if it
266   # changes.
267   inputs = [ "tools/jsmin.py" ]
268
269   sources = [
270     "src/macros.py",
271     "src/messages.h",
272     "src/code-stubs.js"
273   ]
274
275   outputs = [
276     "$target_gen_dir/code-stub-libraries.cc",
277   ]
278
279   args = [
280            rebase_path("$target_gen_dir/code-stub-libraries.cc",
281                        root_build_dir),
282            "CODE_STUB",
283          ] + rebase_path(sources, root_build_dir)
284
285   if (v8_use_external_startup_data) {
286     outputs += [ "$target_gen_dir/libraries_code_stub.bin" ]
287     args += [
288       "--startup_blob",
289       rebase_path("$target_gen_dir/libraries_code_stub.bin", root_build_dir),
290     ]
291   }
292 }
293
294 action("js2c_experimental") {
295   visibility = [ ":*" ]  # Only targets in this file can depend on this.
296
297   script = "tools/js2c.py"
298
299   # The script depends on this other script, this rule causes a rebuild if it
300   # changes.
301   inputs = [ "tools/jsmin.py" ]
302
303   sources = [
304     "src/macros.py",
305     "src/messages.h",
306     "src/proxy.js",
307     "src/generator.js",
308     "src/harmony-atomics.js",
309     "src/harmony-array-includes.js",
310     "src/harmony-concat-spreadable.js",
311     "src/harmony-tostring.js",
312     "src/harmony-regexp.js",
313     "src/harmony-reflect.js",
314     "src/harmony-spread.js",
315     "src/harmony-object.js",
316     "src/harmony-sharedarraybuffer.js",
317     "src/harmony-simd.js"
318   ]
319
320   outputs = [
321     "$target_gen_dir/experimental-libraries.cc",
322   ]
323
324   args = [
325            rebase_path("$target_gen_dir/experimental-libraries.cc",
326                        root_build_dir),
327            "EXPERIMENTAL",
328          ] + rebase_path(sources, root_build_dir)
329
330   if (v8_use_external_startup_data) {
331     outputs += [ "$target_gen_dir/libraries_experimental.bin" ]
332     args += [
333       "--startup_blob",
334       rebase_path("$target_gen_dir/libraries_experimental.bin", root_build_dir),
335     ]
336   }
337 }
338
339 action("js2c_extras") {
340   visibility = [ ":*" ]  # Only targets in this file can depend on this.
341
342   script = "tools/js2c.py"
343
344   # The script depends on this other script, this rule causes a rebuild if it
345   # changes.
346   inputs = [ "tools/jsmin.py" ]
347
348   sources = v8_extra_library_files
349
350   outputs = [
351     "$target_gen_dir/extras-libraries.cc",
352   ]
353
354   args = [
355            rebase_path("$target_gen_dir/extras-libraries.cc",
356                        root_build_dir),
357            "EXTRAS",
358          ] + rebase_path(sources, root_build_dir)
359
360   if (v8_use_external_startup_data) {
361     outputs += [ "$target_gen_dir/libraries_extras.bin" ]
362     args += [
363       "--startup_blob",
364       rebase_path("$target_gen_dir/libraries_extras.bin", root_build_dir),
365     ]
366   }
367 }
368
369 action("d8_js2c") {
370   visibility = [ ":*" ]  # Only targets in this file can depend on this.
371
372   script = "tools/js2c.py"
373
374   inputs = [
375     "src/d8.js",
376     "src/macros.py",
377   ]
378
379   outputs = [
380     "$target_gen_dir/d8-js.cc",
381   ]
382
383   args = rebase_path(outputs, root_build_dir) + [ "D8" ] +
384          rebase_path(inputs, root_build_dir)
385 }
386
387 if (v8_use_external_startup_data) {
388   action("natives_blob") {
389     visibility = [ ":*" ]  # Only targets in this file can depend on this.
390
391     deps = [
392       ":js2c",
393       ":js2c_code_stubs",
394       ":js2c_experimental",
395       ":js2c_extras",
396     ]
397
398     sources = [
399       "$target_gen_dir/libraries.bin",
400       "$target_gen_dir/libraries_code_stub.bin",
401       "$target_gen_dir/libraries_experimental.bin",
402       "$target_gen_dir/libraries_extras.bin",
403     ]
404
405     outputs = [
406       "$root_out_dir/natives_blob.bin",
407     ]
408
409     script = "tools/concatenate-files.py"
410
411     args = rebase_path(sources + outputs, root_build_dir)
412   }
413 }
414
415 action("postmortem-metadata") {
416   # Only targets in this file and the top-level visibility target can
417   # depend on this.
418   visibility = [
419     ":*",
420     "//:gn_visibility",
421   ]
422
423   script = "tools/gen-postmortem-metadata.py"
424
425   sources = [
426     "src/objects.h",
427     "src/objects-inl.h",
428   ]
429
430   outputs = [
431     "$target_gen_dir/debug-support.cc",
432   ]
433
434   args = rebase_path(outputs, root_build_dir) +
435          rebase_path(sources, root_build_dir)
436 }
437
438 action("run_mksnapshot") {
439   visibility = [ ":*" ]  # Only targets in this file can depend on this.
440
441   deps = [
442     ":mksnapshot($snapshot_toolchain)",
443   ]
444
445   script = "tools/run.py"
446
447   outputs = [
448     "$target_gen_dir/snapshot.cc",
449   ]
450
451   args = [
452     "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)",
453                                       "root_out_dir") + "/mksnapshot",
454                        root_build_dir),
455     "--log-snapshot-positions",
456     "--logfile",
457     rebase_path("$target_gen_dir/snapshot.log", root_build_dir),
458     rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
459   ]
460
461   if (v8_random_seed != "0") {
462     args += [
463       "--random-seed",
464       v8_random_seed,
465     ]
466   }
467
468   if (v8_use_external_startup_data) {
469     outputs += [ "$root_out_dir/snapshot_blob.bin" ]
470     args += [
471       "--startup_blob",
472       rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir),
473     ]
474   }
475 }
476
477 ###############################################################################
478 # Source Sets (aka static libraries)
479 #
480
481 source_set("v8_nosnapshot") {
482   visibility = [ ":*" ]  # Only targets in this file can depend on this.
483
484   deps = [
485     ":js2c",
486     ":js2c_code_stubs",
487     ":js2c_experimental",
488     ":js2c_extras",
489     ":v8_base",
490   ]
491
492   sources = [
493     "$target_gen_dir/libraries.cc",
494     "$target_gen_dir/code-stub-libraries.cc",
495     "$target_gen_dir/experimental-libraries.cc",
496     "$target_gen_dir/extras-libraries.cc",
497     "src/snapshot/snapshot-empty.cc",
498   ]
499
500   configs -= [ "//build/config/compiler:chromium_code" ]
501   configs += [ "//build/config/compiler:no_chromium_code" ]
502   configs += [
503     ":internal_config",
504     ":features",
505     ":toolchain",
506   ]
507 }
508
509 source_set("v8_snapshot") {
510   # Only targets in this file and the top-level visibility target can
511   # depend on this.
512   visibility = [
513     ":*",
514     "//:gn_visibility",
515   ]
516
517   deps = [
518     ":js2c",
519     ":js2c_code_stubs",
520     ":js2c_experimental",
521     ":js2c_extras",
522     ":v8_base",
523   ]
524   public_deps = [
525     # This should be public so downstream targets can declare the snapshot
526     # output file as their inputs.
527     ":run_mksnapshot",
528   ]
529
530   sources = [
531     "$target_gen_dir/libraries.cc",
532     "$target_gen_dir/code-stub-libraries.cc",
533     "$target_gen_dir/experimental-libraries.cc",
534     "$target_gen_dir/extras-libraries.cc",
535     "$target_gen_dir/snapshot.cc",
536   ]
537
538   configs -= [ "//build/config/compiler:chromium_code" ]
539   configs += [ "//build/config/compiler:no_chromium_code" ]
540   configs += [
541     ":internal_config",
542     ":features",
543     ":toolchain",
544   ]
545 }
546
547 if (v8_use_external_startup_data) {
548   source_set("v8_external_snapshot") {
549     visibility = [ ":*" ]  # Only targets in this file can depend on this.
550
551     deps = [
552       ":js2c",
553       ":js2c_code_stubs",
554       ":js2c_experimental",
555       ":js2c_extras",
556       ":v8_base",
557     ]
558     public_deps = [
559       ":natives_blob",
560       ":run_mksnapshot",
561     ]
562
563     sources = [
564       "src/snapshot/natives-external.cc",
565       "src/snapshot/snapshot-external.cc",
566     ]
567
568     configs -= [ "//build/config/compiler:chromium_code" ]
569     configs += [ "//build/config/compiler:no_chromium_code" ]
570     configs += [
571       ":internal_config",
572       ":features",
573       ":toolchain",
574     ]
575   }
576 }
577
578 source_set("v8_base") {
579   visibility = [ ":*" ]  # Only targets in this file can depend on this.
580
581   sources = [
582     "include/v8-debug.h",
583     "include/v8-platform.h",
584     "include/v8-profiler.h",
585     "include/v8-testing.h",
586     "include/v8-util.h",
587     "include/v8-version.h",
588     "include/v8.h",
589     "include/v8config.h",
590     "src/accessors.cc",
591     "src/accessors.h",
592     "src/allocation.cc",
593     "src/allocation.h",
594     "src/allocation-site-scopes.cc",
595     "src/allocation-site-scopes.h",
596     "src/allocation-tracker.cc",
597     "src/allocation-tracker.h",
598     "src/api.cc",
599     "src/api.h",
600     "src/api-natives.cc",
601     "src/api-natives.h",
602     "src/arguments.cc",
603     "src/arguments.h",
604     "src/assembler.cc",
605     "src/assembler.h",
606     "src/assert-scope.h",
607     "src/assert-scope.cc",
608     "src/ast-literal-reindexer.cc",
609     "src/ast-literal-reindexer.h",
610     "src/ast-numbering.cc",
611     "src/ast-numbering.h",
612     "src/ast-value-factory.cc",
613     "src/ast-value-factory.h",
614     "src/ast.cc",
615     "src/ast.h",
616     "src/background-parsing-task.cc",
617     "src/background-parsing-task.h",
618     "src/bailout-reason.cc",
619     "src/bailout-reason.h",
620     "src/basic-block-profiler.cc",
621     "src/basic-block-profiler.h",
622     "src/bignum-dtoa.cc",
623     "src/bignum-dtoa.h",
624     "src/bignum.cc",
625     "src/bignum.h",
626     "src/bit-vector.cc",
627     "src/bit-vector.h",
628     "src/bootstrapper.cc",
629     "src/bootstrapper.h",
630     "src/builtins.cc",
631     "src/builtins.h",
632     "src/bytecodes-irregexp.h",
633     "src/cached-powers.cc",
634     "src/cached-powers.h",
635     "src/char-predicates.cc",
636     "src/char-predicates-inl.h",
637     "src/char-predicates.h",
638     "src/checks.cc",
639     "src/checks.h",
640     "src/circular-queue-inl.h",
641     "src/circular-queue.h",
642     "src/code-factory.cc",
643     "src/code-factory.h",
644     "src/code-stubs.cc",
645     "src/code-stubs.h",
646     "src/code-stubs-hydrogen.cc",
647     "src/code.h",
648     "src/codegen.cc",
649     "src/codegen.h",
650     "src/compilation-cache.cc",
651     "src/compilation-cache.h",
652     "src/compilation-dependencies.cc",
653     "src/compilation-dependencies.h",
654     "src/compilation-statistics.cc",
655     "src/compilation-statistics.h",
656     "src/compiler/access-builder.cc",
657     "src/compiler/access-builder.h",
658     "src/compiler/all-nodes.cc",
659     "src/compiler/all-nodes.h",
660     "src/compiler/ast-graph-builder.cc",
661     "src/compiler/ast-graph-builder.h",
662     "src/compiler/ast-loop-assignment-analyzer.cc",
663     "src/compiler/ast-loop-assignment-analyzer.h",
664     "src/compiler/basic-block-instrumentor.cc",
665     "src/compiler/basic-block-instrumentor.h",
666     "src/compiler/change-lowering.cc",
667     "src/compiler/change-lowering.h",
668     "src/compiler/coalesced-live-ranges.cc",
669     "src/compiler/coalesced-live-ranges.h",
670     "src/compiler/code-generator-impl.h",
671     "src/compiler/code-generator.cc",
672     "src/compiler/code-generator.h",
673     "src/compiler/common-node-cache.cc",
674     "src/compiler/common-node-cache.h",
675     "src/compiler/common-operator-reducer.cc",
676     "src/compiler/common-operator-reducer.h",
677     "src/compiler/common-operator.cc",
678     "src/compiler/common-operator.h",
679     "src/compiler/control-builders.cc",
680     "src/compiler/control-builders.h",
681     "src/compiler/control-equivalence.cc",
682     "src/compiler/control-equivalence.h",
683     "src/compiler/control-flow-optimizer.cc",
684     "src/compiler/control-flow-optimizer.h",
685     "src/compiler/dead-code-elimination.cc",
686     "src/compiler/dead-code-elimination.h",
687     "src/compiler/diamond.h",
688     "src/compiler/frame.h",
689     "src/compiler/frame-elider.cc",
690     "src/compiler/frame-elider.h",
691     "src/compiler/frame-states.cc",
692     "src/compiler/frame-states.h",
693     "src/compiler/gap-resolver.cc",
694     "src/compiler/gap-resolver.h",
695     "src/compiler/graph-builder.h",
696     "src/compiler/graph-reducer.cc",
697     "src/compiler/graph-reducer.h",
698     "src/compiler/graph-replay.cc",
699     "src/compiler/graph-replay.h",
700     "src/compiler/graph-trimmer.cc",
701     "src/compiler/graph-trimmer.h",
702     "src/compiler/graph-visualizer.cc",
703     "src/compiler/graph-visualizer.h",
704     "src/compiler/graph.cc",
705     "src/compiler/graph.h",
706     "src/compiler/greedy-allocator.cc",
707     "src/compiler/greedy-allocator.h",
708     "src/compiler/instruction-codes.h",
709     "src/compiler/instruction-selector-impl.h",
710     "src/compiler/instruction-selector.cc",
711     "src/compiler/instruction-selector.h",
712     "src/compiler/instruction.cc",
713     "src/compiler/instruction.h",
714     "src/compiler/js-builtin-reducer.cc",
715     "src/compiler/js-builtin-reducer.h",
716     "src/compiler/js-context-specialization.cc",
717     "src/compiler/js-context-specialization.h",
718     "src/compiler/js-frame-specialization.cc",
719     "src/compiler/js-frame-specialization.h",
720     "src/compiler/js-generic-lowering.cc",
721     "src/compiler/js-generic-lowering.h",
722     "src/compiler/js-graph.cc",
723     "src/compiler/js-graph.h",
724     "src/compiler/js-inlining.cc",
725     "src/compiler/js-inlining.h",
726     "src/compiler/js-intrinsic-lowering.cc",
727     "src/compiler/js-intrinsic-lowering.h",
728     "src/compiler/js-operator.cc",
729     "src/compiler/js-operator.h",
730     "src/compiler/js-type-feedback.cc",
731     "src/compiler/js-type-feedback.h",
732     "src/compiler/js-type-feedback-lowering.cc",
733     "src/compiler/js-type-feedback-lowering.h",
734     "src/compiler/js-typed-lowering.cc",
735     "src/compiler/js-typed-lowering.h",
736     "src/compiler/jump-threading.cc",
737     "src/compiler/jump-threading.h",
738     "src/compiler/linkage-impl.h",
739     "src/compiler/linkage.cc",
740     "src/compiler/linkage.h",
741     "src/compiler/liveness-analyzer.cc",
742     "src/compiler/liveness-analyzer.h",
743     "src/compiler/load-elimination.cc",
744     "src/compiler/load-elimination.h",
745     "src/compiler/loop-peeling.cc",
746     "src/compiler/loop-analysis.cc",
747     "src/compiler/loop-analysis.h",
748     "src/compiler/machine-operator-reducer.cc",
749     "src/compiler/machine-operator-reducer.h",
750     "src/compiler/machine-operator.cc",
751     "src/compiler/machine-operator.h",
752     "src/compiler/machine-type.cc",
753     "src/compiler/machine-type.h",
754     "src/compiler/move-optimizer.cc",
755     "src/compiler/move-optimizer.h",
756     "src/compiler/node-aux-data.h",
757     "src/compiler/node-cache.cc",
758     "src/compiler/node-cache.h",
759     "src/compiler/node-marker.cc",
760     "src/compiler/node-marker.h",
761     "src/compiler/node-matchers.cc",
762     "src/compiler/node-matchers.h",
763     "src/compiler/node-properties.cc",
764     "src/compiler/node-properties.h",
765     "src/compiler/node.cc",
766     "src/compiler/node.h",
767     "src/compiler/opcodes.cc",
768     "src/compiler/opcodes.h",
769     "src/compiler/operator-properties.cc",
770     "src/compiler/operator-properties.h",
771     "src/compiler/operator.cc",
772     "src/compiler/operator.h",
773     "src/compiler/osr.cc",
774     "src/compiler/osr.h",
775     "src/compiler/pipeline.cc",
776     "src/compiler/pipeline.h",
777     "src/compiler/pipeline-statistics.cc",
778     "src/compiler/pipeline-statistics.h",
779     "src/compiler/raw-machine-assembler.cc",
780     "src/compiler/raw-machine-assembler.h",
781     "src/compiler/register-allocator.cc",
782     "src/compiler/register-allocator.h",
783     "src/compiler/register-allocator-verifier.cc",
784     "src/compiler/register-allocator-verifier.h",
785     "src/compiler/register-configuration.cc",
786     "src/compiler/register-configuration.h",
787     "src/compiler/representation-change.h",
788     "src/compiler/schedule.cc",
789     "src/compiler/schedule.h",
790     "src/compiler/scheduler.cc",
791     "src/compiler/scheduler.h",
792     "src/compiler/select-lowering.cc",
793     "src/compiler/select-lowering.h",
794     "src/compiler/simplified-lowering.cc",
795     "src/compiler/simplified-lowering.h",
796     "src/compiler/simplified-operator-reducer.cc",
797     "src/compiler/simplified-operator-reducer.h",
798     "src/compiler/simplified-operator.cc",
799     "src/compiler/simplified-operator.h",
800     "src/compiler/source-position.cc",
801     "src/compiler/source-position.h",
802     "src/compiler/state-values-utils.cc",
803     "src/compiler/state-values-utils.h",
804     "src/compiler/tail-call-optimization.cc",
805     "src/compiler/tail-call-optimization.h",
806     "src/compiler/typer.cc",
807     "src/compiler/typer.h",
808     "src/compiler/value-numbering-reducer.cc",
809     "src/compiler/value-numbering-reducer.h",
810     "src/compiler/verifier.cc",
811     "src/compiler/verifier.h",
812     "src/compiler/zone-pool.cc",
813     "src/compiler/zone-pool.h",
814     "src/compiler.cc",
815     "src/compiler.h",
816     "src/contexts.cc",
817     "src/contexts.h",
818     "src/conversions-inl.h",
819     "src/conversions.cc",
820     "src/conversions.h",
821     "src/counters.cc",
822     "src/counters.h",
823     "src/cpu-profiler-inl.h",
824     "src/cpu-profiler.cc",
825     "src/cpu-profiler.h",
826     "src/date.cc",
827     "src/date.h",
828     "src/dateparser-inl.h",
829     "src/dateparser.cc",
830     "src/dateparser.h",
831     "src/debug.cc",
832     "src/debug.h",
833     "src/deoptimizer.cc",
834     "src/deoptimizer.h",
835     "src/disasm.h",
836     "src/disassembler.cc",
837     "src/disassembler.h",
838     "src/diy-fp.cc",
839     "src/diy-fp.h",
840     "src/double.h",
841     "src/dtoa.cc",
842     "src/dtoa.h",
843     "src/effects.h",
844     "src/elements-kind.cc",
845     "src/elements-kind.h",
846     "src/elements.cc",
847     "src/elements.h",
848     "src/execution.cc",
849     "src/execution.h",
850     "src/expression-classifier.h",
851     "src/extensions/externalize-string-extension.cc",
852     "src/extensions/externalize-string-extension.h",
853     "src/extensions/free-buffer-extension.cc",
854     "src/extensions/free-buffer-extension.h",
855     "src/extensions/gc-extension.cc",
856     "src/extensions/gc-extension.h",
857     "src/extensions/statistics-extension.cc",
858     "src/extensions/statistics-extension.h",
859     "src/extensions/trigger-failure-extension.cc",
860     "src/extensions/trigger-failure-extension.h",
861     "src/factory.cc",
862     "src/factory.h",
863     "src/fast-dtoa.cc",
864     "src/fast-dtoa.h",
865     "src/field-index.h",
866     "src/field-index-inl.h",
867     "src/fixed-dtoa.cc",
868     "src/fixed-dtoa.h",
869     "src/flag-definitions.h",
870     "src/flags.cc",
871     "src/flags.h",
872     "src/frames-inl.h",
873     "src/frames.cc",
874     "src/frames.h",
875     "src/full-codegen.cc",
876     "src/full-codegen.h",
877     "src/func-name-inferrer.cc",
878     "src/func-name-inferrer.h",
879     "src/gdb-jit.cc",
880     "src/gdb-jit.h",
881     "src/global-handles.cc",
882     "src/global-handles.h",
883     "src/globals.h",
884     "src/handles-inl.h",
885     "src/handles.cc",
886     "src/handles.h",
887     "src/hashmap.h",
888     "src/heap-profiler.cc",
889     "src/heap-profiler.h",
890     "src/heap-snapshot-generator-inl.h",
891     "src/heap-snapshot-generator.cc",
892     "src/heap-snapshot-generator.h",
893     "src/heap/gc-idle-time-handler.cc",
894     "src/heap/gc-idle-time-handler.h",
895     "src/heap/gc-tracer.cc",
896     "src/heap/gc-tracer.h",
897     "src/heap/heap-inl.h",
898     "src/heap/heap.cc",
899     "src/heap/heap.h",
900     "src/heap/identity-map.cc",
901     "src/heap/identity-map.h",
902     "src/heap/incremental-marking.cc",
903     "src/heap/incremental-marking.h",
904     "src/heap/mark-compact-inl.h",
905     "src/heap/mark-compact.cc",
906     "src/heap/mark-compact.h",
907     "src/heap/memory-reducer.cc",
908     "src/heap/memory-reducer.h",
909     "src/heap/objects-visiting-inl.h",
910     "src/heap/objects-visiting.cc",
911     "src/heap/objects-visiting.h",
912     "src/heap/spaces-inl.h",
913     "src/heap/spaces.cc",
914     "src/heap/spaces.h",
915     "src/heap/store-buffer-inl.h",
916     "src/heap/store-buffer.cc",
917     "src/heap/store-buffer.h",
918     "src/hydrogen-alias-analysis.h",
919     "src/hydrogen-bce.cc",
920     "src/hydrogen-bce.h",
921     "src/hydrogen-bch.cc",
922     "src/hydrogen-bch.h",
923     "src/hydrogen-canonicalize.cc",
924     "src/hydrogen-canonicalize.h",
925     "src/hydrogen-check-elimination.cc",
926     "src/hydrogen-check-elimination.h",
927     "src/hydrogen-dce.cc",
928     "src/hydrogen-dce.h",
929     "src/hydrogen-dehoist.cc",
930     "src/hydrogen-dehoist.h",
931     "src/hydrogen-environment-liveness.cc",
932     "src/hydrogen-environment-liveness.h",
933     "src/hydrogen-escape-analysis.cc",
934     "src/hydrogen-escape-analysis.h",
935     "src/hydrogen-flow-engine.h",
936     "src/hydrogen-instructions.cc",
937     "src/hydrogen-instructions.h",
938     "src/hydrogen.cc",
939     "src/hydrogen.h",
940     "src/hydrogen-gvn.cc",
941     "src/hydrogen-gvn.h",
942     "src/hydrogen-infer-representation.cc",
943     "src/hydrogen-infer-representation.h",
944     "src/hydrogen-infer-types.cc",
945     "src/hydrogen-infer-types.h",
946     "src/hydrogen-load-elimination.cc",
947     "src/hydrogen-load-elimination.h",
948     "src/hydrogen-mark-deoptimize.cc",
949     "src/hydrogen-mark-deoptimize.h",
950     "src/hydrogen-mark-unreachable.cc",
951     "src/hydrogen-mark-unreachable.h",
952     "src/hydrogen-osr.cc",
953     "src/hydrogen-osr.h",
954     "src/hydrogen-range-analysis.cc",
955     "src/hydrogen-range-analysis.h",
956     "src/hydrogen-redundant-phi.cc",
957     "src/hydrogen-redundant-phi.h",
958     "src/hydrogen-removable-simulates.cc",
959     "src/hydrogen-removable-simulates.h",
960     "src/hydrogen-representation-changes.cc",
961     "src/hydrogen-representation-changes.h",
962     "src/hydrogen-sce.cc",
963     "src/hydrogen-sce.h",
964     "src/hydrogen-store-elimination.cc",
965     "src/hydrogen-store-elimination.h",
966     "src/hydrogen-types.cc",
967     "src/hydrogen-types.h",
968     "src/hydrogen-uint32-analysis.cc",
969     "src/hydrogen-uint32-analysis.h",
970     "src/i18n.cc",
971     "src/i18n.h",
972     "src/icu_util.cc",
973     "src/icu_util.h",
974     "src/ic/access-compiler.cc",
975     "src/ic/access-compiler.h",
976     "src/ic/call-optimization.cc",
977     "src/ic/call-optimization.h",
978     "src/ic/handler-compiler.cc",
979     "src/ic/handler-compiler.h",
980     "src/ic/ic-inl.h",
981     "src/ic/ic-state.cc",
982     "src/ic/ic-state.h",
983     "src/ic/ic.cc",
984     "src/ic/ic.h",
985     "src/ic/ic-compiler.cc",
986     "src/ic/ic-compiler.h",
987     "src/ic/stub-cache.cc",
988     "src/ic/stub-cache.h",
989     "src/interface-descriptors.cc",
990     "src/interface-descriptors.h",
991     "src/interpreter-irregexp.cc",
992     "src/interpreter-irregexp.h",
993     "src/isolate.cc",
994     "src/isolate.h",
995     "src/json-parser.h",
996     "src/json-stringifier.h",
997     "src/jsregexp-inl.h",
998     "src/jsregexp.cc",
999     "src/jsregexp.h",
1000     "src/layout-descriptor-inl.h",
1001     "src/layout-descriptor.cc",
1002     "src/layout-descriptor.h",
1003     "src/list-inl.h",
1004     "src/list.h",
1005     "src/lithium-allocator-inl.h",
1006     "src/lithium-allocator.cc",
1007     "src/lithium-allocator.h",
1008     "src/lithium-codegen.cc",
1009     "src/lithium-codegen.h",
1010     "src/lithium.cc",
1011     "src/lithium.h",
1012     "src/liveedit.cc",
1013     "src/liveedit.h",
1014     "src/log-inl.h",
1015     "src/log-utils.cc",
1016     "src/log-utils.h",
1017     "src/log.cc",
1018     "src/log.h",
1019     "src/lookup-inl.h",
1020     "src/lookup.cc",
1021     "src/lookup.h",
1022     "src/macro-assembler.h",
1023     "src/messages.cc",
1024     "src/messages.h",
1025     "src/modules.cc",
1026     "src/modules.h",
1027     "src/msan.h",
1028     "src/objects-debug.cc",
1029     "src/objects-inl.h",
1030     "src/objects-printer.cc",
1031     "src/objects.cc",
1032     "src/objects.h",
1033     "src/optimizing-compile-dispatcher.cc",
1034     "src/optimizing-compile-dispatcher.h",
1035     "src/ostreams.cc",
1036     "src/ostreams.h",
1037     "src/pattern-rewriter.cc",
1038     "src/parser.cc",
1039     "src/parser.h",
1040     "src/pending-compilation-error-handler.cc",
1041     "src/pending-compilation-error-handler.h",
1042     "src/preparse-data-format.h",
1043     "src/preparse-data.cc",
1044     "src/preparse-data.h",
1045     "src/preparser.cc",
1046     "src/preparser.h",
1047     "src/prettyprinter.cc",
1048     "src/prettyprinter.h",
1049     "src/profile-generator-inl.h",
1050     "src/profile-generator.cc",
1051     "src/profile-generator.h",
1052     "src/property-details.h",
1053     "src/property.cc",
1054     "src/property.h",
1055     "src/prototype.h",
1056     "src/regexp-macro-assembler-irregexp-inl.h",
1057     "src/regexp-macro-assembler-irregexp.cc",
1058     "src/regexp-macro-assembler-irregexp.h",
1059     "src/regexp-macro-assembler-tracer.cc",
1060     "src/regexp-macro-assembler-tracer.h",
1061     "src/regexp-macro-assembler.cc",
1062     "src/regexp-macro-assembler.h",
1063     "src/regexp-stack.cc",
1064     "src/regexp-stack.h",
1065     "src/rewriter.cc",
1066     "src/rewriter.h",
1067     "src/runtime-profiler.cc",
1068     "src/runtime-profiler.h",
1069     "src/runtime/runtime-array.cc",
1070     "src/runtime/runtime-atomics.cc",
1071     "src/runtime/runtime-classes.cc",
1072     "src/runtime/runtime-collections.cc",
1073     "src/runtime/runtime-compiler.cc",
1074     "src/runtime/runtime-date.cc",
1075     "src/runtime/runtime-debug.cc",
1076     "src/runtime/runtime-forin.cc",
1077     "src/runtime/runtime-function.cc",
1078     "src/runtime/runtime-generator.cc",
1079     "src/runtime/runtime-i18n.cc",
1080     "src/runtime/runtime-internal.cc",
1081     "src/runtime/runtime-json.cc",
1082     "src/runtime/runtime-literals.cc",
1083     "src/runtime/runtime-liveedit.cc",
1084     "src/runtime/runtime-maths.cc",
1085     "src/runtime/runtime-numbers.cc",
1086     "src/runtime/runtime-object.cc",
1087     "src/runtime/runtime-observe.cc",
1088     "src/runtime/runtime-proxy.cc",
1089     "src/runtime/runtime-regexp.cc",
1090     "src/runtime/runtime-scopes.cc",
1091     "src/runtime/runtime-simd.cc",
1092     "src/runtime/runtime-strings.cc",
1093     "src/runtime/runtime-symbol.cc",
1094     "src/runtime/runtime-test.cc",
1095     "src/runtime/runtime-typedarray.cc",
1096     "src/runtime/runtime-uri.cc",
1097     "src/runtime/runtime-utils.h",
1098     "src/runtime/runtime.cc",
1099     "src/runtime/runtime.h",
1100     "src/safepoint-table.cc",
1101     "src/safepoint-table.h",
1102     "src/sampler.cc",
1103     "src/sampler.h",
1104     "src/scanner-character-streams.cc",
1105     "src/scanner-character-streams.h",
1106     "src/scanner.cc",
1107     "src/scanner.h",
1108     "src/scopeinfo.cc",
1109     "src/scopeinfo.h",
1110     "src/scopes.cc",
1111     "src/scopes.h",
1112     "src/signature.h",
1113     "src/simulator.h",
1114     "src/small-pointer-list.h",
1115     "src/snapshot/natives.h",
1116     "src/snapshot/serialize.cc",
1117     "src/snapshot/serialize.h",
1118     "src/snapshot/snapshot-common.cc",
1119     "src/snapshot/snapshot-source-sink.cc",
1120     "src/snapshot/snapshot-source-sink.h",
1121     "src/splay-tree.h",
1122     "src/splay-tree-inl.h",
1123     "src/snapshot/snapshot.h",
1124     "src/string-builder.cc",
1125     "src/string-builder.h",
1126     "src/string-search.cc",
1127     "src/string-search.h",
1128     "src/string-stream.cc",
1129     "src/string-stream.h",
1130     "src/strings-storage.cc",
1131     "src/strings-storage.h",
1132     "src/strtod.cc",
1133     "src/strtod.h",
1134     "src/token.cc",
1135     "src/token.h",
1136     "src/transitions-inl.h",
1137     "src/transitions.cc",
1138     "src/transitions.h",
1139     "src/type-feedback-vector-inl.h",
1140     "src/type-feedback-vector.cc",
1141     "src/type-feedback-vector.h",
1142     "src/type-info.cc",
1143     "src/type-info.h",
1144     "src/types-inl.h",
1145     "src/types.cc",
1146     "src/types.h",
1147     "src/typing.cc",
1148     "src/typing.h",
1149     "src/unbound-queue-inl.h",
1150     "src/unbound-queue.h",
1151     "src/unicode-inl.h",
1152     "src/unicode.cc",
1153     "src/unicode.h",
1154     "src/unicode-decoder.cc",
1155     "src/unicode-decoder.h",
1156     "src/unique.h",
1157     "src/utils.cc",
1158     "src/utils.h",
1159     "src/v8.cc",
1160     "src/v8.h",
1161     "src/v8memory.h",
1162     "src/v8threads.cc",
1163     "src/v8threads.h",
1164     "src/variables.cc",
1165     "src/variables.h",
1166     "src/version.cc",
1167     "src/version.h",
1168     "src/vm-state-inl.h",
1169     "src/vm-state.h",
1170     "src/zone.cc",
1171     "src/zone.h",
1172     "src/zone-allocator.h",
1173     "src/zone-containers.h",
1174     "src/third_party/fdlibm/fdlibm.cc",
1175     "src/third_party/fdlibm/fdlibm.h",
1176   ]
1177
1178   if (v8_target_arch == "x86") {
1179     sources += [
1180       "src/ia32/assembler-ia32-inl.h",
1181       "src/ia32/assembler-ia32.cc",
1182       "src/ia32/assembler-ia32.h",
1183       "src/ia32/builtins-ia32.cc",
1184       "src/ia32/code-stubs-ia32.cc",
1185       "src/ia32/code-stubs-ia32.h",
1186       "src/ia32/codegen-ia32.cc",
1187       "src/ia32/codegen-ia32.h",
1188       "src/ia32/cpu-ia32.cc",
1189       "src/ia32/debug-ia32.cc",
1190       "src/ia32/deoptimizer-ia32.cc",
1191       "src/ia32/disasm-ia32.cc",
1192       "src/ia32/frames-ia32.cc",
1193       "src/ia32/frames-ia32.h",
1194       "src/ia32/full-codegen-ia32.cc",
1195       "src/ia32/interface-descriptors-ia32.cc",
1196       "src/ia32/lithium-codegen-ia32.cc",
1197       "src/ia32/lithium-codegen-ia32.h",
1198       "src/ia32/lithium-gap-resolver-ia32.cc",
1199       "src/ia32/lithium-gap-resolver-ia32.h",
1200       "src/ia32/lithium-ia32.cc",
1201       "src/ia32/lithium-ia32.h",
1202       "src/ia32/macro-assembler-ia32.cc",
1203       "src/ia32/macro-assembler-ia32.h",
1204       "src/ia32/regexp-macro-assembler-ia32.cc",
1205       "src/ia32/regexp-macro-assembler-ia32.h",
1206       "src/compiler/ia32/code-generator-ia32.cc",
1207       "src/compiler/ia32/instruction-codes-ia32.h",
1208       "src/compiler/ia32/instruction-selector-ia32.cc",
1209       "src/compiler/ia32/linkage-ia32.cc",
1210       "src/ic/ia32/access-compiler-ia32.cc",
1211       "src/ic/ia32/handler-compiler-ia32.cc",
1212       "src/ic/ia32/ic-ia32.cc",
1213       "src/ic/ia32/ic-compiler-ia32.cc",
1214       "src/ic/ia32/stub-cache-ia32.cc",
1215     ]
1216   } else if (v8_target_arch == "x64") {
1217     sources += [
1218       "src/x64/assembler-x64-inl.h",
1219       "src/x64/assembler-x64.cc",
1220       "src/x64/assembler-x64.h",
1221       "src/x64/builtins-x64.cc",
1222       "src/x64/code-stubs-x64.cc",
1223       "src/x64/code-stubs-x64.h",
1224       "src/x64/codegen-x64.cc",
1225       "src/x64/codegen-x64.h",
1226       "src/x64/cpu-x64.cc",
1227       "src/x64/debug-x64.cc",
1228       "src/x64/deoptimizer-x64.cc",
1229       "src/x64/disasm-x64.cc",
1230       "src/x64/frames-x64.cc",
1231       "src/x64/frames-x64.h",
1232       "src/x64/full-codegen-x64.cc",
1233       "src/x64/interface-descriptors-x64.cc",
1234       "src/x64/lithium-codegen-x64.cc",
1235       "src/x64/lithium-codegen-x64.h",
1236       "src/x64/lithium-gap-resolver-x64.cc",
1237       "src/x64/lithium-gap-resolver-x64.h",
1238       "src/x64/lithium-x64.cc",
1239       "src/x64/lithium-x64.h",
1240       "src/x64/macro-assembler-x64.cc",
1241       "src/x64/macro-assembler-x64.h",
1242       "src/x64/regexp-macro-assembler-x64.cc",
1243       "src/x64/regexp-macro-assembler-x64.h",
1244       "src/compiler/x64/code-generator-x64.cc",
1245       "src/compiler/x64/instruction-codes-x64.h",
1246       "src/compiler/x64/instruction-selector-x64.cc",
1247       "src/compiler/x64/linkage-x64.cc",
1248       "src/ic/x64/access-compiler-x64.cc",
1249       "src/ic/x64/handler-compiler-x64.cc",
1250       "src/ic/x64/ic-x64.cc",
1251       "src/ic/x64/ic-compiler-x64.cc",
1252       "src/ic/x64/stub-cache-x64.cc",
1253     ]
1254   } else if (v8_target_arch == "arm") {
1255     sources += [
1256       "src/arm/assembler-arm-inl.h",
1257       "src/arm/assembler-arm.cc",
1258       "src/arm/assembler-arm.h",
1259       "src/arm/builtins-arm.cc",
1260       "src/arm/code-stubs-arm.cc",
1261       "src/arm/code-stubs-arm.h",
1262       "src/arm/codegen-arm.cc",
1263       "src/arm/codegen-arm.h",
1264       "src/arm/constants-arm.h",
1265       "src/arm/constants-arm.cc",
1266       "src/arm/cpu-arm.cc",
1267       "src/arm/debug-arm.cc",
1268       "src/arm/deoptimizer-arm.cc",
1269       "src/arm/disasm-arm.cc",
1270       "src/arm/frames-arm.cc",
1271       "src/arm/frames-arm.h",
1272       "src/arm/full-codegen-arm.cc",
1273       "src/arm/interface-descriptors-arm.cc",
1274       "src/arm/interface-descriptors-arm.h",
1275       "src/arm/lithium-arm.cc",
1276       "src/arm/lithium-arm.h",
1277       "src/arm/lithium-codegen-arm.cc",
1278       "src/arm/lithium-codegen-arm.h",
1279       "src/arm/lithium-gap-resolver-arm.cc",
1280       "src/arm/lithium-gap-resolver-arm.h",
1281       "src/arm/macro-assembler-arm.cc",
1282       "src/arm/macro-assembler-arm.h",
1283       "src/arm/regexp-macro-assembler-arm.cc",
1284       "src/arm/regexp-macro-assembler-arm.h",
1285       "src/arm/simulator-arm.cc",
1286       "src/arm/simulator-arm.h",
1287       "src/compiler/arm/code-generator-arm.cc",
1288       "src/compiler/arm/instruction-codes-arm.h",
1289       "src/compiler/arm/instruction-selector-arm.cc",
1290       "src/compiler/arm/linkage-arm.cc",
1291       "src/ic/arm/access-compiler-arm.cc",
1292       "src/ic/arm/handler-compiler-arm.cc",
1293       "src/ic/arm/ic-arm.cc",
1294       "src/ic/arm/ic-compiler-arm.cc",
1295       "src/ic/arm/stub-cache-arm.cc",
1296     ]
1297   } else if (v8_target_arch == "arm64") {
1298     sources += [
1299       "src/arm64/assembler-arm64.cc",
1300       "src/arm64/assembler-arm64.h",
1301       "src/arm64/assembler-arm64-inl.h",
1302       "src/arm64/builtins-arm64.cc",
1303       "src/arm64/codegen-arm64.cc",
1304       "src/arm64/codegen-arm64.h",
1305       "src/arm64/code-stubs-arm64.cc",
1306       "src/arm64/code-stubs-arm64.h",
1307       "src/arm64/constants-arm64.h",
1308       "src/arm64/cpu-arm64.cc",
1309       "src/arm64/debug-arm64.cc",
1310       "src/arm64/decoder-arm64.cc",
1311       "src/arm64/decoder-arm64.h",
1312       "src/arm64/decoder-arm64-inl.h",
1313       "src/arm64/deoptimizer-arm64.cc",
1314       "src/arm64/disasm-arm64.cc",
1315       "src/arm64/disasm-arm64.h",
1316       "src/arm64/frames-arm64.cc",
1317       "src/arm64/frames-arm64.h",
1318       "src/arm64/full-codegen-arm64.cc",
1319       "src/arm64/instructions-arm64.cc",
1320       "src/arm64/instructions-arm64.h",
1321       "src/arm64/instrument-arm64.cc",
1322       "src/arm64/instrument-arm64.h",
1323       "src/arm64/interface-descriptors-arm64.cc",
1324       "src/arm64/interface-descriptors-arm64.h",
1325       "src/arm64/lithium-arm64.cc",
1326       "src/arm64/lithium-arm64.h",
1327       "src/arm64/lithium-codegen-arm64.cc",
1328       "src/arm64/lithium-codegen-arm64.h",
1329       "src/arm64/lithium-gap-resolver-arm64.cc",
1330       "src/arm64/lithium-gap-resolver-arm64.h",
1331       "src/arm64/macro-assembler-arm64.cc",
1332       "src/arm64/macro-assembler-arm64.h",
1333       "src/arm64/macro-assembler-arm64-inl.h",
1334       "src/arm64/regexp-macro-assembler-arm64.cc",
1335       "src/arm64/regexp-macro-assembler-arm64.h",
1336       "src/arm64/simulator-arm64.cc",
1337       "src/arm64/simulator-arm64.h",
1338       "src/arm64/utils-arm64.cc",
1339       "src/arm64/utils-arm64.h",
1340       "src/compiler/arm64/code-generator-arm64.cc",
1341       "src/compiler/arm64/instruction-codes-arm64.h",
1342       "src/compiler/arm64/instruction-selector-arm64.cc",
1343       "src/compiler/arm64/linkage-arm64.cc",
1344       "src/ic/arm64/access-compiler-arm64.cc",
1345       "src/ic/arm64/handler-compiler-arm64.cc",
1346       "src/ic/arm64/ic-arm64.cc",
1347       "src/ic/arm64/ic-compiler-arm64.cc",
1348       "src/ic/arm64/stub-cache-arm64.cc",
1349     ]
1350   } else if (v8_target_arch == "mipsel") {
1351     sources += [
1352       "src/mips/assembler-mips.cc",
1353       "src/mips/assembler-mips.h",
1354       "src/mips/assembler-mips-inl.h",
1355       "src/mips/builtins-mips.cc",
1356       "src/mips/codegen-mips.cc",
1357       "src/mips/codegen-mips.h",
1358       "src/mips/code-stubs-mips.cc",
1359       "src/mips/code-stubs-mips.h",
1360       "src/mips/constants-mips.cc",
1361       "src/mips/constants-mips.h",
1362       "src/mips/cpu-mips.cc",
1363       "src/mips/debug-mips.cc",
1364       "src/mips/deoptimizer-mips.cc",
1365       "src/mips/disasm-mips.cc",
1366       "src/mips/frames-mips.cc",
1367       "src/mips/frames-mips.h",
1368       "src/mips/full-codegen-mips.cc",
1369       "src/mips/interface-descriptors-mips.cc",
1370       "src/mips/lithium-codegen-mips.cc",
1371       "src/mips/lithium-codegen-mips.h",
1372       "src/mips/lithium-gap-resolver-mips.cc",
1373       "src/mips/lithium-gap-resolver-mips.h",
1374       "src/mips/lithium-mips.cc",
1375       "src/mips/lithium-mips.h",
1376       "src/mips/macro-assembler-mips.cc",
1377       "src/mips/macro-assembler-mips.h",
1378       "src/mips/regexp-macro-assembler-mips.cc",
1379       "src/mips/regexp-macro-assembler-mips.h",
1380       "src/mips/simulator-mips.cc",
1381       "src/mips/simulator-mips.h",
1382       "src/compiler/mips/code-generator-mips.cc",
1383       "src/compiler/mips/instruction-codes-mips.h",
1384       "src/compiler/mips/instruction-selector-mips.cc",
1385       "src/compiler/mips/linkage-mips.cc",
1386       "src/ic/mips/access-compiler-mips.cc",
1387       "src/ic/mips/handler-compiler-mips.cc",
1388       "src/ic/mips/ic-mips.cc",
1389       "src/ic/mips/ic-compiler-mips.cc",
1390       "src/ic/mips/stub-cache-mips.cc",
1391     ]
1392   } else if (v8_target_arch == "mips64el") {
1393     sources += [
1394       "src/mips64/assembler-mips64.cc",
1395       "src/mips64/assembler-mips64.h",
1396       "src/mips64/assembler-mips64-inl.h",
1397       "src/mips64/builtins-mips64.cc",
1398       "src/mips64/codegen-mips64.cc",
1399       "src/mips64/codegen-mips64.h",
1400       "src/mips64/code-stubs-mips64.cc",
1401       "src/mips64/code-stubs-mips64.h",
1402       "src/mips64/constants-mips64.cc",
1403       "src/mips64/constants-mips64.h",
1404       "src/mips64/cpu-mips64.cc",
1405       "src/mips64/debug-mips64.cc",
1406       "src/mips64/deoptimizer-mips64.cc",
1407       "src/mips64/disasm-mips64.cc",
1408       "src/mips64/frames-mips64.cc",
1409       "src/mips64/frames-mips64.h",
1410       "src/mips64/full-codegen-mips64.cc",
1411       "src/mips64/interface-descriptors-mips64.cc",
1412       "src/mips64/lithium-codegen-mips64.cc",
1413       "src/mips64/lithium-codegen-mips64.h",
1414       "src/mips64/lithium-gap-resolver-mips64.cc",
1415       "src/mips64/lithium-gap-resolver-mips64.h",
1416       "src/mips64/lithium-mips64.cc",
1417       "src/mips64/lithium-mips64.h",
1418       "src/mips64/macro-assembler-mips64.cc",
1419       "src/mips64/macro-assembler-mips64.h",
1420       "src/mips64/regexp-macro-assembler-mips64.cc",
1421       "src/mips64/regexp-macro-assembler-mips64.h",
1422       "src/mips64/simulator-mips64.cc",
1423       "src/mips64/simulator-mips64.h",
1424       "src/ic/mips64/access-compiler-mips64.cc",
1425       "src/ic/mips64/handler-compiler-mips64.cc",
1426       "src/ic/mips64/ic-mips64.cc",
1427       "src/ic/mips64/ic-compiler-mips64.cc",
1428       "src/ic/mips64/stub-cache-mips64.cc",
1429     ]
1430   }
1431
1432   configs -= [ "//build/config/compiler:chromium_code" ]
1433   configs += [ "//build/config/compiler:no_chromium_code" ]
1434   configs += [
1435     ":internal_config",
1436     ":features",
1437     ":toolchain",
1438   ]
1439
1440   if (!is_debug) {
1441     configs -= [ "//build/config/compiler:optimize" ]
1442     configs += [ "//build/config/compiler:optimize_max" ]
1443   }
1444
1445   defines = []
1446   deps = [
1447     ":v8_libbase",
1448   ]
1449
1450   if (is_win) {
1451     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1452     cflags = [ "/wd4267" ]
1453   }
1454
1455   if (v8_enable_i18n_support) {
1456     deps += [ "//third_party/icu" ]
1457     if (is_win) {
1458       deps += [ "//third_party/icu:icudata" ]
1459     }
1460
1461     # TODO(jochen): Add support for icu_use_data_file_flag
1462     defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ]
1463   } else {
1464     sources -= [
1465       "src/i18n.cc",
1466       "src/i18n.h",
1467     ]
1468   }
1469
1470   if (v8_postmortem_support) {
1471     sources += [ "$target_gen_dir/debug-support.cc" ]
1472     deps += [ ":postmortem-metadata" ]
1473   }
1474 }
1475
1476 source_set("v8_libbase") {
1477   visibility = [ ":*" ]  # Only targets in this file can depend on this.
1478
1479   sources = [
1480     "src/base/adapters.h",
1481     "src/base/atomicops.h",
1482     "src/base/atomicops_internals_arm64_gcc.h",
1483     "src/base/atomicops_internals_arm_gcc.h",
1484     "src/base/atomicops_internals_atomicword_compat.h",
1485     "src/base/atomicops_internals_mac.h",
1486     "src/base/atomicops_internals_mips_gcc.h",
1487     "src/base/atomicops_internals_mips64_gcc.h",
1488     "src/base/atomicops_internals_portable.h",
1489     "src/base/atomicops_internals_tsan.h",
1490     "src/base/atomicops_internals_x86_gcc.cc",
1491     "src/base/atomicops_internals_x86_gcc.h",
1492     "src/base/atomicops_internals_x86_msvc.h",
1493     "src/base/bits.cc",
1494     "src/base/bits.h",
1495     "src/base/build_config.h",
1496     "src/base/cpu.cc",
1497     "src/base/cpu.h",
1498     "src/base/division-by-constant.cc",
1499     "src/base/division-by-constant.h",
1500     "src/base/flags.h",
1501     "src/base/functional.cc",
1502     "src/base/functional.h",
1503     "src/base/iterator.h",
1504     "src/base/lazy-instance.h",
1505     "src/base/logging.cc",
1506     "src/base/logging.h",
1507     "src/base/macros.h",
1508     "src/base/once.cc",
1509     "src/base/once.h",
1510     "src/base/platform/elapsed-timer.h",
1511     "src/base/platform/time.cc",
1512     "src/base/platform/time.h",
1513     "src/base/platform/condition-variable.cc",
1514     "src/base/platform/condition-variable.h",
1515     "src/base/platform/mutex.cc",
1516     "src/base/platform/mutex.h",
1517     "src/base/platform/platform.h",
1518     "src/base/platform/semaphore.cc",
1519     "src/base/platform/semaphore.h",
1520     "src/base/safe_conversions.h",
1521     "src/base/safe_conversions_impl.h",
1522     "src/base/safe_math.h",
1523     "src/base/safe_math_impl.h",
1524     "src/base/smart-pointers.h",
1525     "src/base/sys-info.cc",
1526     "src/base/sys-info.h",
1527     "src/base/utils/random-number-generator.cc",
1528     "src/base/utils/random-number-generator.h",
1529   ]
1530
1531   configs -= [ "//build/config/compiler:chromium_code" ]
1532   configs += [ "//build/config/compiler:no_chromium_code" ]
1533   configs += [
1534     ":internal_config_base",
1535     ":features",
1536     ":toolchain",
1537   ]
1538
1539   if (!is_debug) {
1540     configs -= [ "//build/config/compiler:optimize" ]
1541     configs += [ "//build/config/compiler:optimize_max" ]
1542   }
1543
1544   defines = []
1545
1546   if (is_posix) {
1547     sources += [ "src/base/platform/platform-posix.cc" ]
1548   }
1549
1550   if (is_linux) {
1551     sources += [ "src/base/platform/platform-linux.cc" ]
1552
1553     libs = [ "dl", "rt" ]
1554   } else if (is_android) {
1555     defines += [ "CAN_USE_VFP_INSTRUCTIONS" ]
1556
1557     if (current_toolchain == host_toolchain) {
1558       libs = [ "dl", "rt" ]
1559       if (host_os == "mac") {
1560         sources += [ "src/base/platform/platform-macos.cc" ]
1561       } else {
1562         sources += [ "src/base/platform/platform-linux.cc" ]
1563       }
1564     } else {
1565       sources += [ "src/base/platform/platform-linux.cc" ]
1566     }
1567   } else if (is_mac) {
1568     sources += [ "src/base/platform/platform-macos.cc" ]
1569   } else if (is_win) {
1570     # TODO(jochen): Add support for cygwin.
1571     sources += [
1572       "src/base/platform/platform-win32.cc",
1573       "src/base/win32-headers.h",
1574     ]
1575
1576     defines += [ "_CRT_RAND_S" ]  # for rand_s()
1577
1578     libs = [
1579       "winmm.lib",
1580       "ws2_32.lib",
1581     ]
1582   }
1583
1584   # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
1585 }
1586
1587 source_set("v8_libplatform") {
1588   sources = [
1589     "include/libplatform/libplatform.h",
1590     "src/libplatform/default-platform.cc",
1591     "src/libplatform/default-platform.h",
1592     "src/libplatform/task-queue.cc",
1593     "src/libplatform/task-queue.h",
1594     "src/libplatform/worker-thread.cc",
1595     "src/libplatform/worker-thread.h",
1596   ]
1597
1598   configs -= [ "//build/config/compiler:chromium_code" ]
1599   configs += [ "//build/config/compiler:no_chromium_code" ]
1600   configs += [
1601     ":internal_config_base",
1602     ":features",
1603     ":toolchain",
1604   ]
1605
1606   if (!is_debug) {
1607     configs -= [ "//build/config/compiler:optimize" ]
1608     configs += [ "//build/config/compiler:optimize_max" ]
1609   }
1610
1611   deps = [
1612     ":v8_libbase",
1613   ]
1614 }
1615
1616 ###############################################################################
1617 # Executables
1618 #
1619
1620 if (current_toolchain == snapshot_toolchain) {
1621   executable("mksnapshot") {
1622     visibility = [ ":*" ]  # Only targets in this file can depend on this.
1623
1624     sources = [
1625       "src/snapshot/mksnapshot.cc",
1626     ]
1627
1628     configs -= [ "//build/config/compiler:chromium_code" ]
1629     configs += [ "//build/config/compiler:no_chromium_code" ]
1630     configs += [
1631       ":internal_config",
1632       ":features",
1633       ":toolchain",
1634     ]
1635
1636     deps = [
1637       ":v8_base",
1638       ":v8_libplatform",
1639       ":v8_nosnapshot",
1640       "//build/config/sanitizers:deps",
1641     ]
1642   }
1643 }
1644
1645 ###############################################################################
1646 # Public targets
1647 #
1648
1649 if (is_component_build) {
1650   component("v8") {
1651     sources = [
1652       "src/v8dll-main.cc",
1653     ]
1654
1655     if (v8_use_snapshot && v8_use_external_startup_data) {
1656       deps = [
1657         ":v8_base",
1658       ]
1659       public_deps = [
1660         ":v8_external_snapshot",
1661       ]
1662     } else if (v8_use_snapshot) {
1663       deps = [
1664         ":v8_base",
1665       ]
1666       # v8_snapshot should be public so downstream targets can declare the
1667       # snapshot file as their input.
1668       public_deps = [
1669         ":v8_snapshot",
1670       ]
1671     } else {
1672       assert(!v8_use_external_startup_data)
1673       deps = [
1674         ":v8_base",
1675         ":v8_nosnapshot",
1676       ]
1677     }
1678
1679     configs -= [ "//build/config/compiler:chromium_code" ]
1680     configs += [ "//build/config/compiler:no_chromium_code" ]
1681     configs += [
1682       ":internal_config",
1683       ":features",
1684       ":toolchain",
1685     ]
1686
1687     public_configs = [ ":external_config" ]
1688
1689     libs = []
1690     if (is_android && current_toolchain != host_toolchain) {
1691       libs += [ "log" ]
1692     }
1693   }
1694 } else {
1695   group("v8") {
1696     if (v8_use_snapshot && v8_use_external_startup_data) {
1697       deps = [
1698         ":v8_base",
1699         ":v8_external_snapshot",
1700       ]
1701     } else if (v8_use_snapshot) {
1702       deps = [
1703         ":v8_base",
1704       ]
1705       public_deps = [
1706         ":v8_snapshot",
1707       ]
1708     } else {
1709       assert(!v8_use_external_startup_data)
1710       deps = [
1711         ":v8_base",
1712         ":v8_nosnapshot",
1713       ]
1714     }
1715
1716     public_configs = [ ":external_config" ]
1717   }
1718 }
1719
1720 if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") ||
1721     (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) {
1722   executable("d8") {
1723     sources = [
1724       "src/d8.cc",
1725       "src/d8.h",
1726       "src/startup-data-util.h",
1727       "src/startup-data-util.cc",
1728     ]
1729
1730     configs -= [ "//build/config/compiler:chromium_code" ]
1731     configs += [ "//build/config/compiler:no_chromium_code" ]
1732     configs += [
1733       # Note: don't use :internal_config here because this target will get
1734       # the :external_config applied to it by virtue of depending on :v8, and
1735       # you can't have both applied to the same target.
1736       ":internal_config_base",
1737       ":features",
1738       ":toolchain",
1739     ]
1740
1741     deps = [
1742       ":d8_js2c",
1743       ":v8",
1744       ":v8_libplatform",
1745       "//build/config/sanitizers:deps",
1746     ]
1747
1748     # TODO(jochen): Add support for readline and vtunejit.
1749
1750     if (is_posix) {
1751       sources += [ "src/d8-posix.cc" ]
1752     } else if (is_win) {
1753       sources += [ "src/d8-windows.cc" ]
1754     }
1755
1756     if (!is_component_build) {
1757       sources += [
1758         "src/d8-debug.cc",
1759         "src/d8-debug.h",
1760         "$target_gen_dir/d8-js.cc",
1761       ]
1762     }
1763     if (v8_enable_i18n_support) {
1764       deps += [ "//third_party/icu" ]
1765     }
1766   }
1767 }