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