22#  Use of this source code is governed by a BSD-style license that can be
33#  found in the LICENSE file.
44
5+ import (" //build/config/android/config.gni" 
6+ import (" //build/config/arm.gni" 
7+ import (" //build/config/mips.gni" 
8+ 
59#  Because standalone V8 builds are not supported, assume this is part of a
610#  Chromium build.
711import (" //build/module_args/v8.gni" 
@@ -18,10 +22,23 @@ v8_interpreted_regexp = false
1822v8_object_print  =  false 
1923v8_postmortem_support  =  false 
2024v8_use_snapshot  =  true 
21- v8_target_arch  =  cpu_arch 
25+ v8_target_arch  =  target_cpu 
2226v8_random_seed  =  " 314159265" 
2327v8_toolset_for_d8  =  " host" 
2428
29+ #  The snapshot needs to be compiled for the host, but compiled with
30+ #  a toolchain that matches the bit-width of the target.
31+ # 
32+ #  TODO(GYP ): For now we only support 32-bit little-endian target builds from an
33+ #  x64 Linux host. Eventually we need to support all of the host/target
34+ #  configurations v8 runs on.
35+ if  (host_cpu  ==  " x64" &&  host_os  ==  " linux" && 
36+     (target_cpu  ==  " arm" ||  target_cpu  ==  " mipsel" ||  target_cpu  ==  " x86" 
37+   snapshot_toolchain  =  " //build/toolchain/linux:clang_x86" 
38+ } else  {
39+   snapshot_toolchain  =  default_toolchain 
40+ }
41+ 
2542# ##############################################################################
2643#  Configurations
2744# 
@@ -96,37 +113,49 @@ config("toolchain") {
96113  defines  =  []
97114  cflags  =  []
98115
99-   #  TODO(jochen ): Add support for arm subarchs, mips, mipsel.
116+   #  TODO(jochen ): Add support for arm subarchs, mips, mipsel, mips64el .
100117
101118  if  (v8_target_arch  ==  " arm" 
102119    defines  +=  [ " V8_TARGET_ARCH_ARM" 
103-     if  (arm_version  ==  7 ) {
104-       defines  +=  [ " CAN_USE_ARMV7_INSTRUCTIONS" 
105-     }
106-     if  (arm_fpu  ==  " vfpv3-d16" 
107-       defines  +=  [ " CAN_USE_VFP3_INSTRUCTIONS" 
108-     }
109-     if  (arm_fpu  ==  " vfpv3" 
110-       defines  +=  [
111-         " CAN_USE_VFP3_INSTRUCTIONS" 
112-         " CAN_USE_VFP32DREGS" 
113-       ]
114-     }
115-     if  (arm_fpu  ==  " neon" 
120+     if  (current_cpu  ==  " arm" 
121+       if  (arm_version  ==  7 ) {
122+         defines  +=  [ " CAN_USE_ARMV7_INSTRUCTIONS" 
123+       }
124+       if  (arm_fpu  ==  " vfpv3-d16" 
125+         defines  +=  [ " CAN_USE_VFP3_INSTRUCTIONS" 
126+       } else  if  (arm_fpu  ==  " vfpv3" 
127+         defines  +=  [
128+           " CAN_USE_VFP3_INSTRUCTIONS" 
129+           " CAN_USE_VFP32DREGS" 
130+         ]
131+       } else  if  (arm_fpu  ==  " neon" 
132+         defines  +=  [
133+           " CAN_USE_VFP3_INSTRUCTIONS" 
134+           " CAN_USE_VFP32DREGS" 
135+           " CAN_USE_NEON" 
136+         ]
137+       }
138+     } else  {
139+       #  These defines ares used for the ARM simulator.
116140      defines  +=  [
141+         " CAN_USE_ARMV7_INSTRUCTIONS" 
117142        " CAN_USE_VFP3_INSTRUCTIONS" 
118143        " CAN_USE_VFP32DREGS" 
119-         " CAN_USE_NEON " 
144+         " USE_EABI_HARDFLOAT=0 " 
120145      ]
121146    }
122147
123148    #  TODO(jochen ): Add support for arm_test_noprobe.
124- 
125-     #  TODO(jochen ): Add support for cpu_arch != v8_target_arch/
126149  }
127150  if  (v8_target_arch  ==  " arm64" 
128151    defines  +=  [ " V8_TARGET_ARCH_ARM64" 
129152  }
153+   if  (v8_target_arch  ==  " mipsel" 
154+     defines  +=  [ " V8_TARGET_ARCH_MIPS" 
155+   }
156+   if  (v8_target_arch  ==  " mips64el" 
157+     defines  +=  [ " V8_TARGET_ARCH_MIPS64" 
158+   }
130159  if  (v8_target_arch  ==  " x86" 
131160    defines  +=  [ " V8_TARGET_ARCH_IA32" 
132161  }
@@ -173,8 +202,8 @@ action("js2c") {
173202    " src/array.js" 
174203    " src/string.js" 
175204    " src/uri.js" 
176-     " src/third_party/fdlibm/fdlibm.js" 
177205    " src/math.js" 
206+     " src/third_party/fdlibm/fdlibm.js" 
178207    " src/date.js" 
179208    " src/regexp.js" 
180209    " src/arraybuffer.js" 
@@ -192,6 +221,7 @@ action("js2c") {
192221    " src/debug-debugger.js" 
193222    " src/mirror-debugger.js" 
194223    " src/liveedit-debugger.js" 
224+     " src/templates.js" 
195225    " src/macros.py" 
196226  ]
197227
@@ -230,13 +260,12 @@ action("js2c_experimental") {
230260    " src/macros.py" 
231261    " src/proxy.js" 
232262    " src/generator.js" 
233-     " src/harmony-string.js" 
234263    " src/harmony-array.js" 
235264    " src/harmony-array-includes.js" 
236265    " src/harmony-typedarray.js" 
237266    " src/harmony-tostring.js" 
238-     " src/harmony-templates.js" 
239267    " src/harmony-regexp.js" 
268+     " src/harmony-reflect.js" 
240269  ]
241270
242271  outputs  =  [
@@ -322,7 +351,7 @@ action("run_mksnapshot") {
322351  visibility  =  [ " :*" #  Only targets in this file can depend on this.
323352
324353  deps  =  [
325-     " :mksnapshot($host_toolchain  )" 
354+     " :mksnapshot($snapshot_toolchain  )" 
326355  ]
327356
328357  script  =  " tools/run.py" 
@@ -332,7 +361,7 @@ action("run_mksnapshot") {
332361  ]
333362
334363  args  =  [
335-     " ./" +  rebase_path (get_label_info (" :mksnapshot($host_toolchain  )" 
364+     " ./" +  rebase_path (get_label_info (" :mksnapshot($snapshot_toolchain  )" 
336365                                      " root_out_dir" +  " /mksnapshot" 
337366                       root_build_dir ),
338367    " --log-snapshot-positions" 
@@ -373,7 +402,7 @@ source_set("v8_nosnapshot") {
373402  sources  =  [
374403    " $target_gen_dir /libraries.cc" 
375404    " $target_gen_dir /experimental-libraries.cc" 
376-     " src/snapshot-empty.cc" 
405+     " src/snapshot/snapshot -empty.cc" 
377406  ]
378407
379408  configs  -=  [ " //build/config/compiler:chromium_code" 
@@ -423,8 +452,8 @@ if (v8_use_external_startup_data) {
423452    ]
424453
425454    sources  =  [
426-       " src/natives-external.cc" 
427-       " src/snapshot-external.cc" 
455+       " src/snapshot/ natives-external.cc" 
456+       " src/snapshot/snapshot -external.cc" 
428457    ]
429458
430459    configs  -=  [ " //build/config/compiler:chromium_code" 
@@ -535,9 +564,7 @@ source_set("v8_base") {
535564    " src/compiler/frame.h" 
536565    " src/compiler/gap-resolver.cc" 
537566    " src/compiler/gap-resolver.h" 
538-     " src/compiler/generic-algorithm.h" 
539567    " src/compiler/graph-builder.h" 
540-     " src/compiler/graph-inl.h" 
541568    " src/compiler/graph-reducer.cc" 
542569    " src/compiler/graph-reducer.h" 
543570    " src/compiler/graph-replay.cc" 
@@ -566,13 +593,17 @@ source_set("v8_base") {
566593    " src/compiler/js-intrinsic-lowering.h" 
567594    " src/compiler/js-operator.cc" 
568595    " src/compiler/js-operator.h" 
596+     " src/compiler/js-type-feedback.cc" 
597+     " src/compiler/js-type-feedback.h" 
569598    " src/compiler/js-typed-lowering.cc" 
570599    " src/compiler/js-typed-lowering.h" 
571600    " src/compiler/jump-threading.cc" 
572601    " src/compiler/jump-threading.h" 
573602    " src/compiler/linkage-impl.h" 
574603    " src/compiler/linkage.cc" 
575604    " src/compiler/linkage.h" 
605+     " src/compiler/liveness-analyzer.cc" 
606+     " src/compiler/liveness-analyzer.h" 
576607    " src/compiler/load-elimination.cc" 
577608    " src/compiler/load-elimination.h" 
578609    " src/compiler/loop-peeling.cc" 
@@ -591,6 +622,7 @@ source_set("v8_base") {
591622    " src/compiler/node-cache.h" 
592623    " src/compiler/node-marker.cc" 
593624    " src/compiler/node-marker.h" 
625+     " src/compiler/node-matchers.cc" 
594626    " src/compiler/node-matchers.h" 
595627    " src/compiler/node-properties.cc" 
596628    " src/compiler/node-properties.h" 
@@ -631,6 +663,8 @@ source_set("v8_base") {
631663    " src/compiler/simplified-operator.h" 
632664    " src/compiler/source-position.cc" 
633665    " src/compiler/source-position.h" 
666+     " src/compiler/state-values-utils.cc" 
667+     " src/compiler/state-values-utils.h" 
634668    " src/compiler/typer.cc" 
635669    " src/compiler/typer.h" 
636670    " src/compiler/value-numbering-reducer.cc" 
@@ -848,7 +882,6 @@ source_set("v8_base") {
848882    " src/modules.cc" 
849883    " src/modules.h" 
850884    " src/msan.h" 
851-     " src/natives.h" 
852885    " src/objects-debug.cc" 
853886    " src/objects-inl.h" 
854887    " src/objects-printer.cc" 
@@ -860,6 +893,8 @@ source_set("v8_base") {
860893    " src/ostreams.h" 
861894    " src/parser.cc" 
862895    " src/parser.h" 
896+     " src/pending-compilation-error-handler.cc" 
897+     " src/pending-compilation-error-handler.h" 
863898    " src/perf-jit.cc" 
864899    " src/perf-jit.h" 
865900    " src/preparse-data-format.h" 
@@ -929,20 +964,23 @@ source_set("v8_base") {
929964    " src/scopeinfo.h" 
930965    " src/scopes.cc" 
931966    " src/scopes.h" 
932-     " src/serialize.cc" 
933-     " src/serialize.h" 
934967    " src/small-pointer-list.h" 
935968    " src/smart-pointers.h" 
936-     " src/snapshot-common.cc" 
937-     " src/snapshot-source-sink.cc" 
938-     " src/snapshot-source-sink.h" 
939-     " src/snapshot.h" 
969+     " src/snapshot/natives.h" 
970+     " src/snapshot/serialize.cc" 
971+     " src/snapshot/serialize.h" 
972+     " src/snapshot/snapshot-common.cc" 
973+     " src/snapshot/snapshot-source-sink.cc" 
974+     " src/snapshot/snapshot-source-sink.h" 
975+     " src/snapshot/snapshot.h" 
940976    " src/string-builder.cc" 
941977    " src/string-builder.h" 
942978    " src/string-search.cc" 
943979    " src/string-search.h" 
944980    " src/string-stream.cc" 
945981    " src/string-stream.h" 
982+     " src/strings-storage.cc" 
983+     " src/strings-storage.h" 
946984    " src/strtod.cc" 
947985    " src/strtod.h" 
948986    " src/token.cc" 
@@ -1356,11 +1394,11 @@ source_set("v8_libbase") {
13561394  if  (is_linux ) {
13571395    sources  +=  [ " src/base/platform/platform-linux.cc" 
13581396
1359-     libs  =  [ " rt" 
1397+     libs  =  [ " dl " ,  " rt" 
13601398  } else  if  (is_android ) {
13611399    defines  +=  [ " CAN_USE_VFP_INSTRUCTIONS" 
13621400
1363-     if  (build_os  ==  " mac" 
1401+     if  (host_os  ==  " mac" 
13641402      if  (current_toolchain  ==  host_toolchain ) {
13651403        sources  +=  [ " src/base/platform/platform-macos.cc" 
13661404      } else  {
@@ -1425,12 +1463,12 @@ source_set("v8_libplatform") {
14251463#  Executables
14261464# 
14271465
1428- if  (current_toolchain  ==  host_toolchain ) {
1466+ if  (current_toolchain  ==  snapshot_toolchain ) {
14291467  executable (" mksnapshot" 
14301468    visibility  =  [ " :*" #  Only targets in this file can depend on this.
14311469
14321470    sources  =  [
1433-       " src/mksnapshot.cc" 
1471+       " src/snapshot/ mksnapshot.cc" 
14341472    ]
14351473
14361474    configs  -=  [ " //build/config/compiler:chromium_code" 
0 commit comments