tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 22e0ba8c7bd3ec24b9fe19f9f419a13c47fd68a1
parent b2f3b1d06f5c078c9c1bbe49fba188a1e6353cdb
Author: André Bargull <andre.bargull@gmail.com>
Date:   Mon, 22 Dec 2025 15:18:01 +0000

Bug 1504045 - Part 6: Add moz.build for js/src/vm. r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D276619

Diffstat:
Mjs/src/moz.build | 141+------------------------------------------------------------------------------
Ajs/src/vm/moz.build | 163+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 164 insertions(+), 140 deletions(-)

diff --git a/js/src/moz.build b/js/src/moz.build @@ -70,26 +70,6 @@ LegacyTest( depends=["/config/check_js_msg_encoding.py"], ) -if CONFIG["FUZZING_INTERFACES"] and CONFIG["LIBFUZZER"]: - # In addition to regular coverage provided by trace-pc-guard, - # LibFuzzer can use trace-cmp to instrument various compare instructions. - # Only use this feature on source files that do a lot of constant - # comparisons that would otherwise be hard to guess by LibFuzzer, - # as it comes with a larger overhead (requires -use_value_profile=1). - include("/tools/fuzzing/libfuzzer-flags.mozbuild") - - # Any files that are targeted by LibFuzzer should be added here so they can - # be built with the necessary instrumentation flags, rather than just building - # the whole JS engine with instrumentation, to reduce the amount of noise. - SOURCES += [ - "vm/StructuredClone.cpp", - ] - SOURCES["vm/StructuredClone.cpp"].flags += libfuzzer_flags -else: - UNIFIED_SOURCES += [ - "vm/StructuredClone.cpp", - ] - if CONFIG["FUZZING_JS_FUZZILLI"]: # When building for Fuzzilli, we instrument everything with standard # trace-pc instrumentation. @@ -306,131 +286,14 @@ UNIFIED_SOURCES += [ "jsexn.cpp", "jsfriendapi.cpp", "jsnum.cpp", - "vm/Activation.cpp", - "vm/ArgumentsObject.cpp", - "vm/ArrayBufferObject.cpp", - "vm/ArrayBufferObjectMaybeShared.cpp", - "vm/ArrayBufferViewObject.cpp", - "vm/AsyncFunction.cpp", - "vm/AsyncIteration.cpp", - "vm/BigIntType.cpp", - "vm/BoundFunctionObject.cpp", - "vm/BuildId.cpp", - "vm/BuiltinObjectKind.cpp", - "vm/BytecodeLocation.cpp", - "vm/BytecodeUtil.cpp", - "vm/CallAndConstruct.cpp", - "vm/CallNonGenericMethod.cpp", - "vm/CharacterEncoding.cpp", - "vm/CodeCoverage.cpp", - "vm/Compartment.cpp", - "vm/CompilationAndEvaluation.cpp", - "vm/Compression.cpp", - "vm/ConcurrentDelazification.cpp", - "vm/DateTime.cpp", - "vm/DOMEventDispatch.cpp", - "vm/EnvironmentObject.cpp", - "vm/EqualityOperations.cpp", - "vm/ErrorMessages.cpp", - "vm/ErrorObject.cpp", - "vm/ErrorReporting.cpp", - "vm/Exception.cpp", - "vm/ForOfIterator.cpp", - "vm/FrameIter.cpp", - "vm/FunctionFlags.cpp", - "vm/GeckoProfiler.cpp", - "vm/GeneratorObject.cpp", - "vm/GetterSetter.cpp", - "vm/GlobalObject.cpp", - "vm/HelperThreads.cpp", - "vm/Id.cpp", - "vm/Initialization.cpp", - "vm/Int128.cpp", - "vm/InternalThreadPool.cpp", - "vm/InvalidatingFuse.cpp", - "vm/Iteration.cpp", - "vm/Iterator.cpp", - "vm/JitActivation.cpp", - "vm/JSAtomUtils.cpp", - "vm/JSContext.cpp", - "vm/JSFunction.cpp", - "vm/JSObject.cpp", - "vm/JSONParser.cpp", - "vm/JSONPrinter.cpp", - "vm/JSScript.cpp", - "vm/List.cpp", - "vm/Logging.cpp", - "vm/MemoryMetrics.cpp", - "vm/Modules.cpp", - "vm/NativeObject.cpp", - "vm/ObjectFuse.cpp", - "vm/ObjectWithStashedPointer.cpp", - "vm/OffThreadPromiseRuntimeState.cpp", - "vm/PlainObject.cpp", - "vm/Prefs.cpp", - "vm/Printer.cpp", - "vm/Probes.cpp", - "vm/PropertyAndElement.cpp", - "vm/PropertyDescriptor.cpp", - "vm/PropMap.cpp", - "vm/ProxyObject.cpp", - "vm/Realm.cpp", - "vm/RealmFuses.cpp", - "vm/RegExpObject.cpp", - "vm/RegExpStatics.cpp", - "vm/Runtime.cpp", - "vm/RuntimeFuses.cpp", - "vm/SavedStacks.cpp", - "vm/Scope.cpp", - "vm/SelfHosting.cpp", - "vm/Shape.cpp", - "vm/ShapeZone.cpp", - "vm/SharedArrayObject.cpp", - "vm/SharedImmutableStringsCache.cpp", - "vm/SharedScriptDataTableHolder.cpp", - "vm/SourceHook.cpp", - "vm/Stack.cpp", - "vm/StaticStrings.cpp", - "vm/StencilObject.cpp", - "vm/StringType.cpp", - "vm/SymbolType.cpp", - "vm/TaggedProto.cpp", - "vm/ThrowMsgKind.cpp", - "vm/Time.cpp", - "vm/ToSource.cpp", - "vm/TypedArrayObject.cpp", - "vm/UbiNode.cpp", - "vm/UbiNodeCensus.cpp", - "vm/UbiNodeShortestPaths.cpp", - "vm/UsageStatistics.cpp", - "vm/Value.cpp", - "vm/Warnings.cpp", - "vm/Watchtower.cpp", - "vm/WellKnownAtom.cpp", - "vm/WindowProxy.cpp", - "vm/Xdr.cpp", ] # jsmath.cpp cannot be built in unified mode because it needs to re-#define the # RtlGenRandom declaration's calling convention in <ntsecapi.h> on Windows. -# vm/Interpreter.cpp is gigantic and destroys incremental build times for any -# files unlucky enough to be unified with it. SOURCES += [ "jsmath.cpp", - "vm/Interpreter.cpp", - "vm/ProfilingStack.cpp", ] -if CONFIG["ENABLE_PORTABLE_BASELINE_INTERP"]: - SOURCES += [ - "vm/PortableBaselineInterpret.cpp", - ] - -if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: - UNIFIED_SOURCES += [ - "vm/DisposableRecord.cpp", - ] - if CONFIG["MOZ_INSTRUMENTS"]: OS_LIBS += ["-framework CoreFoundation"] SOURCES += [ @@ -476,6 +339,7 @@ DIRS += [ "proxy", "threading", "util", + "vm", "wasm", "xsum", ] @@ -521,6 +385,3 @@ if CONFIG["JS_HAS_INTL_API"]: ] USE_LIBS += ["intlcomponents"] - -if CONFIG["USE_LIBZ_RS"]: - DEFINES["USE_LIBZ_RS"] = True diff --git a/js/src/vm/moz.build b/js/src/vm/moz.build @@ -0,0 +1,163 @@ +# -*- 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/. + +FINAL_LIBRARY = "js" + +# Includes should be relative to parent path +LOCAL_INCLUDES += ["!..", ".."] + +include("../js-compileflags.mozbuild") +include("../js-config.mozbuild") +include("../js-cxxflags.mozbuild") + +UNIFIED_SOURCES += [ + "Activation.cpp", + "ArgumentsObject.cpp", + "ArrayBufferObject.cpp", + "ArrayBufferObjectMaybeShared.cpp", + "ArrayBufferViewObject.cpp", + "AsyncFunction.cpp", + "AsyncIteration.cpp", + "BigIntType.cpp", + "BoundFunctionObject.cpp", + "BuildId.cpp", + "BuiltinObjectKind.cpp", + "BytecodeLocation.cpp", + "BytecodeUtil.cpp", + "CallAndConstruct.cpp", + "CallNonGenericMethod.cpp", + "CharacterEncoding.cpp", + "CodeCoverage.cpp", + "Compartment.cpp", + "CompilationAndEvaluation.cpp", + "Compression.cpp", + "ConcurrentDelazification.cpp", + "DateTime.cpp", + "DOMEventDispatch.cpp", + "EnvironmentObject.cpp", + "EqualityOperations.cpp", + "ErrorMessages.cpp", + "ErrorObject.cpp", + "ErrorReporting.cpp", + "Exception.cpp", + "ForOfIterator.cpp", + "FrameIter.cpp", + "FunctionFlags.cpp", + "GeckoProfiler.cpp", + "GeneratorObject.cpp", + "GetterSetter.cpp", + "GlobalObject.cpp", + "HelperThreads.cpp", + "Id.cpp", + "Initialization.cpp", + "Int128.cpp", + "InternalThreadPool.cpp", + "InvalidatingFuse.cpp", + "Iteration.cpp", + "Iterator.cpp", + "JitActivation.cpp", + "JSAtomUtils.cpp", + "JSContext.cpp", + "JSFunction.cpp", + "JSObject.cpp", + "JSONParser.cpp", + "JSONPrinter.cpp", + "JSScript.cpp", + "List.cpp", + "Logging.cpp", + "MemoryMetrics.cpp", + "Modules.cpp", + "NativeObject.cpp", + "ObjectFuse.cpp", + "ObjectWithStashedPointer.cpp", + "OffThreadPromiseRuntimeState.cpp", + "PlainObject.cpp", + "Prefs.cpp", + "Printer.cpp", + "Probes.cpp", + "PropertyAndElement.cpp", + "PropertyDescriptor.cpp", + "PropMap.cpp", + "ProxyObject.cpp", + "Realm.cpp", + "RealmFuses.cpp", + "RegExpObject.cpp", + "RegExpStatics.cpp", + "Runtime.cpp", + "RuntimeFuses.cpp", + "SavedStacks.cpp", + "Scope.cpp", + "SelfHosting.cpp", + "Shape.cpp", + "ShapeZone.cpp", + "SharedArrayObject.cpp", + "SharedImmutableStringsCache.cpp", + "SharedScriptDataTableHolder.cpp", + "SourceHook.cpp", + "Stack.cpp", + "StaticStrings.cpp", + "StencilObject.cpp", + "StringType.cpp", + "SymbolType.cpp", + "TaggedProto.cpp", + "ThrowMsgKind.cpp", + "Time.cpp", + "ToSource.cpp", + "TypedArrayObject.cpp", + "UbiNode.cpp", + "UbiNodeCensus.cpp", + "UbiNodeShortestPaths.cpp", + "UsageStatistics.cpp", + "Value.cpp", + "Warnings.cpp", + "Watchtower.cpp", + "WellKnownAtom.cpp", + "WindowProxy.cpp", + "Xdr.cpp", +] + +if CONFIG["ENABLE_EXPLICIT_RESOURCE_MANAGEMENT"]: + UNIFIED_SOURCES += [ + "DisposableRecord.cpp", + ] + +# Interpreter.cpp is gigantic and destroys incremental build times for any files +# unlucky enough to be unified with it. +SOURCES += [ + "Interpreter.cpp", + "ProfilingStack.cpp", +] + +if CONFIG["ENABLE_PORTABLE_BASELINE_INTERP"]: + SOURCES += [ + "PortableBaselineInterpret.cpp", + ] + +if CONFIG["FUZZING_INTERFACES"] and CONFIG["LIBFUZZER"]: + # In addition to regular coverage provided by trace-pc-guard, + # LibFuzzer can use trace-cmp to instrument various compare instructions. + # Only use this feature on source files that do a lot of constant + # comparisons that would otherwise be hard to guess by LibFuzzer, + # as it comes with a larger overhead (requires -use_value_profile=1). + include("/tools/fuzzing/libfuzzer-flags.mozbuild") + + # Any files that are targeted by LibFuzzer should be added here so they can + # be built with the necessary instrumentation flags, rather than just building + # the whole JS engine with instrumentation, to reduce the amount of noise. + SOURCES += [ + "StructuredClone.cpp", + ] + SOURCES["StructuredClone.cpp"].flags += libfuzzer_flags +else: + UNIFIED_SOURCES += [ + "StructuredClone.cpp", + ] + +if CONFIG["USE_LIBZ_RS"]: + DEFINES["USE_LIBZ_RS"] = True + +if CONFIG["FUZZING_JS_FUZZILLI"]: + include("/tools/fuzzing/libfuzzer-config.mozbuild")