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