Bug 1567245: Factor out pointer from DebuggerWeakMap Referent type parameter. r=jorendorff

It's more convenient for a DebuggerWeakMap's Wrapper type parameter to be the
pointed-to type, not the pointer type, since we'll be consulting its member
types. Then, it's a bit more consistent to also use the pointed-to type for
Referent.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jim Blandy 2019-08-08 23:20:09 +00:00
Родитель 6475ea735f
Коммит 2670cfec30
1 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -262,9 +262,9 @@ extern void CheckDebuggeeThing(JSObject* obj, bool invisibleOk);
* it's re-enabled later, new Frame objects are created.) * it's re-enabled later, new Frame objects are created.)
*/ */
template <class Referent, class Wrapper, bool InvisibleKeysOk = false> template <class Referent, class Wrapper, bool InvisibleKeysOk = false>
class DebuggerWeakMap : private WeakMap<HeapPtr<Referent>, HeapPtr<Wrapper*>> { class DebuggerWeakMap : private WeakMap<HeapPtr<Referent*>, HeapPtr<Wrapper*>> {
private: private:
typedef HeapPtr<Referent> Key; typedef HeapPtr<Referent*> Key;
typedef HeapPtr<Wrapper*> Value; typedef HeapPtr<Wrapper*> Value;
typedef HashMap<JS::Zone*, uintptr_t, DefaultHasher<JS::Zone*>, typedef HashMap<JS::Zone*, uintptr_t, DefaultHasher<JS::Zone*>,
@ -632,40 +632,40 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
* An entry in this table exists if and only if the Debugger.Frame's * An entry in this table exists if and only if the Debugger.Frame's
* GENERATOR_INFO_SLOT is set. * GENERATOR_INFO_SLOT is set.
*/ */
typedef DebuggerWeakMap<JSObject*, DebuggerFrame> GeneratorWeakMap; typedef DebuggerWeakMap<JSObject, DebuggerFrame> GeneratorWeakMap;
GeneratorWeakMap generatorFrames; GeneratorWeakMap generatorFrames;
/* An ephemeral map from JSScript* to Debugger.Script instances. */ /* An ephemeral map from JSScript* to Debugger.Script instances. */
typedef DebuggerWeakMap<JSScript*, DebuggerScript> ScriptWeakMap; typedef DebuggerWeakMap<JSScript, DebuggerScript> ScriptWeakMap;
ScriptWeakMap scripts; ScriptWeakMap scripts;
using LazyScriptWeakMap = DebuggerWeakMap<LazyScript*, DebuggerScript>; using LazyScriptWeakMap = DebuggerWeakMap<LazyScript, DebuggerScript>;
LazyScriptWeakMap lazyScripts; LazyScriptWeakMap lazyScripts;
using LazyScriptVector = JS::GCVector<LazyScript*>; using LazyScriptVector = JS::GCVector<LazyScript*>;
// The map from debuggee source script objects to their Debugger.Source // The map from debuggee source script objects to their Debugger.Source
// instances. // instances.
typedef DebuggerWeakMap<JSObject*, DebuggerSource, true> SourceWeakMap; typedef DebuggerWeakMap<JSObject, DebuggerSource, true> SourceWeakMap;
SourceWeakMap sources; SourceWeakMap sources;
// The map from debuggee objects to their Debugger.Object instances. // The map from debuggee objects to their Debugger.Object instances.
typedef DebuggerWeakMap<JSObject*, DebuggerObject> ObjectWeakMap; typedef DebuggerWeakMap<JSObject, DebuggerObject> ObjectWeakMap;
ObjectWeakMap objects; ObjectWeakMap objects;
// The map from debuggee Envs to Debugger.Environment instances. // The map from debuggee Envs to Debugger.Environment instances.
typedef DebuggerWeakMap<JSObject*, DebuggerEnvironment> EnvironmentWeakMap; typedef DebuggerWeakMap<JSObject, DebuggerEnvironment> EnvironmentWeakMap;
EnvironmentWeakMap environments; EnvironmentWeakMap environments;
// The map from WasmInstanceObjects to synthesized Debugger.Script // The map from WasmInstanceObjects to synthesized Debugger.Script
// instances. // instances.
typedef DebuggerWeakMap<WasmInstanceObject*, DebuggerScript> typedef DebuggerWeakMap<WasmInstanceObject, DebuggerScript>
WasmInstanceScriptWeakMap; WasmInstanceScriptWeakMap;
WasmInstanceScriptWeakMap wasmInstanceScripts; WasmInstanceScriptWeakMap wasmInstanceScripts;
// The map from WasmInstanceObjects to synthesized Debugger.Source // The map from WasmInstanceObjects to synthesized Debugger.Source
// instances. // instances.
typedef DebuggerWeakMap<WasmInstanceObject*, DebuggerSource> typedef DebuggerWeakMap<WasmInstanceObject, DebuggerSource>
WasmInstanceSourceWeakMap; WasmInstanceSourceWeakMap;
WasmInstanceSourceWeakMap wasmInstanceSources; WasmInstanceSourceWeakMap wasmInstanceSources;