1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Directory metadata
component_engine = ('Core', 'JavaScript Engine')
component_gc = ('Core', 'JavaScript: GC')
component_intl = ('Core', 'JavaScript: Internationalization API')
component_jit = ('Core', 'JavaScript Engine: JIT')
component_stl = ('Core', 'JavaScript: Standard Library')
FILES_PER_UNIFIED_FILE = 6
with Files('../public/**'):
BUG_COMPONENT = component_engine
with Files('*'):
BUG_COMPONENT = component_engine
with Files('wasm/**'):
BUG_COMPONENT = component_jit
with Files('builtin/**'):
BUG_COMPONENT = component_stl
with Files('ctypes/**'):
BUG_COMPONENT = ('Core', 'js-ctypes')
with Files('gc/**'):
BUG_COMPONENT = component_gc
with Files('jit/**'):
BUG_COMPONENT = component_jit
# File-specific metadata
for gcfile in ['jsgc*', 'devtools/rootAnalysis', 'devtools/gc-ubench', 'devtools/gctrace']:
with Files(gcfile):
BUG_COMPONENT = component_gc
for header in ('GCAnnotations.h', 'GCAPI.h', 'HeapAPI.h', 'RootingAPI.h', 'SliceBudget.h', 'SweepingAPI.h', 'TraceKind.h', 'TracingAPI.h', 'WeakMapPtr.h'):
with Files('../public/' + header):
BUG_COMPONENT = component_gc
for stlfile in ['jsarray.*', 'jsbool*', 'jsdate.*', 'jsnum.*', 'json.*', 'jsstr.*']:
with Files(stlfile):
BUG_COMPONENT = component_stl
with Files('builtin/Intl*'):
BUG_COMPONENT = component_intl
with Files('builtin/make_intl_data.py'):
BUG_COMPONENT = component_intl
with Files('../public/TrackedOptimizationInfo.h'):
BUG_COMPONENT = component_jit
if CONFIG['JS_BUNDLED_EDITLINE']:
DIRS += ['editline']
if not CONFIG['JS_DISABLE_SHELL']:
DIRS += ['shell']
TEST_DIRS += ['jsapi-tests', 'tests', 'gdb']
CONFIGURE_SUBST_FILES += [
'devtools/rootAnalysis/Makefile',
'js-config',
'js.pc',
]
CONFIGURE_DEFINE_FILES += [
'js-confdefs.h',
]
if not CONFIG['JS_STANDALONE']:
LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
CONFIGURE_SUBST_FILES += [
'../../config/autoconf-js.mk',
'../../config/emptyvars-js.mk',
]
CONFIGURE_DEFINE_FILES += [
'js-config.h',
]
if CONFIG['HAVE_DTRACE']:
GENERATED_FILES += ['javascript-trace.h']
EXPORTS += ['!javascript-trace.h']
# Changes to internal header files, used externally, massively slow down
# browser builds. Don't add new files here unless you know what you're
# doing!
EXPORTS += [
'!js-config.h',
'js.msg',
'jsalloc.h',
'jsapi.h',
'jsbytecode.h',
'jsclist.h',
'jscpucfg.h',
'jsfriendapi.h',
'jsprf.h',
'jsprototypes.h',
'jspubtd.h',
'jstypes.h',
'jsversion.h',
'jswrapper.h',
'perf/jsperf.h',
]
# If you add a header here, add it to js/src/jsapi-tests/testIntTypesABI.cpp so
# that we ensure we don't over-expose our internal integer typedefs. Note that
# LegacyIntTypes.h below is deliberately exempted from this requirement.
EXPORTS.js += [
'../public/CallArgs.h',
'../public/CallNonGenericMethod.h',
'../public/CharacterEncoding.h',
'../public/Class.h',
'../public/Conversions.h',
'../public/Date.h',
'../public/Debug.h',
'../public/GCAnnotations.h',
'../public/GCAPI.h',
'../public/GCHashTable.h',
'../public/GCPolicyAPI.h',
'../public/GCVariant.h',
'../public/GCVector.h',
'../public/HashTable.h',
'../public/HeapAPI.h',
'../public/Id.h',
'../public/Initialization.h',
'../public/LegacyIntTypes.h',
'../public/MemoryMetrics.h',
'../public/Principals.h',
'../public/ProfilingFrameIterator.h',
'../public/ProfilingStack.h',
'../public/Proxy.h',
'../public/Realm.h',
'../public/RequiredDefines.h',
'../public/RootingAPI.h',
'../public/SliceBudget.h',
'../public/StructuredClone.h',
'../public/SweepingAPI.h',
'../public/TraceKind.h',
'../public/TracingAPI.h',
'../public/TrackedOptimizationInfo.h',
'../public/TypeDecls.h',
'../public/UbiNode.h',
'../public/UbiNodeBreadthFirst.h',
'../public/UbiNodeCensus.h',
'../public/UbiNodeDominatorTree.h',
'../public/UbiNodePostOrder.h',
'../public/UbiNodeShortestPaths.h',
'../public/UniquePtr.h',
'../public/Utility.h',
'../public/Value.h',
'../public/Vector.h',
'../public/WeakMapPtr.h',
]
UNIFIED_SOURCES += [
'builtin/AtomicsObject.cpp',
'builtin/Eval.cpp',
'builtin/Intl.cpp',
'builtin/MapObject.cpp',
'builtin/ModuleObject.cpp',
'builtin/Object.cpp',
'builtin/Profilers.cpp',
'builtin/Promise.cpp',
'builtin/Reflect.cpp',
'builtin/ReflectParse.cpp',
'builtin/SIMD.cpp',
'builtin/SymbolObject.cpp',
'builtin/TestingFunctions.cpp',
'builtin/TypedObject.cpp',
'builtin/WeakMapObject.cpp',
'builtin/WeakSetObject.cpp',
'devtools/sharkctl.cpp',
'ds/LifoAlloc.cpp',
'ds/MemoryProtectionExceptionHandler.cpp',
'frontend/BytecodeCompiler.cpp',
'frontend/BytecodeEmitter.cpp',
'frontend/FoldConstants.cpp',
'frontend/NameFunctions.cpp',
'frontend/ParseNode.cpp',
'frontend/TokenStream.cpp',
'gc/Allocator.cpp',
'gc/Barrier.cpp',
'gc/GCTrace.cpp',
'gc/Iteration.cpp',
'gc/Marking.cpp',
'gc/Memory.cpp',
'gc/MemoryProfiler.cpp',
'gc/Nursery.cpp',
'gc/RootMarking.cpp',
'gc/Statistics.cpp',
'gc/Tracer.cpp',
'gc/Verifier.cpp',
'gc/Zone.cpp',
'irregexp/NativeRegExpMacroAssembler.cpp',
'irregexp/RegExpAST.cpp',
'irregexp/RegExpCharacters.cpp',
'irregexp/RegExpEngine.cpp',
'irregexp/RegExpInterpreter.cpp',
'irregexp/RegExpMacroAssembler.cpp',
'irregexp/RegExpParser.cpp',
'irregexp/RegExpStack.cpp',
'jit/AliasAnalysis.cpp',
'jit/AliasAnalysisShared.cpp',
'jit/AlignmentMaskAnalysis.cpp',
'jit/BacktrackingAllocator.cpp',
'jit/Bailouts.cpp',
'jit/BaselineBailouts.cpp',
'jit/BaselineCacheIR.cpp',
'jit/BaselineCompiler.cpp',
'jit/BaselineDebugModeOSR.cpp',
'jit/BaselineFrame.cpp',
'jit/BaselineFrameInfo.cpp',
'jit/BaselineIC.cpp',
'jit/BaselineInspector.cpp',
'jit/BaselineJIT.cpp',
'jit/BitSet.cpp',
'jit/BytecodeAnalysis.cpp',
'jit/C1Spewer.cpp',
'jit/CacheIR.cpp',
'jit/CodeGenerator.cpp',
'jit/CompileWrappers.cpp',
'jit/Disassembler.cpp',
'jit/EagerSimdUnbox.cpp',
'jit/EdgeCaseAnalysis.cpp',
'jit/EffectiveAddressAnalysis.cpp',
'jit/ExecutableAllocator.cpp',
'jit/FlowAliasAnalysis.cpp',
'jit/FoldLinearArithConstants.cpp',
'jit/InstructionReordering.cpp',
'jit/Ion.cpp',
'jit/IonAnalysis.cpp',
'jit/IonBuilder.cpp',
'jit/IonCaches.cpp',
'jit/IonOptimizationLevels.cpp',
'jit/JitcodeMap.cpp',
'jit/JitFrames.cpp',
'jit/JitOptions.cpp',
'jit/JitSpewer.cpp',
'jit/JSONSpewer.cpp',
'jit/LICM.cpp',
'jit/Linker.cpp',
'jit/LIR.cpp',
'jit/LoopUnroller.cpp',
'jit/Lowering.cpp',
'jit/MacroAssembler.cpp',
'jit/MCallOptimize.cpp',
'jit/MIR.cpp',
'jit/MIRGraph.cpp',
'jit/MoveResolver.cpp',
'jit/OptimizationTracking.cpp',
'jit/PerfSpewer.cpp',
'jit/ProcessExecutableMemory.cpp',
'jit/RangeAnalysis.cpp',
'jit/Recover.cpp',
'jit/RegisterAllocator.cpp',
'jit/RematerializedFrame.cpp',
'jit/Safepoints.cpp',
'jit/ScalarReplacement.cpp',
'jit/shared/BaselineCompiler-shared.cpp',
'jit/shared/CodeGenerator-shared.cpp',
'jit/shared/Lowering-shared.cpp',
'jit/SharedIC.cpp',
'jit/Sink.cpp',
'jit/Snapshots.cpp',
'jit/StupidAllocator.cpp',
'jit/TypedObjectPrediction.cpp',
'jit/TypePolicy.cpp',
'jit/ValueNumbering.cpp',
'jit/VMFunctions.cpp',
'jit/WasmBCE.cpp',
'jsalloc.cpp',
'jsapi.cpp',
'jsbool.cpp',
'jscntxt.cpp',
'jscompartment.cpp',
'jsdate.cpp',
'jsexn.cpp',
'jsfriendapi.cpp',
'jsfun.cpp',
'jsgc.cpp',
'jsiter.cpp',
'jsnativestack.cpp',
'jsnum.cpp',
'jsobj.cpp',
'json.cpp',
'jsopcode.cpp',
'jsprf.cpp',
'jspropertytree.cpp',
'jsscript.cpp',
'jsstr.cpp',
'jsweakmap.cpp',
'perf/jsperf.cpp',
'proxy/BaseProxyHandler.cpp',
'proxy/CrossCompartmentWrapper.cpp',
'proxy/DeadObjectProxy.cpp',
'proxy/OpaqueCrossCompartmentWrapper.cpp',
'proxy/Proxy.cpp',
'proxy/ScriptedProxyHandler.cpp',
'proxy/SecurityWrapper.cpp',
'proxy/Wrapper.cpp',
'threading/Mutex.cpp',
'vm/ArgumentsObject.cpp',
'vm/ArrayBufferObject.cpp',
'vm/AsyncFunction.cpp',
'vm/Caches.cpp',
'vm/CallNonGenericMethod.cpp',
'vm/CharacterEncoding.cpp',
'vm/CodeCoverage.cpp',
'vm/Compression.cpp',
'vm/DateTime.cpp',
'vm/Debugger.cpp',
'vm/DebuggerMemory.cpp',
'vm/EnvironmentObject.cpp',
'vm/ErrorObject.cpp',
'vm/ForOfIterator.cpp',
'vm/GeneratorObject.cpp',
'vm/GlobalObject.cpp',
'vm/HelperThreads.cpp',
'vm/Id.cpp',
'vm/Interpreter.cpp',
'vm/JSONParser.cpp',
'vm/MemoryMetrics.cpp',
'vm/NativeObject.cpp',
'vm/ObjectGroup.cpp',
'vm/PIC.cpp',
'vm/Printer.cpp',
'vm/Probes.cpp',
'vm/ProxyObject.cpp',
'vm/Realm.cpp',
'vm/ReceiverGuard.cpp',
'vm/RegExpObject.cpp',
'vm/RegExpStatics.cpp',
'vm/Runtime.cpp',
'vm/SavedStacks.cpp',
'vm/Scope.cpp',
'vm/SelfHosting.cpp',
'vm/Shape.cpp',
'vm/SharedArrayObject.cpp',
'vm/SharedImmutableStringsCache.cpp',
'vm/SPSProfiler.cpp',
'vm/Stack.cpp',
'vm/Stopwatch.cpp',
'vm/String.cpp',
'vm/StringBuffer.cpp',
'vm/StructuredClone.cpp',
'vm/Symbol.cpp',
'vm/TaggedProto.cpp',
'vm/Time.cpp',
'vm/TypedArrayObject.cpp',
'vm/TypeInference.cpp',
'vm/UbiNode.cpp',
'vm/UbiNodeCensus.cpp',
'vm/UbiNodeShortestPaths.cpp',
'vm/Unicode.cpp',
'vm/Value.cpp',
'vm/WeakMapPtr.cpp',
'vm/Xdr.cpp',
'wasm/AsmJS.cpp',
'wasm/WasmBaselineCompile.cpp',
'wasm/WasmBinaryFormat.cpp',
'wasm/WasmBinaryIterator.cpp',
'wasm/WasmBinaryToAST.cpp',
'wasm/WasmBinaryToExperimentalText.cpp',
'wasm/WasmBinaryToText.cpp',
'wasm/WasmCode.cpp',
'wasm/WasmCompartment.cpp',
'wasm/WasmCompile.cpp',
'wasm/WasmFrameIterator.cpp',
'wasm/WasmGenerator.cpp',
'wasm/WasmInstance.cpp',
'wasm/WasmIonCompile.cpp',
'wasm/WasmJS.cpp',
'wasm/WasmModule.cpp',
'wasm/WasmSignalHandlers.cpp',
'wasm/WasmStubs.cpp',
'wasm/WasmTable.cpp',
'wasm/WasmTextToBinary.cpp',
'wasm/WasmTextUtils.cpp',
'wasm/WasmTypes.cpp'
]
# jsarray.cpp and jsatom.cpp cannot be built in unified mode because
# xpcshell is broken during packaging when compiled with gcc-4.8.2
# builtin/RegExp.cpp cannot be built in unified mode because it is built
# without PGO
# frontend/Parser.cpp cannot be built in unified mode because of explicit
# template instantiations.
# jsdtoa.cpp cannot be built in unified mode because we want to suppress
# compiler warnings in third-party dtoa.c.
# jsmath.cpp cannot be built in unified mode because it needs to pull rand_s
# from <stdlib.h> on Windows through a preprocessor define.
# jsutil.cpp cannot be built in unified mode because it is needed for
# check-vanilla-allocations.
# StoreBuffer.cpp cannot be built in unified because its template
# instantiations may or may not be needed depending on what it gets bundled
# with.
SOURCES += [
'builtin/RegExp.cpp',
'frontend/Parser.cpp',
'gc/StoreBuffer.cpp',
'jsarray.cpp',
'jsatom.cpp',
'jsdtoa.cpp',
'jsmath.cpp',
'jsutil.cpp',
'vm/Initialization.cpp',
]
if CONFIG['JS_POSIX_NSPR']:
UNIFIED_SOURCES += [
'vm/PosixNSPR.cpp',
]
if CONFIG['MOZ_INSTRUMENTS']:
SOURCES += [
'devtools/Instruments.cpp',
]
if CONFIG['ENABLE_TRACE_LOGGING']:
SOURCES += [
'vm/TraceLogging.cpp',
'vm/TraceLoggingGraph.cpp',
'vm/TraceLoggingTypes.cpp',
]
if not CONFIG['ENABLE_ION']:
UNIFIED_SOURCES += [
'jit/none/Trampoline-none.cpp'
]
elif CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']:
UNIFIED_SOURCES += [
'jit/x86-shared/Architecture-x86-shared.cpp',
'jit/x86-shared/Assembler-x86-shared.cpp',
'jit/x86-shared/AssemblerBuffer-x86-shared.cpp',
'jit/x86-shared/BaselineCompiler-x86-shared.cpp',
'jit/x86-shared/BaselineIC-x86-shared.cpp',
'jit/x86-shared/CodeGenerator-x86-shared.cpp',
'jit/x86-shared/Lowering-x86-shared.cpp',
'jit/x86-shared/MacroAssembler-x86-shared.cpp',
'jit/x86-shared/MoveEmitter-x86-shared.cpp',
]
SOURCES += [
'jit/x86-shared/Disassembler-x86-shared.cpp', # using namespace js::jit::X86Encoding;
]
if CONFIG['JS_CODEGEN_X64']:
UNIFIED_SOURCES += [
'jit/x64/Assembler-x64.cpp',
'jit/x64/Bailouts-x64.cpp',
'jit/x64/BaselineCompiler-x64.cpp',
'jit/x64/BaselineIC-x64.cpp',
'jit/x64/CodeGenerator-x64.cpp',
'jit/x64/Lowering-x64.cpp',
'jit/x64/MacroAssembler-x64.cpp',
'jit/x64/SharedIC-x64.cpp',
'jit/x64/Trampoline-x64.cpp',
]
else:
UNIFIED_SOURCES += [
'jit/x86/Assembler-x86.cpp',
'jit/x86/Bailouts-x86.cpp',
'jit/x86/BaselineCompiler-x86.cpp',
'jit/x86/BaselineIC-x86.cpp',
'jit/x86/CodeGenerator-x86.cpp',
'jit/x86/Lowering-x86.cpp',
'jit/x86/MacroAssembler-x86.cpp',
'jit/x86/SharedIC-x86.cpp',
'jit/x86/Trampoline-x86.cpp',
]
elif CONFIG['JS_CODEGEN_ARM']:
UNIFIED_SOURCES += [
'jit/arm/Architecture-arm.cpp',
'jit/arm/Assembler-arm.cpp',
'jit/arm/Bailouts-arm.cpp',
'jit/arm/BaselineCompiler-arm.cpp',
'jit/arm/BaselineIC-arm.cpp',
'jit/arm/CodeGenerator-arm.cpp',
'jit/arm/disasm/Constants-arm.cpp',
'jit/arm/disasm/Disasm-arm.cpp',
'jit/arm/Lowering-arm.cpp',
'jit/arm/MacroAssembler-arm.cpp',
'jit/arm/MoveEmitter-arm.cpp',
'jit/arm/SharedIC-arm.cpp',
'jit/arm/Trampoline-arm.cpp',
]
if CONFIG['JS_SIMULATOR_ARM']:
UNIFIED_SOURCES += [
'jit/arm/Simulator-arm.cpp'
]
# Configuration used only for testing.
if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin':
CXXFLAGS += [ '-msse2', '-mfpmath=sse' ]
elif CONFIG['OS_ARCH'] == 'Darwin':
SOURCES += [
'jit/arm/llvm-compiler-rt/arm/aeabi_idivmod.S',
'jit/arm/llvm-compiler-rt/arm/aeabi_uidivmod.S',
]
elif CONFIG['JS_CODEGEN_ARM64']:
UNIFIED_SOURCES += [
'jit/arm64/Architecture-arm64.cpp',
'jit/arm64/Assembler-arm64.cpp',
'jit/arm64/Bailouts-arm64.cpp',
'jit/arm64/BaselineIC-arm64.cpp',
'jit/arm64/CodeGenerator-arm64.cpp',
'jit/arm64/Lowering-arm64.cpp',
'jit/arm64/MacroAssembler-arm64.cpp',
'jit/arm64/MoveEmitter-arm64.cpp',
'jit/arm64/SharedIC-arm64.cpp',
'jit/arm64/Trampoline-arm64.cpp',
'jit/arm64/vixl/Assembler-vixl.cpp',
'jit/arm64/vixl/Cpu-vixl.cpp',
'jit/arm64/vixl/Decoder-vixl.cpp',
'jit/arm64/vixl/Disasm-vixl.cpp',
'jit/arm64/vixl/Instructions-vixl.cpp',
'jit/arm64/vixl/Instrument-vixl.cpp',
'jit/arm64/vixl/MacroAssembler-vixl.cpp',
'jit/arm64/vixl/MozAssembler-vixl.cpp',
'jit/arm64/vixl/MozInstructions-vixl.cpp',
'jit/arm64/vixl/Utils-vixl.cpp'
]
if CONFIG['JS_SIMULATOR_ARM64']:
UNIFIED_SOURCES += [
'jit/arm64/vixl/Debugger-vixl.cpp',
'jit/arm64/vixl/Logic-vixl.cpp',
'jit/arm64/vixl/MozSimulator-vixl.cpp',
'jit/arm64/vixl/Simulator-vixl.cpp'
]
elif CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']:
UNIFIED_SOURCES += [
'jit/mips-shared/Architecture-mips-shared.cpp',
'jit/mips-shared/Assembler-mips-shared.cpp',
'jit/mips-shared/Bailouts-mips-shared.cpp',
'jit/mips-shared/BaselineCompiler-mips-shared.cpp',
'jit/mips-shared/BaselineIC-mips-shared.cpp',
'jit/mips-shared/CodeGenerator-mips-shared.cpp',
'jit/mips-shared/Lowering-mips-shared.cpp',
'jit/mips-shared/MacroAssembler-mips-shared.cpp',
'jit/mips-shared/MoveEmitter-mips-shared.cpp',
]
if CONFIG['JS_CODEGEN_MIPS32']:
UNIFIED_SOURCES += [
'jit/mips32/Architecture-mips32.cpp',
'jit/mips32/Assembler-mips32.cpp',
'jit/mips32/Bailouts-mips32.cpp',
'jit/mips32/BaselineCompiler-mips32.cpp',
'jit/mips32/BaselineIC-mips32.cpp',
'jit/mips32/CodeGenerator-mips32.cpp',
'jit/mips32/Lowering-mips32.cpp',
'jit/mips32/MacroAssembler-mips32.cpp',
'jit/mips32/MoveEmitter-mips32.cpp',
'jit/mips32/SharedIC-mips32.cpp',
'jit/mips32/Trampoline-mips32.cpp',
]
if CONFIG['JS_SIMULATOR_MIPS32']:
UNIFIED_SOURCES += [
'jit/mips32/Simulator-mips32.cpp'
]
elif CONFIG['JS_CODEGEN_MIPS64']:
UNIFIED_SOURCES += [
'jit/mips64/Architecture-mips64.cpp',
'jit/mips64/Assembler-mips64.cpp',
'jit/mips64/Bailouts-mips64.cpp',
'jit/mips64/BaselineCompiler-mips64.cpp',
'jit/mips64/BaselineIC-mips64.cpp',
'jit/mips64/CodeGenerator-mips64.cpp',
'jit/mips64/Lowering-mips64.cpp',
'jit/mips64/MacroAssembler-mips64.cpp',
'jit/mips64/MoveEmitter-mips64.cpp',
'jit/mips64/SharedIC-mips64.cpp',
'jit/mips64/Trampoline-mips64.cpp',
]
if CONFIG['JS_SIMULATOR_MIPS64']:
UNIFIED_SOURCES += [
'jit/mips64/Simulator-mips64.cpp'
]
if CONFIG['OS_ARCH'] == 'WINNT':
SOURCES += [
'threading/windows/ConditionVariable.cpp',
'threading/windows/MutexImpl.cpp',
'threading/windows/Thread.cpp',
]
# _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s()
DEFINES['_CRT_RAND_S'] = True
else:
SOURCES += [
'threading/posix/ConditionVariable.cpp',
'threading/posix/MutexImpl.cpp',
'threading/posix/Thread.cpp',
]
if CONFIG['JS_HAS_CTYPES']:
SOURCES += [
'ctypes/CTypes.cpp',
'ctypes/Library.cpp',
]
if not CONFIG['MOZ_SYSTEM_FFI']:
LOCAL_INCLUDES += [
'!ctypes/libffi/include',
'ctypes/libffi/src/%s' % CONFIG['FFI_TARGET_DIR'],
]
if CONFIG['MOZ_VTUNE']:
SOURCES += [
'vtune/jitprofiling.c'
]
if CONFIG['HAVE_LINUX_PERF_EVENT_H']:
SOURCES += [
'perf/pm_linux.cpp'
]
if CONFIG['LINUX_HEADERS_INCLUDES']:
SOURCES['perf/pm_linux.cpp'].flags += [CONFIG['LINUX_HEADERS_INCLUDES']]
else:
SOURCES += [
'perf/pm_stub.cpp'
]
GENERATED_FILES += ['frontend/ReservedWordsGenerated.h']
ReservedWordsGenerated = GENERATED_FILES['frontend/ReservedWordsGenerated.h']
ReservedWordsGenerated.script = 'frontend/GenerateReservedWords.py'
ReservedWordsGenerated.inputs += [
'frontend/ReservedWords.h'
]
# JavaScript must be built shared, even for static builds, as it is used by
# other modules which are always built shared. Failure to do so results in
# the js code getting copied into xpinstall and jsd as well as mozilla-bin,
# and then the static data cells used for locking no longer work.
#
# In fact, we now build both a static and a shared library, as the
# JS shell would like to link to the static library.
if CONFIG['JS_SHARED_LIBRARY']:
GeckoSharedLibrary('js', linkage=None)
SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
SDK_LIBRARY = True
else:
Library('js')
FORCE_STATIC_LIB = True
STATIC_LIBRARY_NAME = 'js_static'
if not CONFIG['MOZ_ICU_DATA_ARCHIVE']:
USE_LIBS += [
'icu',
]
else:
# Linking 'icu' will pull in the stubdata library,
# which the shell doesn't want, so link the other bits.
USE_LIBS += [
'icui18n',
'icuuc',
]
USE_LIBS += [
'nspr',
'zlib',
]
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ENABLE_BINARYDATA'] = True
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ENABLE_SIMD'] = True
# Also set in shell/moz.build
DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
DEFINES['EXPORT_JS_API'] = True
if CONFIG['JS_HAS_CTYPES']:
DEFINES['JS_HAS_CTYPES'] = True
for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
DEFINES[var] = '"%s"' % CONFIG[var]
if CONFIG['MOZ_LINKER']:
DEFINES['MOZ_LINKER'] = True
if CONFIG['_MSC_VER']:
if CONFIG['CPU_ARCH'] == 'x86':
SOURCES['builtin/RegExp.cpp'].no_pgo = True # Bug 772303
elif CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['JS_HAS_CTYPES']:
SOURCES['ctypes/CTypes.cpp'].no_pgo = True # Bug 810661
# Prevent floating point errors caused by VC++ optimizations
# XXX We should add this to CXXFLAGS, too?
CFLAGS += ['-fp:precise']
# C4805 warns mixing bool with other integral types in computation.
# But given the conversion from bool is specified, and this is a
# pattern widely used in code in js/src, suppress this warning here.
CXXFLAGS += ['-wd4805']
# C4661 ("no suitable definition provided for explicit template
# instantiation request") is emitted for all Parser methods that
# have a Parser<FullParseHandler> definition but no
# Parser<SyntaxParseHandler> definition, see bug 1167030.
CXXFLAGS += ['-wd4661']
CXXFLAGS += ['-we4067', '-we4258', '-we4275']
CXXFLAGS += ['-wd4146'] # FIXME: unary minus operator applied to unsigned type (bug 1229189)
# This is intended as a temporary hack to support building with VS2015.
# 'noexcept' used with no exception handling mode specified;
# termination on exception is not guaranteed. Specify /EHsc
CXXFLAGS += ['-wd4577']
CXXFLAGS += ['-wd4312']
if CONFIG['OS_ARCH'] not in ('WINNT'):
OS_LIBS += [
'm',
]
if CONFIG['OS_ARCH'] == 'FreeBSD':
OS_LIBS += [
'-pthread',
]
if CONFIG['OS_ARCH'] == 'Linux':
OS_LIBS += [
'dl',
]
OS_LIBS += CONFIG['REALTIME_LIBS']
CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
NO_EXPAND_LIBS = True
DIST_INSTALL = True
# Prepare self-hosted JS code for embedding
GENERATED_FILES += [('selfhosted.out.h', 'selfhosted.js')]
selfhosted = GENERATED_FILES[('selfhosted.out.h', 'selfhosted.js')]
selfhosted.script = 'builtin/embedjs.py:generate_selfhosted'
selfhosted.inputs = [
'js.msg',
'builtin/TypedObjectConstants.h',
'builtin/SelfHostingDefines.h',
'builtin/Utilities.js',
'builtin/Array.js',
'builtin/Classes.js',
'builtin/Date.js',
'builtin/Error.js',
'builtin/Function.js',
'builtin/Generator.js',
'builtin/Intl.js',
'builtin/IntlData.js',
'builtin/Iterator.js',
'builtin/Map.js',
'builtin/Module.js',
'builtin/Number.js',
'builtin/Object.js',
'builtin/Reflect.js',
'builtin/RegExp.js',
'builtin/RegExpGlobalReplaceOpt.h.js',
'builtin/RegExpLocalReplaceOpt.h.js',
'builtin/String.js',
'builtin/Set.js',
'builtin/Sorting.js',
'builtin/TypedArray.js',
'builtin/TypedObject.js',
'builtin/WeakMap.js',
'builtin/WeakSet.js'
]
if CONFIG['SPIDERMONKEY_PROMISE']:
selfhosted.inputs += ['builtin/Promise.js']
if CONFIG['JS_HAS_CTYPES']:
if CONFIG['MOZ_SYSTEM_FFI']:
CXXFLAGS += CONFIG['MOZ_FFI_CFLAGS']
else:
# Windows needs this to be linked with a static library.
DEFINES['FFI_BUILDING'] = True
if CONFIG['GNU_CXX']:
# Disable strict-aliasing for GCC, which is enabled by default
# starting with version 7.1, see Mozilla bug 1363009.
CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing']
# Suppress warnings in third-party code.
if CONFIG['CLANG_CXX'] or CONFIG['GNU_CXX']:
SOURCES['jsdtoa.cpp'].flags += ['-Wno-implicit-fallthrough']
|