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