| 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/. |
| 6 |
|
| 7 |
include("js-config.mozbuild") |
| 8 |
include("js-cxxflags.mozbuild") |
| 9 |
|
| 10 |
# Directory metadata |
| 11 |
component_engine = ("Core", "JavaScript Engine") |
| 12 |
component_gc = ("Core", "JavaScript: GC") |
| 13 |
component_intl = ("Core", "JavaScript: Internationalization API") |
| 14 |
component_jit = ("Core", "JavaScript Engine: JIT") |
| 15 |
component_stl = ("Core", "JavaScript: Standard Library") |
| 16 |
component_wasm = ("Core", "Javascript: Web Assembly") |
| 17 |
|
| 18 |
FILES_PER_UNIFIED_FILE = 6 |
| 19 |
|
| 20 |
# Prevent redefining FILES_PER_UNIFIED_FILE in each sub-directory of js. This |
| 21 |
# will not escape this directory. |
| 22 |
export("FILES_PER_UNIFIED_FILE") |
| 23 |
|
| 24 |
with Files("*"): |
| 25 |
BUG_COMPONENT = component_engine |
| 26 |
|
| 27 |
with Files("wasm/**"): |
| 28 |
BUG_COMPONENT = component_wasm |
| 29 |
with Files("builtin/**"): |
| 30 |
BUG_COMPONENT = component_stl |
| 31 |
with Files("ctypes/**"): |
| 32 |
BUG_COMPONENT = ("Core", "js-ctypes") |
| 33 |
with Files("gc/**"): |
| 34 |
BUG_COMPONENT = component_gc |
| 35 |
with Files("jit/**"): |
| 36 |
BUG_COMPONENT = component_jit |
| 37 |
|
| 38 |
# File-specific metadata |
| 39 |
for gcfile in ["devtools/rootAnalysis", "devtools/gc-ubench", "devtools/gctrace"]: |
| 40 |
with Files(gcfile): |
| 41 |
BUG_COMPONENT = component_gc |
| 42 |
|
| 43 |
for stlfile in ["jsdate.*", "jsnum.*"]: |
| 44 |
with Files(stlfile): |
| 45 |
BUG_COMPONENT = component_stl |
| 46 |
|
| 47 |
with Files("builtin/intl/*"): |
| 48 |
BUG_COMPONENT = component_intl |
| 49 |
|
| 50 |
if not CONFIG["JS_DISABLE_SHELL"]: |
| 51 |
DIRS += [ |
| 52 |
"rust", |
| 53 |
"shell", |
| 54 |
] |
| 55 |
|
| 56 |
TEST_DIRS += [ |
| 57 |
"gdb", |
| 58 |
"jsapi-tests", |
| 59 |
"tests", |
| 60 |
] |
| 61 |
|
| 62 |
if CONFIG["FUZZING_INTERFACES"]: |
| 63 |
TEST_DIRS += [ |
| 64 |
"fuzz-tests", |
| 65 |
] |
| 66 |
|
| 67 |
if CONFIG["FUZZING_INTERFACES"] and CONFIG["LIBFUZZER"]: |
| 68 |
# In addition to regular coverage provided by trace-pc-guard, |
| 69 |
# LibFuzzer can use trace-cmp to instrument various compare instructions. |
| 70 |
# Only use this feature on source files that do a lot of constant |
| 71 |
# comparisons that would otherwise be hard to guess by LibFuzzer, |
| 72 |
# as it comes with a larger overhead (requires -use_value_profile=1). |
| 73 |
include("/tools/fuzzing/libfuzzer-flags.mozbuild") |
| 74 |
|
| 75 |
# Any files that are targeted by LibFuzzer should be added here so they can |
| 76 |
# be built with the necessary instrumentation flags, rather than just building |
| 77 |
# the whole JS engine with instrumentation, to reduce the amount of noise. |
| 78 |
SOURCES += [ |
| 79 |
"vm/StructuredClone.cpp", |
| 80 |
] |
| 81 |
SOURCES["vm/StructuredClone.cpp"].flags += libfuzzer_flags |
| 82 |
else: |
| 83 |
UNIFIED_SOURCES += [ |
| 84 |
"vm/StructuredClone.cpp", |
| 85 |
] |
| 86 |
|
| 87 |
if CONFIG["FUZZING_JS_FUZZILLI"]: |
| 88 |
# When building for Fuzzilli, we instrument everything with standard |
| 89 |
# trace-pc instrumentation. |
| 90 |
include("/tools/fuzzing/libfuzzer-config.mozbuild") |
| 91 |
|
| 92 |
CONFIGURE_DEFINE_FILES += [ |
| 93 |
"js-confdefs.h", |
| 94 |
] |
| 95 |
|
| 96 |
CONFIGURE_DEFINE_FILES += [ |
| 97 |
"js-config.h", |
| 98 |
] |
| 99 |
|
| 100 |
if CONFIG["HAVE_DTRACE"]: |
| 101 |
GeneratedFile("javascript-trace.h") |
| 102 |
EXPORTS += ["!javascript-trace.h"] |
| 103 |
|
| 104 |
# Changes to internal header files, used externally, massively slow down |
| 105 |
# browser builds. Don't add new files here unless you know what you're |
| 106 |
# doing! |
| 107 |
EXPORTS += [ |
| 108 |
"!js-config.h", |
| 109 |
"jsapi.h", |
| 110 |
"jsfriendapi.h", |
| 111 |
"jspubtd.h", |
| 112 |
"jstypes.h", |
| 113 |
] |
| 114 |
|
| 115 |
EXPORTS.js += [ |
| 116 |
"!../public/PrefsGenerated.h", |
| 117 |
"../public/AllocationLogging.h", |
| 118 |
"../public/AllocationRecording.h", |
| 119 |
"../public/AllocPolicy.h", |
| 120 |
"../public/Array.h", |
| 121 |
"../public/ArrayBuffer.h", |
| 122 |
"../public/ArrayBufferMaybeShared.h", |
| 123 |
"../public/BigInt.h", |
| 124 |
"../public/BuildId.h", |
| 125 |
"../public/CallAndConstruct.h", |
| 126 |
"../public/CallArgs.h", |
| 127 |
"../public/CallNonGenericMethod.h", |
| 128 |
"../public/CharacterEncoding.h", |
| 129 |
"../public/Class.h", |
| 130 |
"../public/ColumnNumber.h", |
| 131 |
"../public/ComparisonOperators.h", |
| 132 |
"../public/CompilationAndEvaluation.h", |
| 133 |
"../public/CompileOptions.h", |
| 134 |
"../public/Context.h", |
| 135 |
"../public/ContextOptions.h", |
| 136 |
"../public/Conversions.h", |
| 137 |
"../public/Date.h", |
| 138 |
"../public/Debug.h", |
| 139 |
"../public/EnvironmentChain.h", |
| 140 |
"../public/Equality.h", |
| 141 |
"../public/ErrorInterceptor.h", |
| 142 |
"../public/ErrorReport.h", |
| 143 |
"../public/Exception.h", |
| 144 |
"../public/ForOfIterator.h", |
| 145 |
"../public/GCAnnotations.h", |
| 146 |
"../public/GCAPI.h", |
| 147 |
"../public/GCHashTable.h", |
| 148 |
"../public/GCPolicyAPI.h", |
| 149 |
"../public/GCTypeMacros.h", |
| 150 |
"../public/GCVariant.h", |
| 151 |
"../public/GCVector.h", |
| 152 |
"../public/GlobalObject.h", |
| 153 |
"../public/HashTable.h", |
| 154 |
"../public/HeapAPI.h", |
| 155 |
"../public/HelperThreadAPI.h", |
| 156 |
"../public/Id.h", |
| 157 |
"../public/Initialization.h", |
| 158 |
"../public/Interrupt.h", |
| 159 |
"../public/Iterator.h", |
| 160 |
"../public/JSON.h", |
| 161 |
"../public/LocaleSensitive.h", |
| 162 |
"../public/MapAndSet.h", |
| 163 |
"../public/MemoryCallbacks.h", |
| 164 |
"../public/MemoryFunctions.h", |
| 165 |
"../public/MemoryMetrics.h", |
| 166 |
"../public/Modules.h", |
| 167 |
"../public/NativeStackLimits.h", |
| 168 |
"../public/Object.h", |
| 169 |
"../public/ObjectWithStashedPointer.h", |
| 170 |
"../public/Prefs.h", |
| 171 |
"../public/Principals.h", |
| 172 |
"../public/Printer.h", |
| 173 |
"../public/Printf.h", |
| 174 |
"../public/ProfilingCategory.h", |
| 175 |
"../public/ProfilingFrameIterator.h", |
| 176 |
"../public/ProfilingStack.h", |
| 177 |
"../public/Promise.h", |
| 178 |
"../public/PropertyAndElement.h", |
| 179 |
"../public/PropertyDescriptor.h", |
| 180 |
"../public/PropertySpec.h", |
| 181 |
"../public/ProtoKey.h", |
| 182 |
"../public/Proxy.h", |
| 183 |
"../public/Realm.h", |
| 184 |
"../public/RealmIterators.h", |
| 185 |
"../public/RealmOptions.h", |
| 186 |
"../public/RefCounted.h", |
| 187 |
"../public/RegExp.h", |
| 188 |
"../public/RegExpFlags.h", |
| 189 |
"../public/Result.h", |
| 190 |
"../public/RootingAPI.h", |
| 191 |
"../public/SavedFrameAPI.h", |
| 192 |
"../public/ScalarType.h", |
| 193 |
"../public/ScriptPrivate.h", |
| 194 |
"../public/ShadowRealmCallbacks.h", |
| 195 |
"../public/SharedArrayBuffer.h", |
| 196 |
"../public/SliceBudget.h", |
| 197 |
"../public/SourceText.h", |
| 198 |
"../public/StableStringChars.h", |
| 199 |
"../public/Stack.h", |
| 200 |
"../public/StreamConsumer.h", |
| 201 |
"../public/String.h", |
| 202 |
"../public/StructuredClone.h", |
| 203 |
"../public/SweepingAPI.h", |
| 204 |
"../public/Symbol.h", |
| 205 |
"../public/TelemetryTimers.h", |
| 206 |
"../public/TraceKind.h", |
| 207 |
"../public/TracingAPI.h", |
| 208 |
"../public/Transcoding.h", |
| 209 |
"../public/TypeDecls.h", |
| 210 |
"../public/UbiNode.h", |
| 211 |
"../public/UbiNodeBreadthFirst.h", |
| 212 |
"../public/UbiNodeCensus.h", |
| 213 |
"../public/UbiNodeDominatorTree.h", |
| 214 |
"../public/UbiNodePostOrder.h", |
| 215 |
"../public/UbiNodeShortestPaths.h", |
| 216 |
"../public/UbiNodeUtils.h", |
| 217 |
"../public/UniquePtr.h", |
| 218 |
"../public/Utility.h", |
| 219 |
"../public/Value.h", |
| 220 |
"../public/ValueArray.h", |
| 221 |
"../public/Vector.h", |
| 222 |
"../public/WaitCallbacks.h", |
| 223 |
"../public/Warnings.h", |
| 224 |
"../public/WasmFeatures.h", |
| 225 |
"../public/WasmModule.h", |
| 226 |
"../public/WeakMap.h", |
| 227 |
"../public/WeakMapPtr.h", |
| 228 |
"../public/Wrapper.h", |
| 229 |
"../public/WrapperCallbacks.h", |
| 230 |
"../public/Zone.h", |
| 231 |
] |
| 232 |
|
| 233 |
# This lives in mozglue/baseprofiler but we re-publish ourselves to support |
| 234 |
# standalone SpiderMonkey configurations. |
| 235 |
EXPORTS.js += [ |
| 236 |
"!/mozglue/baseprofiler/public/ProfilingCategoryList.h", |
| 237 |
] |
| 238 |
|
| 239 |
# Public APIs that are experimental: the precise contour of the APIs may still |
| 240 |
# change, but they're at least plausible first passes at designing something. |
| 241 |
# We expose them as-is, buyer beware. |
| 242 |
EXPORTS.js.experimental += [ |
| 243 |
"../public/experimental/BindingAllocs.h", |
| 244 |
"../public/experimental/CodeCoverage.h", |
| 245 |
"../public/experimental/CompileScript.h", |
| 246 |
"../public/experimental/CTypes.h", |
| 247 |
"../public/experimental/Intl.h", |
| 248 |
"../public/experimental/JitInfo.h", |
| 249 |
"../public/experimental/JSStencil.h", |
| 250 |
"../public/experimental/LoggingInterface.h", |
| 251 |
"../public/experimental/PCCountProfiling.h", |
| 252 |
"../public/experimental/SourceHook.h", |
| 253 |
"../public/experimental/TypedData.h", |
| 254 |
] |
| 255 |
|
| 256 |
# Friend APIs are APIs that either basically SpiderMonkey-internal, or their |
| 257 |
# contours are gross and terrible -- but the functionality is too important to |
| 258 |
# some embedder (often, Gecko) to just not expose anything or to agonize through |
| 259 |
# a clean design. Use this only if you absolutely must, and feel free to |
| 260 |
# propose clean APIs to replace what's here! |
| 261 |
EXPORTS.js.friend += [ |
| 262 |
"../public/friend/CycleCollector.h", |
| 263 |
"../public/friend/DOMProxy.h", |
| 264 |
"../public/friend/DumpFunctions.h", |
| 265 |
"../public/friend/ErrorMessages.h", |
| 266 |
"../public/friend/ErrorNumbers.msg", |
| 267 |
"../public/friend/JSMEnvironment.h", |
| 268 |
"../public/friend/PerformanceHint.h", |
| 269 |
"../public/friend/StackLimits.h", |
| 270 |
"../public/friend/UsageStatistics.h", |
| 271 |
"../public/friend/WindowProxy.h", |
| 272 |
"../public/friend/XrayJitInfo.h", |
| 273 |
] |
| 274 |
|
| 275 |
# "Shadow" API defines the internal layout of public JSAPI types like |JSObject| |
| 276 |
# and |JSString|, so that other *inline* public functions can efficiently access |
| 277 |
# their internal fields. |
| 278 |
# |
| 279 |
# Embedders must never include these headers themselves or use their contents. |
| 280 |
# These internal layout details are publicly exposed for access *only* so that |
| 281 |
# other public API definitions may use them. |
| 282 |
# |
| 283 |
# When adding new shadow structure definitions (or new fields/static constants |
| 284 |
# to existing structures) for access by inline methods, make sure to add static |
| 285 |
# asserts to the original header file to ensure that offsets and duplicated |
| 286 |
# constants are consistent. (Long term, it might be worth figuring out some way |
| 287 |
# to back actual implementations *with* these shadow definitions to eliminate |
| 288 |
# this requirement.) |
| 289 |
EXPORTS.js.shadow += [ |
| 290 |
"../public/shadow/Function.h", |
| 291 |
"../public/shadow/Object.h", |
| 292 |
"../public/shadow/Realm.h", |
| 293 |
"../public/shadow/Shape.h", |
| 294 |
"../public/shadow/String.h", |
| 295 |
"../public/shadow/Symbol.h", |
| 296 |
"../public/shadow/Zone.h", |
| 297 |
] |
| 298 |
|
| 299 |
UNIFIED_SOURCES += [ |
| 300 |
"builtin/Array.cpp", |
| 301 |
"builtin/AtomicsObject.cpp", |
| 302 |
"builtin/BigInt.cpp", |
| 303 |
"builtin/Boolean.cpp", |
| 304 |
"builtin/DataViewObject.cpp", |
| 305 |
"builtin/Eval.cpp", |
| 306 |
"builtin/FinalizationRegistryObject.cpp", |
| 307 |
"builtin/JSON.cpp", |
| 308 |
"builtin/MapObject.cpp", |
| 309 |
"builtin/ModuleObject.cpp", |
| 310 |
"builtin/Object.cpp", |
| 311 |
"builtin/ParseRecordObject.cpp", |
| 312 |
"builtin/Profilers.cpp", |
| 313 |
"builtin/Promise.cpp", |
| 314 |
"builtin/RawJSONObject.cpp", |
| 315 |
"builtin/Reflect.cpp", |
| 316 |
"builtin/ReflectParse.cpp", |
| 317 |
"builtin/ShadowRealm.cpp", |
| 318 |
"builtin/String.cpp", |
| 319 |
"builtin/Symbol.cpp", |
| 320 |
"builtin/TestingFunctions.cpp", |
| 321 |
"builtin/TestingUtility.cpp", |
| 322 |
"builtin/WeakMapObject.cpp", |
| 323 |
"builtin/WeakRefObject.cpp", |
| 324 |
"builtin/WeakSetObject.cpp", |
| 325 |
"builtin/WrappedFunctionObject.cpp", |
| 326 |
"ds/Bitmap.cpp", |
| 327 |
"ds/LifoAlloc.cpp", |
| 328 |
"jsapi.cpp", |
| 329 |
"jsdate.cpp", |
| 330 |
"jsexn.cpp", |
| 331 |
"jsfriendapi.cpp", |
| 332 |
"jsnum.cpp", |
| 333 |
"proxy/BaseProxyHandler.cpp", |
| 334 |
"proxy/CrossCompartmentWrapper.cpp", |
| 335 |
"proxy/DeadObjectProxy.cpp", |
| 336 |
"proxy/DOMProxy.cpp", |
| 337 |
"proxy/OpaqueCrossCompartmentWrapper.cpp", |
| 338 |
"proxy/Proxy.cpp", |
| 339 |
"proxy/ScriptedProxyHandler.cpp", |
| 340 |
"proxy/SecurityWrapper.cpp", |
| 341 |
"proxy/Wrapper.cpp", |
| 342 |
"threading/Mutex.cpp", |
| 343 |
"threading/ProtectedData.cpp", |
| 344 |
"threading/Thread.cpp", |
| 345 |
"vm/Activation.cpp", |
| 346 |
"vm/ArgumentsObject.cpp", |
| 347 |
"vm/ArrayBufferObject.cpp", |
| 348 |
"vm/ArrayBufferObjectMaybeShared.cpp", |
| 349 |
"vm/ArrayBufferViewObject.cpp", |
| 350 |
"vm/AsyncFunction.cpp", |
| 351 |
"vm/AsyncIteration.cpp", |
| 352 |
"vm/BigIntType.cpp", |
| 353 |
"vm/BoundFunctionObject.cpp", |
| 354 |
"vm/BuildId.cpp", |
| 355 |
"vm/BuiltinObjectKind.cpp", |
| 356 |
"vm/BytecodeLocation.cpp", |
| 357 |
"vm/BytecodeUtil.cpp", |
| 358 |
"vm/CallAndConstruct.cpp", |
| 359 |
"vm/CallNonGenericMethod.cpp", |
| 360 |
"vm/CharacterEncoding.cpp", |
| 361 |
"vm/CodeCoverage.cpp", |
| 362 |
"vm/Compartment.cpp", |
| 363 |
"vm/CompilationAndEvaluation.cpp", |
| 364 |
"vm/Compression.cpp", |
| 365 |
"vm/ConcurrentDelazification.cpp", |
| 366 |
"vm/DateTime.cpp", |
| 367 |
"vm/EnvironmentObject.cpp", |
| 368 |
"vm/EqualityOperations.cpp", |
| 369 |
"vm/ErrorMessages.cpp", |
| 370 |
"vm/ErrorObject.cpp", |
| 371 |
"vm/ErrorReporting.cpp", |
| 372 |
"vm/Exception.cpp", |
| 373 |
"vm/ForOfIterator.cpp", |
| 374 |
"vm/FrameIter.cpp", |
| 375 |
"vm/FunctionFlags.cpp", |
| 376 |
"vm/GeckoProfiler.cpp", |
| 377 |
"vm/GeneratorObject.cpp", |
| 378 |
"vm/GetterSetter.cpp", |
| 379 |
"vm/GlobalObject.cpp", |
| 380 |
"vm/HelperThreads.cpp", |
| 381 |
"vm/Id.cpp", |
| 382 |
"vm/Initialization.cpp", |
| 383 |
"vm/InternalThreadPool.cpp", |
| 384 |
"vm/InvalidatingFuse.cpp", |
| 385 |
"vm/Iteration.cpp", |
| 386 |
"vm/Iterator.cpp", |
| 387 |
"vm/JitActivation.cpp", |
| 388 |
"vm/JSAtomUtils.cpp", |
| 389 |
"vm/JSContext.cpp", |
| 390 |
"vm/JSFunction.cpp", |
| 391 |
"vm/JSObject.cpp", |
| 392 |
"vm/JSONParser.cpp", |
| 393 |
"vm/JSONPrinter.cpp", |
| 394 |
"vm/JSScript.cpp", |
| 395 |
"vm/List.cpp", |
| 396 |
"vm/Logging.cpp", |
| 397 |
"vm/MemoryMetrics.cpp", |
| 398 |
"vm/Modules.cpp", |
| 399 |
"vm/NativeObject.cpp", |
| 400 |
"vm/ObjectWithStashedPointer.cpp", |
| 401 |
"vm/OffThreadPromiseRuntimeState.cpp", |
| 402 |
"vm/PlainObject.cpp", |
| 403 |
"vm/Prefs.cpp", |
| 404 |
"vm/Printer.cpp", |
| 405 |
"vm/Probes.cpp", |
| 406 |
"vm/PropertyAndElement.cpp", |
| 407 |
"vm/PropertyDescriptor.cpp", |
| 408 |
"vm/PropMap.cpp", |
| 409 |
"vm/ProxyObject.cpp", |
| 410 |
"vm/Realm.cpp", |
| 411 |
"vm/RealmFuses.cpp", |
| 412 |
"vm/RegExpObject.cpp", |
| 413 |
"vm/RegExpStatics.cpp", |
| 414 |
"vm/Runtime.cpp", |
| 415 |
"vm/SavedStacks.cpp", |
| 416 |
"vm/Scope.cpp", |
| 417 |
"vm/SelfHosting.cpp", |
| 418 |
"vm/Shape.cpp", |
| 419 |
"vm/ShapeZone.cpp", |
| 420 |
"vm/SharedArrayObject.cpp", |
| 421 |
"vm/SharedImmutableStringsCache.cpp", |
| 422 |
"vm/SharedScriptDataTableHolder.cpp", |
| 423 |
"vm/SourceHook.cpp", |
| 424 |
"vm/Stack.cpp", |
| 425 |
"vm/StaticStrings.cpp", |
| 426 |
"vm/StencilObject.cpp", |
| 427 |
"vm/StringType.cpp", |
| 428 |
"vm/SymbolType.cpp", |
| 429 |
"vm/TaggedProto.cpp", |
| 430 |
"vm/ThrowMsgKind.cpp", |
| 431 |
"vm/Time.cpp", |
| 432 |
"vm/ToSource.cpp", |
| 433 |
"vm/TypedArrayObject.cpp", |
| 434 |
"vm/UbiNode.cpp", |
| 435 |
"vm/UbiNodeCensus.cpp", |
| 436 |
"vm/UbiNodeShortestPaths.cpp", |
| 437 |
"vm/UsageStatistics.cpp", |
| 438 |
"vm/Value.cpp", |
| 439 |
"vm/Warnings.cpp", |
| 440 |
"vm/Watchtower.cpp", |
| 441 |
"vm/WellKnownAtom.cpp", |
| 442 |
"vm/WindowProxy.cpp", |
| 443 |
"vm/Xdr.cpp", |
| 444 |
] |
| 445 |
|
| 446 |
# builtin/RegExp.cpp cannot be built in unified mode because it causes huge |
| 447 |
# win32 test slowdowns |
| 448 |
# jsmath.cpp cannot be built in unified mode because it needs to re-#define the |
| 449 |
# RtlGenRandom declaration's calling convention in <ntsecapi.h> on Windows. |
| 450 |
# vm/Interpreter.cpp is gigantic and destroys incremental build times for any |
| 451 |
# files unlucky enough to be unified with it. |
| 452 |
SOURCES += [ |
| 453 |
"builtin/RegExp.cpp", |
| 454 |
"jsmath.cpp", |
| 455 |
"vm/Interpreter.cpp", |
| 456 |
"vm/ProfilingStack.cpp", |
| 457 |
] |
| 458 |
|
| 459 |
if CONFIG["ENABLE_PORTABLE_BASELINE_INTERP"]: |
| 460 |
SOURCES += [ |
| 461 |
"vm/PortableBaselineInterpret.cpp", |
| 462 |
] |
| 463 |
|
| 464 |
if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: |
| 465 |
UNIFIED_SOURCES += [ |
| 466 |
"builtin/AsyncDisposableStackObject.cpp", |
| 467 |
"builtin/DisposableStackObject.cpp", |
| 468 |
"builtin/DisposableStackObjectBase.cpp", |
| 469 |
"vm/DisposableRecord.cpp", |
| 470 |
] |
| 471 |
|
| 472 |
if CONFIG["JS_HAS_INTL_API"]: |
| 473 |
UNIFIED_SOURCES += [ |
| 474 |
"builtin/intl/Collator.cpp", |
| 475 |
"builtin/intl/CommonFunctions.cpp", |
| 476 |
"builtin/intl/DateTimeFormat.cpp", |
| 477 |
"builtin/intl/DisplayNames.cpp", |
| 478 |
"builtin/intl/DurationFormat.cpp", |
| 479 |
"builtin/intl/IntlObject.cpp", |
| 480 |
"builtin/intl/LanguageTag.cpp", |
| 481 |
"builtin/intl/ListFormat.cpp", |
| 482 |
"builtin/intl/Locale.cpp", |
| 483 |
"builtin/intl/NumberFormat.cpp", |
| 484 |
"builtin/intl/PluralRules.cpp", |
| 485 |
"builtin/intl/RelativeTimeFormat.cpp", |
| 486 |
"builtin/intl/Segmenter.cpp", |
| 487 |
"builtin/intl/SharedIntlData.cpp", |
| 488 |
] |
| 489 |
|
| 490 |
if CONFIG["MOZ_INSTRUMENTS"]: |
| 491 |
OS_LIBS += ["-framework CoreFoundation"] |
| 492 |
SOURCES += [ |
| 493 |
"devtools/Instruments.cpp", |
| 494 |
] |
| 495 |
|
| 496 |
if CONFIG["OS_ARCH"] == "WINNT": |
| 497 |
OS_LIBS += [ |
| 498 |
"advapi32", |
| 499 |
] |
| 500 |
UNIFIED_SOURCES += [ |
| 501 |
"threading/windows/CpuCount.cpp", |
| 502 |
"threading/windows/WindowsThread.cpp", |
| 503 |
] |
| 504 |
# WASI hasn't supported thread yet so noop implementation is used. |
| 505 |
elif CONFIG["OS_ARCH"] == "WASI": |
| 506 |
UNIFIED_SOURCES += [ |
| 507 |
"threading/noop/CpuCount.cpp", |
| 508 |
"threading/noop/NoopThread.cpp", |
| 509 |
] |
| 510 |
else: |
| 511 |
UNIFIED_SOURCES += [ |
| 512 |
"threading/posix/CpuCount.cpp", |
| 513 |
"threading/posix/PosixThread.cpp", |
| 514 |
] |
| 515 |
|
| 516 |
if CONFIG["JS_HAS_INTL_API"]: |
| 517 |
LOCAL_INCLUDES += [ |
| 518 |
"/intl/icu_capi/bindings/c", |
| 519 |
] |
| 520 |
|
| 521 |
if CONFIG["JS_HAS_CTYPES"]: |
| 522 |
SOURCES += [ |
| 523 |
"ctypes/CTypes.cpp", |
| 524 |
"ctypes/Library.cpp", |
| 525 |
] |
| 526 |
if not CONFIG["MOZ_SYSTEM_FFI"]: |
| 527 |
LOCAL_INCLUDES += [ |
| 528 |
"!ctypes/libffi/include", |
| 529 |
"ctypes/libffi/src/%s" % CONFIG["FFI_TARGET_DIR"], |
| 530 |
] |
| 531 |
|
| 532 |
if CONFIG["MOZ_VTUNE"]: |
| 533 |
SOURCES += [ |
| 534 |
"vtune/ittnotify_static.c", |
| 535 |
"vtune/jitprofiling.c", |
| 536 |
"vtune/VTuneWrapper.cpp", |
| 537 |
] |
| 538 |
SOURCES["vtune/ittnotify_static.c"].flags += [ |
| 539 |
"-Wno-varargs", |
| 540 |
"-Wno-sign-compare", |
| 541 |
"-Wno-unknown-pragmas", |
| 542 |
] |
| 543 |
if CONFIG["CC_TYPE"] == "gcc": |
| 544 |
SOURCES["vtune/ittnotify_static.c"].flags += ["-Wno-stringop-overflow"] |
| 545 |
if int(CONFIG["CC_VERSION"].split(".")[0]) >= 8: |
| 546 |
SOURCES["vtune/ittnotify_static.c"].flags += ["-Wno-stringop-truncation"] |
| 547 |
|
| 548 |
DIRS += [ |
| 549 |
"build", |
| 550 |
"debugger", |
| 551 |
"frontend", |
| 552 |
"gc", |
| 553 |
"irregexp", |
| 554 |
"jit", |
| 555 |
"util", |
| 556 |
"wasm", |
| 557 |
"xsum", |
| 558 |
] |
| 559 |
|
| 560 |
if CONFIG["JS_HAS_INTL_API"]: |
| 561 |
DIRS += ["builtin/temporal"] |
| 562 |
|
| 563 |
# Bug 1739321 - clang 13+ only emits debuginfo for classes that are actually |
| 564 |
# constructed, and we cheat in a number of cases. The flag exists at least |
| 565 |
# back to clang 4. |
| 566 |
if CONFIG["CC_TYPE"] == "clang": |
| 567 |
CXXFLAGS += ["-fstandalone-debug"] |
| 568 |
|
| 569 |
# Bug 1722102 - This should never be enabled in Release without explicit |
| 570 |
# security and SpiderMonkey review. |
| 571 |
# See https://bugzilla.mozilla.org/show_bug.cgi?id=1722102#c16 |
| 572 |
if CONFIG["ENABLE_WASM_MOZ_INTGEMM"]: |
| 573 |
DIRS += ["intgemm"] |
| 574 |
|
| 575 |
if CONFIG["JS_JITSPEW"]: |
| 576 |
DIRS += ["zydis"] |
| 577 |
|
| 578 |
FINAL_LIBRARY = "js" |
| 579 |
|
| 580 |
selfhosted_inputs = [ |
| 581 |
"../public/friend/ErrorNumbers.msg", |
| 582 |
# ProfilingCategoryList.h is being indirectly included, and it must be passed |
| 583 |
# here as an input, so it's generated before this self-hosted JS code |
| 584 |
# generation. Otherwise, it will intermittently fail to build. |
| 585 |
"!/mozglue/baseprofiler/public/ProfilingCategoryList.h", |
| 586 |
"builtin/TypedArrayConstants.h", |
| 587 |
"builtin/SelfHostingDefines.h", |
| 588 |
"builtin/Utilities.js", |
| 589 |
"builtin/Array.js", |
| 590 |
"builtin/AsyncFunction.js", |
| 591 |
"builtin/AsyncIteration.js", |
| 592 |
"builtin/BigInt.js", |
| 593 |
"builtin/Date.js", |
| 594 |
"builtin/Error.js", |
| 595 |
"builtin/Generator.js", |
| 596 |
"builtin/Iterator.js", |
| 597 |
"builtin/Map.js", |
| 598 |
"builtin/Number.js", |
| 599 |
"builtin/Object.js", |
| 600 |
"builtin/Promise.js", |
| 601 |
"builtin/Reflect.js", |
| 602 |
"builtin/RegExp.js", |
| 603 |
"builtin/RegExpGlobalReplaceOpt.h.js", |
| 604 |
"builtin/RegExpLocalReplaceOpt.h.js", |
| 605 |
"builtin/String.js", |
| 606 |
"builtin/Set.js", |
| 607 |
"builtin/TypedArray.js", |
| 608 |
"builtin/WeakMap.js", |
| 609 |
"builtin/WeakSet.js", |
| 610 |
] + ( |
| 611 |
[ |
| 612 |
"builtin/intl/NumberingSystemsGenerated.h", |
| 613 |
"builtin/intl/Collator.js", |
| 614 |
"builtin/intl/CommonFunctions.js", |
| 615 |
"builtin/intl/CurrencyDataGenerated.js", |
| 616 |
"builtin/intl/DateTimeFormat.js", |
| 617 |
"builtin/intl/DisplayNames.js", |
| 618 |
"builtin/intl/DurationFormat.js", |
| 619 |
"builtin/intl/IntlObject.js", |
| 620 |
"builtin/intl/ListFormat.js", |
| 621 |
"builtin/intl/NumberFormat.js", |
| 622 |
"builtin/intl/PluralRules.js", |
| 623 |
"builtin/intl/RelativeTimeFormat.js", |
| 624 |
"builtin/intl/SanctionedSimpleUnitIdentifiersGenerated.js", |
| 625 |
"builtin/intl/Segmenter.js", |
| 626 |
] |
| 627 |
if CONFIG["JS_HAS_INTL_API"] |
| 628 |
else [] |
| 629 |
) |
| 630 |
|
| 631 |
if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: |
| 632 |
selfhosted_inputs += [ |
| 633 |
"builtin/AsyncDisposableStack.js", |
| 634 |
"builtin/DisposableStack.js", |
| 635 |
] |
| 636 |
|
| 637 |
# Prepare self-hosted JS code for embedding |
| 638 |
GeneratedFile( |
| 639 |
"selfhosted.out.h", |
| 640 |
"selfhosted.js", |
| 641 |
script="builtin/embedjs.py", |
| 642 |
entry_point="generate_selfhosted", |
| 643 |
inputs=selfhosted_inputs, |
| 644 |
) |
| 645 |
|
| 646 |
GeneratedFile( |
| 647 |
"../public/PrefsGenerated.h", |
| 648 |
script="GeneratePrefs.py", |
| 649 |
entry_point="generate_prefs_header", |
| 650 |
inputs=["../../modules/libpref/init/StaticPrefList.yaml"], |
| 651 |
) |
| 652 |
|
| 653 |
if CONFIG["JS_HAS_CTYPES"]: |
| 654 |
if CONFIG["MOZ_SYSTEM_FFI"]: |
| 655 |
CXXFLAGS += CONFIG["MOZ_FFI_CFLAGS"] |
| 656 |
|
| 657 |
if CONFIG["JS_HAS_INTL_API"]: |
| 658 |
if CONFIG["JS_STANDALONE"]: |
| 659 |
DIRS += [ |
| 660 |
"../../intl/bidi", |
| 661 |
"../../intl/components", |
| 662 |
] |
| 663 |
|
| 664 |
USE_LIBS += ["intlcomponents"] |
| 665 |
|
| 666 |
if CONFIG["USE_LIBZ_RS"]: |
| 667 |
DEFINES["USE_LIBZ_RS"] = True |