2
2
# Use of this source code is governed by a BSD-style license that can be
3
3
# found in the LICENSE file.
4
4
5
+ import (" //build/config/android/config.gni" )
6
+ import (" //build/config/arm.gni" )
7
+ import (" //build/config/mips.gni" )
8
+
5
9
# Because standalone V8 builds are not supported, assume this is part of a
6
10
# Chromium build.
7
11
import (" //build/module_args/v8.gni" )
@@ -18,10 +22,23 @@ v8_interpreted_regexp = false
18
22
v8_object_print = false
19
23
v8_postmortem_support = false
20
24
v8_use_snapshot = true
21
- v8_target_arch = cpu_arch
25
+ v8_target_arch = target_cpu
22
26
v8_random_seed = " 314159265"
23
27
v8_toolset_for_d8 = " host"
24
28
29
+ # The snapshot needs to be compiled for the host, but compiled with
30
+ # a toolchain that matches the bit-width of the target.
31
+ #
32
+ # TODO(GYP ): For now we only support 32-bit little-endian target builds from an
33
+ # x64 Linux host. Eventually we need to support all of the host/target
34
+ # configurations v8 runs on.
35
+ if (host_cpu == " x64" && host_os == " linux" &&
36
+ (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
+
25
42
# ##############################################################################
26
43
# Configurations
27
44
#
@@ -96,37 +113,49 @@ config("toolchain") {
96
113
defines = []
97
114
cflags = []
98
115
99
- # TODO(jochen ): Add support for arm subarchs, mips, mipsel.
116
+ # TODO(jochen ): Add support for arm subarchs, mips, mipsel, mips64el .
100
117
101
118
if (v8_target_arch == " arm" ) {
102
119
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.
116
140
defines += [
141
+ " CAN_USE_ARMV7_INSTRUCTIONS" ,
117
142
" CAN_USE_VFP3_INSTRUCTIONS" ,
118
143
" CAN_USE_VFP32DREGS" ,
119
- " CAN_USE_NEON " ,
144
+ " USE_EABI_HARDFLOAT=0 " ,
120
145
]
121
146
}
122
147
123
148
# TODO(jochen ): Add support for arm_test_noprobe.
124
-
125
- # TODO(jochen ): Add support for cpu_arch != v8_target_arch/
126
149
}
127
150
if (v8_target_arch == " arm64" ) {
128
151
defines += [ " V8_TARGET_ARCH_ARM64" ]
129
152
}
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
+ }
130
159
if (v8_target_arch == " x86" ) {
131
160
defines += [ " V8_TARGET_ARCH_IA32" ]
132
161
}
@@ -173,8 +202,8 @@ action("js2c") {
173
202
" src/array.js" ,
174
203
" src/string.js" ,
175
204
" src/uri.js" ,
176
- " src/third_party/fdlibm/fdlibm.js" ,
177
205
" src/math.js" ,
206
+ " src/third_party/fdlibm/fdlibm.js" ,
178
207
" src/date.js" ,
179
208
" src/regexp.js" ,
180
209
" src/arraybuffer.js" ,
@@ -192,6 +221,7 @@ action("js2c") {
192
221
" src/debug-debugger.js" ,
193
222
" src/mirror-debugger.js" ,
194
223
" src/liveedit-debugger.js" ,
224
+ " src/templates.js" ,
195
225
" src/macros.py" ,
196
226
]
197
227
@@ -230,13 +260,12 @@ action("js2c_experimental") {
230
260
" src/macros.py" ,
231
261
" src/proxy.js" ,
232
262
" src/generator.js" ,
233
- " src/harmony-string.js" ,
234
263
" src/harmony-array.js" ,
235
264
" src/harmony-array-includes.js" ,
236
265
" src/harmony-typedarray.js" ,
237
266
" src/harmony-tostring.js" ,
238
- " src/harmony-templates.js" ,
239
267
" src/harmony-regexp.js" ,
268
+ " src/harmony-reflect.js"
240
269
]
241
270
242
271
outputs = [
@@ -322,7 +351,7 @@ action("run_mksnapshot") {
322
351
visibility = [ " :*" ] # Only targets in this file can depend on this.
323
352
324
353
deps = [
325
- " :mksnapshot($host_toolchain )" ,
354
+ " :mksnapshot($snapshot_toolchain )" ,
326
355
]
327
356
328
357
script = " tools/run.py"
@@ -332,7 +361,7 @@ action("run_mksnapshot") {
332
361
]
333
362
334
363
args = [
335
- " ./" + rebase_path (get_label_info (" :mksnapshot($host_toolchain )" ,
364
+ " ./" + rebase_path (get_label_info (" :mksnapshot($snapshot_toolchain )" ,
336
365
" root_out_dir" ) + " /mksnapshot" ,
337
366
root_build_dir ),
338
367
" --log-snapshot-positions" ,
@@ -373,7 +402,7 @@ source_set("v8_nosnapshot") {
373
402
sources = [
374
403
" $target_gen_dir /libraries.cc" ,
375
404
" $target_gen_dir /experimental-libraries.cc" ,
376
- " src/snapshot-empty.cc" ,
405
+ " src/snapshot/snapshot -empty.cc" ,
377
406
]
378
407
379
408
configs -= [ " //build/config/compiler:chromium_code" ]
@@ -423,8 +452,8 @@ if (v8_use_external_startup_data) {
423
452
]
424
453
425
454
sources = [
426
- " src/natives-external.cc" ,
427
- " src/snapshot-external.cc" ,
455
+ " src/snapshot/ natives-external.cc" ,
456
+ " src/snapshot/snapshot -external.cc" ,
428
457
]
429
458
430
459
configs -= [ " //build/config/compiler:chromium_code" ]
@@ -535,9 +564,7 @@ source_set("v8_base") {
535
564
" src/compiler/frame.h" ,
536
565
" src/compiler/gap-resolver.cc" ,
537
566
" src/compiler/gap-resolver.h" ,
538
- " src/compiler/generic-algorithm.h" ,
539
567
" src/compiler/graph-builder.h" ,
540
- " src/compiler/graph-inl.h" ,
541
568
" src/compiler/graph-reducer.cc" ,
542
569
" src/compiler/graph-reducer.h" ,
543
570
" src/compiler/graph-replay.cc" ,
@@ -566,13 +593,17 @@ source_set("v8_base") {
566
593
" src/compiler/js-intrinsic-lowering.h" ,
567
594
" src/compiler/js-operator.cc" ,
568
595
" src/compiler/js-operator.h" ,
596
+ " src/compiler/js-type-feedback.cc" ,
597
+ " src/compiler/js-type-feedback.h" ,
569
598
" src/compiler/js-typed-lowering.cc" ,
570
599
" src/compiler/js-typed-lowering.h" ,
571
600
" src/compiler/jump-threading.cc" ,
572
601
" src/compiler/jump-threading.h" ,
573
602
" src/compiler/linkage-impl.h" ,
574
603
" src/compiler/linkage.cc" ,
575
604
" src/compiler/linkage.h" ,
605
+ " src/compiler/liveness-analyzer.cc" ,
606
+ " src/compiler/liveness-analyzer.h" ,
576
607
" src/compiler/load-elimination.cc" ,
577
608
" src/compiler/load-elimination.h" ,
578
609
" src/compiler/loop-peeling.cc" ,
@@ -591,6 +622,7 @@ source_set("v8_base") {
591
622
" src/compiler/node-cache.h" ,
592
623
" src/compiler/node-marker.cc" ,
593
624
" src/compiler/node-marker.h" ,
625
+ " src/compiler/node-matchers.cc" ,
594
626
" src/compiler/node-matchers.h" ,
595
627
" src/compiler/node-properties.cc" ,
596
628
" src/compiler/node-properties.h" ,
@@ -631,6 +663,8 @@ source_set("v8_base") {
631
663
" src/compiler/simplified-operator.h" ,
632
664
" src/compiler/source-position.cc" ,
633
665
" src/compiler/source-position.h" ,
666
+ " src/compiler/state-values-utils.cc" ,
667
+ " src/compiler/state-values-utils.h" ,
634
668
" src/compiler/typer.cc" ,
635
669
" src/compiler/typer.h" ,
636
670
" src/compiler/value-numbering-reducer.cc" ,
@@ -848,7 +882,6 @@ source_set("v8_base") {
848
882
" src/modules.cc" ,
849
883
" src/modules.h" ,
850
884
" src/msan.h" ,
851
- " src/natives.h" ,
852
885
" src/objects-debug.cc" ,
853
886
" src/objects-inl.h" ,
854
887
" src/objects-printer.cc" ,
@@ -860,6 +893,8 @@ source_set("v8_base") {
860
893
" src/ostreams.h" ,
861
894
" src/parser.cc" ,
862
895
" src/parser.h" ,
896
+ " src/pending-compilation-error-handler.cc" ,
897
+ " src/pending-compilation-error-handler.h" ,
863
898
" src/perf-jit.cc" ,
864
899
" src/perf-jit.h" ,
865
900
" src/preparse-data-format.h" ,
@@ -929,20 +964,23 @@ source_set("v8_base") {
929
964
" src/scopeinfo.h" ,
930
965
" src/scopes.cc" ,
931
966
" src/scopes.h" ,
932
- " src/serialize.cc" ,
933
- " src/serialize.h" ,
934
967
" src/small-pointer-list.h" ,
935
968
" 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" ,
940
976
" src/string-builder.cc" ,
941
977
" src/string-builder.h" ,
942
978
" src/string-search.cc" ,
943
979
" src/string-search.h" ,
944
980
" src/string-stream.cc" ,
945
981
" src/string-stream.h" ,
982
+ " src/strings-storage.cc" ,
983
+ " src/strings-storage.h" ,
946
984
" src/strtod.cc" ,
947
985
" src/strtod.h" ,
948
986
" src/token.cc" ,
@@ -1356,11 +1394,11 @@ source_set("v8_libbase") {
1356
1394
if (is_linux ) {
1357
1395
sources += [ " src/base/platform/platform-linux.cc" ]
1358
1396
1359
- libs = [ " rt" ]
1397
+ libs = [ " dl " , " rt" ]
1360
1398
} else if (is_android ) {
1361
1399
defines += [ " CAN_USE_VFP_INSTRUCTIONS" ]
1362
1400
1363
- if (build_os == " mac" ) {
1401
+ if (host_os == " mac" ) {
1364
1402
if (current_toolchain == host_toolchain ) {
1365
1403
sources += [ " src/base/platform/platform-macos.cc" ]
1366
1404
} else {
@@ -1425,12 +1463,12 @@ source_set("v8_libplatform") {
1425
1463
# Executables
1426
1464
#
1427
1465
1428
- if (current_toolchain == host_toolchain ) {
1466
+ if (current_toolchain == snapshot_toolchain ) {
1429
1467
executable (" mksnapshot" ) {
1430
1468
visibility = [ " :*" ] # Only targets in this file can depend on this.
1431
1469
1432
1470
sources = [
1433
- " src/mksnapshot.cc" ,
1471
+ " src/snapshot/ mksnapshot.cc" ,
1434
1472
]
1435
1473
1436
1474
configs -= [ " //build/config/compiler:chromium_code" ]
0 commit comments