Revert of [simd.js] Update to spec version 0.8.2. (patchset #11 id:200001 of https...
[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/prologue.js",
207     "src/runtime.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/templates.js",
231     "src/harmony-array.js",
232     "src/harmony-typedarray.js",
233     "src/debug/mirrors.js",
234     "src/debug/debug.js",
235     "src/debug/liveedit.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-object-observe.js",
317     "src/harmony-sharedarraybuffer.js",
318     "src/harmony-simd.js"
319   ]
320
321   outputs = [
322     "$target_gen_dir/experimental-libraries.cc",
323   ]
324
325   args = [
326            rebase_path("$target_gen_dir/experimental-libraries.cc",
327                        root_build_dir),
328            "EXPERIMENTAL",
329          ] + rebase_path(sources, root_build_dir)
330
331   if (v8_use_external_startup_data) {
332     outputs += [ "$target_gen_dir/libraries_experimental.bin" ]
333     args += [
334       "--startup_blob",
335       rebase_path("$target_gen_dir/libraries_experimental.bin", root_build_dir),
336     ]
337   }
338 }
339
340 action("js2c_extras") {
341   visibility = [ ":*" ]  # Only targets in this file can depend on this.
342
343   script = "tools/js2c.py"
344
345   # The script depends on this other script, this rule causes a rebuild if it
346   # changes.
347   inputs = [ "tools/jsmin.py" ]
348
349   sources = v8_extra_library_files
350
351   outputs = [
352     "$target_gen_dir/extras-libraries.cc",
353   ]
354
355   args = [
356            rebase_path("$target_gen_dir/extras-libraries.cc",
357                        root_build_dir),
358            "EXTRAS",
359          ] + rebase_path(sources, root_build_dir)
360
361   if (v8_use_external_startup_data) {
362     outputs += [ "$target_gen_dir/libraries_extras.bin" ]
363     args += [
364       "--startup_blob",
365       rebase_path("$target_gen_dir/libraries_extras.bin", root_build_dir),
366     ]
367   }
368 }
369
370 action("js2c_experimental_extras") {
371   visibility = [ ":*" ]  # Only targets in this file can depend on this.
372
373   script = "tools/js2c.py"
374
375   # The script depends on this other script, this rule causes a rebuild if it
376   # changes.
377   inputs = [ "tools/jsmin.py" ]
378
379   sources = v8_experimental_extra_library_files
380
381   outputs = [
382     "$target_gen_dir/experimental-extras-libraries.cc",
383   ]
384
385   args = [
386            rebase_path("$target_gen_dir/experimental-extras-libraries.cc",
387                        root_build_dir),
388            "EXPERIMENTAL_EXTRAS",
389          ] + rebase_path(sources, root_build_dir)
390
391   if (v8_use_external_startup_data) {
392     outputs += [ "$target_gen_dir/libraries_experimental_extras.bin" ]
393     args += [
394       "--startup_blob",
395       rebase_path("$target_gen_dir/libraries_experimental_extras.bin", root_build_dir),
396     ]
397   }
398 }
399
400 action("d8_js2c") {
401   visibility = [ ":*" ]  # Only targets in this file can depend on this.
402
403   script = "tools/js2c.py"
404
405   inputs = [
406     "src/d8.js",
407     "src/macros.py",
408   ]
409
410   outputs = [
411     "$target_gen_dir/d8-js.cc",
412   ]
413
414   args = rebase_path(outputs, root_build_dir) + [ "D8" ] +
415          rebase_path(inputs, root_build_dir)
416 }
417
418 if (v8_use_external_startup_data) {
419   action("natives_blob") {
420     visibility = [ ":*" ]  # Only targets in this file can depend on this.
421
422     deps = [
423       ":js2c",
424       ":js2c_code_stubs",
425       ":js2c_experimental",
426       ":js2c_extras",
427       ":js2c_experimental_extras",
428     ]
429
430     sources = [
431       "$target_gen_dir/libraries.bin",
432       "$target_gen_dir/libraries_code_stub.bin",
433       "$target_gen_dir/libraries_experimental.bin",
434       "$target_gen_dir/libraries_extras.bin",
435       "$target_gen_dir/libraries_experimental_extras.bin",
436     ]
437
438     outputs = [
439       "$root_out_dir/natives_blob.bin",
440     ]
441
442     script = "tools/concatenate-files.py"
443
444     args = rebase_path(sources + outputs, root_build_dir)
445   }
446 }
447
448 action("postmortem-metadata") {
449   # Only targets in this file and the top-level visibility target can
450   # depend on this.
451   visibility = [
452     ":*",
453     "//:gn_visibility",
454   ]
455
456   script = "tools/gen-postmortem-metadata.py"
457
458   sources = [
459     "src/objects.h",
460     "src/objects-inl.h",
461   ]
462
463   outputs = [
464     "$target_gen_dir/debug-support.cc",
465   ]
466
467   args = rebase_path(outputs, root_build_dir) +
468          rebase_path(sources, root_build_dir)
469 }
470
471 action("run_mksnapshot") {
472   visibility = [ ":*" ]  # Only targets in this file can depend on this.
473
474   deps = [
475     ":mksnapshot($snapshot_toolchain)",
476   ]
477
478   script = "tools/run.py"
479
480   outputs = [
481     "$target_gen_dir/snapshot.cc",
482   ]
483
484   args = [
485     "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)",
486                                       "root_out_dir") + "/mksnapshot",
487                        root_build_dir),
488     "--log-snapshot-positions",
489     "--logfile",
490     rebase_path("$target_gen_dir/snapshot.log", root_build_dir),
491     rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
492   ]
493
494   if (v8_random_seed != "0") {
495     args += [
496       "--random-seed",
497       v8_random_seed,
498     ]
499   }
500
501   if (v8_use_external_startup_data) {
502     outputs += [ "$root_out_dir/snapshot_blob.bin" ]
503     args += [
504       "--startup_blob",
505       rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir),
506     ]
507   }
508 }
509
510 ###############################################################################
511 # Source Sets (aka static libraries)
512 #
513
514 source_set("v8_nosnapshot") {
515   visibility = [ ":*" ]  # Only targets in this file can depend on this.
516
517   deps = [
518     ":js2c",
519     ":js2c_code_stubs",
520     ":js2c_experimental",
521     ":js2c_extras",
522     ":js2c_experimental_extras",
523     ":v8_base",
524   ]
525
526   sources = [
527     "$target_gen_dir/libraries.cc",
528     "$target_gen_dir/code-stub-libraries.cc",
529     "$target_gen_dir/experimental-libraries.cc",
530     "$target_gen_dir/extras-libraries.cc",
531     "$target_gen_dir/experimental-extras-libraries.cc",
532     "src/snapshot/snapshot-empty.cc",
533   ]
534
535   configs -= [ "//build/config/compiler:chromium_code" ]
536   configs += [ "//build/config/compiler:no_chromium_code" ]
537   configs += [
538     ":internal_config",
539     ":features",
540     ":toolchain",
541   ]
542 }
543
544 source_set("v8_snapshot") {
545   # Only targets in this file and the top-level visibility target can
546   # depend on this.
547   visibility = [
548     ":*",
549     "//:gn_visibility",
550   ]
551
552   deps = [
553     ":js2c",
554     ":js2c_code_stubs",
555     ":js2c_experimental",
556     ":js2c_extras",
557     ":js2c_experimental_extras",
558     ":v8_base",
559   ]
560   public_deps = [
561     # This should be public so downstream targets can declare the snapshot
562     # output file as their inputs.
563     ":run_mksnapshot",
564   ]
565
566   sources = [
567     "$target_gen_dir/libraries.cc",
568     "$target_gen_dir/code-stub-libraries.cc",
569     "$target_gen_dir/experimental-libraries.cc",
570     "$target_gen_dir/extras-libraries.cc",
571     "$target_gen_dir/experimental-extras-libraries.cc",
572     "$target_gen_dir/snapshot.cc",
573   ]
574
575   configs -= [ "//build/config/compiler:chromium_code" ]
576   configs += [ "//build/config/compiler:no_chromium_code" ]
577   configs += [
578     ":internal_config",
579     ":features",
580     ":toolchain",
581   ]
582 }
583
584 if (v8_use_external_startup_data) {
585   source_set("v8_external_snapshot") {
586     visibility = [ ":*" ]  # Only targets in this file can depend on this.
587
588     deps = [
589       ":js2c",
590       ":js2c_code_stubs",
591       ":js2c_experimental",
592       ":js2c_extras",
593       ":js2c_experimental_extras",
594       ":v8_base",
595     ]
596     public_deps = [
597       ":natives_blob",
598       ":run_mksnapshot",
599     ]
600
601     sources = [
602       "src/snapshot/natives-external.cc",
603       "src/snapshot/snapshot-external.cc",
604     ]
605
606     configs -= [ "//build/config/compiler:chromium_code" ]
607     configs += [ "//build/config/compiler:no_chromium_code" ]
608     configs += [
609       ":internal_config",
610       ":features",
611       ":toolchain",
612     ]
613   }
614 }
615
616 source_set("v8_base") {
617   visibility = [ ":*" ]  # Only targets in this file can depend on this.
618
619   sources = [
620     "include/v8-debug.h",
621     "include/v8-platform.h",
622     "include/v8-profiler.h",
623     "include/v8-testing.h",
624     "include/v8-util.h",
625     "include/v8-version.h",
626     "include/v8.h",
627     "include/v8config.h",
628     "src/accessors.cc",
629     "src/accessors.h",
630     "src/allocation.cc",
631     "src/allocation.h",
632     "src/allocation-site-scopes.cc",
633     "src/allocation-site-scopes.h",
634     "src/allocation-tracker.cc",
635     "src/allocation-tracker.h",
636     "src/api.cc",
637     "src/api.h",
638     "src/api-natives.cc",
639     "src/api-natives.h",
640     "src/arguments.cc",
641     "src/arguments.h",
642     "src/assembler.cc",
643     "src/assembler.h",
644     "src/assert-scope.h",
645     "src/assert-scope.cc",
646     "src/ast-literal-reindexer.cc",
647     "src/ast-literal-reindexer.h",
648     "src/ast-numbering.cc",
649     "src/ast-numbering.h",
650     "src/ast-value-factory.cc",
651     "src/ast-value-factory.h",
652     "src/ast.cc",
653     "src/ast.h",
654     "src/background-parsing-task.cc",
655     "src/background-parsing-task.h",
656     "src/bailout-reason.cc",
657     "src/bailout-reason.h",
658     "src/basic-block-profiler.cc",
659     "src/basic-block-profiler.h",
660     "src/bignum-dtoa.cc",
661     "src/bignum-dtoa.h",
662     "src/bignum.cc",
663     "src/bignum.h",
664     "src/bit-vector.cc",
665     "src/bit-vector.h",
666     "src/bootstrapper.cc",
667     "src/bootstrapper.h",
668     "src/builtins.cc",
669     "src/builtins.h",
670     "src/cancelable-task.cc",
671     "src/cancelable-task.h",
672     "src/cached-powers.cc",
673     "src/cached-powers.h",
674     "src/char-predicates.cc",
675     "src/char-predicates-inl.h",
676     "src/char-predicates.h",
677     "src/checks.h",
678     "src/circular-queue-inl.h",
679     "src/circular-queue.h",
680     "src/code-factory.cc",
681     "src/code-factory.h",
682     "src/code-stubs.cc",
683     "src/code-stubs.h",
684     "src/code-stubs-hydrogen.cc",
685     "src/codegen.cc",
686     "src/codegen.h",
687     "src/compilation-cache.cc",
688     "src/compilation-cache.h",
689     "src/compilation-dependencies.cc",
690     "src/compilation-dependencies.h",
691     "src/compilation-statistics.cc",
692     "src/compilation-statistics.h",
693     "src/compiler/access-builder.cc",
694     "src/compiler/access-builder.h",
695     "src/compiler/all-nodes.cc",
696     "src/compiler/all-nodes.h",
697     "src/compiler/ast-graph-builder.cc",
698     "src/compiler/ast-graph-builder.h",
699     "src/compiler/ast-loop-assignment-analyzer.cc",
700     "src/compiler/ast-loop-assignment-analyzer.h",
701     "src/compiler/basic-block-instrumentor.cc",
702     "src/compiler/basic-block-instrumentor.h",
703     "src/compiler/change-lowering.cc",
704     "src/compiler/change-lowering.h",
705     "src/compiler/c-linkage.cc",
706     "src/compiler/coalesced-live-ranges.cc",
707     "src/compiler/coalesced-live-ranges.h",
708     "src/compiler/code-generator-impl.h",
709     "src/compiler/code-generator.cc",
710     "src/compiler/code-generator.h",
711     "src/compiler/common-node-cache.cc",
712     "src/compiler/common-node-cache.h",
713     "src/compiler/common-operator-reducer.cc",
714     "src/compiler/common-operator-reducer.h",
715     "src/compiler/common-operator.cc",
716     "src/compiler/common-operator.h",
717     "src/compiler/control-builders.cc",
718     "src/compiler/control-builders.h",
719     "src/compiler/control-equivalence.cc",
720     "src/compiler/control-equivalence.h",
721     "src/compiler/control-flow-optimizer.cc",
722     "src/compiler/control-flow-optimizer.h",
723     "src/compiler/dead-code-elimination.cc",
724     "src/compiler/dead-code-elimination.h",
725     "src/compiler/diamond.h",
726     "src/compiler/frame.cc",
727     "src/compiler/frame.h",
728     "src/compiler/frame-elider.cc",
729     "src/compiler/frame-elider.h",
730     "src/compiler/frame-states.cc",
731     "src/compiler/frame-states.h",
732     "src/compiler/gap-resolver.cc",
733     "src/compiler/gap-resolver.h",
734     "src/compiler/graph-reducer.cc",
735     "src/compiler/graph-reducer.h",
736     "src/compiler/graph-replay.cc",
737     "src/compiler/graph-replay.h",
738     "src/compiler/graph-trimmer.cc",
739     "src/compiler/graph-trimmer.h",
740     "src/compiler/graph-visualizer.cc",
741     "src/compiler/graph-visualizer.h",
742     "src/compiler/graph.cc",
743     "src/compiler/graph.h",
744     "src/compiler/greedy-allocator.cc",
745     "src/compiler/greedy-allocator.h",
746     "src/compiler/instruction-codes.h",
747     "src/compiler/instruction-selector-impl.h",
748     "src/compiler/instruction-selector.cc",
749     "src/compiler/instruction-selector.h",
750     "src/compiler/instruction.cc",
751     "src/compiler/instruction.h",
752     "src/compiler/interpreter-assembler.cc",
753     "src/compiler/interpreter-assembler.h",
754     "src/compiler/js-builtin-reducer.cc",
755     "src/compiler/js-builtin-reducer.h",
756     "src/compiler/js-context-relaxation.cc",
757     "src/compiler/js-context-relaxation.h",
758     "src/compiler/js-context-specialization.cc",
759     "src/compiler/js-context-specialization.h",
760     "src/compiler/js-frame-specialization.cc",
761     "src/compiler/js-frame-specialization.h",
762     "src/compiler/js-generic-lowering.cc",
763     "src/compiler/js-generic-lowering.h",
764     "src/compiler/js-graph.cc",
765     "src/compiler/js-graph.h",
766     "src/compiler/js-inlining.cc",
767     "src/compiler/js-inlining.h",
768     "src/compiler/js-intrinsic-lowering.cc",
769     "src/compiler/js-intrinsic-lowering.h",
770     "src/compiler/js-operator.cc",
771     "src/compiler/js-operator.h",
772     "src/compiler/js-type-feedback.cc",
773     "src/compiler/js-type-feedback.h",
774     "src/compiler/js-type-feedback-lowering.cc",
775     "src/compiler/js-type-feedback-lowering.h",
776     "src/compiler/js-typed-lowering.cc",
777     "src/compiler/js-typed-lowering.h",
778     "src/compiler/jump-threading.cc",
779     "src/compiler/jump-threading.h",
780     "src/compiler/linkage.cc",
781     "src/compiler/linkage.h",
782     "src/compiler/liveness-analyzer.cc",
783     "src/compiler/liveness-analyzer.h",
784     "src/compiler/load-elimination.cc",
785     "src/compiler/load-elimination.h",
786     "src/compiler/loop-peeling.cc",
787     "src/compiler/loop-analysis.cc",
788     "src/compiler/loop-analysis.h",
789     "src/compiler/machine-operator-reducer.cc",
790     "src/compiler/machine-operator-reducer.h",
791     "src/compiler/machine-operator.cc",
792     "src/compiler/machine-operator.h",
793     "src/compiler/machine-type.cc",
794     "src/compiler/machine-type.h",
795     "src/compiler/move-optimizer.cc",
796     "src/compiler/move-optimizer.h",
797     "src/compiler/node-aux-data.h",
798     "src/compiler/node-cache.cc",
799     "src/compiler/node-cache.h",
800     "src/compiler/node-marker.cc",
801     "src/compiler/node-marker.h",
802     "src/compiler/node-matchers.cc",
803     "src/compiler/node-matchers.h",
804     "src/compiler/node-properties.cc",
805     "src/compiler/node-properties.h",
806     "src/compiler/node.cc",
807     "src/compiler/node.h",
808     "src/compiler/opcodes.cc",
809     "src/compiler/opcodes.h",
810     "src/compiler/operator-properties.cc",
811     "src/compiler/operator-properties.h",
812     "src/compiler/operator.cc",
813     "src/compiler/operator.h",
814     "src/compiler/osr.cc",
815     "src/compiler/osr.h",
816     "src/compiler/pipeline.cc",
817     "src/compiler/pipeline.h",
818     "src/compiler/pipeline-statistics.cc",
819     "src/compiler/pipeline-statistics.h",
820     "src/compiler/preprocess-live-ranges.cc",
821     "src/compiler/preprocess-live-ranges.h",
822     "src/compiler/raw-machine-assembler.cc",
823     "src/compiler/raw-machine-assembler.h",
824     "src/compiler/register-allocator.cc",
825     "src/compiler/register-allocator.h",
826     "src/compiler/register-allocator-verifier.cc",
827     "src/compiler/register-allocator-verifier.h",
828     "src/compiler/register-configuration.cc",
829     "src/compiler/register-configuration.h",
830     "src/compiler/representation-change.h",
831     "src/compiler/schedule.cc",
832     "src/compiler/schedule.h",
833     "src/compiler/scheduler.cc",
834     "src/compiler/scheduler.h",
835     "src/compiler/select-lowering.cc",
836     "src/compiler/select-lowering.h",
837     "src/compiler/simplified-lowering.cc",
838     "src/compiler/simplified-lowering.h",
839     "src/compiler/simplified-operator-reducer.cc",
840     "src/compiler/simplified-operator-reducer.h",
841     "src/compiler/simplified-operator.cc",
842     "src/compiler/simplified-operator.h",
843     "src/compiler/source-position.cc",
844     "src/compiler/source-position.h",
845     "src/compiler/state-values-utils.cc",
846     "src/compiler/state-values-utils.h",
847     "src/compiler/tail-call-optimization.cc",
848     "src/compiler/tail-call-optimization.h",
849     "src/compiler/typer.cc",
850     "src/compiler/typer.h",
851     "src/compiler/value-numbering-reducer.cc",
852     "src/compiler/value-numbering-reducer.h",
853     "src/compiler/verifier.cc",
854     "src/compiler/verifier.h",
855     "src/compiler/zone-pool.cc",
856     "src/compiler/zone-pool.h",
857     "src/compiler.cc",
858     "src/compiler.h",
859     "src/context-measure.cc",
860     "src/context-measure.h",
861     "src/contexts.cc",
862     "src/contexts.h",
863     "src/conversions-inl.h",
864     "src/conversions.cc",
865     "src/conversions.h",
866     "src/counters.cc",
867     "src/counters.h",
868     "src/cpu-profiler-inl.h",
869     "src/cpu-profiler.cc",
870     "src/cpu-profiler.h",
871     "src/date.cc",
872     "src/date.h",
873     "src/dateparser-inl.h",
874     "src/dateparser.cc",
875     "src/dateparser.h",
876     "src/debug/debug-evaluate.cc",
877     "src/debug/debug-evaluate.h",
878     "src/debug/debug-frames.cc",
879     "src/debug/debug-frames.h",
880     "src/debug/debug-scopes.cc",
881     "src/debug/debug-scopes.h",
882     "src/debug/debug.cc",
883     "src/debug/debug.h",
884     "src/debug/liveedit.cc",
885     "src/debug/liveedit.h",
886     "src/deoptimizer.cc",
887     "src/deoptimizer.h",
888     "src/disasm.h",
889     "src/disassembler.cc",
890     "src/disassembler.h",
891     "src/diy-fp.cc",
892     "src/diy-fp.h",
893     "src/double.h",
894     "src/dtoa.cc",
895     "src/dtoa.h",
896     "src/effects.h",
897     "src/elements-kind.cc",
898     "src/elements-kind.h",
899     "src/elements.cc",
900     "src/elements.h",
901     "src/execution.cc",
902     "src/execution.h",
903     "src/expression-classifier.h",
904     "src/extensions/externalize-string-extension.cc",
905     "src/extensions/externalize-string-extension.h",
906     "src/extensions/free-buffer-extension.cc",
907     "src/extensions/free-buffer-extension.h",
908     "src/extensions/gc-extension.cc",
909     "src/extensions/gc-extension.h",
910     "src/extensions/statistics-extension.cc",
911     "src/extensions/statistics-extension.h",
912     "src/extensions/trigger-failure-extension.cc",
913     "src/extensions/trigger-failure-extension.h",
914     "src/factory.cc",
915     "src/factory.h",
916     "src/fast-dtoa.cc",
917     "src/fast-dtoa.h",
918     "src/field-index.h",
919     "src/field-index-inl.h",
920     "src/fixed-dtoa.cc",
921     "src/fixed-dtoa.h",
922     "src/flag-definitions.h",
923     "src/flags.cc",
924     "src/flags.h",
925     "src/frames-inl.h",
926     "src/frames.cc",
927     "src/frames.h",
928     "src/full-codegen/full-codegen.cc",
929     "src/full-codegen/full-codegen.h",
930     "src/func-name-inferrer.cc",
931     "src/func-name-inferrer.h",
932     "src/futex-emulation.cc",
933     "src/futex-emulation.h",
934     "src/gdb-jit.cc",
935     "src/gdb-jit.h",
936     "src/global-handles.cc",
937     "src/global-handles.h",
938     "src/globals.h",
939     "src/handles-inl.h",
940     "src/handles.cc",
941     "src/handles.h",
942     "src/hashmap.h",
943     "src/heap-profiler.cc",
944     "src/heap-profiler.h",
945     "src/heap-snapshot-generator-inl.h",
946     "src/heap-snapshot-generator.cc",
947     "src/heap-snapshot-generator.h",
948     "src/heap/gc-idle-time-handler.cc",
949     "src/heap/gc-idle-time-handler.h",
950     "src/heap/gc-tracer.cc",
951     "src/heap/gc-tracer.h",
952     "src/heap/heap-inl.h",
953     "src/heap/heap.cc",
954     "src/heap/heap.h",
955     "src/heap/identity-map.cc",
956     "src/heap/identity-map.h",
957     "src/heap/incremental-marking.cc",
958     "src/heap/incremental-marking.h",
959     "src/heap/mark-compact-inl.h",
960     "src/heap/mark-compact.cc",
961     "src/heap/mark-compact.h",
962     "src/heap/memory-reducer.cc",
963     "src/heap/memory-reducer.h",
964     "src/heap/objects-visiting-inl.h",
965     "src/heap/objects-visiting.cc",
966     "src/heap/objects-visiting.h",
967     "src/heap/spaces-inl.h",
968     "src/heap/spaces.cc",
969     "src/heap/spaces.h",
970     "src/heap/store-buffer-inl.h",
971     "src/heap/store-buffer.cc",
972     "src/heap/store-buffer.h",
973     "src/hydrogen-alias-analysis.h",
974     "src/hydrogen-bce.cc",
975     "src/hydrogen-bce.h",
976     "src/hydrogen-bch.cc",
977     "src/hydrogen-bch.h",
978     "src/hydrogen-canonicalize.cc",
979     "src/hydrogen-canonicalize.h",
980     "src/hydrogen-check-elimination.cc",
981     "src/hydrogen-check-elimination.h",
982     "src/hydrogen-dce.cc",
983     "src/hydrogen-dce.h",
984     "src/hydrogen-dehoist.cc",
985     "src/hydrogen-dehoist.h",
986     "src/hydrogen-environment-liveness.cc",
987     "src/hydrogen-environment-liveness.h",
988     "src/hydrogen-escape-analysis.cc",
989     "src/hydrogen-escape-analysis.h",
990     "src/hydrogen-flow-engine.h",
991     "src/hydrogen-instructions.cc",
992     "src/hydrogen-instructions.h",
993     "src/hydrogen.cc",
994     "src/hydrogen.h",
995     "src/hydrogen-gvn.cc",
996     "src/hydrogen-gvn.h",
997     "src/hydrogen-infer-representation.cc",
998     "src/hydrogen-infer-representation.h",
999     "src/hydrogen-infer-types.cc",
1000     "src/hydrogen-infer-types.h",
1001     "src/hydrogen-load-elimination.cc",
1002     "src/hydrogen-load-elimination.h",
1003     "src/hydrogen-mark-deoptimize.cc",
1004     "src/hydrogen-mark-deoptimize.h",
1005     "src/hydrogen-mark-unreachable.cc",
1006     "src/hydrogen-mark-unreachable.h",
1007     "src/hydrogen-osr.cc",
1008     "src/hydrogen-osr.h",
1009     "src/hydrogen-range-analysis.cc",
1010     "src/hydrogen-range-analysis.h",
1011     "src/hydrogen-redundant-phi.cc",
1012     "src/hydrogen-redundant-phi.h",
1013     "src/hydrogen-removable-simulates.cc",
1014     "src/hydrogen-removable-simulates.h",
1015     "src/hydrogen-representation-changes.cc",
1016     "src/hydrogen-representation-changes.h",
1017     "src/hydrogen-sce.cc",
1018     "src/hydrogen-sce.h",
1019     "src/hydrogen-store-elimination.cc",
1020     "src/hydrogen-store-elimination.h",
1021     "src/hydrogen-types.cc",
1022     "src/hydrogen-types.h",
1023     "src/hydrogen-uint32-analysis.cc",
1024     "src/hydrogen-uint32-analysis.h",
1025     "src/i18n.cc",
1026     "src/i18n.h",
1027     "src/icu_util.cc",
1028     "src/icu_util.h",
1029     "src/ic/access-compiler.cc",
1030     "src/ic/access-compiler.h",
1031     "src/ic/call-optimization.cc",
1032     "src/ic/call-optimization.h",
1033     "src/ic/handler-compiler.cc",
1034     "src/ic/handler-compiler.h",
1035     "src/ic/ic-inl.h",
1036     "src/ic/ic-state.cc",
1037     "src/ic/ic-state.h",
1038     "src/ic/ic.cc",
1039     "src/ic/ic.h",
1040     "src/ic/ic-compiler.cc",
1041     "src/ic/ic-compiler.h",
1042     "src/ic/stub-cache.cc",
1043     "src/ic/stub-cache.h",
1044     "src/interface-descriptors.cc",
1045     "src/interface-descriptors.h",
1046     "src/interpreter/bytecodes.cc",
1047     "src/interpreter/bytecodes.h",
1048     "src/interpreter/bytecode-array-builder.cc",
1049     "src/interpreter/bytecode-array-builder.h",
1050     "src/interpreter/bytecode-generator.cc",
1051     "src/interpreter/bytecode-generator.h",
1052     "src/interpreter/interpreter.cc",
1053     "src/interpreter/interpreter.h",
1054     "src/isolate.cc",
1055     "src/isolate.h",
1056     "src/json-parser.h",
1057     "src/json-stringifier.h",
1058     "src/layout-descriptor-inl.h",
1059     "src/layout-descriptor.cc",
1060     "src/layout-descriptor.h",
1061     "src/list-inl.h",
1062     "src/list.h",
1063     "src/lithium-allocator-inl.h",
1064     "src/lithium-allocator.cc",
1065     "src/lithium-allocator.h",
1066     "src/lithium-codegen.cc",
1067     "src/lithium-codegen.h",
1068     "src/lithium.cc",
1069     "src/lithium.h",
1070     "src/log-inl.h",
1071     "src/log-utils.cc",
1072     "src/log-utils.h",
1073     "src/log.cc",
1074     "src/log.h",
1075     "src/lookup-inl.h",
1076     "src/lookup.cc",
1077     "src/lookup.h",
1078     "src/macro-assembler.h",
1079     "src/messages.cc",
1080     "src/messages.h",
1081     "src/modules.cc",
1082     "src/modules.h",
1083     "src/msan.h",
1084     "src/objects-debug.cc",
1085     "src/objects-inl.h",
1086     "src/objects-printer.cc",
1087     "src/objects.cc",
1088     "src/objects.h",
1089     "src/optimizing-compile-dispatcher.cc",
1090     "src/optimizing-compile-dispatcher.h",
1091     "src/ostreams.cc",
1092     "src/ostreams.h",
1093     "src/pattern-rewriter.cc",
1094     "src/parser.cc",
1095     "src/parser.h",
1096     "src/pending-compilation-error-handler.cc",
1097     "src/pending-compilation-error-handler.h",
1098     "src/preparse-data-format.h",
1099     "src/preparse-data.cc",
1100     "src/preparse-data.h",
1101     "src/preparser.cc",
1102     "src/preparser.h",
1103     "src/prettyprinter.cc",
1104     "src/prettyprinter.h",
1105     "src/profile-generator-inl.h",
1106     "src/profile-generator.cc",
1107     "src/profile-generator.h",
1108     "src/property-details.h",
1109     "src/property.cc",
1110     "src/property.h",
1111     "src/prototype.h",
1112     "src/rewriter.cc",
1113     "src/rewriter.h",
1114     "src/regexp/bytecodes-irregexp.h",
1115     "src/regexp/interpreter-irregexp.cc",
1116     "src/regexp/interpreter-irregexp.h",
1117     "src/regexp/jsregexp-inl.h",
1118     "src/regexp/jsregexp.cc",
1119     "src/regexp/jsregexp.h",
1120     "src/regexp/regexp-macro-assembler-irregexp-inl.h",
1121     "src/regexp/regexp-macro-assembler-irregexp.cc",
1122     "src/regexp/regexp-macro-assembler-irregexp.h",
1123     "src/regexp/regexp-macro-assembler-tracer.cc",
1124     "src/regexp/regexp-macro-assembler-tracer.h",
1125     "src/regexp/regexp-macro-assembler.cc",
1126     "src/regexp/regexp-macro-assembler.h",
1127     "src/regexp/regexp-stack.cc",
1128     "src/regexp/regexp-stack.h",
1129     "src/runtime-profiler.cc",
1130     "src/runtime-profiler.h",
1131     "src/runtime/runtime-array.cc",
1132     "src/runtime/runtime-atomics.cc",
1133     "src/runtime/runtime-classes.cc",
1134     "src/runtime/runtime-collections.cc",
1135     "src/runtime/runtime-compiler.cc",
1136     "src/runtime/runtime-date.cc",
1137     "src/runtime/runtime-debug.cc",
1138     "src/runtime/runtime-forin.cc",
1139     "src/runtime/runtime-function.cc",
1140     "src/runtime/runtime-futex.cc",
1141     "src/runtime/runtime-generator.cc",
1142     "src/runtime/runtime-i18n.cc",
1143     "src/runtime/runtime-internal.cc",
1144     "src/runtime/runtime-json.cc",
1145     "src/runtime/runtime-literals.cc",
1146     "src/runtime/runtime-liveedit.cc",
1147     "src/runtime/runtime-maths.cc",
1148     "src/runtime/runtime-numbers.cc",
1149     "src/runtime/runtime-object.cc",
1150     "src/runtime/runtime-observe.cc",
1151     "src/runtime/runtime-proxy.cc",
1152     "src/runtime/runtime-regexp.cc",
1153     "src/runtime/runtime-scopes.cc",
1154     "src/runtime/runtime-simd.cc",
1155     "src/runtime/runtime-strings.cc",
1156     "src/runtime/runtime-symbol.cc",
1157     "src/runtime/runtime-test.cc",
1158     "src/runtime/runtime-typedarray.cc",
1159     "src/runtime/runtime-uri.cc",
1160     "src/runtime/runtime-utils.h",
1161     "src/runtime/runtime.cc",
1162     "src/runtime/runtime.h",
1163     "src/safepoint-table.cc",
1164     "src/safepoint-table.h",
1165     "src/sampler.cc",
1166     "src/sampler.h",
1167     "src/scanner-character-streams.cc",
1168     "src/scanner-character-streams.h",
1169     "src/scanner.cc",
1170     "src/scanner.h",
1171     "src/scopeinfo.cc",
1172     "src/scopeinfo.h",
1173     "src/scopes.cc",
1174     "src/scopes.h",
1175     "src/signature.h",
1176     "src/simulator.h",
1177     "src/small-pointer-list.h",
1178     "src/snapshot/natives.h",
1179     "src/snapshot/natives-common.cc",
1180     "src/snapshot/serialize.cc",
1181     "src/snapshot/serialize.h",
1182     "src/snapshot/snapshot-common.cc",
1183     "src/snapshot/snapshot-source-sink.cc",
1184     "src/snapshot/snapshot-source-sink.h",
1185     "src/splay-tree.h",
1186     "src/splay-tree-inl.h",
1187     "src/snapshot/snapshot.h",
1188     "src/startup-data-util.h",
1189     "src/startup-data-util.cc",
1190     "src/string-builder.cc",
1191     "src/string-builder.h",
1192     "src/string-search.h",
1193     "src/string-stream.cc",
1194     "src/string-stream.h",
1195     "src/strings-storage.cc",
1196     "src/strings-storage.h",
1197     "src/strtod.cc",
1198     "src/strtod.h",
1199     "src/token.cc",
1200     "src/token.h",
1201     "src/transitions-inl.h",
1202     "src/transitions.cc",
1203     "src/transitions.h",
1204     "src/type-feedback-vector-inl.h",
1205     "src/type-feedback-vector.cc",
1206     "src/type-feedback-vector.h",
1207     "src/type-info.cc",
1208     "src/type-info.h",
1209     "src/types-inl.h",
1210     "src/types.cc",
1211     "src/types.h",
1212     "src/typing.cc",
1213     "src/typing.h",
1214     "src/unbound-queue-inl.h",
1215     "src/unbound-queue.h",
1216     "src/unicode-inl.h",
1217     "src/unicode.cc",
1218     "src/unicode.h",
1219     "src/unicode-cache-inl.h",
1220     "src/unicode-cache.h",
1221     "src/unicode-decoder.cc",
1222     "src/unicode-decoder.h",
1223     "src/unique.h",
1224     "src/utils.cc",
1225     "src/utils.h",
1226     "src/v8.cc",
1227     "src/v8.h",
1228     "src/v8memory.h",
1229     "src/v8threads.cc",
1230     "src/v8threads.h",
1231     "src/variables.cc",
1232     "src/variables.h",
1233     "src/version.cc",
1234     "src/version.h",
1235     "src/vm-state-inl.h",
1236     "src/vm-state.h",
1237     "src/zone.cc",
1238     "src/zone.h",
1239     "src/zone-allocator.h",
1240     "src/zone-containers.h",
1241     "src/third_party/fdlibm/fdlibm.cc",
1242     "src/third_party/fdlibm/fdlibm.h",
1243   ]
1244
1245   if (v8_target_arch == "x86") {
1246     sources += [
1247       "src/ia32/assembler-ia32-inl.h",
1248       "src/ia32/assembler-ia32.cc",
1249       "src/ia32/assembler-ia32.h",
1250       "src/ia32/builtins-ia32.cc",
1251       "src/ia32/code-stubs-ia32.cc",
1252       "src/ia32/code-stubs-ia32.h",
1253       "src/ia32/codegen-ia32.cc",
1254       "src/ia32/codegen-ia32.h",
1255       "src/ia32/cpu-ia32.cc",
1256       "src/ia32/deoptimizer-ia32.cc",
1257       "src/ia32/disasm-ia32.cc",
1258       "src/ia32/frames-ia32.cc",
1259       "src/ia32/frames-ia32.h",
1260       "src/ia32/interface-descriptors-ia32.cc",
1261       "src/ia32/lithium-codegen-ia32.cc",
1262       "src/ia32/lithium-codegen-ia32.h",
1263       "src/ia32/lithium-gap-resolver-ia32.cc",
1264       "src/ia32/lithium-gap-resolver-ia32.h",
1265       "src/ia32/lithium-ia32.cc",
1266       "src/ia32/lithium-ia32.h",
1267       "src/ia32/macro-assembler-ia32.cc",
1268       "src/ia32/macro-assembler-ia32.h",
1269       "src/compiler/ia32/code-generator-ia32.cc",
1270       "src/compiler/ia32/instruction-codes-ia32.h",
1271       "src/compiler/ia32/instruction-selector-ia32.cc",
1272       "src/debug/ia32/debug-ia32.cc",
1273       "src/full-codegen/ia32/full-codegen-ia32.cc",
1274       "src/ic/ia32/access-compiler-ia32.cc",
1275       "src/ic/ia32/handler-compiler-ia32.cc",
1276       "src/ic/ia32/ic-ia32.cc",
1277       "src/ic/ia32/ic-compiler-ia32.cc",
1278       "src/ic/ia32/stub-cache-ia32.cc",
1279       "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
1280       "src/regexp/ia32/regexp-macro-assembler-ia32.h",
1281     ]
1282   } else if (v8_target_arch == "x64") {
1283     sources += [
1284       "src/x64/assembler-x64-inl.h",
1285       "src/x64/assembler-x64.cc",
1286       "src/x64/assembler-x64.h",
1287       "src/x64/builtins-x64.cc",
1288       "src/x64/code-stubs-x64.cc",
1289       "src/x64/code-stubs-x64.h",
1290       "src/x64/codegen-x64.cc",
1291       "src/x64/codegen-x64.h",
1292       "src/x64/cpu-x64.cc",
1293       "src/x64/deoptimizer-x64.cc",
1294       "src/x64/disasm-x64.cc",
1295       "src/x64/frames-x64.cc",
1296       "src/x64/frames-x64.h",
1297       "src/x64/interface-descriptors-x64.cc",
1298       "src/x64/lithium-codegen-x64.cc",
1299       "src/x64/lithium-codegen-x64.h",
1300       "src/x64/lithium-gap-resolver-x64.cc",
1301       "src/x64/lithium-gap-resolver-x64.h",
1302       "src/x64/lithium-x64.cc",
1303       "src/x64/lithium-x64.h",
1304       "src/x64/macro-assembler-x64.cc",
1305       "src/x64/macro-assembler-x64.h",
1306       "src/compiler/x64/code-generator-x64.cc",
1307       "src/compiler/x64/instruction-codes-x64.h",
1308       "src/compiler/x64/instruction-selector-x64.cc",
1309       "src/debug/x64/debug-x64.cc",
1310       "src/full-codegen/x64/full-codegen-x64.cc",
1311       "src/ic/x64/access-compiler-x64.cc",
1312       "src/ic/x64/handler-compiler-x64.cc",
1313       "src/ic/x64/ic-x64.cc",
1314       "src/ic/x64/ic-compiler-x64.cc",
1315       "src/ic/x64/stub-cache-x64.cc",
1316       "src/regexp/x64/regexp-macro-assembler-x64.cc",
1317       "src/regexp/x64/regexp-macro-assembler-x64.h",
1318     ]
1319   } else if (v8_target_arch == "arm") {
1320     sources += [
1321       "src/arm/assembler-arm-inl.h",
1322       "src/arm/assembler-arm.cc",
1323       "src/arm/assembler-arm.h",
1324       "src/arm/builtins-arm.cc",
1325       "src/arm/code-stubs-arm.cc",
1326       "src/arm/code-stubs-arm.h",
1327       "src/arm/codegen-arm.cc",
1328       "src/arm/codegen-arm.h",
1329       "src/arm/constants-arm.h",
1330       "src/arm/constants-arm.cc",
1331       "src/arm/cpu-arm.cc",
1332       "src/arm/deoptimizer-arm.cc",
1333       "src/arm/disasm-arm.cc",
1334       "src/arm/frames-arm.cc",
1335       "src/arm/frames-arm.h",
1336       "src/arm/interface-descriptors-arm.cc",
1337       "src/arm/interface-descriptors-arm.h",
1338       "src/arm/lithium-arm.cc",
1339       "src/arm/lithium-arm.h",
1340       "src/arm/lithium-codegen-arm.cc",
1341       "src/arm/lithium-codegen-arm.h",
1342       "src/arm/lithium-gap-resolver-arm.cc",
1343       "src/arm/lithium-gap-resolver-arm.h",
1344       "src/arm/macro-assembler-arm.cc",
1345       "src/arm/macro-assembler-arm.h",
1346       "src/arm/simulator-arm.cc",
1347       "src/arm/simulator-arm.h",
1348       "src/compiler/arm/code-generator-arm.cc",
1349       "src/compiler/arm/instruction-codes-arm.h",
1350       "src/compiler/arm/instruction-selector-arm.cc",
1351       "src/debug/arm/debug-arm.cc",
1352       "src/full-codegen/arm/full-codegen-arm.cc",
1353       "src/ic/arm/access-compiler-arm.cc",
1354       "src/ic/arm/handler-compiler-arm.cc",
1355       "src/ic/arm/ic-arm.cc",
1356       "src/ic/arm/ic-compiler-arm.cc",
1357       "src/ic/arm/stub-cache-arm.cc",
1358       "src/regexp/arm/regexp-macro-assembler-arm.cc",
1359       "src/regexp/arm/regexp-macro-assembler-arm.h",
1360     ]
1361   } else if (v8_target_arch == "arm64") {
1362     sources += [
1363       "src/arm64/assembler-arm64.cc",
1364       "src/arm64/assembler-arm64.h",
1365       "src/arm64/assembler-arm64-inl.h",
1366       "src/arm64/builtins-arm64.cc",
1367       "src/arm64/codegen-arm64.cc",
1368       "src/arm64/codegen-arm64.h",
1369       "src/arm64/code-stubs-arm64.cc",
1370       "src/arm64/code-stubs-arm64.h",
1371       "src/arm64/constants-arm64.h",
1372       "src/arm64/cpu-arm64.cc",
1373       "src/arm64/decoder-arm64.cc",
1374       "src/arm64/decoder-arm64.h",
1375       "src/arm64/decoder-arm64-inl.h",
1376       "src/arm64/deoptimizer-arm64.cc",
1377       "src/arm64/disasm-arm64.cc",
1378       "src/arm64/disasm-arm64.h",
1379       "src/arm64/frames-arm64.cc",
1380       "src/arm64/frames-arm64.h",
1381       "src/arm64/instructions-arm64.cc",
1382       "src/arm64/instructions-arm64.h",
1383       "src/arm64/instrument-arm64.cc",
1384       "src/arm64/instrument-arm64.h",
1385       "src/arm64/interface-descriptors-arm64.cc",
1386       "src/arm64/interface-descriptors-arm64.h",
1387       "src/arm64/lithium-arm64.cc",
1388       "src/arm64/lithium-arm64.h",
1389       "src/arm64/lithium-codegen-arm64.cc",
1390       "src/arm64/lithium-codegen-arm64.h",
1391       "src/arm64/lithium-gap-resolver-arm64.cc",
1392       "src/arm64/lithium-gap-resolver-arm64.h",
1393       "src/arm64/macro-assembler-arm64.cc",
1394       "src/arm64/macro-assembler-arm64.h",
1395       "src/arm64/macro-assembler-arm64-inl.h",
1396       "src/arm64/simulator-arm64.cc",
1397       "src/arm64/simulator-arm64.h",
1398       "src/arm64/utils-arm64.cc",
1399       "src/arm64/utils-arm64.h",
1400       "src/compiler/arm64/code-generator-arm64.cc",
1401       "src/compiler/arm64/instruction-codes-arm64.h",
1402       "src/compiler/arm64/instruction-selector-arm64.cc",
1403       "src/debug/arm64/debug-arm64.cc",
1404       "src/full-codegen/arm64/full-codegen-arm64.cc",
1405       "src/ic/arm64/access-compiler-arm64.cc",
1406       "src/ic/arm64/handler-compiler-arm64.cc",
1407       "src/ic/arm64/ic-arm64.cc",
1408       "src/ic/arm64/ic-compiler-arm64.cc",
1409       "src/ic/arm64/stub-cache-arm64.cc",
1410       "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
1411       "src/regexp/arm64/regexp-macro-assembler-arm64.h",
1412     ]
1413   } else if (v8_target_arch == "mipsel") {
1414     sources += [
1415       "src/mips/assembler-mips.cc",
1416       "src/mips/assembler-mips.h",
1417       "src/mips/assembler-mips-inl.h",
1418       "src/mips/builtins-mips.cc",
1419       "src/mips/codegen-mips.cc",
1420       "src/mips/codegen-mips.h",
1421       "src/mips/code-stubs-mips.cc",
1422       "src/mips/code-stubs-mips.h",
1423       "src/mips/constants-mips.cc",
1424       "src/mips/constants-mips.h",
1425       "src/mips/cpu-mips.cc",
1426       "src/mips/deoptimizer-mips.cc",
1427       "src/mips/disasm-mips.cc",
1428       "src/mips/frames-mips.cc",
1429       "src/mips/frames-mips.h",
1430       "src/mips/interface-descriptors-mips.cc",
1431       "src/mips/lithium-codegen-mips.cc",
1432       "src/mips/lithium-codegen-mips.h",
1433       "src/mips/lithium-gap-resolver-mips.cc",
1434       "src/mips/lithium-gap-resolver-mips.h",
1435       "src/mips/lithium-mips.cc",
1436       "src/mips/lithium-mips.h",
1437       "src/mips/macro-assembler-mips.cc",
1438       "src/mips/macro-assembler-mips.h",
1439       "src/mips/simulator-mips.cc",
1440       "src/mips/simulator-mips.h",
1441       "src/compiler/mips/code-generator-mips.cc",
1442       "src/compiler/mips/instruction-codes-mips.h",
1443       "src/compiler/mips/instruction-selector-mips.cc",
1444       "src/debug/mips/debug-mips.cc",
1445       "src/full-codegen/mips/full-codegen-mips.cc",
1446       "src/ic/mips/access-compiler-mips.cc",
1447       "src/ic/mips/handler-compiler-mips.cc",
1448       "src/ic/mips/ic-mips.cc",
1449       "src/ic/mips/ic-compiler-mips.cc",
1450       "src/ic/mips/stub-cache-mips.cc",
1451       "src/regexp/mips/regexp-macro-assembler-mips.cc",
1452       "src/regexp/mips/regexp-macro-assembler-mips.h",
1453     ]
1454   } else if (v8_target_arch == "mips64el") {
1455     sources += [
1456       "src/mips64/assembler-mips64.cc",
1457       "src/mips64/assembler-mips64.h",
1458       "src/mips64/assembler-mips64-inl.h",
1459       "src/mips64/builtins-mips64.cc",
1460       "src/mips64/codegen-mips64.cc",
1461       "src/mips64/codegen-mips64.h",
1462       "src/mips64/code-stubs-mips64.cc",
1463       "src/mips64/code-stubs-mips64.h",
1464       "src/mips64/constants-mips64.cc",
1465       "src/mips64/constants-mips64.h",
1466       "src/mips64/cpu-mips64.cc",
1467       "src/mips64/deoptimizer-mips64.cc",
1468       "src/mips64/disasm-mips64.cc",
1469       "src/mips64/frames-mips64.cc",
1470       "src/mips64/frames-mips64.h",
1471       "src/mips64/interface-descriptors-mips64.cc",
1472       "src/mips64/lithium-codegen-mips64.cc",
1473       "src/mips64/lithium-codegen-mips64.h",
1474       "src/mips64/lithium-gap-resolver-mips64.cc",
1475       "src/mips64/lithium-gap-resolver-mips64.h",
1476       "src/mips64/lithium-mips64.cc",
1477       "src/mips64/lithium-mips64.h",
1478       "src/mips64/macro-assembler-mips64.cc",
1479       "src/mips64/macro-assembler-mips64.h",
1480       "src/mips64/simulator-mips64.cc",
1481       "src/mips64/simulator-mips64.h",
1482       "src/debug/mips64/debug-mips64.cc",
1483       "src/full-codegen/mips64/full-codegen-mips64.cc",
1484       "src/ic/mips64/access-compiler-mips64.cc",
1485       "src/ic/mips64/handler-compiler-mips64.cc",
1486       "src/ic/mips64/ic-mips64.cc",
1487       "src/ic/mips64/ic-compiler-mips64.cc",
1488       "src/ic/mips64/stub-cache-mips64.cc",
1489       "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
1490       "src/regexp/mips64/regexp-macro-assembler-mips64.h",
1491     ]
1492   }
1493
1494   configs -= [ "//build/config/compiler:chromium_code" ]
1495   configs += [ "//build/config/compiler:no_chromium_code" ]
1496   configs += [
1497     ":internal_config",
1498     ":features",
1499     ":toolchain",
1500   ]
1501
1502   if (!is_debug) {
1503     configs -= [ "//build/config/compiler:optimize" ]
1504     configs += [ "//build/config/compiler:optimize_max" ]
1505   }
1506
1507   defines = []
1508   deps = [
1509     ":v8_libbase",
1510   ]
1511
1512   if (is_win) {
1513     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1514     cflags = [ "/wd4267" ]
1515   }
1516
1517   if (v8_enable_i18n_support) {
1518     deps += [ "//third_party/icu" ]
1519     if (is_win) {
1520       deps += [ "//third_party/icu:icudata" ]
1521     }
1522
1523     # TODO(jochen): Add support for icu_use_data_file_flag
1524     defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ]
1525   } else {
1526     sources -= [
1527       "src/i18n.cc",
1528       "src/i18n.h",
1529     ]
1530   }
1531
1532   if (v8_postmortem_support) {
1533     sources += [ "$target_gen_dir/debug-support.cc" ]
1534     deps += [ ":postmortem-metadata" ]
1535   }
1536 }
1537
1538 source_set("v8_libbase") {
1539   visibility = [ ":*" ]  # Only targets in this file can depend on this.
1540
1541   sources = [
1542     "src/base/adapters.h",
1543     "src/base/atomicops.h",
1544     "src/base/atomicops_internals_arm64_gcc.h",
1545     "src/base/atomicops_internals_arm_gcc.h",
1546     "src/base/atomicops_internals_atomicword_compat.h",
1547     "src/base/atomicops_internals_mac.h",
1548     "src/base/atomicops_internals_mips_gcc.h",
1549     "src/base/atomicops_internals_mips64_gcc.h",
1550     "src/base/atomicops_internals_portable.h",
1551     "src/base/atomicops_internals_tsan.h",
1552     "src/base/atomicops_internals_x86_gcc.cc",
1553     "src/base/atomicops_internals_x86_gcc.h",
1554     "src/base/atomicops_internals_x86_msvc.h",
1555     "src/base/bits.cc",
1556     "src/base/bits.h",
1557     "src/base/build_config.h",
1558     "src/base/cpu.cc",
1559     "src/base/cpu.h",
1560     "src/base/division-by-constant.cc",
1561     "src/base/division-by-constant.h",
1562     "src/base/flags.h",
1563     "src/base/functional.cc",
1564     "src/base/functional.h",
1565     "src/base/iterator.h",
1566     "src/base/lazy-instance.h",
1567     "src/base/logging.cc",
1568     "src/base/logging.h",
1569     "src/base/macros.h",
1570     "src/base/once.cc",
1571     "src/base/once.h",
1572     "src/base/platform/elapsed-timer.h",
1573     "src/base/platform/time.cc",
1574     "src/base/platform/time.h",
1575     "src/base/platform/condition-variable.cc",
1576     "src/base/platform/condition-variable.h",
1577     "src/base/platform/mutex.cc",
1578     "src/base/platform/mutex.h",
1579     "src/base/platform/platform.h",
1580     "src/base/platform/semaphore.cc",
1581     "src/base/platform/semaphore.h",
1582     "src/base/safe_conversions.h",
1583     "src/base/safe_conversions_impl.h",
1584     "src/base/safe_math.h",
1585     "src/base/safe_math_impl.h",
1586     "src/base/smart-pointers.h",
1587     "src/base/sys-info.cc",
1588     "src/base/sys-info.h",
1589     "src/base/utils/random-number-generator.cc",
1590     "src/base/utils/random-number-generator.h",
1591   ]
1592
1593   configs -= [ "//build/config/compiler:chromium_code" ]
1594   configs += [ "//build/config/compiler:no_chromium_code" ]
1595   configs += [
1596     ":internal_config_base",
1597     ":features",
1598     ":toolchain",
1599   ]
1600
1601   if (!is_debug) {
1602     configs -= [ "//build/config/compiler:optimize" ]
1603     configs += [ "//build/config/compiler:optimize_max" ]
1604   }
1605
1606   defines = []
1607
1608   if (is_posix) {
1609     sources += [ "src/base/platform/platform-posix.cc" ]
1610   }
1611
1612   if (is_linux) {
1613     sources += [ "src/base/platform/platform-linux.cc" ]
1614
1615     libs = [ "dl", "rt" ]
1616   } else if (is_android) {
1617     defines += [ "CAN_USE_VFP_INSTRUCTIONS" ]
1618
1619     if (current_toolchain == host_toolchain) {
1620       libs = [ "dl", "rt" ]
1621       if (host_os == "mac") {
1622         sources += [ "src/base/platform/platform-macos.cc" ]
1623       } else {
1624         sources += [ "src/base/platform/platform-linux.cc" ]
1625       }
1626     } else {
1627       sources += [ "src/base/platform/platform-linux.cc" ]
1628     }
1629   } else if (is_mac) {
1630     sources += [ "src/base/platform/platform-macos.cc" ]
1631   } else if (is_win) {
1632     # TODO(jochen): Add support for cygwin.
1633     sources += [
1634       "src/base/platform/platform-win32.cc",
1635       "src/base/win32-headers.h",
1636     ]
1637
1638     defines += [ "_CRT_RAND_S" ]  # for rand_s()
1639
1640     libs = [
1641       "winmm.lib",
1642       "ws2_32.lib",
1643     ]
1644   }
1645
1646   # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
1647 }
1648
1649 source_set("v8_libplatform") {
1650   sources = [
1651     "include/libplatform/libplatform.h",
1652     "src/libplatform/default-platform.cc",
1653     "src/libplatform/default-platform.h",
1654     "src/libplatform/task-queue.cc",
1655     "src/libplatform/task-queue.h",
1656     "src/libplatform/worker-thread.cc",
1657     "src/libplatform/worker-thread.h",
1658   ]
1659
1660   configs -= [ "//build/config/compiler:chromium_code" ]
1661   configs += [ "//build/config/compiler:no_chromium_code" ]
1662   configs += [
1663     ":internal_config_base",
1664     ":features",
1665     ":toolchain",
1666   ]
1667
1668   if (!is_debug) {
1669     configs -= [ "//build/config/compiler:optimize" ]
1670     configs += [ "//build/config/compiler:optimize_max" ]
1671   }
1672
1673   deps = [
1674     ":v8_libbase",
1675   ]
1676 }
1677
1678 ###############################################################################
1679 # Executables
1680 #
1681
1682 if (current_toolchain == snapshot_toolchain) {
1683   executable("mksnapshot") {
1684     visibility = [ ":*" ]  # Only targets in this file can depend on this.
1685
1686     sources = [
1687       "src/snapshot/mksnapshot.cc",
1688     ]
1689
1690     configs -= [ "//build/config/compiler:chromium_code" ]
1691     configs += [ "//build/config/compiler:no_chromium_code" ]
1692     configs += [
1693       ":internal_config",
1694       ":features",
1695       ":toolchain",
1696     ]
1697
1698     deps = [
1699       ":v8_base",
1700       ":v8_libplatform",
1701       ":v8_nosnapshot",
1702       "//build/config/sanitizers:deps",
1703     ]
1704   }
1705 }
1706
1707 ###############################################################################
1708 # Public targets
1709 #
1710
1711 if (is_component_build) {
1712   component("v8") {
1713     sources = [
1714       "src/v8dll-main.cc",
1715     ]
1716
1717     if (v8_use_snapshot && v8_use_external_startup_data) {
1718       deps = [
1719         ":v8_base",
1720       ]
1721       public_deps = [
1722         ":v8_external_snapshot",
1723       ]
1724     } else if (v8_use_snapshot) {
1725       deps = [
1726         ":v8_base",
1727       ]
1728       # v8_snapshot should be public so downstream targets can declare the
1729       # snapshot file as their input.
1730       public_deps = [
1731         ":v8_snapshot",
1732       ]
1733     } else {
1734       assert(!v8_use_external_startup_data)
1735       deps = [
1736         ":v8_base",
1737         ":v8_nosnapshot",
1738       ]
1739     }
1740
1741     configs -= [ "//build/config/compiler:chromium_code" ]
1742     configs += [ "//build/config/compiler:no_chromium_code" ]
1743     configs += [
1744       ":internal_config",
1745       ":features",
1746       ":toolchain",
1747     ]
1748
1749     public_configs = [ ":external_config" ]
1750
1751     libs = []
1752     if (is_android && current_toolchain != host_toolchain) {
1753       libs += [ "log" ]
1754     }
1755   }
1756 } else {
1757   group("v8") {
1758     if (v8_use_snapshot && v8_use_external_startup_data) {
1759       deps = [
1760         ":v8_base",
1761         ":v8_external_snapshot",
1762       ]
1763     } else if (v8_use_snapshot) {
1764       deps = [
1765         ":v8_base",
1766       ]
1767       public_deps = [
1768         ":v8_snapshot",
1769       ]
1770     } else {
1771       assert(!v8_use_external_startup_data)
1772       deps = [
1773         ":v8_base",
1774         ":v8_nosnapshot",
1775       ]
1776     }
1777
1778     public_configs = [ ":external_config" ]
1779   }
1780 }
1781
1782 if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") ||
1783     (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) {
1784   executable("d8") {
1785     sources = [
1786       "src/d8.cc",
1787       "src/d8.h",
1788     ]
1789
1790     configs -= [ "//build/config/compiler:chromium_code" ]
1791     configs += [ "//build/config/compiler:no_chromium_code" ]
1792     configs += [
1793       # Note: don't use :internal_config here because this target will get
1794       # the :external_config applied to it by virtue of depending on :v8, and
1795       # you can't have both applied to the same target.
1796       ":internal_config_base",
1797       ":features",
1798       ":toolchain",
1799     ]
1800
1801     deps = [
1802       ":d8_js2c",
1803       ":v8",
1804       ":v8_libplatform",
1805       "//build/config/sanitizers:deps",
1806     ]
1807
1808     # TODO(jochen): Add support for vtunejit.
1809
1810     if (is_posix) {
1811       sources += [ "src/d8-posix.cc" ]
1812     } else if (is_win) {
1813       sources += [ "src/d8-windows.cc" ]
1814     }
1815
1816     if (!is_component_build) {
1817       sources += [
1818         "$target_gen_dir/d8-js.cc",
1819       ]
1820     }
1821     if (v8_enable_i18n_support) {
1822       deps += [ "//third_party/icu" ]
1823     }
1824   }
1825 }