зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1267551 - Use MOZ_MUST_USE in js/src/vm/Debugger.h; r=jimb
This commit is contained in:
Родитель
a4668d0b79
Коммит
c823acfbbc
|
@ -110,7 +110,7 @@ class DebuggerWeakMap : private WeakMap<HeapPtr<UnbarrieredKey>, HeapPtr<JSObjec
|
||||||
using Base::all;
|
using Base::all;
|
||||||
using Base::trace;
|
using Base::trace;
|
||||||
|
|
||||||
bool init(uint32_t len = 16) {
|
MOZ_MUST_USE bool init(uint32_t len = 16) {
|
||||||
return Base::init(len) && zoneCounts.init();
|
return Base::init(len) && zoneCounts.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ class DebuggerWeakMap : private WeakMap<HeapPtr<UnbarrieredKey>, HeapPtr<JSObjec
|
||||||
Base::assertEntriesNotAboutToBeFinalized();
|
Base::assertEntriesNotAboutToBeFinalized();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool incZoneCount(JS::Zone* zone) {
|
MOZ_MUST_USE bool incZoneCount(JS::Zone* zone) {
|
||||||
CountMap::Ptr p = zoneCounts.lookupWithDefault(zone, 0);
|
CountMap::Ptr p = zoneCounts.lookupWithDefault(zone, 0);
|
||||||
if (!p)
|
if (!p)
|
||||||
return false;
|
return false;
|
||||||
|
@ -219,7 +219,7 @@ class MOZ_RAII EvalOptions {
|
||||||
~EvalOptions();
|
~EvalOptions();
|
||||||
const char* filename() const { return filename_; }
|
const char* filename() const { return filename_; }
|
||||||
unsigned lineno() const { return lineno_; }
|
unsigned lineno() const { return lineno_; }
|
||||||
bool setFilename(JSContext* cx, const char* filename);
|
MOZ_MUST_USE bool setFilename(JSContext* cx, const char* filename);
|
||||||
void setLineno(unsigned lineno) { lineno_ = lineno; }
|
void setLineno(unsigned lineno) { lineno_ = lineno; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -391,8 +391,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
|
|
||||||
static const size_t DEFAULT_MAX_LOG_LENGTH = 5000;
|
static const size_t DEFAULT_MAX_LOG_LENGTH = 5000;
|
||||||
|
|
||||||
bool appendAllocationSite(JSContext* cx, HandleObject obj, HandleSavedFrame frame,
|
MOZ_MUST_USE bool appendAllocationSite(JSContext* cx, HandleObject obj, HandleSavedFrame frame,
|
||||||
double when);
|
double when);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Recompute the set of debuggee zones based on the set of debuggee globals.
|
* Recompute the set of debuggee zones based on the set of debuggee globals.
|
||||||
|
@ -417,7 +417,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* debuggee's compartment. The given debuggee global must be observed by at
|
* debuggee's compartment. The given debuggee global must be observed by at
|
||||||
* least one Debugger that is enabled and tracking allocations.
|
* least one Debugger that is enabled and tracking allocations.
|
||||||
*/
|
*/
|
||||||
static bool addAllocationsTracking(JSContext* cx, Handle<GlobalObject*> debuggee);
|
static MOZ_MUST_USE bool addAllocationsTracking(JSContext* cx, Handle<GlobalObject*> debuggee);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove allocations tracking for objects allocated within the given
|
* Remove allocations tracking for objects allocated within the given
|
||||||
|
@ -429,7 +429,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
/*
|
/*
|
||||||
* Add or remove allocations tracking for all debuggees.
|
* Add or remove allocations tracking for all debuggees.
|
||||||
*/
|
*/
|
||||||
bool addAllocationsTrackingForAllDebuggees(JSContext* cx);
|
MOZ_MUST_USE bool addAllocationsTrackingForAllDebuggees(JSContext* cx);
|
||||||
void removeAllocationsTrackingForAllDebuggees();
|
void removeAllocationsTrackingForAllDebuggees();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -495,7 +495,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
class ScriptQuery;
|
class ScriptQuery;
|
||||||
class ObjectQuery;
|
class ObjectQuery;
|
||||||
|
|
||||||
bool addDebuggeeGlobal(JSContext* cx, Handle<GlobalObject*> obj);
|
MOZ_MUST_USE bool addDebuggeeGlobal(JSContext* cx, Handle<GlobalObject*> obj);
|
||||||
void removeDebuggeeGlobal(FreeOp* fop, GlobalObject* global,
|
void removeDebuggeeGlobal(FreeOp* fop, GlobalObject* global,
|
||||||
WeakGlobalObjectSet::Enum* debugEnum);
|
WeakGlobalObjectSet::Enum* debugEnum);
|
||||||
|
|
||||||
|
@ -576,8 +576,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
static const ClassOps classOps_;
|
static const ClassOps classOps_;
|
||||||
static const Class class_;
|
static const Class class_;
|
||||||
|
|
||||||
static bool getHookImpl(JSContext* cx, CallArgs& args, Debugger& dbg, Hook which);
|
static MOZ_MUST_USE bool getHookImpl(JSContext* cx, CallArgs& args, Debugger& dbg, Hook which);
|
||||||
static bool setHookImpl(JSContext* cx, CallArgs& args, Debugger& dbg, Hook which);
|
static MOZ_MUST_USE bool setHookImpl(JSContext* cx, CallArgs& args, Debugger& dbg, Hook which);
|
||||||
|
|
||||||
static Debugger* fromThisValue(JSContext* cx, const CallArgs& ca, const char* fnname);
|
static Debugger* fromThisValue(JSContext* cx, const CallArgs& ca, const char* fnname);
|
||||||
static bool getEnabled(JSContext* cx, unsigned argc, Value* vp);
|
static bool getEnabled(JSContext* cx, unsigned argc, Value* vp);
|
||||||
|
@ -647,14 +647,15 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* compute it ourselves from |frame|.
|
* compute it ourselves from |frame|.
|
||||||
*/
|
*/
|
||||||
using DebuggerFrameVector = GCVector<NativeObject*>;
|
using DebuggerFrameVector = GCVector<NativeObject*>;
|
||||||
static bool getDebuggerFrames(AbstractFramePtr frame,
|
static MOZ_MUST_USE bool getDebuggerFrames(AbstractFramePtr frame,
|
||||||
MutableHandle<DebuggerFrameVector> frames);
|
MutableHandle<DebuggerFrameVector> frames);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool ensureExecutionObservabilityOfOsrFrame(JSContext* cx, InterpreterFrame* frame);
|
static MOZ_MUST_USE bool ensureExecutionObservabilityOfOsrFrame(JSContext* cx,
|
||||||
|
InterpreterFrame* frame);
|
||||||
|
|
||||||
// Public for DebuggerScript_setBreakpoint.
|
// Public for DebuggerScript_setBreakpoint.
|
||||||
static bool ensureExecutionObservabilityOfScript(JSContext* cx, JSScript* script);
|
static MOZ_MUST_USE bool ensureExecutionObservabilityOfScript(JSContext* cx, JSScript* script);
|
||||||
|
|
||||||
// Whether the Debugger instance needs to observe all non-AOT JS
|
// Whether the Debugger instance needs to observe all non-AOT JS
|
||||||
// execution of its debugees.
|
// execution of its debugees.
|
||||||
|
@ -669,28 +670,32 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
IsObserving observesCoverage() const;
|
IsObserving observesCoverage() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool ensureExecutionObservabilityOfFrame(JSContext* cx, AbstractFramePtr frame);
|
static MOZ_MUST_USE bool ensureExecutionObservabilityOfFrame(JSContext* cx,
|
||||||
static bool ensureExecutionObservabilityOfCompartment(JSContext* cx, JSCompartment* comp);
|
AbstractFramePtr frame);
|
||||||
|
static MOZ_MUST_USE bool ensureExecutionObservabilityOfCompartment(JSContext* cx,
|
||||||
|
JSCompartment* comp);
|
||||||
|
|
||||||
static bool hookObservesAllExecution(Hook which);
|
static bool hookObservesAllExecution(Hook which);
|
||||||
|
|
||||||
bool updateObservesAllExecutionOnDebuggees(JSContext* cx, IsObserving observing);
|
MOZ_MUST_USE bool updateObservesAllExecutionOnDebuggees(JSContext* cx, IsObserving observing);
|
||||||
bool updateObservesCoverageOnDebuggees(JSContext* cx, IsObserving observing);
|
MOZ_MUST_USE bool updateObservesCoverageOnDebuggees(JSContext* cx, IsObserving observing);
|
||||||
void updateObservesAsmJSOnDebuggees(IsObserving observing);
|
void updateObservesAsmJSOnDebuggees(IsObserving observing);
|
||||||
|
|
||||||
JSObject* getHook(Hook hook) const;
|
JSObject* getHook(Hook hook) const;
|
||||||
bool hasAnyLiveHooks() const;
|
bool hasAnyLiveHooks() const;
|
||||||
|
|
||||||
static bool slowPathCheckNoExecute(JSContext* cx, HandleScript script);
|
static MOZ_MUST_USE bool slowPathCheckNoExecute(JSContext* cx, HandleScript script);
|
||||||
static JSTrapStatus slowPathOnEnterFrame(JSContext* cx, AbstractFramePtr frame);
|
static JSTrapStatus slowPathOnEnterFrame(JSContext* cx, AbstractFramePtr frame);
|
||||||
static bool slowPathOnLeaveFrame(JSContext* cx, AbstractFramePtr frame, jsbytecode* pc, bool ok);
|
static MOZ_MUST_USE bool slowPathOnLeaveFrame(JSContext* cx, AbstractFramePtr frame,
|
||||||
|
jsbytecode* pc, bool ok);
|
||||||
static JSTrapStatus slowPathOnDebuggerStatement(JSContext* cx, AbstractFramePtr frame);
|
static JSTrapStatus slowPathOnDebuggerStatement(JSContext* cx, AbstractFramePtr frame);
|
||||||
static JSTrapStatus slowPathOnExceptionUnwind(JSContext* cx, AbstractFramePtr frame);
|
static JSTrapStatus slowPathOnExceptionUnwind(JSContext* cx, AbstractFramePtr frame);
|
||||||
static void slowPathOnNewScript(JSContext* cx, HandleScript script);
|
static void slowPathOnNewScript(JSContext* cx, HandleScript script);
|
||||||
static void slowPathOnNewWasmInstance(JSContext* cx, Handle<WasmInstanceObject*> wasmInstance);
|
static void slowPathOnNewWasmInstance(JSContext* cx, Handle<WasmInstanceObject*> wasmInstance);
|
||||||
static void slowPathOnNewGlobalObject(JSContext* cx, Handle<GlobalObject*> global);
|
static void slowPathOnNewGlobalObject(JSContext* cx, Handle<GlobalObject*> global);
|
||||||
static bool slowPathOnLogAllocationSite(JSContext* cx, HandleObject obj, HandleSavedFrame frame,
|
static MOZ_MUST_USE bool slowPathOnLogAllocationSite(JSContext* cx, HandleObject obj,
|
||||||
double when, GlobalObject::DebuggerVector& dbgs);
|
HandleSavedFrame frame, double when,
|
||||||
|
GlobalObject::DebuggerVector& dbgs);
|
||||||
static void slowPathPromiseHook(JSContext* cx, Hook hook, HandleObject promise);
|
static void slowPathPromiseHook(JSContext* cx, Hook hook, HandleObject promise);
|
||||||
|
|
||||||
template <typename HookIsEnabledFun /* bool (Debugger*) */,
|
template <typename HookIsEnabledFun /* bool (Debugger*) */,
|
||||||
|
@ -754,21 +759,23 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* Gets a Debugger.Frame object. If maybeIter is non-null, we eagerly copy
|
* Gets a Debugger.Frame object. If maybeIter is non-null, we eagerly copy
|
||||||
* its data if we need to make a new Debugger.Frame.
|
* its data if we need to make a new Debugger.Frame.
|
||||||
*/
|
*/
|
||||||
bool getScriptFrameWithIter(JSContext* cx, AbstractFramePtr frame,
|
MOZ_MUST_USE bool getScriptFrameWithIter(JSContext* cx, AbstractFramePtr frame,
|
||||||
const ScriptFrameIter* maybeIter, MutableHandleValue vp);
|
const ScriptFrameIter* maybeIter,
|
||||||
|
MutableHandleValue vp);
|
||||||
|
|
||||||
inline Breakpoint* firstBreakpoint() const;
|
inline Breakpoint* firstBreakpoint() const;
|
||||||
|
|
||||||
static inline Debugger* fromOnNewGlobalObjectWatchersLink(JSCList* link);
|
static inline Debugger* fromOnNewGlobalObjectWatchersLink(JSCList* link);
|
||||||
|
|
||||||
static bool replaceFrameGuts(JSContext* cx, AbstractFramePtr from, AbstractFramePtr to,
|
static MOZ_MUST_USE bool replaceFrameGuts(JSContext* cx, AbstractFramePtr from,
|
||||||
ScriptFrameIter& iter);
|
AbstractFramePtr to,
|
||||||
|
ScriptFrameIter& iter);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Debugger(JSContext* cx, NativeObject* dbg);
|
Debugger(JSContext* cx, NativeObject* dbg);
|
||||||
~Debugger();
|
~Debugger();
|
||||||
|
|
||||||
bool init(JSContext* cx);
|
MOZ_MUST_USE bool init(JSContext* cx);
|
||||||
inline const js::GCPtrNativeObject& toJSObject() const;
|
inline const js::GCPtrNativeObject& toJSObject() const;
|
||||||
inline js::GCPtrNativeObject& toJSObjectRef();
|
inline js::GCPtrNativeObject& toJSObjectRef();
|
||||||
static inline Debugger* fromJSObject(const JSObject* obj);
|
static inline Debugger* fromJSObject(const JSObject* obj);
|
||||||
|
@ -797,14 +804,14 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* them and returns true. If not, it returns false.
|
* them and returns true. If not, it returns false.
|
||||||
*/
|
*/
|
||||||
static void markIncomingCrossCompartmentEdges(JSTracer* tracer);
|
static void markIncomingCrossCompartmentEdges(JSTracer* tracer);
|
||||||
static bool markAllIteratively(GCMarker* trc);
|
static MOZ_MUST_USE bool markAllIteratively(GCMarker* trc);
|
||||||
static void markAll(JSTracer* trc);
|
static void markAll(JSTracer* trc);
|
||||||
static void sweepAll(FreeOp* fop);
|
static void sweepAll(FreeOp* fop);
|
||||||
static void detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global);
|
static void detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global);
|
||||||
static void findZoneEdges(JS::Zone* v, gc::ZoneComponentFinder& finder);
|
static void findZoneEdges(JS::Zone* v, gc::ZoneComponentFinder& finder);
|
||||||
|
|
||||||
// Checks it the current compartment is allowed to execute code.
|
// Checks it the current compartment is allowed to execute code.
|
||||||
static inline bool checkNoExecute(JSContext* cx, HandleScript script);
|
static inline MOZ_MUST_USE bool checkNoExecute(JSContext* cx, HandleScript script);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* JSTrapStatus Overview
|
* JSTrapStatus Overview
|
||||||
|
@ -864,17 +871,20 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* throw, or vice versa: we can redirect to a complete copy of the
|
* throw, or vice versa: we can redirect to a complete copy of the
|
||||||
* alternative path, containing its own call to onLeaveFrame.)
|
* alternative path, containing its own call to onLeaveFrame.)
|
||||||
*/
|
*/
|
||||||
static inline bool onLeaveFrame(JSContext* cx, AbstractFramePtr frame, jsbytecode* pc, bool ok);
|
static inline MOZ_MUST_USE bool onLeaveFrame(JSContext* cx, AbstractFramePtr frame,
|
||||||
|
jsbytecode* pc, bool ok);
|
||||||
|
|
||||||
static inline void onNewScript(JSContext* cx, HandleScript script);
|
static inline void onNewScript(JSContext* cx, HandleScript script);
|
||||||
static inline void onNewWasmInstance(JSContext* cx, Handle<WasmInstanceObject*> wasmInstance);
|
static inline void onNewWasmInstance(JSContext* cx, Handle<WasmInstanceObject*> wasmInstance);
|
||||||
static inline void onNewGlobalObject(JSContext* cx, Handle<GlobalObject*> global);
|
static inline void onNewGlobalObject(JSContext* cx, Handle<GlobalObject*> global);
|
||||||
static inline bool onLogAllocationSite(JSContext* cx, JSObject* obj, HandleSavedFrame frame,
|
static inline MOZ_MUST_USE bool onLogAllocationSite(JSContext* cx, JSObject* obj,
|
||||||
double when);
|
HandleSavedFrame frame, double when);
|
||||||
static JSTrapStatus onTrap(JSContext* cx, MutableHandleValue vp);
|
static JSTrapStatus onTrap(JSContext* cx, MutableHandleValue vp);
|
||||||
static JSTrapStatus onSingleStep(JSContext* cx, MutableHandleValue vp);
|
static JSTrapStatus onSingleStep(JSContext* cx, MutableHandleValue vp);
|
||||||
static bool handleBaselineOsr(JSContext* cx, InterpreterFrame* from, jit::BaselineFrame* to);
|
static MOZ_MUST_USE bool handleBaselineOsr(JSContext* cx, InterpreterFrame* from,
|
||||||
static bool handleIonBailout(JSContext* cx, jit::RematerializedFrame* from, jit::BaselineFrame* to);
|
jit::BaselineFrame* to);
|
||||||
|
static MOZ_MUST_USE bool handleIonBailout(JSContext* cx, jit::RematerializedFrame* from,
|
||||||
|
jit::BaselineFrame* to);
|
||||||
static void handleUnrecoverableIonBailoutError(JSContext* cx, jit::RematerializedFrame* frame);
|
static void handleUnrecoverableIonBailoutError(JSContext* cx, jit::RematerializedFrame* frame);
|
||||||
static void propagateForcedReturn(JSContext* cx, AbstractFramePtr frame, HandleValue rval);
|
static void propagateForcedReturn(JSContext* cx, AbstractFramePtr frame, HandleValue rval);
|
||||||
static bool hasLiveHook(GlobalObject* global, Hook which);
|
static bool hasLiveHook(GlobalObject* global, Hook which);
|
||||||
|
@ -895,7 +905,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* or create a Debugger.Environment object for the given Env. On success,
|
* or create a Debugger.Environment object for the given Env. On success,
|
||||||
* store the Environment object in *vp and return true.
|
* store the Environment object in *vp and return true.
|
||||||
*/
|
*/
|
||||||
bool wrapEnvironment(JSContext* cx, Handle<Env*> env, MutableHandleValue vp);
|
MOZ_MUST_USE bool wrapEnvironment(JSContext* cx, Handle<Env*> env, MutableHandleValue vp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Like cx->compartment()->wrap(cx, vp), but for the debugger compartment.
|
* Like cx->compartment()->wrap(cx, vp), but for the debugger compartment.
|
||||||
|
@ -917,8 +927,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* unaccessible uninitialized binding, this produces a plain object of the
|
* unaccessible uninitialized binding, this produces a plain object of the
|
||||||
* form { uninitialized: true }.
|
* form { uninitialized: true }.
|
||||||
*/
|
*/
|
||||||
bool wrapDebuggeeValue(JSContext* cx, MutableHandleValue vp);
|
MOZ_MUST_USE bool wrapDebuggeeValue(JSContext* cx, MutableHandleValue vp);
|
||||||
bool wrapDebuggeeObject(JSContext* cx, MutableHandleObject obj);
|
MOZ_MUST_USE bool wrapDebuggeeObject(JSContext* cx, MutableHandleObject obj);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unwrap a Debug.Object, without rewrapping it for any particular debuggee
|
* Unwrap a Debug.Object, without rewrapping it for any particular debuggee
|
||||||
|
@ -947,10 +957,10 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* debugger compartment--mirror symmetry. But compartment wrapping always
|
* debugger compartment--mirror symmetry. But compartment wrapping always
|
||||||
* happens in the target compartment--rotational symmetry.)
|
* happens in the target compartment--rotational symmetry.)
|
||||||
*/
|
*/
|
||||||
bool unwrapDebuggeeValue(JSContext* cx, MutableHandleValue vp);
|
MOZ_MUST_USE bool unwrapDebuggeeValue(JSContext* cx, MutableHandleValue vp);
|
||||||
bool unwrapDebuggeeObject(JSContext* cx, MutableHandleObject obj);
|
MOZ_MUST_USE bool unwrapDebuggeeObject(JSContext* cx, MutableHandleObject obj);
|
||||||
bool unwrapPropertyDescriptor(JSContext* cx, HandleObject obj,
|
MOZ_MUST_USE bool unwrapPropertyDescriptor(JSContext* cx, HandleObject obj,
|
||||||
MutableHandle<PropertyDescriptor> desc);
|
MutableHandle<PropertyDescriptor> desc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Store the Debugger.Frame object for frame in *vp.
|
* Store the Debugger.Frame object for frame in *vp.
|
||||||
|
@ -958,7 +968,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* Use this if you have already access to a frame pointer without having
|
* Use this if you have already access to a frame pointer without having
|
||||||
* to incur the cost of walking the stack.
|
* to incur the cost of walking the stack.
|
||||||
*/
|
*/
|
||||||
bool getScriptFrame(JSContext* cx, AbstractFramePtr frame, MutableHandleValue vp) {
|
MOZ_MUST_USE bool getScriptFrame(JSContext* cx, AbstractFramePtr frame, MutableHandleValue vp) {
|
||||||
return getScriptFrameWithIter(cx, frame, nullptr, vp);
|
return getScriptFrameWithIter(cx, frame, nullptr, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -970,7 +980,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* frame, in which case the cost of walking the stack has already been
|
* frame, in which case the cost of walking the stack has already been
|
||||||
* paid.
|
* paid.
|
||||||
*/
|
*/
|
||||||
bool getScriptFrame(JSContext* cx, const ScriptFrameIter& iter, MutableHandleValue vp) {
|
MOZ_MUST_USE bool getScriptFrame(JSContext* cx, const ScriptFrameIter& iter,
|
||||||
|
MutableHandleValue vp) {
|
||||||
return getScriptFrameWithIter(cx, iter.abstractFramePtr(), &iter, vp);
|
return getScriptFrameWithIter(cx, iter.abstractFramePtr(), &iter, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,8 +1000,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* and |value|. |value| should be the return value or exception value, not
|
* and |value|. |value| should be the return value or exception value, not
|
||||||
* wrapped as a debuggee value. |cx| must be in the debugger compartment.
|
* wrapped as a debuggee value. |cx| must be in the debugger compartment.
|
||||||
*/
|
*/
|
||||||
bool newCompletionValue(JSContext* cx, JSTrapStatus status, Value value,
|
MOZ_MUST_USE bool newCompletionValue(JSContext* cx, JSTrapStatus status, Value value,
|
||||||
MutableHandleValue result);
|
MutableHandleValue result);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Precondition: we are in the debuggee compartment (ac is entered) and ok
|
* Precondition: we are in the debuggee compartment (ac is entered) and ok
|
||||||
|
@ -1004,9 +1015,9 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||||
* pending exception. (This ordinarily returns true even if the ok argument
|
* pending exception. (This ordinarily returns true even if the ok argument
|
||||||
* is false.)
|
* is false.)
|
||||||
*/
|
*/
|
||||||
bool receiveCompletionValue(mozilla::Maybe<AutoCompartment>& ac, bool ok,
|
MOZ_MUST_USE bool receiveCompletionValue(mozilla::Maybe<AutoCompartment>& ac, bool ok,
|
||||||
HandleValue val,
|
HandleValue val,
|
||||||
MutableHandleValue vp);
|
MutableHandleValue vp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the Debugger.Script object for |script|, or create a new one if
|
* Return the Debugger.Script object for |script|, or create a new one if
|
||||||
|
@ -1052,67 +1063,73 @@ class DebuggerObject : public NativeObject
|
||||||
static DebuggerObject* create(JSContext* cx, HandleObject proto, HandleObject obj,
|
static DebuggerObject* create(JSContext* cx, HandleObject proto, HandleObject obj,
|
||||||
HandleNativeObject debugger);
|
HandleNativeObject debugger);
|
||||||
|
|
||||||
static bool isCallable(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool isCallable(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool isFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool isFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool isDebuggeeFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool isDebuggeeFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool isBoundFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool isBoundFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool isArrowFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool isArrowFunction(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool isGlobal(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool isGlobal(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool className(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool className(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
MutableHandleString result);
|
MutableHandleString result);
|
||||||
static bool global(JSContext* cx, Handle<DebuggerObject*> object, MutableHandleObject result);
|
static MOZ_MUST_USE bool global(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool name(JSContext* cx, Handle<DebuggerObject*> object, MutableHandleString result);
|
|
||||||
static bool displayName(JSContext* cx, Handle<DebuggerObject*> object,
|
|
||||||
MutableHandleString result);
|
|
||||||
static bool parameterNames(JSContext* cx, Handle<DebuggerObject*> object,
|
|
||||||
MutableHandle<StringVector> result);
|
|
||||||
static bool boundTargetFunction(JSContext* cx, Handle<DebuggerObject*> object,
|
|
||||||
MutableHandleObject result);
|
MutableHandleObject result);
|
||||||
static bool boundThis(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool name(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
MutableHandleValue result);
|
MutableHandleString result);
|
||||||
static bool boundArguments(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool displayName(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
MutableHandle<ValueVector> result);
|
MutableHandleString result);
|
||||||
static bool allocationSite(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool parameterNames(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
MutableHandleObject result);
|
MutableHandle<StringVector> result);
|
||||||
static bool errorMessageName(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool boundTargetFunction(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
MutableHandleString result);
|
MutableHandleObject result);
|
||||||
|
static MOZ_MUST_USE bool boundThis(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
|
MutableHandleValue result);
|
||||||
|
static MOZ_MUST_USE bool boundArguments(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
|
MutableHandle<ValueVector> result);
|
||||||
|
static MOZ_MUST_USE bool allocationSite(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
|
MutableHandleObject result);
|
||||||
|
static MOZ_MUST_USE bool errorMessageName(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
|
MutableHandleString result);
|
||||||
|
|
||||||
static bool isExtensible(JSContext* cx, Handle<DebuggerObject*> object, bool& result);
|
static MOZ_MUST_USE bool isExtensible(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool isSealed(JSContext* cx, Handle<DebuggerObject*> object, bool& result);
|
bool& result);
|
||||||
static bool isFrozen(JSContext* cx, Handle<DebuggerObject*> object, bool& result);
|
static MOZ_MUST_USE bool isSealed(JSContext* cx, Handle<DebuggerObject*> object, bool& result);
|
||||||
static bool getPrototypeOf(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool isFrozen(JSContext* cx, Handle<DebuggerObject*> object, bool& result);
|
||||||
MutableHandleObject result);
|
static MOZ_MUST_USE bool getPrototypeOf(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool getOwnPropertyNames(JSContext* cx, Handle<DebuggerObject*> object,
|
MutableHandleObject result);
|
||||||
MutableHandle<IdVector> result);
|
static MOZ_MUST_USE bool getOwnPropertyNames(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool getOwnPropertySymbols(JSContext* cx, Handle<DebuggerObject*> object,
|
MutableHandle<IdVector> result);
|
||||||
MutableHandle<IdVector> result);
|
static MOZ_MUST_USE bool getOwnPropertySymbols(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool getOwnPropertyDescriptor(JSContext* cx, Handle<DebuggerObject*> object,
|
MutableHandle<IdVector> result);
|
||||||
HandleId id, MutableHandle<PropertyDescriptor> desc);
|
static MOZ_MUST_USE bool getOwnPropertyDescriptor(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool preventExtensions(JSContext* cx, Handle<DebuggerObject*> object);
|
HandleId id,
|
||||||
static bool seal(JSContext* cx, Handle<DebuggerObject*> object);
|
MutableHandle<PropertyDescriptor> desc);
|
||||||
static bool freeze(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool preventExtensions(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool defineProperty(JSContext* cx, Handle<DebuggerObject*> object, HandleId id,
|
static MOZ_MUST_USE bool seal(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
Handle<PropertyDescriptor> desc);
|
static MOZ_MUST_USE bool freeze(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
static bool defineProperties(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool defineProperty(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
Handle<IdVector> ids,
|
HandleId id, Handle<PropertyDescriptor> desc);
|
||||||
Handle<PropertyDescriptorVector> descs);
|
static MOZ_MUST_USE bool defineProperties(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
static bool deleteProperty(JSContext* cx, Handle<DebuggerObject*> object, HandleId id,
|
Handle<IdVector> ids,
|
||||||
ObjectOpResult& result);
|
Handle<PropertyDescriptorVector> descs);
|
||||||
static bool call(JSContext* cx, Handle<DebuggerObject*> object, HandleValue thisv,
|
static MOZ_MUST_USE bool deleteProperty(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
Handle<ValueVector> args, MutableHandleValue result);
|
HandleId id, ObjectOpResult& result);
|
||||||
static bool forceLexicalInitializationByName(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool call(JSContext* cx, Handle<DebuggerObject*> object, HandleValue thisv,
|
||||||
HandleId id, bool& result);
|
Handle<ValueVector> args, MutableHandleValue result);
|
||||||
static bool executeInGlobal(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool forceLexicalInitializationByName(JSContext* cx,
|
||||||
mozilla::Range<const char16_t> chars, HandleObject bindings,
|
Handle<DebuggerObject*> object,
|
||||||
const EvalOptions& options, MutableHandleValue result);
|
HandleId id, bool& result);
|
||||||
static bool makeDebuggeeValue(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool executeInGlobal(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
HandleValue value, MutableHandleValue result);
|
mozilla::Range<const char16_t> chars,
|
||||||
static bool unsafeDereference(JSContext* cx, Handle<DebuggerObject*> object,
|
HandleObject bindings, const EvalOptions& options,
|
||||||
MutableHandleObject result);
|
MutableHandleValue result);
|
||||||
static bool unwrap(JSContext* cx, Handle<DebuggerObject*> object,
|
static MOZ_MUST_USE bool makeDebuggeeValue(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
MutableHandle<DebuggerObject*> result);
|
HandleValue value, MutableHandleValue result);
|
||||||
|
static MOZ_MUST_USE bool unsafeDereference(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
|
MutableHandleObject result);
|
||||||
|
static MOZ_MUST_USE bool unwrap(JSContext* cx, Handle<DebuggerObject*> object,
|
||||||
|
MutableHandle<DebuggerObject*> result);
|
||||||
|
|
||||||
static bool requireGlobal(JSContext* cx, Handle<DebuggerObject*> object);
|
static MOZ_MUST_USE bool requireGlobal(JSContext* cx, Handle<DebuggerObject*> object);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum {
|
enum {
|
||||||
|
@ -1329,7 +1346,7 @@ Debugger::onLogAllocationSite(JSContext* cx, JSObject* obj, HandleSavedFrame fra
|
||||||
return Debugger::slowPathOnLogAllocationSite(cx, hobj, frame, when, *dbgs);
|
return Debugger::slowPathOnLogAllocationSite(cx, hobj, frame, when, *dbgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReportObjectRequired(JSContext* cx);
|
MOZ_MUST_USE bool ReportObjectRequired(JSContext* cx);
|
||||||
|
|
||||||
} /* namespace js */
|
} /* namespace js */
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче