Bug 1569080: Correct #includes in js/src/debugger. r=jorendorff

These changes were produced using the Include What You Use tool, which uses the
Clang front end to figure out which headers actually declare the identifiers
you're using.

These changes aren't exactly the ones IWYU suggests. The tool has some odd false
positives, even when you use its 'pragmas' to tell it about headers like
jsapi.h, which is supposed to gather up other headers for you. And there are
some cases where I could get away with a forward declaration (say, for Maybe),
but I really just want to #include the full header because it seems better. But
overall this patch has only minor deviations from IWYU's suggestions.

No intended change in execution or visible behavior.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jim Blandy 2019-08-08 23:20:21 +00:00
parent 1ff16f50ee
commit 715bf97a70
21 changed files with 633 additions and 211 deletions

View File

@ -6,13 +6,35 @@
#include "debugger/DebugScript.h" #include "debugger/DebugScript.h"
#include "jit/BaselineJIT.h" #include "mozilla/Assertions.h" // for AssertionConditionType
#include "mozilla/HashTable.h" // for HashMapEntry, HashTable<>::Ptr, HashMap
#include "mozilla/Move.h" // for std::move
#include "mozilla/UniquePtr.h" // for UniquePtr
#include "gc/FreeOp-inl.h" #include "jsapi.h"
#include "gc/GC-inl.h"
#include "gc/Marking-inl.h" #include "debugger/DebugAPI.h" // for DebugAPI
#include "vm/JSContext-inl.h" #include "debugger/Debugger.h" // for BreakpointSite, Breakpoint
#include "vm/Realm-inl.h" #include "gc/Barrier.h" // for GCPtrNativeObject, WriteBarriered
#include "gc/Cell.h" // for TenuredCell
#include "gc/FreeOp.h" // for FreeOp
#include "gc/GCEnum.h" // for MemoryUse, MemoryUse::BreakpointSite
#include "gc/Marking.h" // for IsAboutToBeFinalized
#include "gc/Zone.h" // for Zone
#include "gc/ZoneAllocator.h" // for AddCellMemory
#include "jit/BaselineJIT.h" // for BaselineScript
#include "vm/JSContext.h" // for JSContext
#include "vm/JSScript.h" // for JSScript, DebugScriptMap
#include "vm/NativeObject.h" // for NativeObject
#include "vm/Realm.h" // for Realm, AutoRealm
#include "vm/Runtime.h" // for ReportOutOfMemory
#include "vm/Stack.h" // for ActivationIterator, Activation
#include "gc/FreeOp-inl.h" // for FreeOp::free_
#include "gc/GC-inl.h" // for ZoneCellIter
#include "gc/Marking-inl.h" // for CheckGCThingAfterMovingGC
#include "vm/JSContext-inl.h" // for JSContext::check
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
namespace js { namespace js {

View File

@ -7,10 +7,22 @@
#ifndef dbg_DebugScript_h #ifndef dbg_DebugScript_h
#define dbg_DebugScript_h #define dbg_DebugScript_h
#include "debugger/Debugger.h" #include <stddef.h> // for offsetof
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t
#include "jsapi.h"
namespace JS {
class Realm;
}
namespace js { namespace js {
class BreakpointSite;
class Debugger;
class FreeOp;
// DebugScript manages the internal debugger state for a JSScript, which may be // DebugScript manages the internal debugger state for a JSScript, which may be
// associated with multiple Debuggers. // associated with multiple Debuggers.
class DebugScript { class DebugScript {
@ -74,8 +86,8 @@ class DebugScript {
static void destroyBreakpointSite(FreeOp* fop, JSScript* script, static void destroyBreakpointSite(FreeOp* fop, JSScript* script,
jsbytecode* pc); jsbytecode* pc);
static void clearBreakpointsIn(FreeOp* fop, Realm* realm, static void clearBreakpointsIn(FreeOp* fop, JS::Realm* realm, Debugger* dbg,
Debugger* dbg, JSObject* handler); JSObject* handler);
static void clearBreakpointsIn(FreeOp* fop, JSScript* script, static void clearBreakpointsIn(FreeOp* fop, JSScript* script,
Debugger* dbg, JSObject* handler); Debugger* dbg, JSObject* handler);

View File

@ -7,7 +7,12 @@
#ifndef debugger_Debugger_inl_h #ifndef debugger_Debugger_inl_h
#define debugger_Debugger_inl_h #define debugger_Debugger_inl_h
#include "debugger/Debugger.h" #include "debugger/Debugger.h" // for Debugger, ResumeMode
#include "mozilla/Assertions.h" // for AssertionConditionType
#include "vm/JSObject.h" // for JSObject
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
/* static */ inline js::Debugger* js::Debugger::fromJSObject( /* static */ inline js::Debugger* js::Debugger::fromJSObject(
const JSObject* obj) { const JSObject* obj) {

View File

@ -6,68 +6,146 @@
#include "debugger/Debugger-inl.h" #include "debugger/Debugger-inl.h"
#include "mozilla/DebugOnly.h" #include "mozilla/Attributes.h" // for MOZ_STACK_CLASS, MOZ_RAII
#include "mozilla/ScopeExit.h" #include "mozilla/DebugOnly.h" // for DebugOnly
#include "mozilla/Sprintf.h" #include "mozilla/DoublyLinkedList.h" // for DoublyLinkedList<>::Iterator
#include "mozilla/TypeTraits.h" #include "mozilla/GuardObjects.h" // for MOZ_GUARD_OBJECT_NOTIFIER_PARAM
#include "mozilla/HashTable.h" // for HashSet<>::Range, HashMapEntry
#include "mozilla/Maybe.h" // for Maybe, Nothing, Some
#include "mozilla/Move.h" // for std::move
#include "mozilla/RecordReplay.h" // for IsMiddleman
#include "mozilla/ScopeExit.h" // for MakeScopeExit, ScopeExit
#include "mozilla/ThreadLocal.h" // for ThreadLocal
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
#include "mozilla/TypeTraits.h" // for RemoveConst<>::Type
#include "mozilla/UniquePtr.h" // for UniquePtr
#include "mozilla/Variant.h" // for AsVariant, AsVariantTemporary
#include "mozilla/Vector.h" // for Vector, Vector<>::ConstRange
#include <utility> #include <algorithm> // for std::max
#include <functional> // for function
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint64_t, int32_t
#include <string.h> // for strlen, strcmp
#include "jsfriendapi.h" #include "jsapi.h" // for CallArgs, CallArgsFromVp
#include "jsnum.h" #include "jsfriendapi.h" // for GetErrorMessage
#include "jstypes.h" // for JS_PUBLIC_API
#include "jsutil.h" // for Find
#include "builtin/Promise.h" #include "builtin/Array.h" // for NewDenseFullyAllocatedArray
#include "debugger/DebuggerMemory.h" #include "builtin/Promise.h" // for PromiseObject
#include "debugger/DebugScript.h" #include "debugger/DebugAPI.h" // for ResumeMode, DebugAPI
#include "debugger/Environment.h" #include "debugger/DebuggerMemory.h" // for DebuggerMemory
#include "debugger/Frame.h" #include "debugger/DebugScript.h" // for DebugScript
#include "debugger/NoExecute.h" #include "debugger/Environment.h" // for DebuggerEnvironment
#include "debugger/Object.h" #include "debugger/Frame.h" // for DebuggerFrame
#include "debugger/Script.h" #include "debugger/NoExecute.h" // for EnterDebuggeeNoExecute
#include "debugger/Source.h" #include "debugger/Object.h" // for DebuggerObject
#include "frontend/BytecodeCompilation.h" #include "debugger/Script.h" // for DebuggerScript
#include "frontend/Parser.h" #include "debugger/Source.h" // for DebuggerSource
#include "gc/FreeOp.h" #include "frontend/BytecodeCompiler.h" // for CreateScriptSourceObject
#include "gc/HashUtil.h" #include "frontend/NameAnalysisTypes.h" // for ParseGoal, ParseGoal::Script
#include "gc/Marking.h" #include "frontend/ParseContext.h" // for UsedNameTracker
#include "gc/Policy.h" #include "frontend/Parser.h" // for Parser
#include "gc/PublicIterators.h" #include "gc/Barrier.h" // for GCPtrNativeObject
#include "jit/BaselineDebugModeOSR.h" #include "gc/FreeOp.h" // for FreeOp
#include "jit/BaselineJIT.h" #include "gc/GC.h" // for IterateLazyScripts
#include "js/CharacterEncoding.h" #include "gc/GCMarker.h" // for GCMarker
#include "js/Date.h" #include "gc/GCRuntime.h" // for GCRuntime, AutoEnterIteration
#include "js/Promise.h" #include "gc/HashUtil.h" // for DependentAddPtr
#include "js/PropertyDescriptor.h" #include "gc/Marking.h" // for IsMarkedUnbarriered, IsMarked
#include "js/PropertySpec.h" #include "gc/PublicIterators.h" // for RealmsIter, CompartmentsIter
#include "js/SourceText.h" #include "gc/Rooting.h" // for RootedNativeObject
#include "js/StableStringChars.h" #include "gc/Statistics.h" // for Statistics::SliceData
#include "js/UbiNodeBreadthFirst.h" #include "gc/Tracer.h" // for TraceEdge
#include "js/Vector.h" #include "gc/Zone.h" // for Zone
#include "js/Wrapper.h" #include "gc/ZoneAllocator.h" // for ZoneAllocPolicy
#include "util/Text.h" #include "jit/BaselineDebugModeOSR.h" // for RecompileOnStackBaselineScriptsForDebugMode
#include "vm/ArgumentsObject.h" #include "jit/BaselineJIT.h" // for FinishDiscardBaselineScript
#include "vm/AsyncFunction.h" #include "jit/Ion.h" // for JitContext
#include "vm/AsyncIteration.h" #include "jit/JitScript.h" // for JitScript
#include "vm/GeckoProfiler.h" #include "jit/JSJitFrameIter.h" // for InlineFrameIterator
#include "vm/Instrumentation.h" #include "jit/RematerializedFrame.h" // for RematerializedFrame
#include "vm/JSContext.h" #include "js/Conversions.h" // for ToBoolean, ToUint32
#include "vm/JSObject.h" #include "js/Debug.h" // for Builder::Object, Builder
#include "vm/Realm.h" #include "js/GCAPI.h" // for GarbageCollectionEvent
#include "vm/TraceLogging.h" #include "js/HeapAPI.h" // for ExposeObjectToActiveJS
#include "vm/WrapperObject.h" #include "js/Promise.h" // for AutoDebuggerJobQueueInterruption
#include "wasm/WasmInstance.h" #include "js/Proxy.h" // for PropertyDescriptor
#include "js/SourceText.h" // for SourceOwnership, SourceText
#include "js/StableStringChars.h" // for AutoStableStringChars
#include "js/UbiNode.h" // for Node, RootList, Edge
#include "js/UbiNodeBreadthFirst.h" // for BreadthFirst
#include "js/Warnings.h" // for AutoSuppressWarningReporter
#include "js/Wrapper.h" // for CheckedUnwrapStatic
#include "util/Text.h" // for DuplicateString, js_strlen
#include "vm/ArrayObject.h" // for ArrayObject
#include "vm/AsyncFunction.h" // for AsyncFunctionGeneratorObject
#include "vm/AsyncIteration.h" // for AsyncGeneratorObject
#include "vm/BytecodeUtil.h" // for JSDVG_IGNORE_STACK
#include "vm/Compartment.h" // for CrossCompartmentKey
#include "vm/EnvironmentObject.h" // for IsSyntacticEnvironment
#include "vm/ErrorReporting.h" // for ReportErrorToGlobal
#include "vm/GeneratorObject.h" // for AbstractGeneratorObject
#include "vm/GlobalObject.h" // for GlobalObject
#include "vm/Interpreter.h" // for Call, ReportIsNotFunction
#include "vm/Iteration.h" // for CreateIterResultObject
#include "vm/JSAtom.h" // for Atomize, ClassName
#include "vm/JSContext.h" // for JSContext
#include "vm/JSFunction.h" // for JSFunction
#include "vm/JSObject.h" // for JSObject, RequireObject
#include "vm/ObjectGroup.h" // for TenuredObject
#include "vm/ObjectOperations.h" // for DefineDataProperty
#include "vm/ProxyObject.h" // for ProxyObject, JSObject::is
#include "vm/Realm.h" // for AutoRealm, Realm
#include "vm/Runtime.h" // for ReportOutOfMemory, JSRuntime
#include "vm/SavedFrame.h" // for SavedFrame
#include "vm/SavedStacks.h" // for SavedStacks
#include "vm/Scope.h" // for Scope
#include "vm/StringType.h" // for JSString, PropertyName
#include "vm/TraceLogging.h" // for TraceLoggerForCurrentThread
#include "vm/TypeInference.h" // for TypeZone
#include "vm/WrapperObject.h" // for CrossCompartmentWrapperObject
#include "wasm/WasmDebug.h" // for DebugState
#include "wasm/WasmInstance.h" // for Instance
#include "wasm/WasmJS.h" // for WasmInstanceObject
#include "wasm/WasmRealm.h" // for Realm
#include "wasm/WasmTypes.h" // for WasmInstanceObjectVector
#include "debugger/DebugAPI-inl.h" #include "debugger/DebugAPI-inl.h"
#include "debugger/Frame-inl.h" #include "debugger/Frame-inl.h" // for DebuggerFrame::hasGenerator
#include "debugger/Script-inl.h" #include "debugger/Script-inl.h" // for DebuggerScript::getReferent
#include "gc/GC-inl.h" #include "gc/GC-inl.h" // for ZoneCellIter
#include "gc/WeakMap-inl.h" #include "gc/Marking-inl.h" // for MaybeForwarded
#include "jit/JSJitFrameIter-inl.h" #include "gc/WeakMap-inl.h" // for DebuggerWeakMap::trace
#include "vm/Compartment-inl.h" #include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/GeckoProfiler-inl.h" #include "vm/GeckoProfiler-inl.h" // for AutoSuppressProfilerSampling
#include "vm/JSObject-inl.h" #include "vm/JSAtom-inl.h" // for AtomToId, ValueToId
#include "vm/NativeObject-inl.h" #include "vm/JSContext-inl.h" // for JSContext::check
#include "vm/Stack-inl.h" #include "vm/JSObject-inl.h" // for JSObject::isCallable
#include "vm/JSScript-inl.h" // for JSScript::isDebuggee, JSScript
#include "vm/NativeObject-inl.h" // for NativeObject::ensureDenseInitializedLength
#include "vm/ObjectOperations-inl.h" // for GetProperty, HasProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
#include "vm/Stack-inl.h" // for AbstractFramePtr::script
#include "vm/TypeInference-inl.h" // for AutoEnterAnalysis
namespace js {
namespace frontend {
class FullParseHandler;
}
namespace gc {
struct Cell;
}
namespace jit {
class BaselineFrame;
}
} /* namespace js */
using namespace js; using namespace js;

View File

@ -7,30 +7,75 @@
#ifndef debugger_Debugger_h #ifndef debugger_Debugger_h
#define debugger_Debugger_h #define debugger_Debugger_h
#include "mozilla/DoublyLinkedList.h" #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER1
#include "mozilla/GuardObjects.h" #include "mozilla/Attributes.h" // for MOZ_MUST_USE, MOZ_RAII
#include "mozilla/LinkedList.h" #include "mozilla/DoublyLinkedList.h" // for DoublyLinkedListElement
#include "mozilla/Range.h" #include "mozilla/HashTable.h" // for HashSet, DefaultHasher (ptr only)
#include "mozilla/TimeStamp.h" #include "mozilla/LinkedList.h" // for LinkedList (ptr only)
#include "mozilla/Vector.h" #include "mozilla/Maybe.h" // for Maybe, Nothing
#include "mozilla/Move.h" // for std::move
#include "mozilla/Range.h" // for Range
#include "mozilla/Result.h" // for Result
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "mozilla/Variant.h" // for Variant
#include "debugger/DebugAPI.h" #include <stddef.h> // for size_t
#include "ds/TraceableFifo.h" #include <stdint.h> // for uint32_t, uint64_t, uintptr_t
#include "gc/Barrier.h"
#include "gc/WeakMap.h" #include "jsapi.h" // for Handle, UnsafeTraceRoot
#include "js/Debug.h" #include "jstypes.h" // for JS_GC_ZEAL
#include "js/GCVariant.h"
#include "js/HashTable.h" #include "NamespaceImports.h" // for Value, HandleObject
#include "js/Promise.h" #include "debugger/DebugAPI.h" // for DebugAPI
#include "js/Result.h" #include "debugger/Object.h" // for DebuggerObject
#include "js/RootingAPI.h" #include "ds/TraceableFifo.h" // for TraceableFifo
#include "js/Utility.h" #include "gc/Barrier.h" // for WeakHeapPtrGlobalObject, HeapPtr
#include "js/Wrapper.h" #include "gc/Marking.h" // for IsAboutToBeFinalized, ToMarkable
#include "proxy/DeadObjectProxy.h" #include "gc/Rooting.h" // for HandleSavedFrame, HandleAtom
#include "vm/GeneratorObject.h" #include "gc/Tracer.h" // for TraceNullableEdge, TraceEdge
#include "vm/Realm.h" #include "gc/WeakMap.h" // for WeakMap
#include "vm/SavedStacks.h" #include "gc/ZoneAllocator.h" // for ZoneAllocPolicy
#include "vm/Stack.h" #include "js/GCAPI.h" // for GarbageCollectionEvent
#include "js/Proxy.h" // for PropertyDescriptor
#include "js/Wrapper.h" // for UncheckedUnwrap
#include "proxy/DeadObjectProxy.h" // for IsDeadProxyObject
#include "vm/GeneratorObject.h" // for AbstractGeneratorObject
#include "vm/GlobalObject.h" // for GlobalObject
#include "vm/JSContext.h" // for JSContext
#include "vm/JSObject.h" // for JSObject
#include "vm/JSScript.h" // for JSScript, ScriptSourceObject
#include "vm/NativeObject.h" // for NativeObject
#include "vm/Runtime.h" // for JSRuntime
#include "vm/SavedFrame.h" // for SavedFrame
#include "vm/Stack.h" // for AbstractFramePtr, FrameIter
#include "vm/StringType.h" // for JSAtom
#include "wasm/WasmJS.h" // for WasmInstanceObject
class JSFunction;
namespace JS {
class AutoStableStringChars;
class Compartment;
class Realm;
class Zone;
} /* namespace JS */
namespace js {
class AutoRealm;
class CrossCompartmentKey;
class Debugger;
class DebuggerEnvironment;
class FreeOp;
class PromiseObject;
namespace gc {
struct Cell;
}
namespace wasm {
class Instance;
}
template <typename T>
struct GCManagedDeletePolicy;
} /* namespace js */
/* /*
* Windows 3.x used a cooperative multitasking model, with a Yield macro that * Windows 3.x used a cooperative multitasking model, with a Yield macro that
@ -48,7 +93,6 @@ class DebuggerSource;
class DebuggerMemory; class DebuggerMemory;
class ScriptedOnStepHandler; class ScriptedOnStepHandler;
class ScriptedOnPopHandler; class ScriptedOnPopHandler;
class WasmInstanceObject;
/** /**
* A completion value, describing how some sort of JavaScript evaluation * A completion value, describing how some sort of JavaScript evaluation

View File

@ -7,9 +7,14 @@
#ifndef debugger_Environment_inl_h #ifndef debugger_Environment_inl_h
#define debugger_Environment_inl_h #define debugger_Environment_inl_h
#include "debugger/Environment.h" #include "debugger/Environment.h" // for DebuggerEnvironment
#include "debugger/Debugger-inl.h" #include "NamespaceImports.h" // for Value
#include "debugger/Debugger.h" // for Debugger
#include "debugger/Debugger-inl.h" // for Debugger::fromJSObject
class JSObject;
inline js::Debugger* js::DebuggerEnvironment::owner() const { inline js::Debugger* js::DebuggerEnvironment::owner() const {
JSObject* dbgobj = &getReservedSlot(OWNER_SLOT).toObject(); JSObject* dbgobj = &getReservedSlot(OWNER_SLOT).toObject();

View File

@ -6,15 +6,43 @@
#include "debugger/Environment-inl.h" #include "debugger/Environment-inl.h"
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h" // for AssertionConditionType
#include "mozilla/Maybe.h" // for Maybe, Some, Nothing
#include "mozilla/Vector.h" // for Vector
#include "debugger/Debugger.h" #include <string.h> // for strlen, size_t
#include "debugger/Object.h" #include <utility> // for move
#include "frontend/BytecodeCompiler.h"
#include "vm/Realm.h"
#include "vm/Compartment-inl.h" #include "jsapi.h" // for Rooted, CallArgs, MutableHandle
#include "vm/EnvironmentObject-inl.h" #include "jsfriendapi.h" // for GetErrorMessage, GetPropertyKeys
#include "debugger/Debugger.h" // for Env, Debugger, ValueToIdentifier
#include "debugger/Object.h" // for DebuggerObject
#include "frontend/BytecodeCompiler.h" // for IsIdentifier
#include "gc/Rooting.h" // for RootedDebuggerEnvironment
#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge
#include "js/HeapAPI.h" // for IsInsideNursery
#include "vm/Compartment.h" // for Compartment
#include "vm/EnvironmentObject.h" // for JSObject::is, DebugEnvironmentProxy
#include "vm/JSAtom.h" // for Atomize, PinAtom
#include "vm/JSContext.h" // for JSContext
#include "vm/JSFunction.h" // for JSFunction
#include "vm/JSObject.h" // for JSObject, RequireObject
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
#include "vm/Realm.h" // for AutoRealm, ErrorCopier
#include "vm/Scope.h" // for ScopeKind, ScopeKindString
#include "vm/StringType.h" // for JSAtom
#include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/EnvironmentObject-inl.h" // for JSObject::enclosingEnvironment
#include "vm/JSObject-inl.h" // for IsInternalFunctionObject
#include "vm/ObjectOperations-inl.h" // for HasProperty, GetProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
namespace js {
class GlobalObject;
}
using namespace js; using namespace js;

View File

@ -7,17 +7,28 @@
#ifndef debugger_Environment_h #ifndef debugger_Environment_h
#define debugger_Environment_h #define debugger_Environment_h
#include "debugger/Debugger.h" #include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "gc/Rooting.h" #include "mozilla/Attributes.h" // for MOZ_MUST_USE
#include "js/Class.h" #include "mozilla/Maybe.h" // for Maybe
#include "js/PropertySpec.h"
#include "js/RootingAPI.h" #include "NamespaceImports.h" // for Value, HandleId, HandleObject
#include "js/TypeDecls.h" #include "debugger/Debugger.h" // for Env
#include "vm/GlobalObject.h" #include "gc/Rooting.h" // for HandleDebuggerEnvironment
#include "vm/NativeObject.h" #include "js/PropertySpec.h" // for JSFunctionSpec, JSPropertySpec
#include "js/RootingAPI.h" // for Handle, MutableHandle
#include "vm/NativeObject.h" // for NativeObject
#include "vm/Scope.h" // for ScopeKind
class JSObject;
class JSTracer;
struct JSContext;
namespace js { namespace js {
class GlobalObject;
struct Class;
struct ClassOps;
enum class DebuggerEnvironmentType { Declarative, With, Object }; enum class DebuggerEnvironmentType { Declarative, With, Object };
class DebuggerEnvironment : public NativeObject { class DebuggerEnvironment : public NativeObject {

View File

@ -7,9 +7,11 @@
#ifndef debugger_Frame_inl_h #ifndef debugger_Frame_inl_h
#define debugger_Frame_inl_h #define debugger_Frame_inl_h
#include "debugger/Frame.h" #include "debugger/Frame.h" // for DebuggerFrame
#include "vm/GeneratorObject.h" #include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "NamespaceImports.h" // for Value
inline bool js::DebuggerFrame::hasGenerator() const { inline bool js::DebuggerFrame::hasGenerator() const {
return !getReservedSlot(GENERATOR_INFO_SLOT).isUndefined(); return !getReservedSlot(GENERATOR_INFO_SLOT).isUndefined();

View File

@ -6,25 +6,84 @@
#include "debugger/Frame-inl.h" #include "debugger/Frame-inl.h"
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h" // for AssertionConditionType
#include "mozilla/ScopeExit.h" #include "mozilla/HashTable.h" // for HashMapEntry
#include "mozilla/Maybe.h" // for Maybe
#include "mozilla/Move.h" // for std::move
#include "mozilla/Range.h" // for Range
#include "mozilla/RangedPtr.h" // for RangedPtr
#include "mozilla/Result.h" // for Result
#include "mozilla/ScopeExit.h" // for MakeScopeExit, ScopeExit
#include "mozilla/ThreadLocal.h" // for ThreadLocal
#include "mozilla/Vector.h" // for Vector
#include <stddef.h> // for size_t
#include <stdint.h> // for int32_t
#include <string.h> // for strlen
#include "jsapi.h" // for CallArgs, Handle
#include "jsfriendapi.h" // for GetErrorMessage
#include "jsnum.h" // for Int32ToString
#include "builtin/Array.h" // for NewDenseCopiedArray
#include "debugger/Debugger.h" // for Completion, Debugger
#include "debugger/DebugScript.h" #include "debugger/DebugScript.h"
#include "debugger/Environment.h" #include "debugger/Environment.h" // for DebuggerEnvironment
#include "debugger/NoExecute.h" #include "debugger/NoExecute.h" // for LeaveDebuggeeNoExecute
#include "debugger/Object.h" #include "debugger/Object.h" // for DebuggerObject
#include "debugger/Script.h" #include "debugger/Script.h" // for DebuggerScript
#include "frontend/BytecodeCompilation.h" #include "frontend/BytecodeCompilation.h" // for CompileEvalScript
#include "gc/ZoneAllocator.h" #include "gc/Barrier.h" // for HeapPtr
#include "jit/JitFrames.h" #include "gc/FreeOp.h" // for FreeOp
#include "jit/RematerializedFrame.h" #include "gc/GC.h" // for MemoryUse
#include "vm/Interpreter.h" #include "gc/Marking.h" // for IsAboutToBeFinalized
#include "wasm/WasmInstance.h" #include "gc/Rooting.h" // for RootedDebuggerFrame
#include "gc/Tracer.h" // for TraceCrossCompartmentEdge
#include "gc/ZoneAllocator.h" // for AddCellMemory
#include "jit/JSJitFrameIter.h" // for InlineFrameIterator
#include "jit/RematerializedFrame.h" // for RematerializedFrame
#include "js/Proxy.h" // for PrivateValue
#include "js/SourceText.h" // for SourceText, SourceOwnership
#include "js/StableStringChars.h" // for AutoStableStringChars
#include "vm/ArgumentsObject.h" // for ArgumentsObject
#include "vm/ArrayObject.h" // for ArrayObject
#include "vm/BytecodeUtil.h" // for JSDVG_SEARCH_STACK
#include "vm/Compartment.h" // for Compartment
#include "vm/EnvironmentObject.h" // for IsGlobalLexicalEnvironment
#include "vm/GeneratorObject.h" // for AbstractGeneratorObject
#include "vm/GlobalObject.h" // for GlobalObject
#include "vm/Interpreter.h" // for Call, ExecuteKernel
#include "vm/JSAtom.h" // for Atomize
#include "vm/JSContext.h" // for JSContext, ReportValueError
#include "vm/JSFunction.h" // for JSFunction, NewNativeFunction
#include "vm/JSObject.h" // for JSObject, RequireObject
#include "vm/JSScript.h" // for JSScript
#include "vm/NativeObject.h" // for NativeDefineDataProperty
#include "vm/Realm.h" // for AutoRealm
#include "vm/Runtime.h" // for JSAtomState
#include "vm/Scope.h" // for PositionalFormalParameterIter
#include "vm/Stack.h" // for AbstractFramePtr, FrameIter
#include "vm/StringType.h" // for PropertyName, JSString
#include "wasm/WasmDebug.h" // for DebugState
#include "wasm/WasmInstance.h" // for Instance
#include "wasm/WasmJS.h" // for WasmInstanceObject
#include "wasm/WasmTypes.h" // for DebugFrame
#include "debugger/Debugger-inl.h" #include "debugger/Debugger-inl.h" // for Debugger::fromJSObject
#include "vm/Compartment-inl.h" #include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/JSObject-inl.h" #include "vm/JSContext-inl.h" // for JSContext::check
#include "vm/Stack-inl.h" #include "vm/JSObject-inl.h" // for NewObjectWithGivenProto
#include "vm/JSScript-inl.h" // for JSScript::ensureHasAnalyzedArgsUsage
#include "vm/NativeObject-inl.h" // for NativeObject::global
#include "vm/ObjectOperations-inl.h" // for GetProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
#include "vm/Stack-inl.h" // for AbstractFramePtr::script
namespace js {
namespace jit {
class JitFrameLayout;
} /* namespace jit */
} /* namespace js */
using namespace js; using namespace js;

View File

@ -7,24 +7,30 @@
#ifndef debugger_Frame_h #ifndef debugger_Frame_h
#define debugger_Frame_h #define debugger_Frame_h
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h" // for MOZ_MUST_USE
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h" // for Maybe
#include "mozilla/Range.h" #include "mozilla/Range.h" // for Range
#include "mozilla/Result.h" // for Result
#include "jsapi.h" #include <stddef.h> // for size_t
#include "debugger/Debugger.h" #include "jsapi.h" // for JSContext, CallArgs
#include "gc/Rooting.h"
#include "js/Class.h" #include "NamespaceImports.h" // for Value, MutableHandleValue, HandleObject
#include "js/PropertySpec.h" #include "debugger/DebugAPI.h" // for ResumeMode
#include "js/Result.h" #include "debugger/Debugger.h" // for ResumeMode, Handler, Debugger
#include "js/RootingAPI.h" #include "gc/Barrier.h" // for HeapPtr
#include "js/TypeDecls.h" #include "gc/Rooting.h" // for HandleDebuggerFrame, HandleNativeObject
#include "vm/GlobalObject.h" #include "vm/JSObject.h" // for JSObject
#include "vm/NativeObject.h" #include "vm/NativeObject.h" // for NativeObject
#include "vm/Stack.h" // for FrameIter, AbstractFramePtr
namespace js { namespace js {
class AbstractGeneratorObject;
class FreeOp;
class GlobalObject;
/* /*
* An OnStepHandler represents a handler function that is called when a small * An OnStepHandler represents a handler function that is called when a small
* amount of progress is made in a frame. * amount of progress is made in a frame.

View File

@ -5,9 +5,22 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "debugger/NoExecute.h" #include "debugger/NoExecute.h"
#include "mozilla/Sprintf.h"
#include "vm/Realm-inl.h" #include "mozilla/Sprintf.h" // for SprintfLiteral
#include <stdio.h> // for fprintf, stdout
#include "jsapi.h" // for Handle
#include "jsfriendapi.h" // for DumpBacktrace, GetErrorMessage
#include "debugger/Debugger.h" // for Debugger
#include "gc/Barrier.h" // for GCPtrNativeObject
#include "js/Promise.h" // for AutoDebuggerJobQueueInterruption
#include "vm/JSContext.h" // for ProtectedDataContextArg, JSContext
#include "vm/JSScript.h" // for JSScript
#include "vm/Realm.h" // for AutoRealm, Realm
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
using namespace js; using namespace js;

View File

@ -7,16 +7,17 @@
#ifndef debugger_NoExecute_h #ifndef debugger_NoExecute_h
#define debugger_NoExecute_h #define debugger_NoExecute_h
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h" // for MOZ_RAII
#include "debugger/Debugger.h" #include "jsapi.h"
#include "js/Promise.h"
#include "vm/JSContext.h" #include "NamespaceImports.h" // for HandleScript
#include "vm/Realm.h" #include "js/Promise.h" // for JS::AutoDebuggerJobQueueInterruption
namespace js { namespace js {
class Debugger;
class LeaveDebuggeeNoExecute; class LeaveDebuggeeNoExecute;
// Given a Debugger instance dbg, if it is enabled, prevents all its debuggee // Given a Debugger instance dbg, if it is enabled, prevents all its debuggee

View File

@ -7,7 +7,18 @@
#ifndef debugger_Object_inl_h #ifndef debugger_Object_inl_h
#define debugger_Object_inl_h #define debugger_Object_inl_h
#include "debugger/Object.h" #include "debugger/Object.h" // for DebuggerObject
#include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "NamespaceImports.h" // for Value
#include "builtin/Promise.h" // for PromiseObject
#include "debugger/Debugger.h" // for Debugger
#include "js/Wrapper.h" // for CheckedUnwrapStatic
#include "vm/JSObject.h" // for JSObject
#include "debugger/Debugger-inl.h" // for Debugger::fromJSObject
inline js::Debugger* js::DebuggerObject::owner() const { inline js::Debugger* js::DebuggerObject::owner() const {
JSObject* dbgobj = &getReservedSlot(OWNER_SLOT).toObject(); JSObject* dbgobj = &getReservedSlot(OWNER_SLOT).toObject();

View File

@ -6,18 +6,63 @@
#include "debugger/Object-inl.h" #include "debugger/Object-inl.h"
#include "debugger/NoExecute.h" #include "mozilla/Maybe.h" // for Maybe, Nothing, Some
#include "debugger/Script.h" #include "mozilla/Range.h" // for Range
#include "proxy/ScriptedProxyHandler.h" #include "mozilla/Result.h" // for Result
#include "vm/EnvironmentObject.h" #include "mozilla/Vector.h" // for Vector
#include "vm/Instrumentation.h"
#include "vm/WrapperObject.h"
#include "debugger/Debugger-inl.h" #include <string.h> // for size_t, strlen
#include "vm/Compartment-inl.h" #include <type_traits> // for remove_reference<>::type
#include "vm/JSAtom-inl.h" #include <utility> // for move
#include "vm/JSObject-inl.h"
#include "vm/NativeObject-inl.h" #include "jsapi.h" // for CallArgs, RootedObject, Rooted
#include "jsfriendapi.h" // for GetErrorMessage
#include "jsutil.h" // for Min
#include "builtin/Array.h" // for NewDenseCopiedArray
#include "debugger/Debugger.h" // for Completion, Debugger
#include "debugger/NoExecute.h" // for LeaveDebuggeeNoExecute
#include "debugger/Script.h" // for DebuggerScript
#include "gc/Barrier.h" // for ImmutablePropertyNamePtr
#include "gc/Rooting.h" // for RootedDebuggerObject
#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge
#include "js/Conversions.h" // for ToObject
#include "js/HeapAPI.h" // for IsInsideNursery
#include "js/Promise.h" // for PromiseState
#include "js/Proxy.h" // for PropertyDescriptor
#include "js/StableStringChars.h" // for AutoStableStringChars
#include "proxy/ScriptedProxyHandler.h" // for ScriptedProxyHandler
#include "vm/ArgumentsObject.h" // for ARGS_LENGTH_MAX
#include "vm/ArrayObject.h" // for ArrayObject
#include "vm/BytecodeUtil.h" // for JSDVG_SEARCH_STACK
#include "vm/Compartment.h" // for Compartment
#include "vm/EnvironmentObject.h" // for GetDebugEnvironmentForFunction
#include "vm/ErrorObject.h" // for JSObject::is, ErrorObject
#include "vm/GlobalObject.h" // for JSObject::is, GlobalObject
#include "vm/Instrumentation.h" // for RealmInstrumentation
#include "vm/Interpreter.h" // for Call
#include "vm/JSAtom.h" // for Atomize, js_apply_str
#include "vm/JSContext.h" // for JSContext, ReportValueError
#include "vm/JSFunction.h" // for JSFunction
#include "vm/JSScript.h" // for JSScript
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
#include "vm/ObjectOperations.h" // for DefineProperty
#include "vm/Realm.h" // for AutoRealm, ErrorCopier, Realm
#include "vm/Runtime.h" // for JSAtomState
#include "vm/SavedFrame.h" // for SavedFrame
#include "vm/Scope.h" // for PositionalFormalParameterIter
#include "vm/Shape.h" // for Shape
#include "vm/Stack.h" // for InvokeArgs
#include "vm/StringType.h" // for JSAtom, PropertyName
#include "vm/WrapperObject.h" // for JSObject::is, WrapperObject
#include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/JSAtom-inl.h" // for ValueToId
#include "vm/JSObject-inl.h" // for GetObjectClassName, InitClass
#include "vm/NativeObject-inl.h" // for NativeObject::global
#include "vm/ObjectOperations-inl.h" // for DeleteProperty, GetProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
using namespace js; using namespace js;

View File

@ -7,28 +7,31 @@
#ifndef debugger_Object_h #ifndef debugger_Object_h
#define debugger_Object_h #define debugger_Object_h
#include "mozilla/Assertions.h" #include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h" // for MOZ_MUST_USE
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h" // for Maybe
#include "mozilla/Range.h" #include "mozilla/Range.h" // for Range
#include "mozilla/Result.h" // for Result
#include "jsapi.h" #include "jsapi.h" // for JSContext
#include "NamespaceImports.h" // for Value, MutableHandleValue, HandleId
#include "builtin/Promise.h" #include "gc/Rooting.h" // for HandleDebuggerObject
#include "debugger/Debugger.h" #include "js/Promise.h" // for PromiseState
#include "gc/Rooting.h" #include "js/Proxy.h" // for PropertyDescriptor
#include "js/Class.h" #include "vm/JSObject.h" // for JSObject (ptr only)
#include "js/Promise.h" #include "vm/NativeObject.h" // for NativeObject
#include "js/PropertySpec.h"
#include "js/Result.h" class JSAtom;
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "vm/GlobalObject.h"
#include "vm/JSContext.h"
#include "vm/NativeObject.h"
namespace js { namespace js {
class Completion;
class Debugger;
class EvalOptions;
class GlobalObject;
class PromiseObject;
enum { JSSLOT_DEBUGOBJECT_OWNER, JSSLOT_DEBUGOBJECT_COUNT }; enum { JSSLOT_DEBUGOBJECT_OWNER, JSSLOT_DEBUGOBJECT_COUNT };
class DebuggerObject : public NativeObject { class DebuggerObject : public NativeObject {

View File

@ -7,7 +7,20 @@
#ifndef debugger_Script_inl_h #ifndef debugger_Script_inl_h
#define debugger_Script_inl_h #define debugger_Script_inl_h
#include "debugger/Script.h" #include "debugger/Script.h" // for DebuggerScript
#include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "mozilla/Variant.h" // for AsVariant
#include <utility> // for move
#include "debugger/Debugger.h" // for DebuggerScriptReferent
#include "gc/Cell.h" // for Cell
#include "vm/JSScript.h" // for BaseScript, JSScript, LazyScript
#include "vm/NativeObject.h" // for NativeObject
#include "wasm/WasmJS.h" // for WasmInstanceObject
class JSObject;
js::gc::Cell* js::DebuggerScript::getReferentCell() const { js::gc::Cell* js::DebuggerScript::getReferentCell() const {
return static_cast<gc::Cell*>(getPrivate()); return static_cast<gc::Cell*>(getPrivate());

View File

@ -6,14 +6,51 @@
#include "debugger/Script-inl.h" #include "debugger/Script-inl.h"
#include "debugger/Debugger.h" #include "mozilla/Maybe.h" // for Some, Maybe
#include "debugger/DebugScript.h" #include "mozilla/Span.h" // for Span
#include "debugger/Source.h" #include "mozilla/Vector.h" // for Vector
#include "wasm/WasmInstance.h"
#include "vm/BytecodeUtil-inl.h" #include <stddef.h> // for ptrdiff_t
#include "vm/JSObject-inl.h" #include <stdint.h> // for uint32_t, SIZE_MAX, int32_t
#include "vm/JSScript-inl.h"
#include "jsapi.h" // for CallArgs, Rooted, CallArgsFromVp
#include "jsfriendapi.h" // for GetErrorMessage
#include "jsnum.h" // for ToNumber
#include "NamespaceImports.h" // for CallArgs, RootedValue
#include "builtin/Array.h" // for NewDenseEmptyArray
#include "debugger/Debugger.h" // for DebuggerScriptReferent, Debugger
#include "debugger/DebugScript.h" // for DebugScript
#include "debugger/Source.h" // for DebuggerSource
#include "gc/Barrier.h" // for ImmutablePropertyNamePtr
#include "gc/GC.h" // for MemoryUse, MemoryUse::Breakpoint
#include "gc/Rooting.h" // for RootedDebuggerScript
#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge
#include "gc/Zone.h" // for Zone
#include "gc/ZoneAllocator.h" // for AddCellMemory
#include "js/HeapAPI.h" // for GCCellPtr
#include "js/Wrapper.h" // for UncheckedUnwrap
#include "vm/ArrayObject.h" // for ArrayObject
#include "vm/BytecodeUtil.h" // for GET_JUMP_OFFSET
#include "vm/GlobalObject.h" // for GlobalObject
#include "vm/JSContext.h" // for JSContext, ReportValueError
#include "vm/JSFunction.h" // for JSFunction
#include "vm/JSObject.h" // for RequireObject, JSObject
#include "vm/ObjectGroup.h" // for TenuredObject
#include "vm/ObjectOperations.h" // for DefineDataProperty, HasOwnProperty
#include "vm/Realm.h" // for AutoRealm
#include "vm/Runtime.h" // for JSAtomState, JSRuntime
#include "vm/StringType.h" // for NameToId, PropertyName, JSAtom
#include "wasm/WasmDebug.h" // for ExprLoc, DebugState
#include "wasm/WasmInstance.h" // for Instance
#include "wasm/WasmTypes.h" // for Bytes
#include "vm/BytecodeUtil-inl.h" // for BytecodeRangeWithPosition
#include "vm/JSAtom-inl.h" // for ValueToId
#include "vm/JSObject-inl.h" // for NewBuiltinClassInstance
#include "vm/JSScript-inl.h" // for LazyScript::functionDelazifying
#include "vm/ObjectOperations-inl.h" // for GetProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
using namespace js; using namespace js;

View File

@ -7,26 +7,24 @@
#ifndef debugger_Script_h #ifndef debugger_Script_h
#define debugger_Script_h #define debugger_Script_h
#include "mozilla/Variant.h" #include "jsapi.h" // for Handle, JSFunctionSpec, JSPropertySpec
#include "jsapi.h" #include "NamespaceImports.h" // for Value, HandleObject, CallArgs
#include "debugger/Debugger.h" // for DebuggerScriptReferent
#include "gc/Rooting.h" // for HandleNativeObject
#include "vm/NativeObject.h" // for NativeObject
#include "debugger/Debugger.h" class JSObject;
#include "gc/Cell.h"
#include "gc/Rooting.h"
#include "js/CallArgs.h"
#include "js/Class.h"
#include "js/PropertySpec.h"
#include "js/RootingAPI.h"
#include "js/TracingAPI.h"
#include "js/TypeDecls.h"
#include "vm/GlobalObject.h"
#include "vm/JSScript.h"
#include "vm/NativeObject.h"
#include "wasm/WasmJS.h"
namespace js { namespace js {
class BaseScript;
class GlobalObject;
namespace gc {
struct Cell;
}
class DebuggerScript : public NativeObject { class DebuggerScript : public NativeObject {
public: public:
static const Class class_; static const Class class_;

View File

@ -6,13 +6,40 @@
#include "debugger/Source.h" #include "debugger/Source.h"
#include "debugger/Script.h" #include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT
#include "js/Class.h" #include "mozilla/Maybe.h" // for Some, Maybe, Nothing
#include "js/StableStringChars.h" #include "mozilla/Variant.h" // for AsVariant, Variant
#include "wasm/WasmInstance.h"
#include "vm/JSObject-inl.h" #include <stdint.h> // for uint32_t
#include "vm/NativeObject-inl.h" #include <string.h> // for memcpy
#include <utility> // for move
#include "jsapi.h" // for JS_ReportErrorNumberASCII
#include "jsfriendapi.h" // for GetErrorMessage, JS_NewUint8Array
#include "debugger/Debugger.h" // for DebuggerSourceReferent, Debugger
#include "debugger/Script.h" // for DebuggerScript
#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge
#include "js/StableStringChars.h" // for AutoStableStringChars
#include "vm/BytecodeUtil.h" // for JSDVG_SEARCH_STACK
#include "vm/JSContext.h" // for JSContext (ptr only)
#include "vm/JSObject.h" // for JSObject, RequireObject
#include "vm/JSScript.h" // for ScriptSource, ScriptSourceObject
#include "vm/ObjectGroup.h" // for TenuredObject
#include "vm/StringType.h" // for NewStringCopyZ, JSString (ptr only)
#include "vm/TypedArrayObject.h" // for TypedArrayObject, JSObject::is
#include "wasm/WasmCode.h" // for Metadata
#include "wasm/WasmDebug.h" // for DebugState
#include "wasm/WasmInstance.h" // for Instance
#include "wasm/WasmJS.h" // for WasmInstanceObject
#include "wasm/WasmTypes.h" // for Bytes, RootedWasmInstanceObject
#include "vm/JSObject-inl.h" // for InitClass
#include "vm/NativeObject-inl.h" // for NewNativeObjectWithGivenProto
namespace js {
class GlobalObject;
}
using namespace js; using namespace js;

View File

@ -9,12 +9,14 @@
#include "jsapi.h" #include "jsapi.h"
#include "debugger/Debugger.h" #include "NamespaceImports.h" // for Value, HandleObject, CallArgs
#include "js/Class.h" #include "debugger/Debugger.h" // for DebuggerSourceReferent
#include "js/RootingAPI.h" #include "gc/Rooting.h" // for HandleNativeObject
#include "js/TypeDecls.h" #include "vm/NativeObject.h" // for NativeObject
#include "vm/GlobalObject.h"
#include "vm/NativeObject.h" namespace js {
class GlobalObject;
}
namespace js { namespace js {