Bug 1567245: Tighten type of Debugger::generatorFrames and Debugger::sources. r=jorendorff

For generatorFrames, this doesn't matter, but for sources, subsequent patches
need a more precise Referent type than simply 'JSObject'.

Any type used as a weak map key needs a MovableCellHasher instantiation, so add
the necessary ones to Barrier.cpp. Since the list is getting long, sort it.

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

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

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

@ -632,7 +632,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
* An entry in this table exists if and only if the Debugger.Frame's
* GENERATOR_INFO_SLOT is set.
*/
typedef DebuggerWeakMap<JSObject, DebuggerFrame> GeneratorWeakMap;
typedef DebuggerWeakMap<AbstractGeneratorObject, DebuggerFrame>
GeneratorWeakMap;
GeneratorWeakMap generatorFrames;
/* An ephemeral map from JSScript* to Debugger.Script instances. */
@ -646,7 +647,8 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
// The map from debuggee source script objects to their Debugger.Source
// instances.
typedef DebuggerWeakMap<JSObject, DebuggerSource, true> SourceWeakMap;
typedef DebuggerWeakMap<ScriptSourceObject, DebuggerSource, true>
SourceWeakMap;
SourceWeakMap sources;
// The map from debuggee objects to their Debugger.Object instances.

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

@ -12,6 +12,7 @@
#include "js/Value.h"
#include "vm/BigIntType.h" // JS::BigInt
#include "vm/EnvironmentObject.h"
#include "vm/GeneratorObject.h"
#include "vm/JSObject.h"
#include "vm/Realm.h"
#include "vm/SharedArrayObject.h"
@ -174,12 +175,14 @@ template <typename T>
template struct JS_PUBLIC_API MovableCellHasher<JSObject*>;
#endif
template struct JS_PUBLIC_API MovableCellHasher<GlobalObject*>;
template struct JS_PUBLIC_API MovableCellHasher<SavedFrame*>;
template struct JS_PUBLIC_API MovableCellHasher<AbstractGeneratorObject*>;
template struct JS_PUBLIC_API MovableCellHasher<EnvironmentObject*>;
template struct JS_PUBLIC_API MovableCellHasher<WasmInstanceObject*>;
template struct JS_PUBLIC_API MovableCellHasher<GlobalObject*>;
template struct JS_PUBLIC_API MovableCellHasher<JSScript*>;
template struct JS_PUBLIC_API MovableCellHasher<LazyScript*>;
template struct JS_PUBLIC_API MovableCellHasher<ScriptSourceObject*>;
template struct JS_PUBLIC_API MovableCellHasher<SavedFrame*>;
template struct JS_PUBLIC_API MovableCellHasher<WasmInstanceObject*>;
} // namespace js