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