moz.build (4484B)
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 FINAL_LIBRARY = "js" 8 9 # Includes should be relative to parent path 10 LOCAL_INCLUDES += ["!..", ".."] 11 12 include("../js-compileflags.mozbuild") 13 include("../js-config.mozbuild") 14 include("../js-cxxflags.mozbuild") 15 16 UNIFIED_SOURCES += [ 17 "Activation.cpp", 18 "ArgumentsObject.cpp", 19 "ArrayBufferObject.cpp", 20 "ArrayBufferObjectMaybeShared.cpp", 21 "ArrayBufferViewObject.cpp", 22 "AsyncFunction.cpp", 23 "AsyncIteration.cpp", 24 "BigIntType.cpp", 25 "BoundFunctionObject.cpp", 26 "BuildId.cpp", 27 "BuiltinObjectKind.cpp", 28 "BytecodeLocation.cpp", 29 "BytecodeUtil.cpp", 30 "CallAndConstruct.cpp", 31 "CallNonGenericMethod.cpp", 32 "CharacterEncoding.cpp", 33 "CodeCoverage.cpp", 34 "Compartment.cpp", 35 "CompilationAndEvaluation.cpp", 36 "Compression.cpp", 37 "ConcurrentDelazification.cpp", 38 "DateTime.cpp", 39 "DOMEventDispatch.cpp", 40 "EnvironmentObject.cpp", 41 "EqualityOperations.cpp", 42 "ErrorMessages.cpp", 43 "ErrorObject.cpp", 44 "ErrorReporting.cpp", 45 "Exception.cpp", 46 "ForOfIterator.cpp", 47 "FrameIter.cpp", 48 "FunctionFlags.cpp", 49 "GeckoProfiler.cpp", 50 "GeneratorObject.cpp", 51 "GetterSetter.cpp", 52 "GlobalObject.cpp", 53 "HelperThreads.cpp", 54 "Id.cpp", 55 "Initialization.cpp", 56 "Int128.cpp", 57 "InternalThreadPool.cpp", 58 "InvalidatingFuse.cpp", 59 "Iteration.cpp", 60 "Iterator.cpp", 61 "JitActivation.cpp", 62 "JSAtomUtils.cpp", 63 "JSContext.cpp", 64 "JSFunction.cpp", 65 "JSObject.cpp", 66 "JSONParser.cpp", 67 "JSONPrinter.cpp", 68 "JSScript.cpp", 69 "List.cpp", 70 "Logging.cpp", 71 "MemoryMetrics.cpp", 72 "Modules.cpp", 73 "NativeObject.cpp", 74 "ObjectFuse.cpp", 75 "ObjectWithStashedPointer.cpp", 76 "OffThreadPromiseRuntimeState.cpp", 77 "PlainObject.cpp", 78 "Prefs.cpp", 79 "Printer.cpp", 80 "Probes.cpp", 81 "PropertyAndElement.cpp", 82 "PropertyDescriptor.cpp", 83 "PropMap.cpp", 84 "ProxyObject.cpp", 85 "Realm.cpp", 86 "RealmFuses.cpp", 87 "RegExpObject.cpp", 88 "RegExpStatics.cpp", 89 "Runtime.cpp", 90 "RuntimeFuses.cpp", 91 "SavedStacks.cpp", 92 "Scope.cpp", 93 "SelfHosting.cpp", 94 "Shape.cpp", 95 "ShapeZone.cpp", 96 "SharedArrayObject.cpp", 97 "SharedImmutableStringsCache.cpp", 98 "SharedScriptDataTableHolder.cpp", 99 "SourceHook.cpp", 100 "Stack.cpp", 101 "StaticStrings.cpp", 102 "StencilObject.cpp", 103 "StringType.cpp", 104 "SymbolType.cpp", 105 "TaggedProto.cpp", 106 "ThrowMsgKind.cpp", 107 "Time.cpp", 108 "ToSource.cpp", 109 "TypedArrayObject.cpp", 110 "UbiNode.cpp", 111 "UbiNodeCensus.cpp", 112 "UbiNodeShortestPaths.cpp", 113 "UsageStatistics.cpp", 114 "Value.cpp", 115 "Warnings.cpp", 116 "Watchtower.cpp", 117 "WellKnownAtom.cpp", 118 "WindowProxy.cpp", 119 "Xdr.cpp", 120 ] 121 122 if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: 123 UNIFIED_SOURCES += [ 124 "DisposableRecord.cpp", 125 ] 126 127 # Interpreter.cpp is gigantic and destroys incremental build times for any files 128 # unlucky enough to be unified with it. 129 SOURCES += [ 130 "Interpreter.cpp", 131 "ProfilingStack.cpp", 132 ] 133 134 if CONFIG["ENABLE_PORTABLE_BASELINE_INTERP"]: 135 SOURCES += [ 136 "PortableBaselineInterpret.cpp", 137 ] 138 139 if CONFIG["FUZZING_INTERFACES"] and CONFIG["LIBFUZZER"]: 140 # In addition to regular coverage provided by trace-pc-guard, 141 # LibFuzzer can use trace-cmp to instrument various compare instructions. 142 # Only use this feature on source files that do a lot of constant 143 # comparisons that would otherwise be hard to guess by LibFuzzer, 144 # as it comes with a larger overhead (requires -use_value_profile=1). 145 include("/tools/fuzzing/libfuzzer-flags.mozbuild") 146 147 # Any files that are targeted by LibFuzzer should be added here so they can 148 # be built with the necessary instrumentation flags, rather than just building 149 # the whole JS engine with instrumentation, to reduce the amount of noise. 150 SOURCES += [ 151 "StructuredClone.cpp", 152 ] 153 SOURCES["StructuredClone.cpp"].flags += libfuzzer_flags 154 else: 155 UNIFIED_SOURCES += [ 156 "StructuredClone.cpp", 157 ] 158 159 if CONFIG["USE_LIBZ_RS"]: 160 DEFINES["USE_LIBZ_RS"] = True 161 162 if CONFIG["FUZZING_JS_FUZZILLI"]: 163 include("/tools/fuzzing/libfuzzer-config.mozbuild")