From a8ab5bb0eda337c7a965e9de44af554db65de440 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Thu, 8 Aug 2019 23:20:13 +0000 Subject: [PATCH] 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 --- js/src/debugger/Debugger.h | 6 ++++-- js/src/gc/Barrier.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/src/debugger/Debugger.h b/js/src/debugger/Debugger.h index 3b10cb22508d..a396f1374f28 100644 --- a/js/src/debugger/Debugger.h +++ b/js/src/debugger/Debugger.h @@ -632,7 +632,8 @@ class Debugger : private mozilla::LinkedListElement { * An entry in this table exists if and only if the Debugger.Frame's * GENERATOR_INFO_SLOT is set. */ - typedef DebuggerWeakMap GeneratorWeakMap; + typedef DebuggerWeakMap + GeneratorWeakMap; GeneratorWeakMap generatorFrames; /* An ephemeral map from JSScript* to Debugger.Script instances. */ @@ -646,7 +647,8 @@ class Debugger : private mozilla::LinkedListElement { // The map from debuggee source script objects to their Debugger.Source // instances. - typedef DebuggerWeakMap SourceWeakMap; + typedef DebuggerWeakMap + SourceWeakMap; SourceWeakMap sources; // The map from debuggee objects to their Debugger.Object instances. diff --git a/js/src/gc/Barrier.cpp b/js/src/gc/Barrier.cpp index 380b0d7372c4..069a222c49fe 100644 --- a/js/src/gc/Barrier.cpp +++ b/js/src/gc/Barrier.cpp @@ -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 template struct JS_PUBLIC_API MovableCellHasher; #endif -template struct JS_PUBLIC_API MovableCellHasher; -template struct JS_PUBLIC_API MovableCellHasher; +template struct JS_PUBLIC_API MovableCellHasher; template struct JS_PUBLIC_API MovableCellHasher; -template struct JS_PUBLIC_API MovableCellHasher; +template struct JS_PUBLIC_API MovableCellHasher; template struct JS_PUBLIC_API MovableCellHasher; template struct JS_PUBLIC_API MovableCellHasher; +template struct JS_PUBLIC_API MovableCellHasher; +template struct JS_PUBLIC_API MovableCellHasher; +template struct JS_PUBLIC_API MovableCellHasher; } // namespace js