|
1 # -*- Mode: python; c-basic-offset: 4; 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/. |
|
6 |
|
7 if CONFIG['DEHYDRA_PATH']: |
|
8 DIRS += ['analysis-tests'] |
|
9 |
|
10 if CONFIG['JS_NATIVE_EDITLINE']: |
|
11 DIRS += ['editline'] |
|
12 |
|
13 # editline needs to get built before the shell |
|
14 if not CONFIG['JS_DISABLE_SHELL']: |
|
15 DIRS += ['shell'] |
|
16 |
|
17 TEST_DIRS += ['jsapi-tests', 'tests', 'gdb'] |
|
18 |
|
19 LOCAL_INCLUDES += ['../../mfbt/double-conversion'] |
|
20 |
|
21 LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME'] |
|
22 |
|
23 CONFIGURE_SUBST_FILES += [ |
|
24 'devtools/rootAnalysis/Makefile', |
|
25 'js-confdefs.h', |
|
26 'js-config', |
|
27 'js.pc', |
|
28 ] |
|
29 |
|
30 if CONFIG['JS_STANDALONE']: |
|
31 DEFINES['IMPL_MFBT'] = True |
|
32 else: |
|
33 CONFIGURE_SUBST_FILES += [ |
|
34 '../../config/autoconf-js.mk', |
|
35 '../../config/emptyvars-js.mk', |
|
36 ] |
|
37 |
|
38 CONFIGURE_DEFINE_FILES += [ |
|
39 'js-config.h', |
|
40 ] |
|
41 |
|
42 # Changes to internal header files, used externally, massively slow down |
|
43 # browser builds. Don't add new files here unless you know what you're |
|
44 # doing! |
|
45 EXPORTS += [ |
|
46 'js.msg', |
|
47 'jsalloc.h', |
|
48 'jsapi.h', |
|
49 'jsbytecode.h', |
|
50 'jsclist.h', |
|
51 'jscpucfg.h', |
|
52 'jsfriendapi.h', |
|
53 'jsprf.h', |
|
54 'jsprototypes.h', |
|
55 'jsproxy.h', |
|
56 'jspubtd.h', |
|
57 'jstypes.h', |
|
58 'jsversion.h', |
|
59 'jswrapper.h', |
|
60 'perf/jsperf.h', |
|
61 ] |
|
62 |
|
63 # If you add a header here, add it to js/src/jsapi-tests/testIntTypesABI.cpp so |
|
64 # that we ensure we don't over-expose our internal integer typedefs. Note that |
|
65 # LegacyIntTypes.h below is deliberately exempted from this requirement. |
|
66 EXPORTS.js += [ |
|
67 '../public/Anchor.h', |
|
68 '../public/CallArgs.h', |
|
69 '../public/CallNonGenericMethod.h', |
|
70 '../public/CharacterEncoding.h', |
|
71 '../public/Class.h', |
|
72 '../public/Date.h', |
|
73 '../public/GCAPI.h', |
|
74 '../public/HashTable.h', |
|
75 '../public/HeapAPI.h', |
|
76 '../public/Id.h', |
|
77 '../public/LegacyIntTypes.h', |
|
78 '../public/MemoryMetrics.h', |
|
79 '../public/OldDebugAPI.h', |
|
80 '../public/Principals.h', |
|
81 '../public/ProfilingStack.h', |
|
82 '../public/PropertyKey.h', |
|
83 '../public/RequiredDefines.h', |
|
84 '../public/RootingAPI.h', |
|
85 '../public/SliceBudget.h', |
|
86 '../public/StructuredClone.h', |
|
87 '../public/TracingAPI.h', |
|
88 '../public/TypeDecls.h', |
|
89 '../public/Utility.h', |
|
90 '../public/Value.h', |
|
91 '../public/Vector.h', |
|
92 '../public/WeakMapPtr.h', |
|
93 ] |
|
94 |
|
95 UNIFIED_SOURCES += [ |
|
96 'assembler/jit/ExecutableAllocator.cpp', |
|
97 'builtin/Eval.cpp', |
|
98 'builtin/Intl.cpp', |
|
99 'builtin/MapObject.cpp', |
|
100 'builtin/Object.cpp', |
|
101 'builtin/Profilers.cpp', |
|
102 'builtin/SIMD.cpp', |
|
103 'builtin/TestingFunctions.cpp', |
|
104 'builtin/TypedObject.cpp', |
|
105 'devtools/sharkctl.cpp', |
|
106 'ds/LifoAlloc.cpp', |
|
107 'frontend/BytecodeCompiler.cpp', |
|
108 'frontend/BytecodeEmitter.cpp', |
|
109 'frontend/FoldConstants.cpp', |
|
110 'frontend/NameFunctions.cpp', |
|
111 'frontend/ParseMaps.cpp', |
|
112 'frontend/ParseNode.cpp', |
|
113 'frontend/TokenStream.cpp', |
|
114 'gc/Barrier.cpp', |
|
115 'gc/Iteration.cpp', |
|
116 'gc/Marking.cpp', |
|
117 'gc/Memory.cpp', |
|
118 'gc/Nursery.cpp', |
|
119 'gc/RootMarking.cpp', |
|
120 'gc/Statistics.cpp', |
|
121 'gc/StoreBuffer.cpp', |
|
122 'gc/Tracer.cpp', |
|
123 'gc/Verifier.cpp', |
|
124 'gc/Zone.cpp', |
|
125 'jsalloc.cpp', |
|
126 'jsanalyze.cpp', |
|
127 'jsapi.cpp', |
|
128 'jsbool.cpp', |
|
129 'jscntxt.cpp', |
|
130 'jscompartment.cpp', |
|
131 'jscrashreport.cpp', |
|
132 'jsdate.cpp', |
|
133 'jsdtoa.cpp', |
|
134 'jsexn.cpp', |
|
135 'jsfriendapi.cpp', |
|
136 'jsfun.cpp', |
|
137 'jsgc.cpp', |
|
138 'jsinfer.cpp', |
|
139 'jsiter.cpp', |
|
140 'jsnativestack.cpp', |
|
141 'jsnum.cpp', |
|
142 'jsobj.cpp', |
|
143 'json.cpp', |
|
144 'jsonparser.cpp', |
|
145 'jsopcode.cpp', |
|
146 'jsprf.cpp', |
|
147 'jspropertytree.cpp', |
|
148 'jsproxy.cpp', |
|
149 'jsreflect.cpp', |
|
150 'jsscript.cpp', |
|
151 'jsstr.cpp', |
|
152 'jswatchpoint.cpp', |
|
153 'jsweakmap.cpp', |
|
154 'jsworkers.cpp', |
|
155 'jswrapper.cpp', |
|
156 'perf/jsperf.cpp', |
|
157 'prmjtime.cpp', |
|
158 'vm/ArgumentsObject.cpp', |
|
159 'vm/ArrayBufferObject.cpp', |
|
160 'vm/CallNonGenericMethod.cpp', |
|
161 'vm/CharacterEncoding.cpp', |
|
162 'vm/Compression.cpp', |
|
163 'vm/DateTime.cpp', |
|
164 'vm/Debugger.cpp', |
|
165 'vm/DebuggerMemory.cpp', |
|
166 'vm/ErrorObject.cpp', |
|
167 'vm/ForkJoin.cpp', |
|
168 'vm/GlobalObject.cpp', |
|
169 'vm/Id.cpp', |
|
170 'vm/Interpreter.cpp', |
|
171 'vm/MemoryMetrics.cpp', |
|
172 'vm/Monitor.cpp', |
|
173 'vm/ObjectImpl.cpp', |
|
174 'vm/OldDebugAPI.cpp', |
|
175 'vm/PIC.cpp', |
|
176 'vm/Probes.cpp', |
|
177 'vm/PropertyKey.cpp', |
|
178 'vm/ProxyObject.cpp', |
|
179 'vm/RegExpObject.cpp', |
|
180 'vm/RegExpStatics.cpp', |
|
181 'vm/Runtime.cpp', |
|
182 'vm/SavedStacks.cpp', |
|
183 'vm/ScopeObject.cpp', |
|
184 'vm/SelfHosting.cpp', |
|
185 'vm/Shape.cpp', |
|
186 'vm/SharedArrayObject.cpp', |
|
187 'vm/SPSProfiler.cpp', |
|
188 'vm/Stack.cpp', |
|
189 'vm/String.cpp', |
|
190 'vm/StringBuffer.cpp', |
|
191 'vm/StructuredClone.cpp', |
|
192 'vm/ThreadPool.cpp', |
|
193 'vm/TypedArrayObject.cpp', |
|
194 'vm/Unicode.cpp', |
|
195 'vm/Value.cpp', |
|
196 'vm/WeakMapPtr.cpp', |
|
197 'vm/Xdr.cpp', |
|
198 'yarr/PageBlock.cpp', |
|
199 'yarr/YarrCanonicalizeUCS2.cpp', |
|
200 'yarr/YarrInterpreter.cpp', |
|
201 'yarr/YarrPattern.cpp', |
|
202 'yarr/YarrSyntaxChecker.cpp', |
|
203 ] |
|
204 |
|
205 # jsarray.cpp and jsatom.cpp cannot be built in unified mode because |
|
206 # xpcshell is broken during packaging when compiled with gcc-4.8.2 |
|
207 # builtin/RegExp.cpp cannot be built in unified mode because it is built |
|
208 # without PGO |
|
209 # frontend/Parser.cpp cannot be built in unified mode because of explicit |
|
210 # template instantiations. |
|
211 # jsmath.cpp cannot be built in unified mode because it needs to pull rand_s |
|
212 # from <stdlib.h> on Windows through a preprocessor define. |
|
213 # jsutil.cpp cannot be built in unified mode because it is needed for |
|
214 # check-vanilla-allocations. |
|
215 SOURCES += [ |
|
216 'builtin/RegExp.cpp', |
|
217 'frontend/Parser.cpp', |
|
218 'jsarray.cpp', |
|
219 'jsatom.cpp', |
|
220 'jsmath.cpp', |
|
221 'jsutil.cpp', |
|
222 ] |
|
223 |
|
224 if CONFIG['JS_POSIX_NSPR']: |
|
225 UNIFIED_SOURCES += [ |
|
226 'vm/PosixNSPR.cpp', |
|
227 ] |
|
228 |
|
229 if CONFIG['MOZ_INSTRUMENTS']: |
|
230 SOURCES += [ |
|
231 'devtools/Instruments.cpp', |
|
232 ] |
|
233 |
|
234 if CONFIG['ENABLE_TRACE_LOGGING']: |
|
235 SOURCES += [ |
|
236 'vm/TraceLogging.cpp', |
|
237 ] |
|
238 |
|
239 if CONFIG['ENABLE_ION']: |
|
240 UNIFIED_SOURCES += [ |
|
241 'jit/AliasAnalysis.cpp', |
|
242 'jit/AsmJS.cpp', |
|
243 'jit/AsmJSLink.cpp', |
|
244 'jit/AsmJSModule.cpp', |
|
245 'jit/AsmJSSignalHandlers.cpp', |
|
246 'jit/BacktrackingAllocator.cpp', |
|
247 'jit/Bailouts.cpp', |
|
248 'jit/BaselineBailouts.cpp', |
|
249 'jit/BaselineCompiler.cpp', |
|
250 'jit/BaselineDebugModeOSR.cpp', |
|
251 'jit/BaselineFrame.cpp', |
|
252 'jit/BaselineFrameInfo.cpp', |
|
253 'jit/BaselineIC.cpp', |
|
254 'jit/BaselineInspector.cpp', |
|
255 'jit/BaselineJIT.cpp', |
|
256 'jit/BitSet.cpp', |
|
257 'jit/BytecodeAnalysis.cpp', |
|
258 'jit/C1Spewer.cpp', |
|
259 'jit/CodeGenerator.cpp', |
|
260 'jit/CompileWrappers.cpp', |
|
261 'jit/EdgeCaseAnalysis.cpp', |
|
262 'jit/EffectiveAddressAnalysis.cpp', |
|
263 'jit/Ion.cpp', |
|
264 'jit/IonAnalysis.cpp', |
|
265 'jit/IonBuilder.cpp', |
|
266 'jit/IonCaches.cpp', |
|
267 'jit/IonFrames.cpp', |
|
268 'jit/IonMacroAssembler.cpp', |
|
269 'jit/IonOptimizationLevels.cpp', |
|
270 'jit/IonSpewer.cpp', |
|
271 'jit/JitOptions.cpp', |
|
272 'jit/JSONSpewer.cpp', |
|
273 'jit/LICM.cpp', |
|
274 'jit/LinearScan.cpp', |
|
275 'jit/LIR.cpp', |
|
276 'jit/LiveRangeAllocator.cpp', |
|
277 'jit/Lowering.cpp', |
|
278 'jit/MCallOptimize.cpp', |
|
279 'jit/MIR.cpp', |
|
280 'jit/MIRGraph.cpp', |
|
281 'jit/MoveResolver.cpp', |
|
282 'jit/ParallelFunctions.cpp', |
|
283 'jit/ParallelSafetyAnalysis.cpp', |
|
284 'jit/PerfSpewer.cpp', |
|
285 'jit/RangeAnalysis.cpp', |
|
286 'jit/Recover.cpp', |
|
287 'jit/RegisterAllocator.cpp', |
|
288 'jit/RematerializedFrame.cpp', |
|
289 'jit/Safepoints.cpp', |
|
290 'jit/shared/BaselineCompiler-shared.cpp', |
|
291 'jit/shared/CodeGenerator-shared.cpp', |
|
292 'jit/shared/Lowering-shared.cpp', |
|
293 'jit/Snapshots.cpp', |
|
294 'jit/StupidAllocator.cpp', |
|
295 'jit/TypeDescrSet.cpp', |
|
296 'jit/TypePolicy.cpp', |
|
297 'jit/UnreachableCodeElimination.cpp', |
|
298 'jit/ValueNumbering.cpp', |
|
299 'jit/VMFunctions.cpp', |
|
300 ] |
|
301 if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: |
|
302 UNIFIED_SOURCES += [ |
|
303 'jit/shared/Assembler-x86-shared.cpp', |
|
304 'jit/shared/BaselineCompiler-x86-shared.cpp', |
|
305 'jit/shared/BaselineIC-x86-shared.cpp', |
|
306 'jit/shared/CodeGenerator-x86-shared.cpp', |
|
307 'jit/shared/Lowering-x86-shared.cpp', |
|
308 'jit/shared/MacroAssembler-x86-shared.cpp', |
|
309 'jit/shared/MoveEmitter-x86-shared.cpp', |
|
310 ] |
|
311 if CONFIG['JS_CODEGEN_X64']: |
|
312 UNIFIED_SOURCES += [ |
|
313 'jit/x64/Assembler-x64.cpp', |
|
314 'jit/x64/Bailouts-x64.cpp', |
|
315 'jit/x64/BaselineCompiler-x64.cpp', |
|
316 'jit/x64/BaselineIC-x64.cpp', |
|
317 'jit/x64/CodeGenerator-x64.cpp', |
|
318 'jit/x64/Lowering-x64.cpp', |
|
319 'jit/x64/MacroAssembler-x64.cpp', |
|
320 'jit/x64/Trampoline-x64.cpp', |
|
321 ] |
|
322 else: |
|
323 UNIFIED_SOURCES += [ |
|
324 'jit/x86/Assembler-x86.cpp', |
|
325 'jit/x86/Bailouts-x86.cpp', |
|
326 'jit/x86/BaselineCompiler-x86.cpp', |
|
327 'jit/x86/BaselineIC-x86.cpp', |
|
328 'jit/x86/CodeGenerator-x86.cpp', |
|
329 'jit/x86/Lowering-x86.cpp', |
|
330 'jit/x86/MacroAssembler-x86.cpp', |
|
331 'jit/x86/Trampoline-x86.cpp', |
|
332 ] |
|
333 elif CONFIG['JS_CODEGEN_ARM']: |
|
334 UNIFIED_SOURCES += [ |
|
335 'jit/arm/Architecture-arm.cpp', |
|
336 'jit/arm/Assembler-arm.cpp', |
|
337 'jit/arm/Bailouts-arm.cpp', |
|
338 'jit/arm/BaselineCompiler-arm.cpp', |
|
339 'jit/arm/BaselineIC-arm.cpp', |
|
340 'jit/arm/CodeGenerator-arm.cpp', |
|
341 'jit/arm/Lowering-arm.cpp', |
|
342 'jit/arm/MacroAssembler-arm.cpp', |
|
343 'jit/arm/MoveEmitter-arm.cpp', |
|
344 'jit/arm/Trampoline-arm.cpp', |
|
345 ] |
|
346 if CONFIG['JS_ARM_SIMULATOR']: |
|
347 UNIFIED_SOURCES += [ |
|
348 'jit/arm/Simulator-arm.cpp' |
|
349 ] |
|
350 |
|
351 if CONFIG['OS_ARCH'] == 'WINNT': |
|
352 SOURCES += [ |
|
353 'assembler/jit/ExecutableAllocatorWin.cpp', |
|
354 'yarr/OSAllocatorWin.cpp', |
|
355 ] |
|
356 # _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s() |
|
357 DEFINES['_CRT_RAND_S'] = True |
|
358 else: |
|
359 SOURCES += [ |
|
360 'assembler/jit/ExecutableAllocatorPosix.cpp', |
|
361 'yarr/OSAllocatorPosix.cpp', |
|
362 ] |
|
363 |
|
364 if CONFIG['ENABLE_ION'] or CONFIG['ENABLE_YARR_JIT']: |
|
365 if CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: |
|
366 SOURCES += [ |
|
367 'assembler/assembler/MacroAssemblerX86Common.cpp', |
|
368 ] |
|
369 elif CONFIG['JS_CODEGEN_ARM']: |
|
370 SOURCES += [ |
|
371 'assembler/assembler/ARMAssembler.cpp', |
|
372 'assembler/assembler/MacroAssemblerARM.cpp', |
|
373 ] |
|
374 |
|
375 if CONFIG['ENABLE_YARR_JIT']: |
|
376 SOURCES += [ |
|
377 'yarr/YarrJIT.cpp' |
|
378 ] |
|
379 |
|
380 if CONFIG['JS_HAS_CTYPES']: |
|
381 SOURCES += [ |
|
382 'ctypes/CTypes.cpp', |
|
383 'ctypes/Library.cpp', |
|
384 ] |
|
385 if not CONFIG['MOZ_NATIVE_FFI']: |
|
386 GENERATED_INCLUDES += [ |
|
387 'ctypes/libffi/include', |
|
388 ] |
|
389 |
|
390 if CONFIG['MOZ_VTUNE']: |
|
391 SOURCES += [ |
|
392 'vtune/jitprofiling.c' |
|
393 ] |
|
394 |
|
395 if CONFIG['HAVE_LINUX_PERF_EVENT_H']: |
|
396 SOURCES += [ |
|
397 'perf/pm_linux.cpp' |
|
398 ] |
|
399 SOURCES['perf/pm_linux.cpp'].flags += [CONFIG['LINUX_HEADERS_INCLUDES']] |
|
400 else: |
|
401 SOURCES += [ |
|
402 'perf/pm_stub.cpp' |
|
403 ] |
|
404 |
|
405 MSVC_ENABLE_PGO = True |
|
406 |
|
407 HOST_SOURCES += [ |
|
408 'jskwgen.cpp', |
|
409 ] |
|
410 |
|
411 HOST_SIMPLE_PROGRAMS += [ |
|
412 'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES |
|
413 ] |
|
414 |
|
415 # JavaScript must be built shared, even for static builds, as it is used by |
|
416 # other modules which are always built shared. Failure to do so results in |
|
417 # the js code getting copied into xpinstall and jsd as well as mozilla-bin, |
|
418 # and then the static data cells used for locking no longer work. |
|
419 # |
|
420 # In fact, we now build both a static and a shared library, as the |
|
421 # JS shell would like to link to the static library. |
|
422 |
|
423 if CONFIG['JS_SHARED_LIBRARY']: |
|
424 FORCE_SHARED_LIB = True |
|
425 |
|
426 FORCE_STATIC_LIB = True |
|
427 |
|
428 if CONFIG['MOZ_ETW']: |
|
429 GENERATED_FILES = [ |
|
430 'ETWProvider.h', |
|
431 ] |
|
432 # This will get the ETW provider resources into the library mozjs.dll |
|
433 RESFILE = 'ETWProvider.res' |
|
434 |
|
435 if CONFIG['NIGHTLY_BUILD']: |
|
436 DEFINES['ENABLE_PARALLEL_JS'] = True |
|
437 DEFINES['ENABLE_BINARYDATA'] = True |
|
438 DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True |
|
439 |
|
440 DEFINES['EXPORT_JS_API'] = True |
|
441 |
|
442 if CONFIG['JS_THREADSAFE']: |
|
443 DEFINES['JS_THREADSAFE'] = True |
|
444 |
|
445 if CONFIG['JS_HAS_CTYPES']: |
|
446 DEFINES['JS_HAS_CTYPES'] = True |
|
447 for var in ('DLL_PREFIX', 'DLL_SUFFIX'): |
|
448 DEFINES[var] = '"%s"' % CONFIG[var] |
|
449 |
|
450 if CONFIG['MOZ_LINKER']: |
|
451 DEFINES['MOZ_LINKER'] = True |
|
452 |
|
453 if CONFIG['_MSC_VER']: |
|
454 if CONFIG['CPU_ARCH'] == 'x86': |
|
455 SOURCES['builtin/RegExp.cpp'].no_pgo = True # Bug 772303 |
|
456 elif CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['JS_HAS_CTYPES']: |
|
457 SOURCES['ctypes/CTypes.cpp'].no_pgo = True # Bug 810661 |
|
458 |
|
459 # Needed to "configure" it correctly. Unfortunately these |
|
460 # flags wind up being applied to all code in js/src, not just |
|
461 # the code in js/src/assembler. |
|
462 DEFINES['USE_SYSTEM_MALLOC'] = 1 |
|
463 DEFINES['ENABLE_ASSEMBLER'] = 1 |
|
464 |
|
465 if CONFIG['ENABLE_YARR_JIT']: |
|
466 DEFINES['ENABLE_JIT'] = 1 |