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